:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --ink: #050505;
  --muted: #686868;
  --card: #252525;
  --line: #dddddd;
  --accent: #ffc400;
  --blue: #0a7cff;
  --green: #42d51d;
  --orange: #ff9f0a;
  --danger: #d94444;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

#app {
  min-height: 100vh;
}

.update-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1000;
  width: min(calc(100% - 28px), 420px);
  transform: translateX(-50%);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.phone {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  background: #f6f6f6;
  position: relative;
  overflow-x: hidden;
  padding: 18px 18px 100px;
}

.workout-phone {
  padding-bottom: 28px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 20px;
  box-shadow: inset 0 -5px 0 rgba(255, 196, 0, 0.18);
}

.brand h1,
.screen-title {
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 950;
}

.brand p {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 750;
}

.hero-card,
.panel,
.workout-card,
.day-card {
  border-radius: 8px;
}

.hero-card {
  color: #fff;
  background: radial-gradient(circle at top left, rgba(255, 196, 0, 0.22), transparent 38%), var(--card);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
}

.hero-card h2 {
  margin-bottom: 8px;
  font-size: 33px;
  line-height: 1.08;
  font-weight: 950;
}

.hero-card p {
  color: #ececec;
  line-height: 1.45;
  font-weight: 650;
}

.panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stack {
  display: grid;
  gap: 12px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #343434;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.field input,
.field select,
.section-title-row select {
  width: 100%;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 13px;
  background: #fbfbfb;
  color: var(--ink);
  font-weight: 800;
  outline: none;
}

.field input:focus,
.field select:focus,
.section-title-row select:focus {
  border-color: var(--blue);
  background: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

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

.form-error,
.success-note,
.empty {
  margin: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 850;
  line-height: 1.35;
}

.form-error {
  background: #fff1f1;
  color: var(--danger);
}

.success-note {
  background: #eeffe9;
  color: #168a00;
}

.empty {
  background: #f3f3f3;
  color: var(--muted);
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.primary,
.secondary,
.danger {
  width: 100%;
  min-height: 58px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.primary {
  border: 0;
  background: var(--ink);
  color: #fff;
}

.secondary {
  border: 2px solid #dedede;
  background: #fff;
  color: var(--ink);
}

.danger {
  border: 0;
  background: #fff1f1;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.danger svg {
  width: 22px;
  height: 22px;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: #ededed;
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon-button svg {
  width: 27px;
  height: 27px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

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

.segmented button,
.chip-button {
  border: 2px solid #e2e2e2;
  border-radius: 8px;
  background: #fff;
  min-height: 48px;
  padding: 8px 10px;
  font-weight: 900;
}

.segmented button.active,
.chip-button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip-button.active {
  background: var(--chip-color, var(--blue));
  border-color: var(--chip-color, var(--blue));
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.day-picker button {
  min-height: 70px;
  border: 2px solid #e2e2e2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 7px 2px;
}

.day-picker button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.day-picker button.locked {
  opacity: 0.55;
}

.day-picker strong {
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.day-picker span {
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
}

.week-header {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric,
.schedule-summary {
  background: #fff;
  border-radius: 8px;
  padding: 13px 15px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.metric {
  min-height: 74px;
  display: grid;
  align-content: center;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.metric span,
.schedule-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.schedule-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 950;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.pill {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 11px 14px;
  background: #e8e8e8;
  color: var(--ink);
  font-weight: 950;
  white-space: nowrap;
}

.pill.active {
  color: #fff;
  background: var(--blue);
}

.pill.training {
  background: var(--accent);
}

.pill.rest {
  color: #767676;
  background: #e8e8e8;
}

.pill.completed {
  color: #fff;
  background: var(--green);
}

.day-card {
  background: var(--card);
  color: #fff;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.day-card.rest {
  min-height: 156px;
  display: grid;
  align-content: center;
}

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

.day-top h2 {
  font-size: 28px;
  line-height: 1.08;
  font-weight: 950;
}

.duration {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f0f0f0;
  font-weight: 850;
  white-space: nowrap;
}

.duration svg {
  width: 20px;
  height: 20px;
}

.rule {
  height: 3px;
  background: rgba(255, 255, 255, 0.55);
  margin: 20px 0;
}

.exercise-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  margin: 13px 0;
}

.order {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 31px;
}

.exercise-row h3 {
  font-size: 21px;
  line-height: 1.05;
  font-weight: 950;
}

.exercise-row p {
  margin-top: 5px;
  color: #f2f2f2;
  font-size: 18px;
  font-weight: 700;
}

.start-button {
  width: 100%;
  min-height: 66px;
  margin-top: 20px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 21px;
  font-weight: 950;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 460px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 9px 18px calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 246, 246, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-button {
  height: 62px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #050505;
  display: grid;
  place-items: center;
  gap: 2px;
  position: relative;
  font-size: 10px;
  font-weight: 900;
}

.nav-button.active {
  background: #e7e7e7;
}

.nav-button svg {
  width: 28px;
  height: 28px;
}

.screen-head {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
  margin-bottom: 16px;
}

.screen-head .screen-title {
  text-align: center;
  font-size: 30px;
}

.back-button {
  border: 0;
  width: 48px;
  height: 48px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.back-button svg {
  width: 34px;
  height: 34px;
}

.workout-card {
  background: #fff;
  padding: 22px 18px 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
}

.single-move {
  display: grid;
  gap: 14px;
  text-align: center;
}

.move-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.move-progress strong {
  color: var(--blue);
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.progress-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d8d8d8;
}

.progress-dots span.active {
  width: 28px;
  background: var(--blue);
}

.progress-dots span.done {
  background: var(--green);
}

.card-visual {
  overflow: hidden;
  border-radius: 8px;
  background: #eeeeee;
}

.exercise-stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stage-photo {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #eeeeee;
  text-align: left;
}

.stage-photo-button {
  width: 100%;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  display: block;
  overflow: hidden;
}

.stage-photo-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

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

.stage-photo figcaption {
  padding: 8px 10px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.phase-pill {
  width: fit-content;
  justify-self: center;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 950;
}

.workout-card h2 {
  font-size: 29px;
  line-height: 1.1;
  font-weight: 950;
}

.why {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.english-name {
  margin-top: -2px;
  color: #4f5967;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.timer {
  width: 168px;
  min-height: 96px;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.timer.running {
  background: var(--blue);
}

.coach-note,
.instruction-box {
  text-align: left;
  border-radius: 8px;
  background: #f5f5f5;
  padding: 14px;
}

.coach-note strong,
.coach-note span {
  display: block;
}

.coach-note strong {
  font-weight: 950;
}

.coach-note span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.instruction-box summary {
  cursor: pointer;
  font-weight: 950;
}

.instruction-box ol {
  margin: 12px 0 10px;
  padding-left: 22px;
  color: #222;
  font-weight: 700;
}

.instruction-box p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.workout-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.icon-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.icon-label svg {
  width: 23px;
  height: 23px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-row > div {
  min-width: 0;
}

.section-title-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.section-title-row h2 {
  margin-top: 2px;
}

.movement-grid {
  display: grid;
  gap: 12px;
}

.movement-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 14px;
  align-items: start;
  border: 2px solid #eeeeee;
  border-radius: 8px;
  padding: 12px;
}

.movement-card > div {
  min-width: 0;
}

.card-visual {
  background: transparent;
}

.stage-card-visual {
  display: grid;
  gap: 8px;
}

.stage-card-visual .stage-photo {
  border-radius: 8px;
}

.stage-card-visual .stage-photo img {
  aspect-ratio: 4 / 3;
}

.stage-card-visual .stage-photo figcaption {
  padding: 6px 8px;
  font-size: 10px;
}

.movement-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.movement-card h3 {
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.movement-card p,
.movement-card li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.movement-card details {
  margin-top: 8px;
}

.movement-card summary {
  cursor: pointer;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
}

.image-modal-content {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
}

.image-modal-content img {
  width: 100%;
  max-height: calc(100vh - 96px);
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #111;
}

.image-modal-close {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
}

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

.sequence-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 12px;
}

.sequence-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 12, 15, 0.78);
}

.sequence-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.sequence-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.sequence-modal-header h2 {
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.15;
}

.sequence-modal-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.sequence-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0f2;
}

.sequence-stage > img {
  width: 100%;
  max-height: min(52vh, 560px);
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
}

.sequence-stage-caption {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: #fff;
}

.sequence-stage-caption strong {
  font-size: 14px;
}

.sequence-stage-caption span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sequence-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.sequence-thumbnail {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 7px;
  padding: 0;
  background: #eef0f2;
}

.sequence-thumbnail.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(36, 99, 235, 0.15);
}

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

.sequence-thumbnail span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 23, 28, 0.86);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.sequence-controls {
  display: grid;
  grid-template-columns: 48px minmax(0, 280px) 48px;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.sequence-step-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.sequence-step-button svg,
.sequence-play-button svg {
  width: 21px;
  height: 21px;
}

.sequence-play-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 600px) {
  .sequence-modal {
    padding: 0;
  }

  .sequence-modal-card {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 14px;
  }

  .sequence-modal-header h2 {
    font-size: 21px;
  }

  .sequence-stage > img {
    max-height: 46vh;
  }

  .sequence-strip {
    grid-template-columns: repeat(7, 88px);
    overflow-x: auto;
    padding: 2px 2px 7px;
    scroll-snap-type: x proximity;
  }

  .sequence-thumbnail {
    scroll-snap-align: center;
  }

}

.history-row,
.admin-reset {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid #ededed;
  border-radius: 8px;
}

.history-row strong,
.history-row span,
.admin-reset strong,
.admin-reset span {
  display: block;
}

.history-row span,
.admin-reset span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 14px 16px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.resume-banner div,
.resume-banner span,
.resume-banner strong,
.resume-banner small {
  min-width: 0;
  display: block;
}

.resume-banner span,
.resume-banner small {
  color: #cfcfcf;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.resume-banner strong {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.resume-banner button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 950;
}

.pill small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.routine-details {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 14px;
}

.routine-details summary {
  cursor: pointer;
  font-weight: 900;
}

.exercise-row.compact {
  grid-template-columns: 42px 1fr;
}

.exercise-row.compact .order {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 18px;
}

.exercise-row.compact h3 {
  font-size: 16px;
}

.exercise-row.compact p {
  font-size: 13px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.assessment-summary {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.assessment-summary h2 {
  margin-top: 3px;
  font-size: 30px;
}

.assessment-summary .secondary {
  width: auto;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}

.assessment-phone textarea,
.library-filters input,
.library-filters select,
.skip-reason,
.field textarea {
  width: 100%;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 13px;
  background: #fbfbfb;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.assessment-item {
  gap: 16px;
}

.assessment-item h2 {
  font-size: 20px;
}

.assessment-item input[type="range"],
.checkin-card input[type="range"],
.summary-card input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.assessment-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.assessment-scale span:last-child {
  text-align: right;
}

.assessment-scale output,
.field output {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.dose-line {
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.safety-note {
  border-left: 4px solid var(--orange);
  border-radius: 4px;
  padding: 12px;
  background: #fff7e7;
  color: #684900;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.summary-metrics,
.settings-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary-metrics div,
.settings-metrics div {
  min-width: 0;
  padding: 14px 10px;
  border-radius: 8px;
  background: #f0f0f0;
  text-align: center;
}

.summary-metrics strong,
.summary-metrics span,
.settings-metrics strong,
.settings-metrics span {
  display: block;
}

.summary-metrics strong,
.settings-metrics strong {
  font-size: 23px;
  font-weight: 950;
}

.summary-metrics span,
.settings-metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.feedback-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #eef6ff;
  text-align: left;
}

.feedback-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feedback-options button {
  min-height: 44px;
  border: 2px solid #c9ddf3;
  border-radius: 8px;
  background: #fff;
  font-weight: 850;
}

.feedback-options button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.skip-reason {
  min-height: 50px;
}

.library-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.library-filters .full,
.favorite-filter {
  grid-column: 1 / -1;
}

.favorite-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 850;
}

.favorite-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.section-title-row h2 small {
  color: var(--muted);
  font-size: 13px;
}

.movement-copy {
  position: relative;
  padding-right: 34px;
}

.favorite-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #fff;
  color: #aaa;
  font-size: 20px;
  line-height: 1;
}

.favorite-button.active {
  border-color: var(--accent);
  color: #b07800;
  background: #fff8d7;
}

.settings-metrics {
  margin: 10px 0 16px;
}

.settings-metrics div {
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-stats span {
  margin: 0;
  border-radius: 4px;
  padding: 5px 7px;
  background: #f2f2f2;
}

.history-row small {
  color: var(--blue);
  font-weight: 850;
}

.settings-actions {
  display: grid;
  gap: 8px;
}

@media (max-width: 560px) {
  .phone {
    padding-inline: 12px;
  }

  .brand h1 {
    font-size: 32px;
  }

  .panel {
    padding: 18px;
  }

  .section-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-title-row select {
    max-width: 100%;
  }

  .field-grid,
  .movement-card {
    grid-template-columns: 1fr;
  }

  .stage-card-visual {
    grid-template-columns: 1fr 1fr;
  }

  .stage-card-visual .stage-photo img {
    aspect-ratio: 4 / 3;
  }

  .day-picker {
    gap: 5px;
  }

  .day-picker button {
    min-height: 62px;
  }

  .bottom-nav {
    padding-inline: 12px;
  }

  .exercise-stage-grid {
    grid-template-columns: 1fr;
  }

  .assessment-summary {
    grid-template-columns: 1fr;
  }

  .assessment-summary .secondary {
    width: 100%;
  }

  .movement-copy {
    padding-right: 38px;
  }
}

@media (max-width: 390px) {
  .stage-card-visual {
    grid-template-columns: 1fr;
  }

  .library-filters,
  .summary-metrics,
  .settings-metrics {
    grid-template-columns: 1fr;
  }

  .favorite-filter,
  .library-filters .full {
    grid-column: 1;
  }
}

/* Refined application UI */
:root {
  --bg: #f3f4f4;
  --surface: #ffffff;
  --ink: #17191c;
  --muted: #667085;
  --card: #ffffff;
  --line: #e4e7ec;
  --accent: #f2c94c;
  --blue: #2463eb;
  --green: #239b68;
  --orange: #e48a16;
  --danger: #c83f49;
  --shadow: 0 8px 24px rgba(23, 25, 28, 0.06);
}

html,
body {
  background: var(--bg);
  letter-spacing: 0;
}

.phone {
  width: min(100%, 480px);
  padding: 18px 16px 104px;
  background: var(--bg);
}

.topbar {
  min-height: 60px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 17px;
}

.brand h1,
.screen-title {
  font-size: 28px;
  line-height: 1.08;
}

.brand p {
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.icon-button,
.back-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.topbar-spacer {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.hero-card,
.panel,
.workout-card,
.day-card,
.history-row,
.admin-reset {
  border-radius: 8px;
}

.hero-card {
  padding: 24px 20px;
  background: var(--ink);
  box-shadow: none;
}

.hero-card h2 {
  font-size: 28px;
}

.panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.primary,
.secondary,
.danger {
  min-height: 52px;
  border-radius: 8px;
  font-size: 15px;
}

.primary {
  background: var(--blue);
}

.secondary {
  border-color: var(--line);
}

.field input,
.field select,
.section-title-row select,
.segmented button,
.chip-button,
.day-picker button {
  border-radius: 8px;
}

.eyebrow {
  color: #5b6472;
  font-size: 11px;
  letter-spacing: 0;
}

.resume-banner {
  margin: -4px 0 14px;
  border-radius: 8px;
  border-left-color: var(--accent);
  background: var(--ink);
}

.resume-banner button {
  background: var(--accent);
}

.today-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.today-card-head,
.section-heading,
.library-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.today-card h2 {
  margin-top: 5px;
  font-size: 25px;
  line-height: 1.12;
}

.date-badge {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 7px 9px;
  background: #f2f3f5;
  color: #4c5563;
  font-size: 12px;
  font-weight: 850;
  text-transform: capitalize;
}

.session-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.session-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3e4652;
  font-size: 13px;
  font-weight: 800;
}

.session-facts svg,
.today-start svg,
.start-button svg,
.quiet-action svg {
  width: 18px;
  height: 18px;
}

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.focus-tags span {
  border-radius: 6px;
  padding: 6px 8px;
  background: #eef3ff;
  color: #3159ad;
  font-size: 12px;
  font-weight: 800;
}

.today-card > p,
.assessment-nudge p,
.program-card > p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.today-start,
.start-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
}

.week-glance {
  display: grid;
  gap: 16px;
}

.section-heading h2 {
  margin-top: 3px;
  font-size: 19px;
}

.text-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

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

.week-track-day {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #8a9099;
  font-size: 11px;
  font-weight: 850;
}

.week-track-day i {
  width: 100%;
  height: 5px;
  border-radius: 2px;
  background: #e5e7eb;
}

.week-track-day.training i {
  background: var(--accent);
}

.week-track-day.completed i {
  background: var(--green);
}

.week-track-day.today span {
  color: var(--ink);
}

.assessment-nudge {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #dce5f7;
  border-radius: 8px;
  background: #f5f8ff;
}

.assessment-nudge h2 {
  margin: 3px 0 5px;
  font-size: 19px;
}

.assessment-nudge .secondary {
  width: auto;
  min-width: 110px;
  background: transparent;
}

.program-summary,
.progress-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.program-summary > div,
.progress-overview > div {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.program-summary span,
.program-summary strong,
.progress-overview span,
.progress-overview strong {
  display: block;
}

.program-summary span,
.progress-overview span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.program-summary strong,
.progress-overview strong {
  margin-top: 4px;
  font-size: 22px;
}

.program-intro {
  margin: 18px 0 12px;
}

.program-intro h2 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.day-tab {
  min-width: 0;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 2px 5px;
  background: var(--surface);
  color: var(--muted);
}

.day-tab span,
.day-tab strong,
.day-tab i {
  display: block;
}

.day-tab span {
  font-size: 10px;
  font-weight: 850;
}

.day-tab strong {
  margin: 3px 0 5px;
  color: var(--ink);
  font-size: 17px;
}

.day-tab i {
  width: 16px;
  height: 3px;
  margin: 0 auto;
  border-radius: 2px;
  background: #d7dae0;
}

.day-tab.training i {
  background: var(--accent);
}

.day-tab.completed i {
  background: var(--green);
}

.day-tab.active {
  border-color: var(--blue);
  background: #eef3ff;
  color: var(--blue);
}

.day-card.program-card {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.program-card .day-top h2 {
  margin-top: 4px;
  font-size: 23px;
}

.program-card .duration {
  color: #3d4653;
  font-size: 13px;
}

.program-card-facts {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.program-card-facts span {
  border-radius: 5px;
  padding: 6px 8px;
  background: #f2f3f5;
  color: #4f5865;
  font-size: 12px;
  font-weight: 800;
}

.routine-block {
  border-top: 1px solid var(--line);
  padding: 15px 0 8px;
}

.routine-block-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.routine-block-title h3 {
  font-size: 15px;
}

.routine-block-title span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.routine-move {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
}

.routine-move i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.routine-move strong,
.routine-move span {
  display: block;
}

.routine-move strong {
  font-size: 14px;
}

.routine-move span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.start-button {
  min-height: 54px;
  margin-top: 14px;
  border-radius: 8px;
  background: var(--blue);
  font-size: 16px;
}

.quiet-action {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5d6673;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav {
  width: min(100%, 480px);
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -6px 20px rgba(23, 25, 28, 0.04);
}

.nav-button {
  height: 62px;
  border-radius: 8px;
  color: #59616d;
}

.nav-button.active {
  background: #eef3ff;
  color: var(--blue);
}

.nav-button svg {
  width: 24px;
  height: 24px;
}

.workout-phone {
  width: min(100%, 520px);
  padding-bottom: 30px;
}

.screen-head {
  margin-bottom: 10px;
}

.workout-head {
  grid-template-columns: 46px 1fr 46px;
}

.workout-head > div {
  min-width: 0;
  text-align: center;
}

.workout-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.workout-head .screen-title {
  margin-top: 2px;
  font-size: 22px;
}

.workout-count {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.workout-progress-track {
  height: 5px;
  margin: 0 2px 12px;
  overflow: hidden;
  border-radius: 2px;
  background: #dfe2e7;
}

.workout-progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.workout-card {
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.single-move {
  gap: 12px;
}

.workout-image-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #edf0f3;
}

.workout-image-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #626b77;
  font-size: 13px;
  font-weight: 850;
}

.workout-image-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(23, 25, 28, 0.08);
}

.single-stage-photo {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #eceeef;
}

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

.single-stage-photo span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 5px;
  padding: 6px 8px;
  background: rgba(23, 25, 28, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.move-heading {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.move-heading h2 {
  font-size: 24px;
}

.phase-pill {
  border-radius: 6px;
  padding: 6px 8px;
}

.timer {
  width: 152px;
  min-height: 82px;
  border-radius: 8px;
  font-size: 38px;
}

.coach-note,
.instruction-box,
.feedback-panel,
.skip-panel {
  border-radius: 8px;
}

.coach-note {
  border-left: 4px solid var(--accent);
  background: #fff9e9;
}

.instruction-box {
  border: 1px solid var(--line);
  background: #fff;
}

.instruction-box .why {
  margin-top: 12px;
}

.workout-primary-action {
  margin-top: 2px;
}

.workout-utility-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.workout-utility-actions > button,
.workout-more > summary {
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4d5663;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 2px;
  list-style: none;
  font-size: 10px;
  font-weight: 800;
}

.workout-utility-actions svg {
  width: 20px;
  height: 20px;
}

.workout-more {
  position: relative;
}

.workout-more summary::-webkit-details-marker {
  display: none;
}

.workout-more > button {
  position: absolute;
  right: 0;
  bottom: 62px;
  z-index: 4;
  width: 170px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
}

.workout-more > button svg {
  width: 18px;
}

.skip-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #f0d7aa;
  background: #fff9ee;
  text-align: left;
}

.skip-panel > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.skip-panel .primary,
.skip-panel .secondary {
  min-height: 46px;
}

.checkin-card,
.summary-card {
  gap: 16px;
}

.library-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.library-search-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}

.library-search {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.library-search svg {
  width: 20px;
  color: #7a828e;
}

.library-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 700;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4f5865;
}

.filter-button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef3ff;
}

.filter-button svg {
  width: 22px;
}

.quick-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.quick-filters button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #5b6470;
  font-size: 12px;
  font-weight: 800;
}

.quick-filters button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.advanced-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.advanced-filters select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 9px;
  font-weight: 750;
}

.library-result-heading {
  align-items: baseline;
  margin-bottom: 10px;
}

.library-result-heading h2 {
  font-size: 20px;
}

.library-result-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

.movement-list-card {
  position: relative;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.movement-list-main {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 42px 0 0;
  background: transparent;
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 12px;
  text-align: left;
}

.movement-list-main img {
  width: 124px;
  height: 94px;
  display: block;
  object-fit: cover;
}

.movement-list-main > .movement-thumb {
  position: relative;
  width: 124px;
  height: 94px;
  display: block;
  flex: 0 0 124px;
  overflow: hidden;
  background: #eceeef;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.movement-list-main .movement-sequence-badge {
  position: absolute;
  left: 7px;
  bottom: 7px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(23, 25, 28, 0.86);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}

.movement-list-main > div {
  min-width: 0;
  align-self: center;
  padding: 10px 0;
}

.movement-list-main span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.movement-list-main h3 {
  margin: 4px 0;
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.movement-list-main p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.movement-list-card .favorite-button {
  top: 8px;
  right: 8px;
}

.favorite-button {
  border-radius: 8px;
}

.movement-detail-phone {
  padding-bottom: 30px;
}

.detail-head .favorite-button {
  position: static;
}

.movement-detail {
  display: grid;
  gap: 16px;
}

.detail-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-images .stage-photo {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-images .stage-photo figcaption {
  padding: 7px 8px;
}

.sequence-launch {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid #252a31;
  border-radius: 8px;
  padding: 10px 12px;
  background: #252a31;
  color: #fff;
  text-align: left;
}

.sequence-launch-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #252a31;
}

.sequence-launch-icon svg {
  width: 20px;
  height: 20px;
}

.sequence-launch strong,
.sequence-launch small {
  display: block;
}

.sequence-launch strong {
  font-size: 14px;
}

.sequence-launch small {
  margin-top: 2px;
  color: #d9dde2;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.sequence-launch.compact {
  margin-top: 8px;
}

.detail-title h2 {
  margin-top: 5px;
  font-size: 27px;
  line-height: 1.12;
}

.detail-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.detail-lead {
  color: #4f5865;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
}

.detail-dose,
.detail-note,
.detail-warning,
.detail-section {
  border-radius: 8px;
}

.detail-dose {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #eef3ff;
  color: #264f9f;
}

.detail-dose svg {
  width: 25px;
}

.detail-dose span,
.detail-dose strong {
  display: block;
}

.detail-dose span {
  font-size: 11px;
  font-weight: 750;
}

.detail-dose strong {
  margin-top: 2px;
}

.detail-section {
  padding: 17px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.detail-section ol {
  margin: 0;
  padding-left: 21px;
}

.detail-section li,
.detail-section p,
.detail-note p,
.detail-warning p {
  color: #555e6a;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.detail-section p + p {
  margin-top: 8px;
}

.detail-note,
.detail-warning {
  padding: 14px;
  border-left: 4px solid var(--accent);
  background: #fff9e9;
}

.detail-note p,
.detail-warning p {
  margin-top: 4px;
}

.detail-warning {
  border-left-color: var(--danger);
  background: #fff3f4;
}

.progress-overview {
  margin-bottom: 14px;
}

.progress-assessment {
  display: grid;
  gap: 16px;
}

.assessment-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.assessment-bars {
  display: grid;
  gap: 10px;
}

.assessment-bars > div {
  display: grid;
  grid-template-columns: 76px 1fr 18px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}

.assessment-bars i {
  height: 7px;
  border-radius: 3px;
  background: #e7e9ed;
  overflow: hidden;
}

.assessment-bars b {
  display: block;
  height: 100%;
  background: var(--blue);
}

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

.refined-history {
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px;
  border-width: 1px;
  background: #fff;
}

.history-date {
  text-align: center;
}

.history-date strong {
  font-size: 20px;
}

.history-date span {
  text-transform: capitalize;
}

.stiffness-change {
  border-radius: 5px;
  padding: 5px 7px;
  background: #eef7f2;
  color: #23724f !important;
  white-space: nowrap;
}

.empty-state {
  padding: 28px 20px;
  border: 1px dashed #cfd4dc;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 30px;
  margin-bottom: 8px;
}

.empty-state h3 {
  color: var(--ink);
}

.empty-state p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.4;
}

.account-panel {
  gap: 16px;
}

.account-panel .secondary {
  margin-top: 4px;
}

#preferences-form,
#preferences-form .field,
.reminder-time-field {
  min-width: 0;
  width: 100%;
}

.reminder-time-field input[type="time"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 50px;
  font-size: 16px;
}

.reminder-time-field input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

@media (max-width: 560px) {
  .phone {
    padding-inline: 14px;
  }

  .brand h1 {
    font-size: 27px;
  }

  .panel {
    padding: 16px;
  }

  .exercise-stage-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .assessment-nudge {
    grid-template-columns: 1fr;
  }

  .assessment-nudge .secondary {
    width: 100%;
  }

  .movement-list-main {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
  }

  .movement-list-main img,
  .movement-list-main > .movement-thumb {
    width: 112px;
    height: 84px;
  }

  .movement-list-main > .movement-thumb {
    flex-basis: 112px;
  }

  .detail-images {
    grid-template-columns: 1fr;
  }

  .refined-history {
    grid-template-columns: 40px 1fr;
  }

  .stiffness-change {
    grid-column: 2;
    width: fit-content;
  }
}

/* Guided profile setup and focused workout experience */
[hidden] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(36, 99, 235, 0.28);
  outline-offset: 2px;
}

.brand h1,
.screen-title,
.hero-card h2,
.today-card h2,
.move-heading h2,
.detail-title h2 {
  font-weight: 800;
}

.primary,
.secondary,
.danger,
.nav-button,
.segmented button,
.chip-button {
  font-weight: 700;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.password-field input {
  min-width: 0;
  border-radius: 8px 0 0 8px;
}

.password-field button {
  min-width: 68px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f8f9fa;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.profile-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.profile-progress span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.profile-progress span::before {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(-50% + 20px);
  width: calc(100% - 32px);
  height: 2px;
  background: var(--line);
}

.profile-progress span:first-child::before {
  display: none;
}

.profile-progress i {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.profile-progress span.active i {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.profile-progress span.complete i {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.profile-progress span.complete::before,
.profile-progress span.active::before {
  background: var(--green);
}

.profile-progress b {
  font-weight: 700;
}

.profile-step {
  display: grid;
  gap: 16px;
}

.profile-step-heading {
  display: grid;
  gap: 5px;
  padding-bottom: 4px;
}

.profile-step-heading > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.profile-step-heading h2 {
  font-size: 23px;
  line-height: 1.15;
}

.profile-step-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.goal-options {
  grid-template-columns: 1fr 1fr;
}

.profile-choice-summary {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fa;
  overflow: hidden;
}

.profile-choice-summary > div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.profile-choice-summary > div:last-child {
  border-bottom: 0;
}

.profile-choice-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-choice-summary strong {
  font-size: 14px;
  line-height: 1.35;
}

.profile-wizard-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding-top: 4px;
}

.profile-wizard-actions .primary:only-child,
.profile-wizard-actions .primary:first-child {
  grid-column: 1 / -1;
}

.profile-wizard-actions [data-profile-next],
.profile-wizard-actions [data-profile-submit] {
  grid-column: 2;
}

.checkin-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.checkin-options button {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: var(--surface);
  color: #4d5663;
  font-size: 12px;
  font-weight: 700;
}

.checkin-options button.active {
  border-color: var(--blue);
  background: #eef3ff;
  color: var(--blue);
}

.range-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.range-scale span:last-child {
  text-align: right;
}

.range-scale output {
  min-width: 48px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.single-move {
  overflow: visible;
}

.workout-image-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  background: transparent;
}

.workout-image-switch button {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.workout-image-switch button.active {
  border-color: var(--blue);
  background: #eef3ff;
  color: var(--blue);
  box-shadow: none;
}

.workout-image-switch img {
  width: 66px;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: 5px;
  object-fit: cover;
}

.workout-image-switch span {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.timer-panel {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 15px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fa;
}

.timer-panel.running {
  border-color: rgba(36, 99, 235, 0.35);
  background: #eef3ff;
}

.timer-context {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.timer-panel .timer {
  width: auto;
  min-height: auto;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 48px;
  line-height: 1.05;
}

.timer-subtext {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.move-progress-track {
  width: 100%;
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: #dfe3e9;
}

.move-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.25s linear;
}

.quick-instructions {
  padding: 14px 15px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f4f7ff;
}

.quick-instructions > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.quick-instructions ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
  color: #414a56;
  font-size: 13px;
  line-height: 1.4;
}

.workout-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  gap: 7px;
  margin: 0 -6px;
  padding: 10px 6px max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.focus-mode {
  gap: 10px;
}

.focus-mode .single-stage-photo img {
  max-height: min(48vh, 420px);
  object-fit: contain;
  background: #eef0f2;
}

.focus-mode .coach-note {
  padding-block: 11px;
}

.detail-images .stage-photo-button img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (max-width: 560px) {
  .detail-images {
    grid-template-columns: 1fr;
  }

  .detail-images .stage-photo {
    width: 100%;
  }
}

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

  .goal-options {
    grid-template-columns: 1fr 1fr;
  }

  .workout-image-switch button {
    min-height: 76px;
    grid-template-columns: 1fr;
    grid-template-rows: 42px auto;
    justify-items: center;
    gap: 4px;
    padding: 6px 4px;
    text-align: center;
  }

  .workout-image-switch img {
    width: 56px;
  }

}
