:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-soft: #f8f8f6;
  --surface-warm: #fff5ed;
  --line: #e2e4df;
  --line-strong: #c8cfc8;
  --text: #202728;
  --muted: #626d75;
  --muted-soft: #707c86;
  --accent: #ef6a2e;
  --accent-deep: #bc4d18;
  --accent-soft: #fff1ea;
  --green: #2f8f63;
  --green-soft: #edf8f2;
  --navy: #222d32;
  --shadow-soft: 0 4px 18px rgba(32, 39, 40, 0.04);
  --shadow-lift: 0 8px 28px rgba(32, 39, 40, 0.1);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 156px;
}

.app-module[hidden] {
  display: none;
}

.app-module.is-active {
  animation: moduleIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-module-page {
  display: grid;
  gap: 20px;
  min-height: calc(100vh - 190px);
}

.module-page-head {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

@keyframes moduleIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  position: relative;
  display: grid;
  gap: 32px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.eyebrow,
.panel-tag {
  margin: 0 0 10px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero h1,
.section-head h2,
.mini-card h3,
.equipment-head h3 {
  margin: 0;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(2.1rem, 4.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25;
}

.hero-text {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero-overview {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

.hero-metric {
  display: grid;
  gap: 8px;
  min-height: 102px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: #f8fafc;
}

.hero-metric-light {
  min-height: 0;
  border: 1px solid rgba(207, 213, 223, 0.92);
  background: #fff;
  color: var(--text);
}

.hero-metric span,
.hero-metric small {
  color: rgba(248, 250, 252, 0.72);
}

.hero-metric-light span,
.hero-metric-light small {
  color: var(--muted);
}

.hero-metric strong {
  align-self: end;
  font-size: 1.45rem;
  line-height: 1.15;
}

.hero-art {
  overflow: hidden;
  padding: 4px 8px 0;
  border-radius: calc(var(--radius-md) - 2px);
  background: linear-gradient(180deg, rgba(255, 247, 241, 0.92), rgba(255, 255, 255, 0.96));
}

.hero-art-image {
  display: block;
  width: 100%;
  aspect-ratio: 599 / 170;
  object-fit: contain;
}

.profile-calendar-hero {
  padding: 6px 10px 0;
  border: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.plan-panel,
.workout-panel,
.secondary-section {
  min-width: 0;
}

.plan-panel,
.workout-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
}

.plan-panel {
  padding: 24px;
}

.workout-panel {
  grid-column: 1 / -1;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 252, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-motto {
  max-width: 620px;
  margin: 10px 0 0;
  padding-left: 0;
  border-left: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}

.secondary-section {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 252, 0.96)),
    #fff;
  box-shadow: var(--shadow-soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head-split {
  align-items: center;
}

.section-head h2 {
  color: var(--navy);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.35;
}

.status-grid,
.profile-grid,
.recovery-grid,
.weekly-plan,
.exercise-list,
.equipment-grid {
  display: grid;
  gap: 12px;
}

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

.status-grid-compact {
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 7px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.metric-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.metric-card span,
.profile-grid span,
.exercise-top-meta span,
.checkin-box span,
.equipment-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  color: var(--navy);
  font-size: 1.8rem;
  line-height: 1.05;
}

.metric-card-inline {
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 6px 18px;
  max-width: 280px;
}

.metric-card-inline span,
.metric-card-inline small {
  grid-column: 1 / -1;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.55;
}

.frequency-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f0f2f5;
}

.frequency-tabs button,
.ghost-button,
.soft-button,
.primary-button,
.guide-button,
.dock-button {
  border: 0;
  cursor: pointer;
}

.frequency-tabs button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.frequency-tabs button.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 18, 37, 0.16);
}

.ghost-button,
.soft-button,
.guide-button {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.primary-button {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(7, 18, 37, 0.2);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.62;
  box-shadow: none;
}

.weekly-plan {
  grid-template-columns: 1fr;
  position: relative;
}

.day-card {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 0 0 0 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.day-card::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  bottom: -12px;
  width: 1px;
  background: linear-gradient(180deg, rgba(207, 213, 223, 0.8), rgba(207, 213, 223, 0.24));
}

.day-card:last-child::before {
  bottom: 24px;
}

.day-card::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(7, 18, 37, 0.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96);
}

.day-card.is-active {
  padding-left: 44px;
}

.day-card.is-active::after {
  border-color: rgba(239, 106, 46, 0.26);
  background: var(--navy);
  box-shadow: 0 0 0 5px rgba(239, 106, 46, 0.12);
}

.day-card.is-complete:not(.is-active) {
  color: var(--green);
}

.day-card.is-complete::after {
  border-color: rgba(47, 143, 99, 0.3);
  background: var(--green);
}

.day-card-shell {
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
}

.day-card:first-child .day-card-shell {
  border-top: 0;
  padding-top: 2px;
}

.day-card.is-active .day-card-shell {
  margin-left: -8px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(7, 18, 37, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 252, 0.96));
}

.day-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.day-top strong {
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.35;
}

.day-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.pill-row,
.tonight-meta,
.equipment-tags,
.exercise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-row {
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.day-card.is-active .pill,
.tonight-meta .pill {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.pill.done {
  background: var(--green-soft);
  color: var(--green);
}

.checkin-box {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.tonight-meta {
  margin-bottom: 20px;
}

.warmup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid rgba(239, 106, 46, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffaf7, #fff);
}

.warmup-copy strong {
  color: var(--navy);
}

.warmup-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.warmup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.exercise-list {
  gap: 14px;
}

.exercise-stepper {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(207, 213, 223, 0.78);
  border-radius: calc(var(--radius-md) + 2px);
  background:
    linear-gradient(145deg, rgba(255, 250, 246, 0.98), rgba(255, 255, 255, 0.94) 44%, rgba(238, 248, 242, 0.82)),
    #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 39, 0.08);
}

.exercise-stepper::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

.stepper-head,
.stepper-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.stepper-head > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.stepper-head strong {
  color: var(--navy);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.12;
}

.stepper-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.stepper-kicker,
.stepper-count {
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

.stepper-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(207, 213, 223, 0.7);
  color: var(--muted);
}

.stepper-count strong {
  color: var(--navy);
  font-size: 1.15rem;
}

.stepper-track {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(7, 18, 37, 0.07);
}

.stepper-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.24s ease;
}

.stepper-dots {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
}

.stepper-dots button {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid rgba(207, 213, 223, 0.9);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.stepper-dots button:hover {
  transform: translateY(-1px);
}

.stepper-dots button.is-active {
  border-color: rgba(7, 18, 37, 0.18);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 20px rgba(7, 18, 37, 0.16);
}

.stepper-dots button.is-complete:not(.is-active) {
  border-color: rgba(47, 143, 99, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.exercise-card {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.exercise-card-focus,
.exercise-card-focus:first-child {
  position: relative;
  z-index: 1;
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  animation: stepInForward 0.24s ease both;
}

.exercise-stepper.is-back .exercise-card-focus {
  animation-name: stepInBack;
}

.exercise-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.exercise-card.is-complete {
  margin: 0 -16px;
  padding: 18px 16px;
  border: 1px solid rgba(47, 143, 99, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f8fffb, #ffffff);
}

.exercise-card-focus.is-complete {
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
}

.exercise-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.exercise-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.exercise-title {
  display: grid;
  gap: 7px;
}

.exercise-title > span {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.exercise-title strong {
  color: var(--navy);
  font-size: 1.18rem;
}

.exercise-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.exercise-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
}

.exercise-check-card {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(47, 143, 99, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(237, 248, 242, 0.92);
  color: var(--green);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.exercise-check-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(47, 143, 99, 0.12);
}

.exercise-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: none;
  appearance: none;
  font: inherit;
  cursor: pointer;
  color: var(--accent-deep);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.tutorial-jump {
  margin-left: 2px;
}

.tutorial-link:hover,
.tutorial-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.exercise-note {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.guide-box {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(207, 213, 223, 0.78);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(16, 24, 39, 0.04);
}

.guide-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.guide-box strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.62;
}

.exercise-actions {
  margin-top: 14px;
}

.exercise-player-body {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-top: 1px solid rgba(24, 35, 32, 0.09);
  background: #f7f8f4;
}

.exercise-demo {
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(24, 35, 32, 0.12);
  background: #fff;
}

.exercise-demo img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  display: block;
}

.exercise-demo > a {
  width: 100%;
  padding: 6px 10px;
  color: #5c675f;
  background: #eef0eb;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
}

.exercise-media-credit {
  width: 100%;
  padding: 6px 10px;
  color: #5c675f;
  background: #eef0eb;
  font-size: 11px;
  text-align: center;
}

.version-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(24, 35, 32, 0.1);
  color: #758078;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.exercise-media-kind {
  width: 100%;
  padding: 6px 9px;
  color: #8b4b2f;
  background: #fff3eb;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.exercise-demo-placeholder {
  width: 100%;
  min-height: 196px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: repeating-linear-gradient(135deg, #f4f5f0 0 14px, #ecefe8 14px 28px);
}

.exercise-demo-placeholder span {
  color: var(--accent, #e45c2f);
  font-size: 34px;
  font-weight: 900;
}

.exercise-demo-placeholder strong { font-size: 17px; }
.exercise-demo-placeholder small { color: #69736d; line-height: 1.5; }

.exercise-demo-meta {
  width: 100%;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid rgba(24, 35, 32, 0.1);
  background: #fff;
}

.exercise-demo-meta > span,
.exercise-demo-meta > button {
  min-height: 30px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: #eef1ec;
  color: #5d6962;
  font-size: 12px;
  font-weight: 800;
}

.exercise-demo-meta > button {
  color: #a94b29;
  cursor: pointer;
}

.exercise-guide-panel { min-width: 0; }

.muscle-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.muscle-summary > div {
  min-height: 62px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid #e45c2f;
  background: #fff;
}

.muscle-summary span,
.guide-callout span {
  color: #69736d;
  font-size: 11px;
  font-weight: 700;
}

.muscle-summary strong { font-size: 14px; line-height: 1.4; }

.exercise-memory-cue {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-warm);
}

.exercise-memory-cue span {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 900;
}

.exercise-memory-cue strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.guide-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(24, 35, 32, 0.12);
}

.guide-tabs::-webkit-scrollbar { display: none; }

.guide-tabs button {
  min-width: max-content;
  padding: 10px 12px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #69736d;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.guide-tabs button:hover,
.guide-tabs button:focus-visible { color: #182320; }

.guide-tabs button.is-active {
  border-bottom-color: #e45c2f;
  color: #182320;
}

.guide-tab-content {
  min-height: 150px;
  padding: 14px 4px 2px;
  outline: none;
}

.guide-tab-content ol,
.guide-tab-content ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.guide-tab-content li {
  padding-left: 4px;
  color: #35413b;
  line-height: 1.65;
}

.guide-tab-content li::marker {
  color: #e45c2f;
  font-weight: 900;
}

.guide-callout {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-left: 4px solid #e45c2f;
  background: #fff;
}

.guide-callout strong { line-height: 1.65; }
.guide-callout-soft { border-left-color: #3a7868; }

.rest-player {
  min-height: 430px;
  padding: 38px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  border: 1px solid rgba(24, 35, 32, 0.1);
  background: #f7f8f4;
  text-align: center;
}

.rest-copy { max-width: 520px; }
.rest-copy h3 { margin: 8px 0 10px; font-size: clamp(1.35rem, 3vw, 2rem); }
.rest-copy p { margin: 0; color: #68736d; line-height: 1.7; }

.rest-ring {
  --rest-progress: 360deg;
  width: 168px;
  aspect-ratio: 1;
  padding: 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#e45c2f var(--rest-progress), #dfe3dc 0);
  box-shadow: 0 14px 35px rgba(43, 51, 47, 0.13);
  transition: background 250ms linear;
}

.rest-ring > div {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
}

.rest-ring strong { font-size: 3.2rem; line-height: 1; }
.rest-ring span { margin-top: 5px; color: #69736d; font-size: 13px; font-weight: 800; }

.rest-controls {
  display: grid;
  grid-template-columns: 92px minmax(150px, 1fr) 92px;
  gap: 8px;
}

.rest-controls button {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(24, 35, 32, 0.14);
  background: #fff;
  color: #26322d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 430px) {
  .rest-player { min-height: 390px; padding: 30px 14px; }
  .rest-controls { grid-template-columns: 1fr 1fr; width: 100%; }
  .rest-controls [data-rest-skip] { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 720px) {
  .exercise-player-body {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .exercise-demo {
    width: min(100%, 280px);
    margin-inline: auto;
  }

  .muscle-summary { grid-template-columns: 1fr 1fr; }
  .guide-tab-content { min-height: 170px; }
}

@media (max-width: 430px) {
  .muscle-summary { grid-template-columns: 1fr; }
  .guide-tabs { margin-inline: -4px; }
  .guide-tabs button { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .exercise-stepper,
  .exercise-card-focus { animation: none !important; transition: none !important; }
  .rest-ring { transition: none !important; }
}

/* 动作教学：保留当前训练上下文，用底部抽屉承接更完整的示范。 */
.tutorial-sheet {
  place-items: end center;
  padding: 24px 24px 0;
}

.tutorial-sheet-panel {
  width: min(100%, 760px);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -18px 60px rgba(7, 18, 37, 0.18);
}

.tutorial-sheet-handle {
  width: 100%;
  min-height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.tutorial-sheet-handle:active {
  cursor: grabbing;
}

.tutorial-sheet-handle span {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.tutorial-sheet-head {
  flex: 0 0 auto;
  padding: 2px 24px 16px;
  border-bottom: 1px solid rgba(207, 213, 223, 0.72);
}

.tutorial-sheet-head > div {
  min-width: 0;
}

.tutorial-sheet-head h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

.tutorial-sheet-head p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-sheet-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px;
}

.tutorial-sheet-grid {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.tutorial-sheet-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(207, 213, 223, 0.78);
  background: #fff;
}

.tutorial-sheet-figure[hidden],
.tutorial-sheet-media-fallback[hidden],
.tutorial-sheet-media-kind[hidden],
.tutorial-sheet-actions [hidden] {
  display: none;
}

.tutorial-sheet-figure img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
  background: #fff;
}

.tutorial-sheet-figure figcaption {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #eef0eb;
  color: #5c675f;
  font-size: 11px;
}

.tutorial-sheet-figure a {
  color: inherit;
  text-decoration: none;
}

.tutorial-sheet-media-kind {
  color: var(--accent-deep);
  font-weight: 800;
}

.tutorial-sheet-media-fallback {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 24px;
  border: 1px solid rgba(207, 213, 223, 0.78);
  background: var(--surface-soft);
  text-align: center;
}

.tutorial-sheet-media-fallback span {
  color: var(--muted);
}

.tutorial-sheet-guide {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.tutorial-sheet-cue {
  margin: 0;
}

.tutorial-sheet-section {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
}

.tutorial-sheet-section > span {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 900;
}

.tutorial-sheet-section ol,
.tutorial-sheet-section ul {
  margin: 9px 0 0;
  padding-left: 1.2rem;
}

.tutorial-sheet-section li {
  padding-left: 4px;
  color: var(--navy);
  line-height: 1.58;
}

.tutorial-sheet-section li + li {
  margin-top: 6px;
}

.tutorial-sheet-warning {
  border-left-color: var(--navy);
}

.tutorial-sheet-warning > span {
  color: var(--navy);
}

.tutorial-sheet-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(207, 213, 223, 0.72);
  background: rgba(255, 255, 255, 0.98);
}

.tutorial-sheet-actions > * {
  min-height: 46px;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.tutorial-sheet-actions.is-single-action {
  grid-template-columns: 1fr;
}

.tutorial-sheet-panel.is-dragging {
  animation: none !important;
  transform: translateY(var(--tutorial-drag-y, 0));
  transition: none;
}

.tutorial-sheet-panel.is-snapping-back {
  transform: translateY(var(--tutorial-drag-y, 0));
  transition: transform 200ms var(--motion-ease-out);
}

@media (max-width: 700px) {
  .tutorial-sheet {
    padding: 12px 0 0;
  }

  .tutorial-sheet-panel {
    width: 100%;
    max-height: calc(100dvh - 12px);
    border-right: 0;
    border-left: 0;
  }

  .tutorial-sheet-head {
    padding: 0 16px 12px;
  }

  .tutorial-sheet-head p:last-child {
    margin-top: 5px;
    font-size: 0.9rem;
  }

  .tutorial-sheet-scroll {
    padding: 14px 16px;
  }

  .tutorial-sheet-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .tutorial-sheet-figure,
  .tutorial-sheet-media-fallback {
    width: min(100%, 300px);
    justify-self: center;
  }

  .tutorial-sheet-figure img {
    max-height: 250px;
  }

  .tutorial-sheet-guide {
    gap: 10px;
  }

  .tutorial-sheet-section {
    padding: 11px 13px;
  }

  .tutorial-sheet-actions {
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
}

/* v11 · 本周安排改为日期驱动的滑动卡片。 */
.plan-panel {
  overflow: hidden;
}

.plan-carousel-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plan-carousel-date {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.plan-carousel-date span {
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.plan-carousel-date strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.plan-carousel-controls > span {
  min-width: 42px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.plan-carousel-controls button {
  width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  transition: transform var(--motion-fast) var(--motion-ease), border-color var(--motion-base) ease, opacity var(--motion-fast) ease;
}

.plan-carousel-controls button:disabled {
  cursor: default;
  opacity: 0.28;
}

.weekly-plan,
.weekly-plan[tabindex] {
  width: 100%;
  display: flex;
  grid-template-columns: none;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  padding: 4px 2px 10px;
  outline: none;
}

.weekly-plan::-webkit-scrollbar {
  display: none;
}

.weekly-plan::after {
  content: "";
  flex: 0 0 calc(100% - min(82%, 420px) - 2px);
}

.weekly-plan .day-card,
.weekly-plan .day-card.is-active {
  flex: 0 0 min(82%, 420px);
  width: auto;
  min-width: 0;
  min-height: 188px;
  padding: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.weekly-plan .day-card::before,
.weekly-plan .day-card::after {
  display: none;
}

.weekly-plan .day-card-shell,
.weekly-plan .day-card:first-child .day-card-shell,
.weekly-plan .day-card.is-active .day-card-shell {
  height: 100%;
  min-height: inherit;
  margin: 0;
  padding: 15px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  transition: transform var(--motion-base) var(--motion-ease-out), border-color var(--motion-base) ease, box-shadow var(--motion-base) ease, opacity var(--motion-base) ease;
}

.weekly-plan .day-card:not(.is-active) .day-card-shell {
  opacity: 0.72;
  transform: scale(0.985);
}

.weekly-plan .day-card.is-active .day-card-shell {
  border-color: rgba(7, 18, 37, 0.28);
  box-shadow: 0 14px 30px rgba(7, 18, 37, 0.09);
  opacity: 1;
  transform: none;
}

.day-card-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(207, 213, 223, 0.72);
}

.day-card-date-row span {
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.day-card-date-row small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.weekly-plan .day-card.is-active .pill {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.weekly-plan .day-card:focus-visible .day-card-shell {
  outline: 3px solid rgba(239, 106, 46, 0.2);
  outline-offset: 2px;
}

.plan-carousel-dots {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.plan-carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: width var(--motion-base) var(--motion-ease-out), background-color var(--motion-base) ease;
}

.plan-carousel-dots button.is-active {
  width: 22px;
  background: var(--navy);
}

@media (hover: hover) and (pointer: fine) {
  .plan-carousel-controls button:not(:disabled):hover {
    border-color: rgba(7, 18, 37, 0.34);
    transform: translateY(-1px);
  }
}

@media (max-width: 480px) {
  .plan-panel > .section-head {
    margin-bottom: 10px;
  }

  .plan-carousel-bar {
    min-height: 52px;
    margin-inline: -2px;
    padding: 8px 4px;
  }

  .plan-carousel-date strong {
    font-size: 0.92rem;
  }

  .plan-carousel-controls {
    gap: 4px;
  }

  .plan-carousel-controls button {
    width: 40px;
    min-height: 40px;
  }

  .plan-carousel-controls > span {
    min-width: 34px;
    font-size: 0.7rem;
  }

  .weekly-plan,
  .weekly-plan[tabindex] {
    gap: 9px;
    margin: 0;
    padding: 3px 1px 8px;
  }

  .weekly-plan .day-card,
  .weekly-plan .day-card.is-active {
    flex-basis: 88%;
    min-height: 174px;
  }

  .weekly-plan::after {
    flex-basis: calc(12% - 1px);
  }

  .weekly-plan .day-card-shell,
  .weekly-plan .day-card:first-child .day-card-shell,
  .weekly-plan .day-card.is-active .day-card-shell {
    padding: 13px 14px 14px;
    border-radius: 14px;
  }

  .day-card-date-row {
    margin-bottom: 11px;
    padding-bottom: 8px;
  }

  .weekly-plan .day-card p {
    margin-top: 5px;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .weekly-plan .pill-row {
    margin-top: 10px;
    gap: 5px;
  }

  .weekly-plan .pill {
    min-height: 25px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 350px) {
  .plan-carousel-controls > span {
    display: none;
  }

  .weekly-plan .day-card,
  .weekly-plan .day-card.is-active {
    flex-basis: 91%;
  }


  .weekly-plan::after {
    flex-basis: calc(9% - 1px);
  }
}

/* v14 · 本周卡片的层叠基础，最终尺寸规则放在文件末尾。 */
.weekly-plan {
  perspective: 900px;
}

.weekly-plan .day-card {
  z-index: 1;
}

.weekly-plan .day-card.is-before,
.weekly-plan .day-card.is-after {
  z-index: 2;
}

.weekly-plan .day-card.is-active {
  z-index: 4;
}

.weekly-plan .day-card-shell,
.weekly-plan .day-card:first-child .day-card-shell,
.weekly-plan .day-card.is-active .day-card-shell {
  display: flex;
  flex-direction: column;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: none;
}

.weekly-plan .day-card .pill-row {
  margin-top: auto;
}

@media (prefers-reduced-motion: reduce) {
  .weekly-plan .day-card-shell,
  .weekly-plan .day-card:first-child .day-card-shell,
  .weekly-plan .day-card.is-active .day-card-shell {
    transition-duration: 0.01ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-plan,
  .weekly-plan[tabindex] {
    scroll-behavior: auto;
  }
}

@media (max-width: 350px) {
  .tutorial-sheet-actions {
    grid-template-columns: 1fr;
  }
}

/* Compact phone workout: keep exercise switching and the demo in easy reach. */
@media (max-width: 480px) {
  .app-module.is-active {
    animation: none;
    transform: none;
  }

  :root {
    --phone-tabbar-height: 56px;
  }

  body {
    overflow-x: clip;
    padding-bottom: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
  }

  .app-shell {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .workout-panel {
    padding: 8px;
  }

  .workout-panel .exercise-stepper {
    overflow: visible;
    gap: 8px;
    padding: 6px;
    border-radius: 12px;
  }

  .workout-panel .stepper-head,
  .workout-panel .stepper-progress-row {
    display: none;
  }

  .workout-panel .stepper-dots {
    position: sticky;
    top: max(4px, env(safe-area-inset-top));
    z-index: 25;
    grid-template-columns: repeat(var(--exercise-count), minmax(0, 1fr));
    gap: 5px;
    margin: -2px 0 0;
    padding: 5px;
    border: 1px solid rgba(207, 213, 223, 0.86);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(16, 24, 39, 0.1);
    backdrop-filter: blur(12px);
  }

  .workout-panel .stepper-dots button {
    min-width: 0;
    min-height: 44px;
    padding: 0;
    border-radius: 9px;
    font-size: 0.92rem;
    box-shadow: none;
  }

  .exercise-stage {
    gap: 7px;
    padding: 10px;
    border-radius: 11px;
  }

  .workout-panel .exercise-stage-number {
    display: none;
  }

  .workout-panel .exercise-stage-main {
    gap: 7px;
  }

  .workout-panel .exercise-head {
    gap: 8px;
  }

  .workout-panel .exercise-title {
    gap: 3px;
  }

  .workout-panel .exercise-title > span {
    font-size: 0.68rem;
  }

  .workout-panel .exercise-title > strong {
    font-size: clamp(1.18rem, 6vw, 1.45rem);
    line-height: 1.12;
  }

  .workout-panel .exercise-head-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .workout-panel .exercise-head-actions > :only-child {
    grid-column: 1 / -1;
  }

  .exercise-check-card,
  .exercise-card-focus .exercise-head-actions .tutorial-link {
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 0.82rem;
  }

  .exercise-card-focus .exercise-note {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .workout-panel .exercise-player-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .workout-panel .exercise-demo {
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
  }

  .workout-panel .exercise-demo img {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .workout-panel .exercise-demo > a,
  .workout-panel .exercise-media-credit {
    grid-column: 1;
    grid-row: 2;
    padding: 5px 4px;
    font-size: 9px;
  }

  .workout-panel .exercise-media-kind {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    z-index: 1;
    margin: 5px;
  }

  .workout-panel .exercise-demo-meta {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-content: start;
    align-self: stretch;
    padding: 8px;
    border-top: 0;
    border-left: 1px solid rgba(24, 35, 32, 0.1);
    background: #fff;
  }

  .workout-panel .exercise-demo-meta > span,
  .workout-panel .exercise-demo-meta > button {
    width: 100%;
    min-height: 34px;
    padding: 6px 7px;
    justify-content: flex-start;
    font-size: 10px;
  }

  .workout-panel .exercise-demo-meta > button {
    min-height: 44px;
  }

  .workout-panel .muscle-summary {
    gap: 5px;
    margin-bottom: 7px;
  }

  .workout-panel .muscle-summary > div {
    min-height: 48px;
    padding: 7px 9px;
  }

  .muscle-summary strong {
    font-size: 12px;
  }

  .exercise-memory-cue {
    gap: 6px;
    margin-bottom: 7px;
    padding: 8px 9px;
  }

  .exercise-memory-cue strong {
    font-size: 12px;
    line-height: 1.45;
  }

  .guide-tabs button {
    min-height: 40px;
    padding: 8px 7px 7px;
    font-size: 10px;
  }

  .guide-tab-content {
    min-height: 120px;
    padding-top: 9px;
    font-size: 0.86rem;
  }

  .stepper-footer {
    gap: 6px;
    padding: 6px;
  }

  .stepper-footer span {
    font-size: 0.78rem;
  }

  .stepper-footer .step-nav-button {
    min-height: 44px;
    padding: 8px;
  }

  .app-tabbar {
    min-height: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
    padding-top: 3px;
    padding-bottom: max(3px, env(safe-area-inset-bottom));
  }

  .app-tabbar button {
    grid-template-rows: 22px 14px;
    min-height: 48px;
    padding: 3px 4px;
    border-radius: 10px;
    font-size: 0.66rem;
  }

  .app-tabbar button span {
    width: 22px;
    height: 22px;
    font-size: 0.64rem;
  }

  .action-dock {
    bottom: calc(var(--phone-tabbar-height) + 8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 359px) {
  .workout-panel .exercise-demo {
    grid-template-columns: minmax(106px, 40%) minmax(0, 1fr);
  }

  .workout-panel .stepper-dots button {
    min-height: 42px;
  }
}

/* Compact training flow after merging recovery into the main module. */
.workout-panel {
  padding: 22px;
}

.workout-panel > .section-head {
  align-items: center;
  margin-bottom: 12px;
}

.workout-panel > .section-head .panel-tag {
  margin-bottom: 5px;
}

.workout-panel > .section-head h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.workout-panel .checkin-box {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
}

.workout-panel .checkin-box .primary-button {
  min-height: 42px;
  padding-block: 9px;
}

.workout-panel .tonight-meta {
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .workout-panel .tonight-meta {
    margin-bottom: 6px;
  }
}

.workout-panel .warmup-card {
  padding: 14px 16px;
  gap: 12px;
}

.workout-panel .warmup-copy p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.workout-panel .warmup-actions {
  gap: 6px;
}

.workout-panel .warmup-actions button {
  min-height: 36px;
  padding: 7px 11px;
}

.workout-panel .stepper-head,
.workout-panel .stepper-progress-row {
  display: none;
}

.workout-panel .exercise-stepper {
  margin-top: 14px;
}

.workout-panel .stepper-dots {
  padding: 10px 14px;
}

.training-notes-merged,
.recovery-panel-merged {
  width: 100%;
}

.recovery-panel-merged {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.recovery-merged-head {
  margin-bottom: 14px;
}

.recovery-panel-merged .recovery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recovery-panel-merged .recovery-card,
.recovery-panel-merged .recovery-card + .recovery-card {
  min-height: 0;
  padding: 14px;
}

.recovery-panel-merged .recovery-card-icon {
  width: 38px;
  height: 38px;
}

.recovery-panel-merged .recovery-card h3 {
  margin: 8px 0 5px;
  font-size: 15px;
}

.recovery-panel-merged .recovery-card p {
  font-size: 12px;
  line-height: 1.55;
}

.app-tabbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.diet-panel {
  display: grid;
  gap: 18px;
}

.diet-hero {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(47, 143, 99, 0.2);
  background: linear-gradient(135deg, #ffffff, #f0f8f3);
}

.diet-hero h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.diet-hero > div > p:last-child { max-width: 680px; margin: 10px 0 0; color: #66736c; line-height: 1.7; }

.diet-goal-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(47, 143, 99, 0.22);
  color: #247450;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.diet-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diet-principles > div {
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-left: 4px solid #2f8f63;
  background: #fff;
}

.diet-principles span { color: #2f8f63; font-size: 12px; font-weight: 900; }
.diet-principles strong { font-size: 14px; line-height: 1.45; }

.diet-schedule {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.diet-section-head { margin-bottom: 14px; }
.diet-section-head h3 { margin: 0; font-size: 1.35rem; }

.diet-carousel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diet-carousel-controls button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 35, 32, 0.14);
  background: #fff;
  color: #26322d;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.diet-carousel-controls span {
  min-width: 42px;
  color: #718078;
  font-size: 12px;
  text-align: center;
}

.diet-period-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline: none;
}

.diet-period-grid::-webkit-scrollbar { display: none; }

.diet-period-card {
  flex: 0 0 calc((100% - 10px) / 2);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 16px;
  border: 1px solid rgba(24, 35, 32, 0.1);
  background: #f8faf7;
}

.diet-period-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.diet-period-head > div { display: flex; flex-direction: column; gap: 3px; }
.diet-period-head strong { font-size: 16px; }
.diet-period-head span { color: #718078; font-size: 12px; }

.diet-period-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef6a2e;
  box-shadow: 0 0 0 5px rgba(239, 106, 46, 0.1);
}

.diet-period-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.diet-period-card li { color: #46534c; font-size: 13px; line-height: 1.5; }
.diet-period-card li::marker { color: #2f8f63; }

.diet-disclaimer {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid #d99a21;
  color: #6d6653;
  background: #fffaf0;
  font-size: 12px;
  line-height: 1.6;
}

.diet-recovery {
  order: -1;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
}

.diet-recovery .recovery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.diet-recovery .recovery-card,
.diet-recovery .recovery-card + .recovery-card {
  min-height: 0;
  padding: 14px;
}

@media (max-width: 720px) {
  .diet-hero { padding: 18px; flex-direction: column; }
  .diet-principles { grid-template-columns: 1fr; }
  .diet-principles > div { min-height: 0; }
  .diet-schedule, .diet-recovery { padding: 16px; }
  .diet-section-head { align-items: end; }
  .diet-period-card { flex-basis: 100%; }
  .diet-recovery .recovery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .recovery-panel-merged .recovery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workout-panel { padding: 16px; }

  .workout-panel > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .workout-panel .checkin-box {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: end;
    gap: 4px;
  }

  .workout-panel .checkin-box .primary-button {
    width: auto;
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .workout-panel .tonight-meta {
    gap: 5px;
  }

  .workout-panel .tonight-meta .pill {
    padding: 6px 9px;
    font-size: 12px;
  }

  .workout-panel .warmup-card {
    grid-template-columns: 1fr;
  }

  .recovery-panel-merged { padding: 16px; }

  .workout-panel .exercise-stage {
    padding: 14px;
    gap: 0;
  }

  .workout-panel .exercise-stage-number {
    display: none;
  }

  .workout-panel .exercise-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .workout-panel .exercise-head-actions {
    align-items: flex-end;
  }

  .workout-panel .exercise-player-body {
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: start;
    padding: 10px;
    gap: 10px;
  }

  .workout-panel .exercise-demo {
    width: 132px;
    min-height: 148px;
    margin: 0;
  }

  .workout-panel .exercise-demo-meta {
    padding: 7px;
    gap: 4px;
  }

  .workout-panel .exercise-demo-meta > span,
  .workout-panel .exercise-demo-meta > button {
    min-height: 26px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .workout-panel .exercise-demo img {
    width: 132px;
    height: 132px;
  }

  .workout-panel .exercise-demo-placeholder {
    min-height: 148px;
    padding: 12px 8px;
  }

  .workout-panel .muscle-summary {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 7px;
  }

  .workout-panel .muscle-summary > div {
    min-height: 0;
    padding: 7px 9px;
  }

  .workout-panel .guide-tabs {
    grid-column: 1 / -1;
  }

  .workout-panel .guide-tabs button {
    padding: 8px 9px 7px;
    font-size: 12px;
  }

  .workout-panel .guide-tab-content {
    min-height: 120px;
    padding-top: 10px;
  }

  .workout-panel .guide-tab-content ol,
  .workout-panel .guide-tab-content ul {
    gap: 6px;
  }

  .workout-panel .guide-tab-content li {
    font-size: 13px;
    line-height: 1.5;
  }

  .workout-panel .stepper-footer {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }

  .workout-panel .stepper-footer > span {
    display: none;
  }

  .workout-panel .stepper-footer .step-nav-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .workout-panel > .section-head {
    grid-template-columns: 1fr;
  }

  .workout-panel .checkin-box {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
  }

  .recovery-panel-merged .recovery-grid {
    grid-template-columns: 1fr;
  }

  .workout-panel .exercise-player-body {
    grid-template-columns: 1fr;
  }

  .workout-panel .exercise-demo {
    width: min(100%, 180px);
    margin-inline: auto;
  }

  .workout-panel .exercise-demo img {
    width: 160px;
    height: 160px;
  }
}

.stepper-footer {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 8px;
  border: 1px solid rgba(207, 213, 223, 0.72);
  border-radius: calc(var(--radius-sm) + 2px);
  background: rgba(255, 255, 255, 0.72);
}

.stepper-footer span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.step-nav-button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 96px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.step-nav-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 24, 39, 0.09);
}

.step-nav-button-primary {
  border-color: transparent;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 24px rgba(7, 18, 37, 0.18);
}

.step-nav-button:disabled {
  cursor: default;
  opacity: 0.48;
  box-shadow: none;
}

.stepper-progress-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.stepper-progress-row > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.exercise-stepper {
  gap: 20px;
  padding: 22px;
  border-color: rgba(7, 18, 37, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 250, 246, 0.96), rgba(255, 255, 255, 0.98) 40%, rgba(239, 248, 243, 0.86)),
    repeating-linear-gradient(90deg, rgba(7, 18, 37, 0.025) 0 1px, transparent 1px 22px),
    #fff;
  box-shadow: 0 20px 48px rgba(16, 24, 39, 0.1);
}

.exercise-stepper::before {
  height: 5px;
  background: linear-gradient(90deg, var(--navy) 0 28%, var(--accent) 28% 66%, var(--green) 66% 100%);
}

.stepper-head {
  padding-top: 4px;
}

.stepper-count {
  display: grid;
  min-width: 92px;
  justify-items: end;
  gap: 1px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.stepper-count span,
.stepper-count small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.stepper-count strong {
  font-size: 1.35rem;
  line-height: 1;
}

.stepper-track {
  height: 7px;
  background:
    linear-gradient(90deg, rgba(7, 18, 37, 0.08), rgba(7, 18, 37, 0.04));
}

.stepper-track span {
  background: linear-gradient(90deg, var(--navy), var(--accent) 58%, var(--green));
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.stepper-dots {
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
}

.stepper-dots button {
  min-height: 36px;
  border-radius: 999px;
}

.stepper-dots button.is-active {
  transform: translateY(-1px);
}

.exercise-card-focus,
.exercise-card-focus:first-child,
.exercise-card-focus.is-complete {
  padding: 0;
  animation-duration: 0.3s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.exercise-stage {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 132px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
}

.exercise-stage-number {
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(7, 18, 37, 0.98), rgba(22, 34, 54, 0.96));
  color: #fff;
}

.exercise-stage-number span {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.exercise-stage-main {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.exercise-card-focus .exercise-head {
  gap: 18px;
}

.exercise-card-focus .exercise-title {
  gap: 8px;
}

.exercise-card-focus .exercise-title strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.35;
}

.exercise-card-focus .exercise-top-meta {
  gap: 8px;
}

.exercise-card-focus .exercise-top-meta span,
.exercise-card-focus .exercise-top-meta button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 242, 245, 0.82);
  color: var(--muted);
  line-height: 1;
}

.exercise-card-focus .tutorial-jump {
  color: var(--accent-deep);
}

.exercise-card-focus .exercise-head-actions .tutorial-link {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(239, 106, 46, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 241, 234, 0.78);
  color: var(--accent-deep);
  justify-content: center;
  text-decoration: none;
}

.exercise-card-focus .exercise-head-actions .tutorial-link:hover,
.exercise-card-focus .exercise-head-actions .tutorial-link:focus-visible {
  background: rgba(255, 241, 234, 1);
  text-decoration: none;
}

.exercise-card-focus .exercise-note {
  max-width: none;
  margin-top: 0;
  font-size: 1rem;
}

.exercise-check-card {
  border-color: rgba(7, 18, 37, 0.08);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 14px 26px rgba(7, 18, 37, 0.16);
}

.exercise-check-card input {
  accent-color: var(--green);
}

.exercise-card-focus.is-complete .exercise-check-card {
  background: var(--green);
  box-shadow: 0 14px 26px rgba(47, 143, 99, 0.18);
}

.exercise-card-focus.is-complete .exercise-stage {
  border-color: rgba(47, 143, 99, 0.26);
  background:
    linear-gradient(180deg, rgba(248, 255, 251, 0.96), rgba(255, 255, 255, 0.96)),
    #fff;
}

.exercise-card-focus.is-complete .exercise-stage-number {
  background: var(--green);
}

.guide-grid {
  gap: 10px;
  margin-top: 0;
}

.guide-box {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 14px 16px;
  border-color: rgba(207, 213, 223, 0.62);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: none;
}

.guide-box::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.guide-box:nth-child(2)::before {
  background: var(--navy);
}

.guide-box:nth-child(3)::before {
  background: var(--green);
}

.guide-box span {
  margin-bottom: 7px;
  color: var(--accent-deep);
  font-weight: 900;
}

.guide-box strong {
  color: var(--text);
}

.stepper-footer {
  min-height: 62px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(250, 251, 252, 0.72));
  backdrop-filter: blur(8px);
}

.stepper-footer span {
  color: var(--navy);
}

.step-nav-button {
  min-width: 104px;
}

.step-nav-button-primary {
  background: linear-gradient(180deg, var(--navy), #0d1b31);
}

@keyframes stepInForward {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stepInBack {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .exercise-card-focus,
  .stepper-track span,
  .stepper-dots button,
  .step-nav-button,
  .exercise-check-card,
  .marquee-track {
    animation: none;
    transition: none;
  }
}

.profile-bmi {
  display: grid;
  justify-items: end;
  gap: 2px;
  flex: 0 0 auto;
}

.profile-bmi span,
.profile-bmi small {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-bmi strong {
  color: var(--navy);
  font-size: 1.18rem;
  line-height: 1;
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px 10px;
}

.profile-grid label {
  display: grid;
  gap: 5px;
}

.profile-grid input,
.profile-grid select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.92rem;
}

.profile-grid input:focus,
.profile-grid select:focus {
  outline: 2px solid rgba(239, 106, 46, 0.18);
  border-color: rgba(239, 106, 46, 0.48);
}

.profile-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-calendar {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.88), rgba(255, 255, 255, 0.98));
}

.profile-calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.profile-calendar-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.94rem;
}

.goal-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f0f2f5;
}

.goal-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.goal-tabs button.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 18px rgba(7, 18, 37, 0.18);
}

.profile-calendar-badge {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 60px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
}

.profile-calendar-badge small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-calendar-badge strong {
  font-size: 1.06rem;
  line-height: 1;
}

.calendar-strip {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 35px;
  margin-top: 12px;
  width: 100%;
}

.calendar-day {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 6px;
  cursor: pointer;
}

.calendar-day-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.calendar-day-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-day.is-train .calendar-day-dot {
  border-color: rgba(239, 106, 46, 0.24);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.calendar-day.is-recovery .calendar-day-dot {
  border-color: rgba(47, 143, 99, 0.24);
  background: var(--green-soft);
  color: var(--green);
}

.calendar-day.is-current .calendar-day-dot {
  background: var(--navy);
  border-color: rgba(7, 18, 37, 0.18);
  color: #fff;
  box-shadow: 0 8px 16px rgba(7, 18, 37, 0.12);
}

.calendar-day.is-current .calendar-day-label {
  color: var(--navy);
}

.profile-calendar-meta {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(207, 213, 223, 0.72);
}

.profile-calendar-hero .calendar-strip {
  margin-bottom: 4px;
}

.profile-calendar-hero .profile-calendar-meta {
  display: none;
}

.calendar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calendar-meta-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.calendar-meta-row strong {
  color: var(--navy);
  font-size: 0.9rem;
}

.calendar-meta-row-accent strong {
  color: var(--accent-deep);
}

.profile-controls-hidden {
  display: none;
}

.recovery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mini-card {
  min-width: 0;
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--line);
}

.mini-card + .mini-card {
  padding-left: 18px;
}

.mini-card:last-child {
  border-right: 0;
}

.mini-card h3 {
  color: var(--navy);
  font-size: 1rem;
}

.mini-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.app-module-page .recovery-grid {
  gap: 14px;
  border: 0;
}

.app-module-page .recovery-card,
.app-module-page .recovery-card + .recovery-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 152px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(207, 213, 223, 0.74);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
    #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 39, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-module-page .recovery-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--recovery-accent, var(--accent));
}

.app-module-page .recovery-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -34px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--recovery-accent, var(--accent)) 12%, transparent);
  pointer-events: none;
}

.app-module-page .recovery-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--recovery-accent, var(--accent)) 38%, var(--line));
  box-shadow: 0 18px 38px rgba(16, 24, 39, 0.1);
}

.recovery-card-stretch {
  --recovery-accent: #ef6a2e;
}

.recovery-card-rest {
  --recovery-accent: #2f8f63;
}

.recovery-card-food {
  --recovery-accent: #d99a21;
}

.recovery-card-safe {
  --recovery-accent: #4267b2;
}

.recovery-card-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--recovery-accent) 16%, #fff), #fff);
  color: color-mix(in srgb, var(--recovery-accent) 78%, #071225);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--recovery-accent) 18%, transparent);
}

.recovery-card-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.recovery-card-copy span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--recovery-accent) 11%, #fff);
  color: color-mix(in srgb, var(--recovery-accent) 86%, #071225);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
}

.app-module-page .recovery-card h3 {
  margin-top: 12px;
  font-size: 1.16rem;
  line-height: 1.22;
}

.app-module-page .recovery-card p {
  margin-top: 9px;
  color: #536174;
  font-size: 0.96rem;
  line-height: 1.74;
  white-space: pre-line;
}

.recovery-actions {
  display: grid;
  justify-content: stretch;
  gap: 10px;
  margin-top: 18px;
}

.module-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid rgba(7, 18, 37, 0.1);
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(7, 18, 37, 0.16);
}

.module-action-button-light {
  border-color: rgba(207, 213, 223, 0.9);
  background: #fff;
  color: var(--navy);
  box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
}

.module-action-button span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
}

.module-action-button-light span {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.training-notes-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(207, 213, 223, 0.78);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 252, 0.92));
}

.training-notes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}

.training-notes-head > div {
  display: grid;
  align-content: center;
}

.training-notes-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.02rem;
}

.note-add-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(47, 143, 99, 0.22);
  border-radius: 999px;
  background: var(--green);
  color: var(--green);
  cursor: pointer;
  font-family: Arial, sans-serif;
  box-shadow: 0 14px 28px rgba(47, 143, 99, 0.22);
}

.note-add-button span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  line-height: 0;
}

.note-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.note-form[hidden] {
  display: none;
}

.note-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.note-form textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  line-height: 1.55;
}

.note-form textarea:focus {
  outline: 2px solid rgba(47, 143, 99, 0.18);
  border-color: rgba(47, 143, 99, 0.48);
}

.note-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.note-ghost-button,
.note-save-button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}

.note-ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.note-save-button {
  border: 1px solid rgba(47, 143, 99, 0.26);
  background: var(--green);
  color: #fff;
}

.note-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.note-empty {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.note-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(226, 229, 234, 0.78);
}

.note-date {
  display: grid;
  place-items: center;
  min-width: 46px;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
}

.note-text {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.equipment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.equipment-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.equipment-card.is-highlighted {
  border-color: rgba(239, 106, 46, 0.55);
  box-shadow: 0 16px 34px rgba(239, 106, 46, 0.16);
  transform: translateY(-2px);
}

.equipment-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef1f5;
}

.equipment-content {
  padding: 15px;
}

.equipment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.equipment-head h3 {
  color: var(--navy);
  font-size: 1.04rem;
}

.equipment-content p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.68;
}

.equipment-meta {
  margin-top: 12px;
}

.equipment-meta strong {
  display: block;
  line-height: 1.58;
}

.empty-text {
  color: var(--muted);
  line-height: 1.7;
}

.action-dock {
  position: fixed;
  right: 24px;
  left: 24px;
  bottom: 92px;
  z-index: 40;
  display: grid;
  grid-template-columns: 56px 112px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.app-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: 100vw;
  padding: 0 0 env(safe-area-inset-bottom);
  border: 1px solid rgba(207, 213, 223, 0.92);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(16px);
}

.app-tabbar button {
  display: inline-grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.app-tabbar button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 0.78rem;
}

.app-tabbar button.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 22px rgba(7, 18, 37, 0.18);
}

.app-tabbar button.is-active span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.dock-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  white-space: nowrap;
  pointer-events: auto;
}

.dock-button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-lift);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.dock-button-quiet.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.dock-button-soft {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.rocket-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  min-height: 52px;
  padding: 0;
  border: 1px solid rgba(239, 106, 46, 0.28);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 20%, #fff 0 22%, rgba(255, 241, 234, 0.92) 23% 100%);
  color: var(--accent-deep);
  box-shadow: 0 14px 28px rgba(239, 106, 46, 0.16);
}

.rocket-button::before {
  content: none;
  width: 18px;
  height: 26px;
  border-radius: 50% 50% 44% 44%;
  background: var(--navy);
  clip-path: polygon(50% 0, 86% 42%, 72% 100%, 50% 84%, 28% 100%, 14% 42%);
}

.rocket-button::after {
  content: none;
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 8px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 8px 14px rgba(239, 106, 46, 0.36);
}

.rocket-button span {
  font-size: 24px;
  line-height: 1;
}

.bmi-modal[hidden] {
  display: none;
}

.bmi-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.bmi-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 37, 0.38);
  backdrop-filter: blur(6px);
}

.bmi-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid rgba(207, 213, 223, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lift);
}

.ai-modal .bmi-modal-panel {
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(226, 229, 234, 0.92);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 18, 37, 0.18);
}

.ai-modal .bmi-modal-head {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 229, 234, 0.82);
}

.ai-modal .panel-tag {
  margin-bottom: 5px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.ai-modal .bmi-modal-head h2 {
  font-size: 1.08rem;
  line-height: 1.3;
}

.ai-modal .bmi-modal-close {
  min-height: 32px;
  padding: 5px 9px;
  border-color: rgba(226, 229, 234, 0.92);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.86rem;
}

.bmi-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.bmi-modal-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.18rem;
}

.bmi-modal-close {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.bmi-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.bmi-modal-grid label {
  display: grid;
  gap: 6px;
}

.bmi-modal-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.bmi-modal-grid input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.bmi-result-card {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(207, 213, 223, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.9), rgba(255, 255, 255, 1));
}

.bmi-result-card span,
.bmi-result-card small {
  color: var(--muted);
}

.bmi-result-card strong {
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

.bmi-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.ai-context-card {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 213, 223, 0.74);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.ai-chat-log {
  display: grid;
  gap: 9px;
  max-height: 260px;
  margin-top: 12px;
  overflow: auto;
  padding: 2px 4px 6px;
}

.ai-message {
  max-width: 88%;
  padding: 11px 12px;
  border-radius: 12px;
  line-height: 1.58;
}

.ai-message p,
.ai-message ol {
  margin: 5px 0 0;
}

.ai-message ol {
  padding-left: 1.2em;
}

.ai-message li + li {
  margin-top: 5px;
}

.ai-message span {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 900;
}

.ai-message strong {
  display: block;
  margin-top: 6px;
  color: var(--accent-deep);
  font-size: 0.82rem;
}

.ai-message.is-assistant {
  justify-self: start;
  border: 1px solid rgba(226, 229, 234, 0.9);
  background: var(--surface-soft);
  color: var(--muted);
}

.ai-message.is-user {
  justify-self: end;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.ai-message.is-user p {
  margin: 0;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.ai-quick-prompts button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(207, 213, 223, 0.9);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.ai-question-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-question-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ai-question-form textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  line-height: 1.55;
}

.ai-question-form textarea:focus {
  outline: 2px solid rgba(239, 106, 46, 0.22);
  border-color: rgba(239, 106, 46, 0.48);
}

.ai-safety-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
  }

  .hero-overview {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 980px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recovery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-card:nth-child(2) {
    border-right: 0;
  }

  .mini-card:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .app-module-page .recovery-card:nth-child(2),
  .app-module-page .recovery-card:nth-child(n + 3) {
    border: 1px solid rgba(207, 213, 223, 0.74);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 12px 166px;
  }

  .hero,
  .system-panel,
  .plan-panel,
  .workout-panel,
  .secondary-section {
    padding: 20px;
    border-radius: 18px;
  }

  .hero {
    gap: 22px;
  }

  .hero-side {
    gap: 10px;
  }

  .hero-overview {
    padding: 8px;
  }

  .hero-art {
    max-width: 100%;
    padding: 8px 8px 0;
  }

  .section-head,
  .section-head-split,
  .exercise-head,
  .warmup-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .frequency-tabs {
    width: 100%;
  }

  .status-grid,
  .recovery-grid,
  .guide-grid,
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .day-card {
    padding-left: 36px;
  }

  .day-card::before {
    left: 11px;
  }

  .day-card::after {
    left: 4px;
  }

  .warmup-actions,
  .exercise-head-actions {
    justify-content: flex-start;
  }

  .exercise-stepper {
    padding: 14px;
  }

  .stepper-head,
  .stepper-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .stepper-head {
    gap: 12px;
  }

  .stepper-progress-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .stepper-dots {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .exercise-stage {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px;
  }

  .exercise-stage-number {
    justify-content: start;
    min-height: 42px;
    padding: 0 14px;
  }

  .exercise-stage-number span {
    font-size: 1.05rem;
  }

  .exercise-card-focus .exercise-head {
    gap: 14px;
  }

  .exercise-card-focus .exercise-head-actions {
    width: 100%;
  }

  .stepper-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 48px;
    justify-items: stretch;
  }

  .stepper-count strong {
    margin-left: auto;
  }

  .exercise-check-card,
  .exercise-head-actions .tutorial-link {
    width: 100%;
    justify-content: center;
  }

  .stepper-count,
  .step-nav-button {
    width: 100%;
  }

  .stepper-footer span {
    order: -1;
    text-align: left;
  }

  .checkin-box {
    justify-items: start;
    width: 100%;
  }

  .primary-button {
    width: 100%;
  }

  .mini-card,
  .mini-card + .mini-card {
    padding: 16px 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .app-module-page .mini-card,
  .app-module-page .mini-card + .mini-card {
    padding: 16px;
    border: 1px solid rgba(207, 213, 223, 0.78);
    border-radius: var(--radius-md);
  }

  .mini-card:first-child {
    border-top: 0;
  }

  .app-module-page .mini-card:first-child {
    border-top: 1px solid rgba(207, 213, 223, 0.78);
  }

  .app-module-page .recovery-card,
  .app-module-page .recovery-card + .recovery-card,
  .app-module-page .recovery-card:first-child {
    min-height: 146px;
    padding: 16px;
    border: 1px solid rgba(207, 213, 223, 0.74);
  }

  .recovery-actions {
    justify-content: stretch;
  }

  .module-action-button {
    width: 100%;
  }

  .training-notes-head {
    flex-direction: row;
    align-items: center;
  }

  .note-add-button {
    width: 58px;
    height: 58px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .note-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .action-dock {
    right: 10px;
    bottom: 82px;
    left: 10px;
    grid-template-columns: 52px minmax(96px, 112px);
    max-width: none;
  }

  .app-tabbar {
    gap: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    border-radius: 0;
  }

  .app-tabbar button {
    min-height: 58px;
    border-radius: 0;
    font-size: 0.96rem;
  }

  .app-tabbar button.is-active {
    border-radius: 0;
  }

  .dock-button {
    min-height: 40px;
    padding: 9px 11px;
    font-size: 0.88rem;
  }

  .rocket-button {
    width: 50px;
    min-height: 50px;
  }

  .bmi-modal-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .bmi-modal-grid {
    grid-template-columns: 1fr;
  }

  .marquee-track {
    gap: 10px;
  }

  .marquee-track span {
    font-size: 0.84rem;
    padding: 5px 10px;
  }
}

@media (max-width: 640px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 2.35rem;
  }

  .day-top {
    flex-direction: column;
  }
}

/* Final responsive guardrails: keep app controls stable across phone sizes. */
html {
  min-width: 0;
  overflow-x: clip;
}

body,
.app-shell,
.app-module,
.dashboard-layout,
.plan-panel,
.workout-panel,
.exercise-stepper,
.exercise-card,
.diet-panel,
.equipment-panel {
  min-width: 0;
  max-width: 100%;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.app-tabbar {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.app-tabbar button {
  min-width: 0;
  white-space: nowrap;
}

.bmi-modal-panel,
.ai-modal .bmi-modal-panel {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 760px) {
  body {
    padding-inline: clamp(8px, 3vw, 15px);
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .hero,
  .plan-panel,
  .workout-panel,
  .training-notes-panel,
  .diet-panel,
  .equipment-panel {
    width: 100%;
  }

  .section-head h2,
  .diet-hero h2,
  .module-page-head h2 {
    overflow-wrap: anywhere;
  }

  .step-nav-button,
  .primary-button,
  .module-action-button,
  .diet-carousel-controls button {
    min-height: 44px;
  }

  .guide-tabs button {
    min-height: 40px;
  }

  .exercise-demo img {
    aspect-ratio: 1;
    object-fit: contain;
  }

  .weekly-plan {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 2px 8px;
  }

  .weekly-plan::-webkit-scrollbar {
    display: none;
  }

  .weekly-plan .day-card {
    flex: 0 0 min(86%, 300px);
    min-height: 210px;
    padding: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .weekly-plan .day-card::before,
  .weekly-plan .day-card::after {
    display: none;
  }

  .weekly-plan .day-card-shell,
  .weekly-plan .day-card:first-child .day-card-shell {
    height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .weekly-plan .day-card.is-active .day-card-shell {
    border-color: rgba(239, 106, 46, 0.45);
    box-shadow: 0 12px 26px rgba(16, 24, 39, 0.08);
  }

  .diet-panel,
  .diet-panel > *,
  #dietGuide,
  #dietGuide > *,
  .diet-recovery,
  .diet-recovery .recovery-grid,
  .diet-schedule,
  .diet-period-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .diet-recovery .recovery-card,
  .diet-recovery .recovery-card + .recovery-card,
  .diet-recovery .recovery-card:first-child {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 10px 4px calc(140px + env(safe-area-inset-bottom));
  }

  .workout-panel {
    padding: 10px;
  }

  .workout-panel .exercise-stepper {
    padding: 8px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 46px 16px 18px;
  }

  .hero-main,
  .hero-side,
  .hero-overview,
  .profile-calendar,
  .profile-calendar-head,
  .calendar-strip,
  .hero-art,
  .hero-art-image {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .version-badge {
    top: 14px;
    right: 16px;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .hero-motto {
    font-size: 0.9rem;
  }

  .frequency-tabs,
  .goal-tabs {
    width: 100%;
  }

  .frequency-tabs button,
  .goal-tabs button {
    min-width: 0;
    flex: 1 1 0;
  }

  .exercise-head-actions {
    width: 100%;
  }

  .workout-panel .exercise-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .workout-panel .exercise-title {
    width: 100%;
    min-width: 0;
  }

  .workout-panel .exercise-title > strong {
    display: block;
    font-size: clamp(1.45rem, 8vw, 1.9rem);
    line-height: 1.15;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .workout-panel .exercise-head-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .exercise-head-actions > *,
  .exercise-check-card {
    width: 100%;
  }

  .workout-panel .exercise-head-actions > :only-child {
    grid-column: 1 / -1;
  }

  .exercise-demo {
    max-width: 200px;
  }

  .guide-tabs {
    scroll-padding-inline: 8px;
  }

  .stepper-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stepper-footer .step-nav-button {
    min-width: 0;
    padding-inline: 8px;
  }

  .diet-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .diet-carousel-controls {
    gap: 4px;
  }

  .diet-carousel-controls button {
    width: 44px;
  }

  .bmi-modal,
  .ai-modal {
    padding: 8px;
  }
}

@media (max-width: 340px) {
  body {
    padding-inline: 6px;
  }

  .app-tabbar button {
    gap: 3px;
    padding-inline: 4px;
    font-size: 12px;
  }

  .app-tabbar button span {
    width: 28px;
    height: 28px;
  }

  .exercise-top-meta,
  .exercise-demo-meta {
    gap: 4px;
  }
}

@media (max-width: 300px) {
  body {
    padding-inline: 3px;
  }

  .app-shell {
    width: 100%;
    padding-inline: 2px;
  }

  .hero,
  .hero-main,
  .hero-side,
  .hero-overview,
  .profile-calendar,
  .profile-calendar-head,
  .plan-panel,
  .workout-panel,
  .training-notes-panel,
  .secondary-section,
  .diet-hero,
  .diet-section-head,
  .equipment-card,
  .equipment-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero {
    gap: 14px;
    padding: 42px 10px 12px;
  }

  .hero h1 {
    width: auto;
    max-width: 100%;
    font-size: 1.55rem;
  }

  .hero-motto {
    margin-top: 10px;
    padding-left: 8px;
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .version-badge {
    top: 10px;
    right: 10px;
    font-size: 9px;
  }

  .profile-calendar,
  .hero-overview,
  .plan-panel,
  .workout-panel,
  .training-notes-panel,
  .secondary-section {
    padding: 10px;
  }

  .profile-calendar-head {
    gap: 6px;
  }

  .profile-calendar-badge {
    min-width: 54px;
    padding: 7px;
  }

  .goal-tabs,
  .frequency-tabs,
  .calendar-strip {
    width: 100%;
    min-width: 0;
  }

  .calendar-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .calendar-day {
    min-width: 0;
    padding-inline: 2px;
  }

  .section-head h2,
  .module-page-head h2,
  .diet-hero h2 {
    font-size: 1.3rem;
    line-height: 1.2;
  }

  .weekly-plan .day-card {
    flex-basis: 94%;
  }

  .workout-panel .exercise-stepper {
    padding: 5px;
  }

  .stepper-dots {
    gap: 3px;
    padding-inline: 4px;
  }

  .stepper-dots button {
    min-width: 32px;
  }

  .workout-panel .exercise-head-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .workout-panel .exercise-head-actions > * {
    grid-column: 1;
  }

  .exercise-demo {
    width: min(100%, 180px);
  }

  .guide-tabs button {
    padding-inline: 8px;
    font-size: 11px;
  }

  .diet-section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .diet-carousel-controls {
    justify-content: space-between;
  }

  .app-tabbar button {
    min-width: 0;
    padding-inline: 2px;
    font-size: 10px;
  }

  .app-tabbar button span {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}

/* Unified phone experience: one mobile layout for Android and iPhone. */
@media (max-width: 480px) {
  :root {
    --phone-gutter: clamp(8px, 2.8vw, 14px);
    --phone-panel-radius: 18px;
    --phone-tabbar-height: 64px;
  }

  html {
    background: #f4f6f8;
  }

  body {
    min-height: 100dvh;
    padding: 0;
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
    padding-bottom: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 12% 0%, rgba(239, 106, 46, 0.08), transparent 32%),
      linear-gradient(180deg, #fafbfc 0%, #f1f4f7 100%);
  }

  button,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell {
    width: 100%;
    padding: var(--phone-gutter) var(--phone-gutter) calc(76px + env(safe-area-inset-bottom));
  }

  .app-module-page {
    min-height: calc(100dvh - var(--phone-tabbar-height));
    gap: 12px;
  }

  .dashboard-layout {
    gap: 12px;
    margin-top: 12px;
  }

  .hero,
  .plan-panel,
  .workout-panel,
  .training-notes-panel,
  .secondary-section {
    border-radius: var(--phone-panel-radius);
    box-shadow: 0 8px 24px rgba(16, 24, 39, 0.055);
  }

  .hero {
    gap: 14px;
    padding: 42px 14px 14px;
  }

  .version-badge {
    top: 12px;
    right: 14px;
    max-width: calc(100% - 28px);
    padding: 5px 7px;
    overflow: hidden;
    border-radius: 7px;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .eyebrow,
  .panel-tag {
    margin-bottom: 6px;
    font-size: 0.7rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.15rem);
    line-height: 1.08;
  }

  .hero-motto {
    margin-top: 10px;
    padding-left: 10px;
    border-left-width: 3px;
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .hero-side,
  .hero-overview {
    gap: 8px;
  }

  .hero-overview {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .profile-calendar-hero {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 248, 242, 0.9), #fff);
  }

  .profile-calendar-head {
    align-items: center;
  }

  .profile-calendar-badge {
    min-width: 58px;
    padding: 7px 9px;
  }

  .goal-tabs {
    margin-top: 10px;
  }

  .goal-tabs button,
  .frequency-tabs button {
    min-height: 44px;
  }

  .calendar-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(4px, 2.2vw, 10px);
  }

  .calendar-day {
    min-width: 0;
  }

  .calendar-day-dot {
    width: 32px;
    height: 32px;
  }

  .hero-art {
    max-height: 84px;
    padding: 2px 6px 0;
  }

  .hero-art-image {
    height: 84px;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .plan-panel,
  .workout-panel,
  .secondary-section {
    padding: 14px;
  }

  .section-head,
  .section-head-split {
    gap: 12px;
    margin-bottom: 14px;
  }

  .section-head h2,
  .module-page-head h2,
  .diet-hero h2 {
    font-size: clamp(1.25rem, 6vw, 1.55rem);
    line-height: 1.2;
  }

  .frequency-tabs {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weekly-plan {
    margin-inline: -2px;
    padding-bottom: 5px;
  }

  .weekly-plan .day-card {
    flex-basis: min(84%, 292px);
    min-height: 190px;
  }

  .weekly-plan .day-card-shell,
  .weekly-plan .day-card:first-child .day-card-shell {
    padding: 14px;
  }

  .day-card p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .workout-panel > .section-head {
    align-items: stretch;
  }

  .workout-panel .checkin-box {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .workout-panel .checkin-box span {
    text-align: left;
  }

  .workout-panel .checkin-box .primary-button,
  .workout-panel .warmup-actions button,
  .exercise-head-actions .tutorial-link,
  .workout-panel .exercise-demo-meta > button,
  .guide-tabs button {
    min-height: 44px;
  }

  .exercise-head-actions .tutorial-link {
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid rgba(239, 106, 46, 0.24);
    border-radius: 10px;
    background: var(--accent-soft);
  }

  .workout-panel .warmup-card {
    padding: 13px;
    border-radius: 14px;
  }

  .workout-panel .warmup-actions,
  .workout-panel .warmup-actions button {
    width: 100%;
  }

  .workout-panel .exercise-stepper {
    gap: 12px;
    padding: 8px;
    border-radius: 14px;
  }

  .workout-panel .stepper-dots {
    gap: 5px;
    padding: 8px 4px;
  }

  .stepper-dots button {
    min-width: 0;
    min-height: 44px;
  }

  .exercise-stage {
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
  }

  .exercise-stage-number {
    min-height: 40px;
  }

  .workout-panel .exercise-title > strong {
    font-size: clamp(1.35rem, 7vw, 1.7rem);
  }

  .exercise-demo {
    width: min(100%, 190px);
    min-height: 0;
    margin-inline: auto;
  }

  .exercise-demo img {
    width: min(100%, 180px);
    height: auto;
    aspect-ratio: 1;
  }

  .stepper-footer {
    gap: 8px;
  }

  .stepper-footer .step-nav-button {
    min-height: 48px;
  }

  .training-notes-panel {
    margin-top: 0;
    padding: 14px;
  }

  .note-add-button {
    width: 48px;
    height: 48px;
  }

  .equipment-card {
    border-radius: 14px;
  }

  .equipment-image {
    aspect-ratio: 16 / 10;
  }

  .diet-panel {
    gap: 12px;
  }

  .diet-hero {
    padding: 16px;
    border-radius: 14px;
  }

  .recovery-actions,
  .note-form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .recovery-actions > *,
  .note-form-actions > * {
    width: 100%;
    min-height: 44px;
  }

  .app-tabbar {
    min-height: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
    padding:
      5px
      max(6px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    border-top-color: rgba(207, 213, 223, 0.78);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 30px rgba(16, 24, 39, 0.1);
  }

  .app-tabbar button {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 26px 16px;
    gap: 1px;
    min-height: 54px;
    padding: 4px 6px;
    border-radius: 12px;
    font-size: 0.72rem;
    line-height: 1;
  }

  .app-tabbar button.is-active {
    border-radius: 12px;
  }

  .app-tabbar button span {
    width: 26px;
    height: 26px;
    margin-inline: auto;
    font-size: 0.7rem;
  }

  .action-dock {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(var(--phone-tabbar-height) + 12px + env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
  }

  .rocket-button {
    width: 48px;
    min-height: 48px;
  }

  .bmi-modal,
  .ai-modal {
    place-items: end center;
    padding: 12px 0 0;
  }

  .bmi-modal-panel,
  .ai-modal .bmi-modal-panel {
    width: 100%;
    max-height: calc(100dvh - 12px);
    padding: 18px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .ai-chat-log {
    max-height: min(38dvh, 300px);
  }
}

@media (max-width: 359px) {
  .app-tabbar button {
    padding-inline: 2px;
    font-size: 0.68rem;
  }

  .weekly-plan .day-card {
    flex-basis: 90%;
  }

  .calendar-strip {
    gap: 3px;
  }

  .calendar-day-dot {
    width: 29px;
    height: 29px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .app-shell {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .app-tabbar {
    --phone-tabbar-height: 54px;
  }

  .app-tabbar button {
    grid-template-columns: auto auto;
    grid-template-rows: 1fr;
    gap: 5px;
    min-height: 44px;
  }

  .action-dock {
    bottom: calc(58px + env(safe-area-inset-bottom));
  }
}

@media (hover: none) and (pointer: coarse) {
  .day-card,
  .equipment-card,
  .exercise-check-card,
  .stepper-dots button {
    -webkit-tap-highlight-color: transparent;
  }

  .equipment-card:hover,
  .exercise-check-card:hover,
  .stepper-dots button:hover {
    transform: none;
  }
}

/* Interaction flow: keep the visual system, soften how the interface responds. */
:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-fast: 160ms;
  --motion-base: 240ms;
  --motion-slow: 340ms;
}

body.has-modal-open {
  overflow: hidden;
}

.app-module.is-active {
  animation: moduleFlowIn var(--motion-slow) var(--motion-ease-out) both;
}

.frequency-tabs button,
.goal-tabs button,
.app-tabbar button,
.app-tabbar button span,
.primary-button,
.ghost-button,
.soft-button,
.guide-button,
.module-action-button,
.note-add-button,
.note-ghost-button,
.note-save-button,
.bmi-modal-close,
.ai-quick-prompts button,
.diet-carousel-controls button,
.dock-button,
.day-card-shell,
.equipment-card,
.recovery-card,
.guide-tabs button,
.tutorial-link {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease),
    border-color var(--motion-base) ease,
    background-color var(--motion-base) ease,
    color var(--motion-base) ease,
    opacity var(--motion-fast) ease;
}

.frequency-tabs button.is-active,
.goal-tabs button.is-active,
.app-tabbar button.is-active {
  animation: controlSettle 280ms var(--motion-ease-out) both;
}

.app-tabbar button.is-active span {
  transform: translateY(-1px) scale(1.04);
}

.weekly-plan .day-card.is-active .day-card-shell {
  animation: cardSettle 320ms var(--motion-ease-out) both;
}

.exercise-card-focus {
  animation-duration: 320ms;
  animation-timing-function: var(--motion-ease-out);
}

.note-form:not([hidden]) {
  transform-origin: top center;
  animation: formReveal 280ms var(--motion-ease-out) both;
}

.note-item,
.ai-message {
  animation: contentSettle 280ms var(--motion-ease-out) both;
}

.equipment-card.is-highlighted {
  animation: highlightSettle 620ms var(--motion-ease-out) both;
}

.bmi-modal:not([hidden]) .bmi-modal-backdrop {
  animation: modalBackdropIn var(--motion-base) ease both;
}

.bmi-modal:not([hidden]) .bmi-modal-panel {
  transform-origin: center bottom;
  animation: modalPanelIn 320ms var(--motion-ease-out) both;
}

.bmi-modal.is-closing .bmi-modal-backdrop {
  animation: modalBackdropOut 180ms ease both;
}

.bmi-modal.is-closing .bmi-modal-panel {
  animation: modalPanelOut 180ms ease both;
}

@media (hover: hover) and (pointer: fine) {
  .day-card:hover .day-card-shell,
  .equipment-card:hover,
  .recovery-card:hover {
    transform: translateY(-3px);
  }

  .primary-button:hover,
  .ghost-button:hover,
  .soft-button:hover,
  .guide-button:hover,
  .module-action-button:hover,
  .note-save-button:hover,
  .note-ghost-button:hover,
  .bmi-modal-close:hover,
  .ai-quick-prompts button:hover,
  .diet-carousel-controls button:hover,
  .dock-button:hover {
    transform: translateY(-1px);
  }

  .tutorial-link:hover {
    transform: translateX(2px);
  }
}

.frequency-tabs button:active,
.goal-tabs button:active,
.app-tabbar button:active,
.primary-button:active,
.ghost-button:active,
.soft-button:active,
.guide-button:active,
.module-action-button:active,
.note-add-button:active,
.note-ghost-button:active,
.note-save-button:active,
.bmi-modal-close:active,
.ai-quick-prompts button:active,
.diet-carousel-controls button:active,
.dock-button:active,
.step-nav-button:not(:disabled):active,
.exercise-check-card:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 80ms;
}

.day-card:active .day-card-shell,
.equipment-card:active,
.recovery-card:active {
  transform: scale(0.99);
  transition-duration: 80ms;
}

@keyframes moduleFlowIn {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes controlSettle {
  0% { transform: scale(0.96); }
  70% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@keyframes cardSettle {
  from {
    opacity: 0.88;
    transform: translateY(4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes formReveal {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes contentSettle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes highlightSettle {
  0% { transform: translateY(4px) scale(0.985); }
  55% { transform: translateY(-3px) scale(1.006); }
  100% { transform: translateY(-2px) scale(1); }
}

@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalPanelOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-module.is-active,
  .frequency-tabs button.is-active,
  .goal-tabs button.is-active,
  .app-tabbar button.is-active,
  .weekly-plan .day-card.is-active .day-card-shell,
  .exercise-card-focus,
  .note-form:not([hidden]),
  .note-item,
  .ai-message,
  .equipment-card.is-highlighted,
  .bmi-modal:not([hidden]) .bmi-modal-backdrop,
  .bmi-modal:not([hidden]) .bmi-modal-panel,
  .bmi-modal.is-closing .bmi-modal-backdrop,
  .bmi-modal.is-closing .bmi-modal-panel {
    animation: none !important;
  }

  .frequency-tabs button,
  .goal-tabs button,
  .app-tabbar button,
  .app-tabbar button span,
  .primary-button,
  .ghost-button,
  .soft-button,
  .guide-button,
  .module-action-button,
  .note-add-button,
  .note-ghost-button,
  .note-save-button,
  .bmi-modal-close,
  .ai-quick-prompts button,
  .diet-carousel-controls button,
  .dock-button,
  .day-card-shell,
  .equipment-card,
  .recovery-card,
  .guide-tabs button,
  .tutorial-link {
    transition-duration: 0.01ms !important;
  }
}

/* Final phone precedence: later legacy breakpoints must not enlarge the workout again. */
@media (max-width: 480px) {
  :root {
    --phone-tabbar-height: 56px;
  }

  body {
    padding-bottom: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
  }

  .app-shell {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .workout-panel {
    padding: 8px;
  }

  .workout-panel .exercise-stepper {
    gap: 8px;
    padding: 6px;
  }

  .workout-panel .stepper-dots {
    gap: 5px;
    padding: 5px;
  }

  .exercise-stage {
    gap: 7px;
    padding: 10px;
    scroll-margin-top: calc(68px + env(safe-area-inset-top));
  }

  .workout-panel .exercise-title > strong {
    font-size: clamp(1.18rem, 6vw, 1.45rem);
  }

  .workout-panel .exercise-head-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .workout-panel .exercise-head-actions > :only-child {
    grid-column: 1 / -1;
  }

  .workout-panel .exercise-player-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .workout-panel .exercise-demo {
    width: 100%;
    max-width: none;
    margin: 0;
    grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
  }

  .workout-panel .exercise-demo img {
    width: 100%;
    height: auto;
  }

  .workout-panel .exercise-demo-meta {
    padding: 8px;
  }

  .guide-tabs button {
    min-height: 40px;
  }

  .stepper-footer .step-nav-button {
    min-height: 44px;
  }

  .app-tabbar {
    min-height: calc(var(--phone-tabbar-height) + env(safe-area-inset-bottom));
    padding-top: 3px;
    padding-bottom: max(3px, env(safe-area-inset-bottom));
  }

  .app-tabbar button {
    grid-template-rows: 22px 14px;
    min-height: 48px;
    padding: 3px 4px;
    border-radius: 10px;
    font-size: 0.66rem;
  }

  .app-tabbar button.is-active {
    border-radius: 10px;
  }

  .app-tabbar button span {
    width: 22px;
    height: 22px;
    font-size: 0.64rem;
  }

  .action-dock {
    bottom: calc(var(--phone-tabbar-height) + 8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 359px) {
  .workout-panel .exercise-demo {
    grid-template-columns: minmax(106px, 40%) minmax(0, 1fr);
  }

  .workout-panel .stepper-dots button {
    min-height: 44px;
  }
}

/* v9: denser muscle summary and an always-reachable mobile next action. */
@media (max-width: 480px) {
  .app-module.is-active {
    animation: none;
    transform: none;
  }

  .app-shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .workout-panel .stepper-dots {
    padding: 3px;
  }

  .exercise-stage {
    padding: 8px;
  }

  .workout-panel .exercise-stage-main {
    gap: 5px;
  }

  .workout-panel .exercise-title > strong {
    font-size: clamp(1.12rem, 5.6vw, 1.35rem);
  }

  .exercise-card-focus .exercise-note {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .workout-panel .exercise-player-body {
    padding: 6px;
  }

  .workout-panel .exercise-demo {
    grid-template-columns: minmax(108px, 38%) minmax(0, 1fr);
  }

  .workout-panel .exercise-demo-meta {
    padding: 6px;
    gap: 3px;
  }

  .workout-panel .exercise-demo-meta > span,
  .workout-panel .exercise-demo-meta > button {
    min-height: 30px;
    padding: 5px 6px;
  }

  .workout-panel .exercise-demo-meta > button {
    min-height: 42px;
  }

  .workout-panel .muscle-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 6px;
  }

  .workout-panel .muscle-summary > div {
    min-height: 50px;
    padding: 6px 7px;
    gap: 2px;
  }

  .workout-panel .muscle-summary span {
    font-size: 10px;
  }

  .workout-panel .muscle-summary strong {
    font-size: 11px;
    line-height: 1.35;
  }

  .exercise-memory-cue {
    margin-bottom: 5px;
    padding: 6px 8px;
  }

  .guide-tab-content {
    min-height: 108px;
    padding-top: 7px;
  }

}

/* Final tutorial drawer precedence over every legacy modal breakpoint. */
.bmi-modal.tutorial-sheet {
  place-items: end center;
  padding: 24px 24px 0;
}

.tutorial-sheet .bmi-modal-panel.tutorial-sheet-panel {
  width: min(100%, 760px);
  max-height: min(88dvh, 760px);
  display: flex;
  padding: 0;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
}

@media (max-width: 700px) {
  .bmi-modal.tutorial-sheet {
    padding: 12px 0 0;
  }

  .tutorial-sheet .bmi-modal-panel.tutorial-sheet-panel {
    width: 100%;
    max-height: calc(100dvh - 12px);
    padding: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }
}

.exercise-timer {
  --timer-color: #966019;
  --timer-soft: #fff8e8;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.exercise-timer[data-timer-phase="cardio"] {
  --timer-color: var(--accent-deep);
  --timer-soft: var(--accent-soft);
}

.exercise-timer[data-timer-phase="cooldown"],
.exercise-timer[data-timer-phase="complete"] {
  --timer-color: #226e4b;
  --timer-soft: #edf8f1;
}

.exercise-timer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exercise-timer-phase {
  min-width: 0;
}

.exercise-timer-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.exercise-timer-heading strong {
  color: var(--timer-color);
  font-size: 22px;
  line-height: 1.3;
}

.exercise-timer-heading > span {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--timer-soft);
  color: var(--timer-color);
  font-size: 11px;
  white-space: nowrap;
}

.exercise-timer-phase p {
  margin: 6px 0 0;
  color: #536174;
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.exercise-timer-time {
  display: grid;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
}

.exercise-timer-time > strong {
  color: #071225;
  font-size: 30px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.exercise-timer-time > span {
  font-size: 12px;
  color: #64748b;
}

.exercise-timer-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.exercise-timer-stages > li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
}

.exercise-timer-stages small {
  font-size: 11px;
  white-space: nowrap;
}

.exercise-timer-stages .is-active {
  border-color: var(--timer-color);
  color: var(--timer-color);
  background: var(--timer-soft);
  font-weight: 700;
}

.exercise-timer-stages .is-done {
  border-top-color: #2f8f63;
  color: #226e4b;
}

.exercise-timer-stages .is-done > span::before {
  content: "✓ ";
}

.exercise-timer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.exercise-timer-controls .step-nav-button {
  width: auto;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}

.exercise-timer-sound {
  margin-left: auto;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #536174;
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.exercise-timer-sound[aria-pressed="true"] {
  border-color: #2f8f63;
  color: #226e4b;
  background: #edf8f1;
}

.exercise-timer-sound:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.exercise-timer-sound-note {
  margin: -4px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.exercise-timer-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .exercise-timer {
    padding: 14px 12px;
  }

  .exercise-timer-heading strong {
    font-size: 20px;
  }

  .exercise-timer-stages > li {
    flex-direction: column;
    padding: 8px;
  }

  .exercise-timer-time > strong {
    font-size: 28px;
  }
}

@media (max-width: 350px) {
  .exercise-timer-stages > li {
    padding-inline: 6px;
    font-size: 11px;
  }
}

/* Shared interface refinement: warm surfaces, clear controls, readable teaching. */
.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.65fr);
  align-items: center;
  column-gap: 20px;
  min-width: 0;
}
.hero-copy { min-width: 0; }
.hero-copy .hero-motto > span { display: inline-block; }
.hero-mascot {
  display: grid;
  place-items: center;
  align-self: center;
  width: 100%;
}
.hero-mascot-sprite {
  display: block;
  width: min(100%, 160px);
  aspect-ratio: 150 / 170;
  background-image: url("images/激励图.png");
  background-size: 400% auto;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: contrast(1.12) brightness(1.02);
  animation: heroMascotPoses 5.6s steps(1, end) infinite;
}
.hero-mascot.is-paused .hero-mascot-sprite { animation-play-state: paused; }
@keyframes heroMascotPoses {
  0% { background-position: 0% 0; }
  20% { background-position: 33.333333% 0; }
  40% { background-position: 66.666667% 0; }
  60%, 100% { background-position: 100% 0; }
}
.hero-current {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.hero-current strong { color: var(--text); font-size: 18px; }
.hero-start {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--accent-deep);
  box-shadow: none;
  font-size: 15px;
  font-weight: 700;
}
.hero-start span { font-size: 20px; line-height: 1; }
.hero-side { min-width: 0; }
.profile-calendar-hero {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.profile-calendar-head h3 { font-size: 15px; }
.profile-calendar-badge {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 5px 9px;
  background: transparent;
  color: var(--muted);
}
.profile-calendar-badge small { font-size: 12px; }
.profile-calendar-badge strong { color: var(--text); font-size: 15px; }
.hero-art { padding: 0; background: transparent; }
.hero-art-image { height: 54px; aspect-ratio: auto; }
.goal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; border-radius: 12px; background: #edeeea; }
.goal-tabs button { min-height: 40px; border-radius: 8px; }
.goal-tabs button.is-active,
.frequency-tabs button.is-active {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 2px 6px rgba(32, 39, 40, 0.08);
}
.calendar-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.calendar-day { min-height: 52px; }
.calendar-day-dot { width: 34px; height: 34px; font-size: 13px; }
.calendar-day-label { font-size: 12px; }
.calendar-day.is-current .calendar-day-dot {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  box-shadow: none;
}
.section-description { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dashboard-layout { gap: 20px; margin-top: 20px; }
.plan-panel { padding: 22px 24px 16px; }
.plan-panel .section-head { margin-bottom: 14px; }
.plan-panel .section-head h2 { font-size: 24px; }
.frequency-tabs { background: #edeeea; border-radius: 12px; }
.frequency-tabs button { min-height: 40px; border-radius: 8px; }

/* One carousel rule set serves every viewport and all plan frequencies. */
.plan-carousel-bar, .plan-carousel-dots { display: none; }
.weekly-plan, .weekly-plan[tabindex] {
  --plan-card-width: min(86%, 480px);
  --plan-gap: 12px;
  display: flex;
  grid-template-columns: none;
  width: 100%;
  gap: var(--plan-gap);
  margin: 0;
  padding: 4px 0 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scroll-behavior: auto;
}
.weekly-plan::before, .weekly-plan::after {
  content: "";
  flex: 0 0 calc((100% - var(--plan-card-width)) / 2 - var(--plan-gap));
}
.weekly-plan .day-card, .weekly-plan .day-card.is-active {
  flex: 0 0 var(--plan-card-width);
  width: auto;
  min-height: 158px;
  padding: 0;
  scroll-snap-align: center;
}
.weekly-plan .day-card::before, .weekly-plan .day-card::after { display: none; }
.weekly-plan .day-card-shell,
.weekly-plan .day-card:first-child .day-card-shell,
.weekly-plan .day-card.is-active .day-card-shell {
  height: 100%;
  min-height: inherit;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
  animation: none;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.weekly-plan .day-card:not(.is-active) .day-card-shell { opacity: 1; transform: none; }
.weekly-plan .day-card.is-active .day-card-shell {
  border-color: var(--accent);
  background: var(--surface-warm);
  transform: none;
}
.day-card-date-row { margin-bottom: 10px; padding-bottom: 8px; }
.day-card-date-row span { color: var(--muted); font-size: 13px; }
.day-card-date-row small { color: var(--muted); font-size: 12px; }
.day-top strong { font-size: 17px; line-height: 1.4; }
.weekly-plan .day-top { flex-direction: row; align-items: flex-start; }
.day-card p { font-size: 14px; line-height: 1.5; }
.weekly-plan .day-card .pill-row { margin-top: 12px; }
.weekly-plan .day-card .pill { background: var(--surface-soft); color: var(--muted); font-size: 12px; }
.weekly-plan .day-card.is-active .pill { background: #fce9dd; color: #a9441c; }
.weekly-plan .day-card .pill.done { background: var(--green-soft); color: var(--green); }

.workout-panel { padding: 24px; background: var(--surface); }
.workout-panel .checkin-box { gap: 4px; }
.workout-panel .checkin-box .primary-button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}
.workout-panel .tonight-meta .pill { background: var(--surface-soft); color: var(--muted); }
.workout-panel .exercise-stepper {
  gap: 16px;
  margin-top: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.exercise-stepper::before { display: none; }
.workout-panel .stepper-dots {
  gap: 8px;
  margin: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}
.stepper-dots button { min-height: 42px; border-radius: 10px; box-shadow: none; }
.stepper-dots button.is-active { background: var(--navy); transform: none; box-shadow: none; }
.workout-panel .exercise-stage { min-height: 0; padding: 0 0 16px; border: 0; border-radius: 0; box-shadow: none; }
.exercise-stage-number { background: var(--surface-soft); color: var(--muted); }
.exercise-prescription { display: block; color: var(--muted); font-size: 15px; font-weight: 600; line-height: 1.6; }
.exercise-card-focus .exercise-title strong { line-height: 1.35; }
.exercise-card-focus .exercise-note { font-size: 14px; color: var(--muted); line-height: 1.65; }
.exercise-check-card { min-height: 44px; box-shadow: none; }
.exercise-card-focus.is-complete .exercise-check-card { box-shadow: none; }
.workout-panel .exercise-player-body {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.workout-panel .exercise-demo { border: 0; border-radius: 10px; background: var(--surface); }
.workout-panel .exercise-demo img { width: 200px; height: 200px; }
.workout-panel .exercise-demo-meta { border: 0; background: var(--surface); }
.workout-panel .exercise-demo-meta > span,
.workout-panel .exercise-demo-meta > button { font-size: 13px; background: var(--surface-soft); border-radius: 6px; }
.workout-panel .muscle-summary > div { padding: 0; border: 0; min-height: 0; background: transparent; }
.workout-panel .muscle-summary span { font-size: 12px; color: var(--muted); }
.workout-panel .muscle-summary strong { font-size: 14px; line-height: 1.5; }
.workout-panel .muscle-summary .muscle-term { display: inline-block; white-space: nowrap; color: inherit; font: inherit; }
.exercise-memory-cue { padding: 12px; }
.exercise-memory-cue span { font-size: 12px; }
.exercise-memory-cue strong { font-size: 14px; line-height: 1.6; }
.workout-panel .guide-tabs { display: flex; }
.workout-panel .guide-tabs button { min-height: 44px; padding: 10px 12px; font-size: 14px; }
.workout-panel .guide-tab-content { min-height: 138px; }
.workout-panel .guide-tab-content li { font-size: 15px; line-height: 1.7; }
.workout-panel .stepper-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}
.step-nav-button-primary { box-shadow: none; }
.stepper-footer > span { color: var(--muted); font-size: 13px; }
.training-reminder { display: flex; align-items: baseline; gap: 14px; padding: 0 8px; font-size: 14px; }
.training-reminder > span { flex-shrink: 0; color: var(--accent-deep); font-weight: 700; }
.training-reminder p { margin: 0; color: var(--muted); line-height: 1.7; }
.training-notes-panel { padding: 20px 24px; background: var(--surface); box-shadow: none; }
.training-notes-head { align-items: center; }
.note-add-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: auto; height: auto; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; box-shadow: none; }
.note-add-button span { width: auto; height: auto; color: var(--accent-deep); font-size: 22px; line-height: 1; }
.note-empty { color: var(--muted); font-size: 14px; }
.diet-period-card li, .diet-principles li { font-size: 14px; line-height: 1.65; }
.diet-period-head span { font-size: 13px; }
.diet-hero h2 { line-height: 1.35; }
.diet-recovery { padding: 0; border: 0; }
.diet-schedule { border-radius: 14px; }
.diet-section-head h3 { font-size: 20px; line-height: 1.4; }
.diet-period-card { border-radius: 12px; }
.diet-carousel-controls button { width: 44px; height: 44px; border-radius: 10px; }
.app-module-page .recovery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-module-page .recovery-card, .app-module-page .recovery-card + .recovery-card { min-height: 120px; background: var(--surface); box-shadow: none; }
.app-module-page .recovery-card::after { display: none; }
.app-tabbar {
  left: 50%;
  right: auto;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
}
.app-tabbar button { display: flex; gap: 8px; min-height: 48px; padding: 8px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.app-tabbar button span { width: 24px; height: 24px; background: transparent; color: inherit; }
.app-tabbar button span svg { display: block; width: 24px; height: 24px; }
.app-tabbar button.is-active { border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); box-shadow: none; }
.app-tabbar button.is-active span { background: transparent; color: inherit; transform: none; }
.action-dock { bottom: 96px; grid-template-columns: 44px auto; }
.rocket-button { width: 44px; min-height: 44px; background: var(--surface); box-shadow: var(--shadow-soft); opacity: 0; visibility: hidden; }
.rocket-button.is-visible { opacity: 1; visibility: visible; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.weekly-plan:focus-visible { outline-offset: 4px; }

@media (min-width: 720px) {
  .app-shell { max-width: 1200px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: center; }
}

@media (min-width: 720px) and (max-width: 1023px) {
  .hero { grid-template-columns: minmax(0, 1fr) 260px; }
  .hero-main { grid-template-columns: minmax(0, 1fr) 120px; column-gap: 12px; }
}

@media (max-width: 760px) {
  .app-module.is-active { animation: moduleFlowIn var(--motion-slow) var(--motion-ease-out) both; }
  body { background: var(--bg); padding-bottom: 0; }
  .app-shell { padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); }
  .hero { gap: 18px; padding: 30px 20px 18px; }
  .hero-main { grid-template-columns: minmax(0, 1fr) minmax(0, 0.65fr); column-gap: 12px; }
  .hero h1 { font-size: 32px; line-height: 1.25; }
  .hero-motto { margin-top: 6px; padding-left: 0; border: 0; font-size: 14px; font-weight: 400; }
  .hero-current { margin: 14px 0 12px; gap: 2px 10px; font-size: 13px; }
  .hero-current strong { font-size: 16px; }
  .hero-start { justify-self: stretch; min-height: 44px; padding: 10px 16px; }
  .hero-overview { padding: 0; }
  .profile-calendar-hero { padding: 10px 12px; }
  .hero-art { display: none; }
  .goal-tabs button { min-height: 44px; }
  .calendar-strip { grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); gap: 5px; margin-top: 10px; }
  .dashboard-layout { gap: 16px; margin-top: 16px; }
  .plan-panel, .workout-panel, .secondary-section, .training-notes-panel { padding: 18px 16px; }
  .plan-panel .section-head { display: flex; flex-direction: row; align-items: center; gap: 10px; }
  .plan-panel .section-head h2 { font-size: 20px; }
  .plan-panel .section-description { font-size: 12px; max-width: 180px; }
  .frequency-tabs { flex-shrink: 0; width: auto; grid-template-columns: repeat(3, minmax(40px, 1fr)); gap: 2px; padding: 3px; }
  .frequency-tabs button { min-height: 44px; padding: 7px 8px; font-size: 13px; }
  .weekly-plan, .weekly-plan[tabindex] { --plan-card-width: 92%; --plan-gap: 8px; padding-block: 4px 8px; }
  .weekly-plan .day-card, .weekly-plan .day-card.is-active { min-height: 154px; }
  .weekly-plan .day-card-shell, .weekly-plan .day-card:first-child .day-card-shell, .weekly-plan .day-card.is-active .day-card-shell { padding: 12px 14px; }
  .day-top strong { font-size: 16px; }
  .day-card p { font-size: 13px; }
  .workout-panel > .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .workout-panel .checkin-box { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .workout-panel .checkin-box .primary-button { width: auto; min-height: 44px; padding: 8px 12px; }
  .workout-panel .exercise-stage { grid-template-columns: 1fr; padding: 4px 0 12px; }
  .workout-panel .exercise-stage-number { display: none; }
  .workout-panel .exercise-stage-main { gap: 8px; }
  .workout-panel .exercise-title > span { font-size: 12px; }
  .workout-panel .exercise-title > strong { font-size: 23px; line-height: 1.35; }
  .workout-panel .exercise-head-actions { gap: 8px; }
  .exercise-card-focus .exercise-head-actions .tutorial-link, .exercise-check-card { min-height: 44px; font-size: 14px; box-shadow: none; }
  .workout-panel .stepper-dots { padding: 6px 0 10px; top: max(0px, env(safe-area-inset-top)); }
  .workout-panel .stepper-dots button { min-height: 44px; }
  .workout-panel .exercise-player-body { grid-template-columns: 1fr; gap: 16px; padding: 12px; }
  .workout-panel .exercise-demo { display: grid; grid-template-columns: minmax(112px, 42%) minmax(0, 1fr); grid-template-rows: auto auto; width: 100%; max-width: none; margin: 0; }
  .workout-panel .exercise-demo img { width: 100%; height: auto; aspect-ratio: 1; grid-column: 1; grid-row: 1; }
  .workout-panel .exercise-demo > a, .workout-panel .exercise-media-credit { grid-column: 1; grid-row: 2; font-size: 11px; }
  .workout-panel .exercise-demo-meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 8px; gap: 6px; border-left: 0; }
  .workout-panel .exercise-demo-meta > span, .workout-panel .exercise-demo-meta > button { min-height: 32px; font-size: 12px; padding: 6px 8px; }
  .workout-panel .exercise-demo-meta > button { min-height: 44px; }
  .workout-panel .exercise-demo-placeholder { grid-column: 1 / -1; min-height: 132px; }
  .workout-panel .exercise-demo.is-text-only .exercise-demo-meta { grid-column: 1 / -1; grid-row: auto; }
  .workout-panel .muscle-summary { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .workout-panel .muscle-summary > div { padding: 0; gap: 3px; }
  .workout-panel .guide-tabs button { padding: 10px 7px; font-size: 13px; flex: 1 0 auto; }
  .workout-panel .guide-tab-content { min-height: 138px; padding: 12px 0 0; }
  .workout-panel .guide-tab-content li { font-size: 14px; line-height: 1.7; }
  .workout-panel .stepper-footer { grid-template-columns: 1fr 1fr; gap: 10px; }
  .workout-panel .stepper-footer > span { display: none; }
  .workout-panel .stepper-footer .step-nav-button { display: block; position: static; width: 100%; max-width: none; min-height: 44px; padding: 10px; box-shadow: none; }
  .training-reminder { display: block; padding: 0 8px; }
  .training-reminder > span { display: block; margin-bottom: 4px; }
  .training-notes-head { flex-direction: row; }
  .note-add-button { flex-shrink: 0; }
  .app-module-page .recovery-grid { grid-template-columns: 1fr; }
  .app-tabbar { left: 0; right: 0; bottom: 0; transform: none; width: 100%; min-height: 64px; padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-radius: 0; border-width: 1px 0 0; }
  .app-tabbar button { display: grid; grid-template-columns: 1fr; grid-template-rows: 24px auto; justify-items: center; gap: 2px; min-height: 52px; padding: 4px 8px; font-size: 12px; line-height: 1.4; }
  .action-dock { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .hero-main { grid-template-columns: minmax(0, 1fr) 112px; }
}
@media (max-width: 359px) {
  .hero-main { grid-template-columns: minmax(0, 1fr) 84px; column-gap: 8px; }
  .plan-panel .section-head { flex-direction: column; align-items: stretch; }
  .plan-panel .section-description { max-width: none; }
  .frequency-tabs { width: 100%; }
  .workout-panel .exercise-demo { grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); }
  .workout-panel .guide-tabs button { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .weekly-plan .day-card-shell { transition: none; }
  .hero-mascot-sprite { animation: none !important; background-position: 100% 0; }
}

/* 练后拉伸：头部和操作固定，中间内容独立滚动。 */
.workout-stretch-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.workout-stretch-entry > span { color: var(--muted); font-size: 14px; }
.workout-stretch-entry .soft-button { min-height: 44px; flex-shrink: 0; }
.stretch-modal .stretch-modal-panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 660px);
  max-height: calc(100vh - 40px);
  max-height: min(88dvh, 820px);
  padding: 0;
  overflow: hidden;
  border-color: var(--line);
  background: #fff;
}
.stretch-modal-head { flex-shrink: 0; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.stretch-modal-head .panel-tag { margin: 0 0 8px; font-size: 13px; }
.stretch-modal-head h2 { color: var(--text); font-size: 24px; line-height: 1.4; }
.stretch-modal-head .bmi-modal-close { flex-shrink: 0; min-height: 44px; min-width: 52px; }
.stretch-summary { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.stretch-modal-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 26px 24px; }
.stretch-safety { margin: 14px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.stretch-list { display: grid; gap: 10px; }
.stretch-rest-message { margin: 0; padding: 32px 12px; color: var(--muted); font-size: 16px; line-height: 1.8; text-align: center; }
.stretch-item { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.stretch-item > summary { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px; list-style: none; cursor: pointer; border-radius: 14px; }
.stretch-item > summary::-webkit-details-marker { display: none; }
.stretch-item > summary:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.stretch-item > summary::after { content: "+"; color: var(--muted); font-size: 22px; flex-shrink: 0; }
.stretch-item[open] > summary::after { content: "−"; }
.stretch-number { color: var(--accent-deep); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stretch-item-heading { display: grid; gap: 4px; flex: 1; min-width: 0; }
.stretch-item-heading strong { color: var(--text); font-size: 16px; line-height: 1.5; }
.stretch-item-heading small { color: var(--muted); font-size: 12px; }
.stretch-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.stretch-item[open] { border-color: #e5bca5; }
.stretch-item-content { padding: 0 16px 16px 42px; }
.stretch-cue { margin: 0 0 10px; color: #a44018; font-size: 14px; font-weight: 700; line-height: 1.75; }
.stretch-item-content ol { margin: 0; padding-left: 20px; color: var(--text); font-size: 14px; line-height: 1.85; }
.stretch-item-content li + li { margin-top: 8px; }
.stretch-avoid { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.stretch-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-shrink: 0; padding: 14px 26px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.stretch-modal-footer .primary-button { flex: 0 0 auto; width: auto; min-height: 44px; min-width: 110px; }
@media (max-width: 600px) {
  .workout-stretch-entry { flex-wrap: wrap; gap: 10px; }
  .stretch-modal { padding: 12px; }
  .stretch-modal .stretch-modal-panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .stretch-modal-head { padding: 18px 16px 14px; gap: 10px; }
  .stretch-modal-head h2 { font-size: 21px; }
  .stretch-modal-scroll { padding: 16px; }
  .stretch-modal-footer { padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
  .stretch-item > summary { gap: 9px; padding: 12px; }
  .stretch-item-heading strong { font-size: 15px; }
  .stretch-item-content { padding: 0 14px 14px; }
  .stretch-time { font-size: 11px; }
  .stretch-modal-footer .primary-button { min-width: 88px; }
}
@media (max-width: 359px) {
  .stretch-modal-head h2 { font-size: 20px; }
  .stretch-item > summary { display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 4px 8px; }
  .stretch-number { grid-column: 1; grid-row: 1 / 3; }
  .stretch-item-heading { grid-column: 2; grid-row: 1; }
  .stretch-time { grid-column: 2; grid-row: 2; }
  .stretch-item > summary::after { grid-column: 3; grid-row: 1 / 3; }
}

.training-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.training-tools .module-action-button { flex: 1; min-height: 44px; }
.equipment-panel .module-page-head .module-action-button { min-height: 44px; flex-shrink: 0; }
.stretch-page { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-soft); }
.stretch-page-head { gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.stretch-page-head h2 { margin: 0; color: var(--text); font-size: 32px; line-height: 1.4; }
.stretch-page-head .soft-button { min-height: 44px; flex-shrink: 0; }
.warmup-section h3, .stretch-section-head h3 { margin: 0; color: var(--text); font-size: 20px; line-height: 1.5; }
.stretch-day-divider { margin: 28px 0 24px; border: 0; border-top: 1px solid var(--line); }
.stretch-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.stretch-section-head .stretch-summary { margin: 0; text-align: right; }
.stretch-section-head .soft-button { min-height: 44px; flex-shrink: 0; }
.stretch-media video { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff; }
.stretch-page-plan { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-warm); }
.stretch-page-plan strong { color: var(--text); font-size: 15px; }
.stretch-page-plan > span { color: var(--muted); font-size: 13px; }
.stretch-item-content { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 20px; align-items: start; padding: 0 16px 18px; }
.stretch-page .stretch-item-content { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; padding: 4px 20px 20px; }
.stretch-instructions { min-width: 0; }
.stretch-instructions:only-child { grid-column: 1 / -1; }
.stretch-media { min-width: 0; margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-soft); text-align: center; }
.stretch-media picture { display: block; aspect-ratio: 1; border-radius: 8px; background: #fff; }
.stretch-media img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.stretch-media figcaption { margin-top: 8px; font-size: 11px; line-height: 1.65; }
.stretch-media figcaption a { color: var(--muted); text-underline-offset: 3px; }
.stretch-media figcaption small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.stretch-media-fallback { padding: 24px 12px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.stretch-page [hidden], .stretch-media [hidden] { display: none; }
@media (max-width: 600px) {
  .stretch-page { padding: 20px 16px; border-radius: 18px; }
  .stretch-page-head { flex-direction: row; align-items: center; gap: 12px; }
  .stretch-page-head h2 { font-size: 26px; }
  .stretch-item-content, .stretch-page .stretch-item-content { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 14px 16px; }
  .stretch-media { width: min(100%, 240px); justify-self: center; }
}
