:root {
  --red: #f11927;
  --red-dark: #dd121d;
  --completed-fill: #24dc7d;
  --completed-highlight: inset 0 0 10px rgba(184, 255, 212, 0.18);
  --recovery-fill: #73b987;
  --missed-ink: #e27881;
  --calendar-program: #282c34;
  --calendar-gap: 5px;
  --bg: #000;
  --surface: #101217;
  --surface-2: #171a21;
  --surface-3: #222632;
  --ink: #f4f5f7;
  --charcoal: #d4d8e0;
  --charcoal-2: #aeb5c2;
  --muted: #89919f;
  --divider: 1px solid rgba(255, 255, 255, 0.16);
  --white: #fff;
  --hero-image-overlay:
    linear-gradient(180deg, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0.44)),
    linear-gradient(120deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1) 54%, rgba(0, 0, 0, 0.48));
  --radius: 4px;
  --control-height: 52px;
  --app-width: 430px;
  --page-space: 20px;
  --section-space: 80px;
  --detail-space: 8px;
  --item-space: 12px;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  --font: "Aptos Display", "Trebuchet MS", "Segoe UI", sans-serif;
  --display-tracking: -0.06em;
  --display-leading: 0.92;
  --display-leading-soft: 1;
}

* {
  scrollbar-width: none;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

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

html {
  min-height: 100%;
  background: #000;
  color-scheme: dark;
  overscroll-behavior-y: none;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body.app-mode,
body.app-mode .app-shell {
  height: 100dvh;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

body.app-mode *,
body.entry-mode * {
  touch-action: inherit;
}

body.entry-mode { touch-action: pan-x pan-y; }

body.app-mode :is(img, video) {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

body.app-mode :is(input, textarea, [contenteditable="true"]) {
  -webkit-user-select: text;
  user-select: text;
}

body.app-mode .app-shell {
  position: fixed;
  inset: 0;
  height: auto;
  min-height: 0;
}

body.app-mode .route:not(.main-screen),
body.app-mode .auth-screen {
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

body.entry-mode {
  height: auto;
  overflow: auto;
  overscroll-behavior-y: auto;
}

button,
select {
  font: inherit;
}

button,
input,
textarea,
dialog {
  border: 0;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

:focus {
  outline: none;
}

/* Compact action controls use capitals; clickable content keeps its own casing. */
button:not(:is(.program-card, .program-day-card, .program-equipment, .diary-highlight, .exercise-preview-trigger, .store-shot)),
.entry-open-app {
  text-transform: uppercase;
}

a,
button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  width: min(100%, var(--app-width));
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--bg);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.72);
}

/* Store-style pages follow the device theme; the training app stays dark. */
body.entry-mode {
  --store-bg-light: #fff;
  --store-bg-dark: #000;
  --store-bg: var(--store-bg-light);
  --store-surface: #f2f2f7;
  --store-ink: #1d1d1f;
  --store-muted: #636366;
  --store-line: rgba(0, 0, 0, .12);
  --divider: 1px solid var(--store-line);
  --store-action: #007aff;
  --store-action-ink: #fff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  body.entry-mode {
    --store-bg: var(--store-bg-dark);
    --store-surface: #1c1c1e;
    --store-ink: #f5f5f7;
    --store-muted: #a1a1a6;
    --store-line: rgba(255, 255, 255, .16);
    --store-action: #0a84ff;
    color-scheme: dark;
  }
}

.entry-mode .app-shell {
  width: 100%;
  max-width: none;
  background: var(--store-bg);
  box-shadow: none;
}

.entry-page {
  --page-space: 24px;
  display: grid;
  min-height: 100dvh;
  justify-items: center;
  padding: max(var(--page-space), env(safe-area-inset-top)) var(--page-space) max(40px, env(safe-area-inset-bottom));
  color: var(--store-ink);
  background: var(--store-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.android-entry {
  --store-bg-dark: #131314;
  --store-action: #01875f;
  font-family: Roboto, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  .android-entry {
    --store-bg: var(--store-bg-dark);
    --store-surface: #202124;
    --store-ink: #e3e3e3;
    --store-muted: #c4c7c5;
    --store-action: #a8dab5;
    --store-action-ink: #003822;
  }
}

.entry-content {
  display: grid;
  width: min(100%, 600px);
  min-width: 0;
  align-content: start;
  gap: var(--page-space);
}

.entry-app-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: var(--page-space);
}

.store-icon {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20%;
}

.entry-app-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 32px;
}

.entry-app-header p,
.entry-message {
  margin: 4px 0 0;
  color: var(--store-muted);
  font-size: 14px;
  line-height: 1.45;
}

.android-entry .entry-app-header p { color: var(--store-action); }
.entry-message { margin: -12px 0 0; }

.store-install-button,
.ios-get-button,
.entry-open-app {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 10px 24px;
  color: var(--store-action-ink);
  background: var(--store-action);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
}

.android-entry .store-install-button,
.android-entry .entry-open-app {
  text-transform: none;
}

.entry-app-header.ios { grid-template-columns: 128px minmax(0, 1fr); gap: 16px; }
.store-icon.ios { width: 128px; height: 128px; border-radius: 28px; }
.ios-entry .entry-app-header h1 { font-size: 17px; font-weight: 700; line-height: 22px; }
.ios-entry .entry-app-header p { font-size: 13px; line-height: 18px; }

.ios-get-button {
  width: fit-content;
  min-width: 76px;
  min-height: 32px;
  margin-top: 12px;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.entry-install-actions,
.entry-details { display: grid; gap: 12px; }
.entry-page button:disabled { color: var(--store-muted); background: var(--store-surface); }
.store-install-button[aria-busy="true"] { cursor: wait; }
.entry-open-app { background: var(--store-surface); color: var(--store-action); }

.entry-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: 8px;
  text-align: center;
}
.entry-facts span { display: grid; align-content: center; gap: 4px; padding-inline: 5px; color: var(--store-muted); }
.entry-facts span + span { border-left: 1px solid var(--store-line); }
.entry-facts strong { color: var(--store-ink); font-size: 14px; font-weight: 500; line-height: 20px; }
.entry-facts small { font-size: 12px; line-height: 16px; }
.entry-facts span:first-child strong { color: var(--store-muted); font-size: 12px; }
.ios-entry .entry-facts { padding-block: 16px; }
.ios-entry .entry-facts small { order: -1; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.ios-entry .entry-facts strong { color: var(--store-muted); font-size: 20px; font-weight: 600; line-height: 24px; }
.ios-entry .entry-facts span:first-child strong { font-size: 14px; }

.store-screens {
  display: flex;
  gap: 12px;
  margin-inline: calc(-1 * var(--page-space));
  padding-inline: var(--page-space);
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.store-shot {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 204px;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  padding: 0;
  background: #000;
  border: 0;
  border-radius: var(--store-image-radius, 8px);
  scroll-snap-align: center;
}
.store-shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ios-entry { --store-image-radius: 21px; }
.ios-entry .store-shot { height: 312px; }
.entry-details h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: normal; line-height: 24px; }
.entry-details p { margin: 0; color: var(--store-muted); font-size: 14px; line-height: 1.5; }
.ios-entry .entry-details { padding-top: 24px; }
.ios-entry .entry-details p { color: var(--store-ink); font-size: 13px; line-height: 18px; }
.entry-access { padding-top: 8px; }

.pwa-debug-panel { display: grid; gap: 10px; }
.pwa-debug-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pwa-debug-button { min-height: 44px; border-radius: 8px; background: var(--store-surface); color: var(--store-ink); font-size: 12px; }
.pwa-debug-output { width: 100%; min-height: 220px; max-height: 280px; padding: 12px; border-radius: 8px; background: var(--store-surface); color: var(--store-ink); font: 10px/1.45 monospace; white-space: pre-wrap; user-select: text; -webkit-user-select: text; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; }
.modal-panel { display: grid; border-radius: var(--radius); box-shadow: var(--shadow); }

.entry-dialog {
  width: min(calc(100% - 32px), 430px);
  max-width: none;
  height: max-content;
  min-height: 0;
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  padding: var(--page-space);
  overflow: auto;
  border-radius: 20px;
  color: var(--store-ink);
  background: var(--store-bg);
}
.entry-dialog::backdrop { background: rgba(0,0,0,.6); }
.entry-dialog .entry-dialog-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--store-muted); background: var(--store-surface); }
.entry-dialog-note { margin: 0 0 var(--page-space); padding-right: 28px; color: var(--store-muted); font-size: 16px; line-height: 1.4; }
.entry-dialog-steps { margin: 0; padding-left: var(--page-space); font-size: 22px; line-height: 1.25; }
.entry-dialog-steps li { padding-left: 4px; color: var(--store-action); }
.entry-dialog-steps li + li { margin-top: var(--page-space); }
.entry-dialog-steps strong { display: inline-flex; max-width: 100%; align-items: baseline; gap: var(--detail-space); vertical-align: top; color: var(--store-ink); font-weight: 600; }
.entry-dialog-steps .icon { width: 24px; height: 24px; flex: none; color: var(--store-action); stroke-width: 1.8; }
.entry-dialog-steps p { margin: var(--detail-space) 0 0; color: var(--store-muted); font-size: 17px; line-height: 1.4; }
html:has(.store-preview[open]) { overflow: hidden; }
.store-preview {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: #fff;
  background: #000;
}
.store-preview::backdrop { background: transparent; }
.ios-entry .store-preview { color: var(--store-action); background: var(--store-bg); }
.store-preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); touch-action: pan-x; }
.store-preview-toolbar {
  display: flex;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: #000;
}
.ios-entry .store-preview-toolbar { justify-content: flex-end; background: transparent; }
.store-preview .store-preview-close { min-width: 44px; min-height: 44px; padding: 8px; color: inherit; background: transparent; font-size: 17px; font-weight: 600; text-transform: none; }
.store-preview-track { display: flex; min-height: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; translate: 0 var(--store-pull, 0px); transition: translate .18s ease-out; }
.store-preview-track.is-pulling { transition: none; }
.store-preview-slide { display: grid; flex: 0 0 100%; min-width: 0; min-height: 0; place-items: center; padding: 16px 24px max(24px, env(safe-area-inset-bottom)); scroll-snap-align: center; scroll-snap-stop: always; }
.store-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; min-height: 0; border-radius: var(--store-image-radius, 0px); object-fit: contain; -webkit-user-drag: none; }

.desktop-entry { --page-space: 20px; align-items: center; color: var(--ink); background: var(--bg); }

.desktop-transfer {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: var(--section-space);
  padding: 0;
}

.app-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.desktop-logo {
  width: min(100%, 310px);
  margin-bottom: 28px;
}

.desktop-transfer p {
  max-width: 300px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.38;
}

.desktop-url {
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.qr-card {
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border-radius: var(--radius);
}

.desktop-qr-code {
  display: block;
  width: min(64vw, 280px);
  height: auto;
  border-radius: var(--radius);
}

.qr-fallback {
  color: #05070a;
  font-weight: 1000;
}

@media (max-width: 720px) {
  .desktop-transfer {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    text-align: center;
  }
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  text-decoration: none;
}

.icon-button > .icon {
  width: 22px;
  height: 22px;
}

.icon {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  font-style: normal;
}

.route {
  min-height: 100dvh;
  background: var(--bg);
}

.route.has-sticky {
  --workout-action-height: 58px;
  padding-bottom: calc(var(--workout-action-height) + 2 * var(--page-space) + 1px + env(safe-area-inset-bottom));
}

.route.has-sticky:has(.optional-bottom) {
  --workout-action-height: 80px;
}

.main-screen {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.main-scroll {
  display: grid;
  align-content: start;
  gap: var(--section-space);
  min-height: 0;
  padding: max(var(--page-space), env(safe-area-inset-top)) var(--page-space) var(--page-space);
  background: #000;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}


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

.main-topbar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: var(--item-space);
}

.home-tagline {
  max-width: 280px;
}

.main-logo {
  width: min(38vw, 140px);
}

.home-ideology {
  display: grid;
  gap: var(--detail-space);
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.home-ideology > .badge,
.home-programs > .badge {
  justify-self: start;
}

.home-consistency {
  display: grid;
  gap: var(--item-space);
  color: var(--ink);
}

.home-consistency p {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.home-consistency p + p {
  margin-top: var(--detail-space);
}

.home-consistency.intro p {
  font-size: 19.8px;
  font-weight: 400;
  line-height: 1.4;
}

.consistency-days {
  --break-outline: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  margin: 0;
  padding: 0;
  list-style: none;
}

.consistency-day {
  --previous-cell-fill: transparent;
  font-size: 14px;
  line-height: 1;
}

.consistency-day.trained,
.consistency-day.recovery {
  box-shadow: var(--day-highlight);
}

.consistency-day.break::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--break-outline);
  /* Open only the connector's interior, leaving one continuous outer outline. */
  clip-path: polygon(
    0 0, 100% 0, 100% calc(50% - 3px),
    var(--outline-right, 100%) calc(50% - 3px),
    var(--outline-right, 100%) calc(50% + 3px),
    100% calc(50% + 3px), 100% 100%, 0 100%, 0 calc(50% + 3px),
    var(--outline-left, 0px) calc(50% + 3px),
    var(--outline-left, 0px) calc(50% - 3px), 0 calc(50% - 3px)
  );
  content: "";
  pointer-events: none;
}

.consistency-day.break + .consistency-day.break:not(:nth-child(7n + 1)) {
  --outline-left: 1px;
}

.consistency-day.break:not(:nth-child(7n)):has(+ .consistency-day.break) {
  --outline-right: calc(100% - 1px);
}

.home-ideology p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.38;
}

.program-equipment {
  display: grid;
  gap: var(--detail-space);
  width: calc(100% - var(--page-space) * 2);
  margin: var(--page-space) var(--page-space) 0;
  padding: var(--item-space);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
}

.equipment-heading {
  display: flex;
  align-items: center;
  gap: var(--detail-space);
}

.equipment-heading > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
  stroke-width: 2;
}

.program-equipment-copy {
  min-width: 0;
  flex: 1;
}

.setup-icons {
  display: inline-flex;
  gap: var(--detail-space);
}

.setup-photo {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  filter: saturate(0.91) contrast(0.685) brightness(0.82);
  background: var(--surface-3);
  border-radius: var(--radius);
}

.home-programs,
.lab-content {
  display: grid;
  grid-auto-rows: max-content;
  gap: var(--page-space);
}

.home-programs,
.lab-screen .lab-content {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-programs > .program-title-card,
.home-programs > .badge {
  grid-column: 1 / -1;
}

.home-programs > .badge:not(:first-child),
.lab-content > .section-label:not(:first-child) {
  margin-top: calc(var(--section-space) - var(--page-space));
}

.program-card {
  --card-padding: var(--page-space);
  position: relative;
  display: flex;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  padding: var(--card-padding);
  color: var(--white);
  background: #272a30;
  border-radius: var(--radius);
  text-align: left;
  isolation: isolate;
}

.program-card::before,
.diary-story-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: var(--hero-image-overlay), var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(0.9);
}

.program-card::before {
  z-index: -2;
  transform: scale(1.03);
}

.program-card.beginner {
  --hero-image:
    url("./assets/programs/basic-min-equipment-v1.jpg");
}

.program-card.weighted-west {
  --hero-image: url("./assets/programs/background3-weightedwest.jpg");
}

.challenge-knee-raises {
  --hero-image: url("./assets/exercises/hanging-knee-raises-v2-poster.jpg");
}

.challenge-high-pull-ups {
  --hero-image: url("./assets/exercises/high-pull-ups-poster.jpg");
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lab-content {
  padding: var(--page-space);
}

.lab-content > .section-label {
  grid-column: 1 / -1;
  margin: 0;
}

.compact-title-card {
  --card-padding: var(--item-space);
  min-width: 0;
}

.compact-title-card .program-title {
  max-width: 100%;
  margin: 0 0 4px;
  font-size: clamp(14px, 5.5vw, 28px);
  line-height: 1.05;
}

.compact-title-card .program-subtitle {
  font-size: 10.5px;
}

.challenge-description {
  margin: var(--page-space) var(--page-space) 0;
  color: var(--charcoal-2);
  font-size: 15px;
  line-height: 1.5;
}

.challenge-description a {
  color: inherit;
}

.program-content {
  display: flex;
  min-width: 0;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.program-title {
  max-width: 92%;
  margin: var(--item-space) 0 var(--detail-space);
  color: var(--white);
  font-size: 34px;
}

.program-subtitle {
  margin: 0;
  color: var(--white);
  font-size: 14.5px;
  line-height: 1.2;
}

.program-progress {
  display: grid;
  width: 100%;
  gap: var(--detail-space);
  margin-top: var(--page-space);
}

.program-days-track {
  display: grid;
  grid-template-columns: repeat(var(--program-days), minmax(0, 1fr));
  height: 4px;
  gap: 4px;
}

.program-days-track > span {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.program-days-track > .done {
  background: var(--completed-fill);
}

.program-detail {
  background: var(--bg);
}

.coming-soon-program {
  display: flex;
  flex-direction: column;
}

.coming-soon-program > .hero-title-shell,
.coming-soon-program > .program-equipment {
  flex-shrink: 0;
}

.program-coming-soon {
  display: grid;
  flex: 1 0 140px;
  place-items: center;
  padding: var(--section-space) var(--page-space);
  padding-bottom: max(var(--section-space), env(safe-area-inset-bottom));
  text-align: center;
}

.program-coming-soon h2 {
  margin: 0;
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
}

.hero-title-shell {
  position: relative;
  display: block;
  padding: 0;
  background: var(--bg);
}

.hero-title-shell > .icon-button {
  position: absolute;
  top: max(var(--page-space), env(safe-area-inset-top));
  left: var(--page-space);
  z-index: 4;
}

.hero-title-shell .program-card {
  width: 100%;
  border-radius: 0;
}

.program-days {
  padding: var(--page-space);
}

.program-end-button {
  width: 100%;
  margin-top: var(--page-space);
}

.program-locked .program-content {
  opacity: 0.55;
}

.program-access-icon {
  position: absolute;
  display: grid;
  place-items: center;
  top: var(--card-padding);
  left: var(--card-padding);
  z-index: 2;
  width: calc(var(--card-padding) + var(--item-space));
  height: calc(var(--card-padding) + var(--item-space));
  border-radius: 50%;
  color: #3a424e;
  background: var(--muted);
}

.program-access-icon.active {
  background: #8bb39c;
}

.program-access-icon .icon {
  width: 62.5%;
  height: 62.5%;
  stroke-width: 2;
}

.program-access-icon rect {
  fill: currentColor;
}

.program-locked-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: var(--page-space);
  color: var(--muted);
  font-size: 14px;
}

.program-days h2 {
  margin: 0 0 var(--page-space);
  color: var(--ink);
  font-size: 25px;
}

.program-day-list,
.auth-form {
  display: grid;
  gap: var(--page-space);
}

.program-day-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius);
  text-align: left;
}

.program-day-card.completed {
  grid-template-columns: minmax(0, 1fr) 50px;
}

.program-day-card:active {
  transform: translateY(1px);
}

.program-day-copy {
  display: grid;
  gap: var(--detail-space);
  min-width: 0;
  padding: var(--page-space);
}

.program-day-status {
  display: grid;
  align-self: stretch;
  place-items: center;
  color: var(--completed-fill);
  background: transparent;
  border-radius: 0;
}

.program-day-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.program-day-card.completed .program-day-copy strong,
.program-day-card.upcoming .program-day-copy strong {
  color: var(--muted);
}

.program-day-copy strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.main-nav,
.diary-calendar-block + .diary-calendar-block,
.bottom-bar,
.exercise-rest-row > span,
.rest-divider > span,
.ios-entry .entry-facts,
.ios-entry .entry-details {
  border-top: var(--divider);
}

.main-nav {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--item-space);
  width: 100%;
  margin: 0 auto;
  padding: 14px var(--page-space) calc(14px + env(safe-area-inset-bottom));
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(12px);
}

.profile-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  box-shadow: none;
}

.profile-button .icon,
.player-close-button .icon {
  width: 18px;
  height: 18px;
}

.profile-screen {
  min-height: 100dvh;
  padding:
    max(var(--page-space), env(safe-area-inset-top))
    var(--page-space)
    max(var(--section-space), env(safe-area-inset-bottom));
  background: #000;
}

.profile-topbar {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: var(--item-space);
}

.profile-logo {
  width: min(42vw, 150px);
}

.profile-content {
  display: grid;
  gap: var(--section-space);
  margin-top: var(--section-space);
}

.profile-account,
.auth-copy,
.auth-field,
.session-history-list,
.player-heading {
  display: grid;
  gap: var(--detail-space);
}

.profile-account h1 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.profile-actions,
.diary-calendar-block,
.session-history-panel {
  display: grid;
  gap: var(--item-space);
}

.profile-update-status {
  min-height: 16px;
  text-align: left;
}

.profile-update-status.current,
.profile-update-status.ready,
.profile-update-status.reloading,
.profile-update-status.updated {
  color: var(--completed-fill);
}

.profile-logout-button {
  width: max-content;
  justify-self: start;
}

.confirmation-dialog {
  width: min(100%, 330px);
  gap: var(--item-space);
  padding: var(--page-space);
  color: var(--white);
  background: var(--surface-2);
  max-width: calc(100% - 2 * var(--page-space));
}

.confirmation-dialog:not([open]) {
  display: none;
}

.confirmation-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.confirmation-dialog h2,
.equipment-preview-panel > h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.auth-screen,
.startup-screen,
.stats-screen,
.exercise-preview-backdrop {
  padding: max(var(--page-space), env(safe-area-inset-top)) var(--page-space) max(var(--page-space), env(safe-area-inset-bottom));
}

.auth-screen {
  display: grid;
  min-height: 100dvh;
  place-items: safe center;
  color: var(--ink);
  background: var(--bg);
}

.auth-screen[hidden] { display: none; }

.auth-entry {
  align-content: start;
  place-items: stretch;
  gap: var(--page-space);
}

.auth-card {
  display: grid;
  width: min(100%, 440px);
  overflow-wrap: anywhere;
  gap: var(--page-space);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-card.compact {
  text-align: center;
}

.auth-card.compact .auth-logo {
  margin-inline: auto;
}

.auth-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 0.95;
}

.confirmation-dialog p,
.auth-card p,
.rest-day-panel p {
  margin: 0;
  color: var(--charcoal-2);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.auth-form input {
  width: 100%;
  padding: 15px 14px;
  color: var(--ink);
  background: var(--surface-2);
  border-radius: var(--radius);
  font: inherit;
  font-size: 18px;
}

.story-fact-grid > div,
.rest-next-panel::before,
.prepare-next-panel::before {
  background: var(--surface-2);
  border-radius: var(--radius);
}

.story-fact-grid > div {
  display: grid;
  padding: var(--item-space);
}

.auth-resend-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--item-space);
}

.onboarding-screen {
  position: relative;
  display: grid;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: stretch;
  gap: calc(2 * var(--page-space));
  padding: env(safe-area-inset-top) 0 0;
  isolation: isolate;
}

.onboarding-stage {
  display: grid;
  min-height: 0;
  align-content: end;
}

.onboarding-visual {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.onboarding-visual img {
  display: block;
  width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
  mask-image: linear-gradient(#000 80%, transparent);
}

.onboarding-timer {
  position: absolute;
  inset: calc(env(safe-area-inset-top) + var(--page-space)) max(var(--page-space), env(safe-area-inset-right)) auto max(var(--page-space), env(safe-area-inset-left));
}

.onboarding-timer .player-status-bar {
  background: var(--surface-3);
  border-radius: var(--radius);
}

@media (max-height: 400px) {
  .onboarding-timer { display: none; }
}

.onboarding-title {
  margin: 0;
  padding: var(--page-space) max(var(--page-space), env(safe-area-inset-right)) var(--page-space) max(var(--page-space), env(safe-area-inset-left));
  font-size: clamp(36px, min(18vw - 18px, 13dvh), 58px);
  white-space: pre-line;
}

.onboarding-actions {
  display: grid;
  gap: var(--detail-space);
  padding: 0 max(var(--page-space), env(safe-area-inset-right)) max(var(--page-space), env(safe-area-inset-bottom)) max(var(--page-space), env(safe-area-inset-left));
}

.onboarding-actions .player-action-control { margin-top: 0; }

.onboarding-error {
  text-align: center;
}

.app-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
}

.sync-status {
  bottom: var(--sync-bottom, calc(14px + env(safe-area-inset-bottom)));
  z-index: 40;
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: rgba(244, 245, 247, 0.78);
  background: rgba(18, 20, 25, 0.94);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.sync-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: #38c987;
  border-radius: 999px;
}

.sync-status.offline .sync-status-dot {
  background: #7c8492;
}

.sync-status.pending .sync-status-dot {
  background: #f2aa2b;
}

.sync-status.syncing .sync-status-dot,
.loading-status .sync-status-dot {
  background: var(--red);
  animation: sync-pulse 0.9s ease-in-out infinite alternate;
}

.sync-status.synced {
  animation: sync-confirm 2.4s ease forwards;
}

@keyframes sync-pulse {
  to {
    opacity: 0.38;
    transform: scale(0.7);
  }
}

@keyframes sync-confirm {
  0%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.training-undo-status {
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 42;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(254px, calc(100vw - 44px));
  padding: 9px 9px 10px 12px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(20, 22, 27, 0.88);
  border-radius: var(--radius);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  backdrop-filter: blur(14px);
  animation: toast-pop 0.18s ease-out both;
}

.training-undo-status::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  opacity: 0.75;
  transform-origin: left center;
  animation: toast-life var(--undo-life, 10s) linear both;
}

.training-undo-status span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-undo-status button {
  min-height: 28px;
  padding: 0 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 800;
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes toast-life {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.diary-highlight-row {
  display: flex;
  gap: 14px;
  padding: 0;
}

.diary-calendar-block + .diary-calendar-block {
  margin-top: var(--page-space);
  padding-top: var(--page-space);
}

.section-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.diary-calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--item-space);
}

.diary-calendar-month {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
  text-align: left;
}

.diary-calendar-consistency {
  flex: 0 0 112px;
}

.consistency-meter,
.program-days-meter {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.consistency-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
}

.consistency-track::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--consistency-progress);
  background: color-mix(in oklch, var(--completed-fill) var(--consistency-progress), var(--red));
  content: "";
}

.consistency-days,
.diary-calendar-weekdays,
.diary-calendar-grid {
  --cell-gap: var(--calendar-gap);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cell-gap);
}

.diary-calendar-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-align: center;
}

.consistency-day,
.diary-calendar-day {
  --cell-fill: transparent;
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  color: var(--charcoal-2);
  background: var(--cell-fill);
  border-radius: var(--radius);
}

.diary-calendar-day {
  --next-cell-fill: var(--calendar-program);
  --cell-link: linear-gradient(90deg, var(--cell-fill), var(--next-cell-fill));
  isolation: isolate;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.diary-calendar-day.in-program {
  --cell-fill: var(--calendar-program);
}

.diary-calendar-day::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: inherit;
  border-radius: inherit;
  box-shadow: var(--day-highlight, none);
  content: "";
  pointer-events: none;
}

.consistency-day,
.segment {
  --link-offset: calc(0px - var(--cell-gap));
  --cell-link: linear-gradient(90deg, var(--previous-cell-fill), var(--cell-fill));
}

.diary-calendar-day.join-next::after,
.consistency-day + .consistency-day::after,
.segment:not(:first-child)::after {
  position: absolute;
  top: 50%;
  left: var(--link-offset, 100%);
  width: var(--cell-gap);
  height: 8px;
  background: var(--cell-link);
  transform: translateY(-50%);
  content: "";
  pointer-events: none;
}

.consistency-day.break + .consistency-day.break::after {
  box-sizing: border-box;
  border-block: 1px solid var(--break-outline);
}

.diary-calendar-day.join-next:has(+ .trained) {
  --next-cell-fill: var(--completed-fill);
}

.diary-calendar-day.join-next:has(+ .recovery) {
  --next-cell-fill: var(--recovery-fill);
}

.diary-calendar-day.trained,
.consistency-day.trained {
  --cell-fill: var(--completed-fill);
  --day-highlight: var(--completed-highlight);
}

.diary-calendar-day.trained,
.consistency-day.trained,
.segment.done,
.finish-mark {
  color: #04130b;
  background: var(--completed-fill);
}

.diary-calendar-day.recovery,
.consistency-day.recovery {
  --cell-fill: var(--recovery-fill);
  --day-highlight: inset 0 0 8px rgba(198, 240, 207, 0.12);
  color: #07120b;
}

.diary-calendar-day.missed,
.consistency-day.missed {
  --cell-fill: var(--calendar-program);
}

.consistency-day.recovery + .consistency-day {
  --previous-cell-fill: var(--recovery-fill);
}

.consistency-day.missed + .consistency-day {
  --previous-cell-fill: var(--calendar-program);
}

.diary-calendar-day.today {
  box-shadow: 0 0 0 1px var(--white);
}

.diary-calendar-day.future {
  opacity: 0.28;
}

.diary-calendar-date {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 500;
  line-height: 1;
}

.activity-mark,
.completion-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  opacity: 0.65;
  width: min(14px, 65%);
}


.activity-mark {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.activity-mark .icon,
.completion-mark .icon {
  width: 100%;
  height: 100%;
}

.activity-mark.missed,
.program-end-button > .icon {
  color: var(--missed-ink);
  opacity: 0.85;
}

.diary-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--detail-space) var(--item-space);
  margin-top: var(--section-space);
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}

.diary-calendar-legend > span {
  display: inline-flex;
  align-items: center;
  gap: var(--detail-space);
}

.diary-calendar-legend .consistency-day {
  width: 16px;
  flex: 0 0 16px;
  box-shadow: var(--day-highlight, none);
}

.diary-highlight {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

@property --highlight-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: -40deg;
}

.highlight-ring {
  display: grid;
  width: 110px;
  aspect-ratio: 1 / 1;
  place-items: center;
  padding: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 18, 23, 0.96) 0 50%, transparent 51%),
    conic-gradient(from var(--highlight-angle, -40deg), var(--red), #ff5a1f, #ffb01f, #d91422, var(--red));
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .highlight-ring {
    animation: highlight-flow 8s linear infinite;
  }
}

@keyframes highlight-flow {
  to { --highlight-angle: 320deg; }
}

.highlight-core {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(26, 29, 38, 0.98), rgba(12, 14, 18, 0.98)),
    var(--surface);
  border-radius: 999px;
}

.highlight-stats-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
}

.diary-highlight strong {
  max-width: 112px;
  overflow: hidden;
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-history-panel > h2 {
  margin: 0;
}

.session-history-more small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.session-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--detail-space);
  width: 100%;
  align-items: start;
  padding: var(--detail-space);
  color: var(--ink);
  background: var(--surface-2);
  border-radius: var(--radius);
  text-align: left;
  cursor: default;
}

.session-history-row.rest,
.session-history-row.skipped {
  background: #131821;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--detail-space);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}

.log-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.log-copy strong,
.log-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.log-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}

.log-difficulty {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.log-copy .log-attribution {
  overflow: visible;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.log-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: var(--charcoal);
  background: var(--surface-3);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.log-value.personal-best {
  color: var(--bg);
  background: var(--completed-fill);
}

.log-value .icon {
  width: 1em;
  height: 1em;
}

.session-history-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.session-history-empty strong {
  font-size: 16px;
  font-weight: 900;
}

.session-history-empty span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.diary-story-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  height: 100dvh;
  overflow: hidden;
  padding: max(var(--page-space), env(safe-area-inset-top)) var(--page-space) max(var(--page-space), env(safe-area-inset-bottom));
  color: var(--white);
  background: #2a1b1d;
}

body.app-mode .route.diary-story-screen {
  overflow: hidden;
}


.diary-story-screen::before {
  z-index: 0;
  transform: scale(1.01);
}

.diary-story-screen.red {
  background: #2d1b1d;
}

.diary-story-screen.ink {
  background: #241b1d;
}

.story-view-header {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
}

.story-view-header strong {
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.story-progress-rail {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(var(--story-count, 1), 1fr);
  gap: 5px;
}

.story-progress-rail span {
  height: 4px;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 99px;
}

.story-progress-rail span.active {
  background: var(--white);
}

.story-presentation-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 18px;
  width: min(100%, 370px);
  height: auto;
  min-height: 0;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  align-content: center;
  justify-items: center;
  padding: clamp(10px, 4vw, 22px) 0;
  overflow: hidden;
  color: var(--white);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
}

.story-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border-radius: 0;
}

.story-card-heading {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.story-presentation-card h1 {
  max-width: 330px;
  margin: 0;
  font-size: clamp(32px, 10vw, 45px);
}

.story-big-metric strong,
.story-big-metric span {
  display: block;
}

.story-big-metric {
  align-self: center;
  text-align: center;
}

.story-big-metric strong {
  font-size: clamp(68px, 24vw, 106px);
  font-weight: 900;
  letter-spacing: -0.1em;
  line-height: 0.78;
}

.story-big-metric span {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(13px, 4vw, 18px);
  font-weight: 900;
}

.story-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--detail-space);
  width: 100%;
}

.story-fact-grid > div {
  min-height: 76px;
  align-content: center;
}

.story-fact-grid strong,
.story-fact-grid span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-fact-grid strong {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.story-fact-grid span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 900;
}

.story-tap-zone {
  position: absolute;
  top: calc(72px + env(safe-area-inset-top));
  bottom: 0;
  z-index: 6;
  width: 50%;
  padding: 0;
  background: transparent;
}

.story-tap-zone.previous {
  left: 0;
}

.story-tap-zone.next {
  right: 0;
}

@media (max-height: 720px) {
  .diary-story-screen {
    gap: var(--detail-space);
  }

  .story-presentation-card {
    gap: 10px;
    padding: 16px 0;
  }

  .story-presentation-card h1 {
    font-size: clamp(29px, 9vw, 38px);
  }

  .story-big-metric strong {
    font-size: clamp(56px, 20vw, 84px);
  }

  .story-fact-grid div {
    min-height: 58px;
  }
}

.stats-screen {
  min-height: 100dvh;
  background: #050506;
  color: var(--white);
}

.stats-back-control {
  margin: 0 0 var(--page-space);
}

.stats-plain-text {
  min-height: auto;
  overflow: auto;
  margin: 0;
  padding: 0;
  color: #e8e8ea;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
}

.bottom-bar,
.next-panel {
  position: fixed;
  right: max(0px, calc((100vw - var(--app-width)) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - var(--app-width)) / 2));
  width: min(100%, var(--app-width));
  margin: 0 auto;
}

.bottom-bar {
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: var(--page-space);
  padding: var(--page-space) var(--page-space) calc(var(--page-space) + env(safe-area-inset-bottom));
  background: rgba(6, 7, 10, 0.9);
  backdrop-filter: blur(10px);
}

.primary-button,
.secondary-button,
.auth-primary-button,
.auth-secondary-button,
.confirmation-stay,
.offline-retry-button,
.main-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  min-height: var(--control-height);
  padding: var(--item-space) 16px;
  font-size: 18px;
}

.primary-button,
.auth-primary-button,
.confirmation-stay,
.complete-button,
.skip-button,
.challenge-reps-adjust,
.main-nav button.active {
  color: var(--white);
  background: var(--red);
  border-radius: var(--radius);
}

.secondary-button,
.auth-secondary-button,
.offline-retry-button,
.main-nav button,
.rest-next-panel .skip-button,
.icon-button,
.profile-button,
.player-back-button__surface {
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--radius);
}

.primary-button:active:not(:disabled),
.auth-primary-button:active:not(:disabled),
.confirmation-stay:active:not(:disabled),
.challenge-reps-adjust:active:not(:disabled) {
  background: var(--red-dark);
}

.workout-primary-button,
.workout-action-copy,
.session-history-more {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workout-action-title {
  line-height: 1;
}

.workout-action-difficulty {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.single-bottom {
  display: block;
}

.single-bottom > button {
  width: 100%;
}

.optional-bottom {
  grid-template-columns: 0.82fr 1.35fr;
}

.bottom-bar .primary-button,
.bottom-bar .secondary-button {
  min-height: var(--workout-action-height);
}

.day-title-card .program-title {
  font-size: 31px;
}

.workout-body {
  padding: var(--section-space) var(--page-space) var(--page-space);
}

.workout-difficulty-control {
  padding: var(--section-space) var(--page-space) 0;
}

.difficulty-toggle,
.challenge-reps-stepper {
  display: grid;
  gap: calc(var(--detail-space) / 2);
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
}

.difficulty-toggle,
.challenge-reps-summary {
  background: var(--surface-3);
}

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

.challenge-reps-stepper {
  grid-template-columns: var(--control-height) minmax(0, 1fr) var(--control-height);
  padding: var(--detail-space) 0;
  background: var(--red);
}

.work-rest-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--detail-space);
  color: var(--charcoal-2);
  font-size: 12px;
}

.work-rest-labels > span {
  display: grid;
  gap: 2px;
}

.work-rest-track {
  display: block;
  height: 4px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--red) var(--work-share), var(--muted) var(--work-share));
}

.challenge-reps-adjust small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
}

.challenge-reps-adjust {
  font-size: 30px;
}

.challenge-reps-summary {
  font-variant-numeric: tabular-nums;
  color: var(--white);
}

.difficulty-option,
.challenge-reps-adjust,
.challenge-reps-summary {
  display: grid;
  min-width: 0;
  min-height: 76px;
  place-content: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: var(--radius);
  text-align: center;
}

.difficulty-option {
  color: rgba(244, 245, 247, 0.58);
  background: transparent;
}

.difficulty-option-label,
.difficulty-option-hint {
  display: block;
  min-width: 0;
}

.difficulty-option-label,
.challenge-reps-summary output {
  line-height: 1;
}

.difficulty-option-label {
  font-size: clamp(18px, 5vw, 21px);
}

.challenge-reps-summary output {
  color: var(--white);
  font-size: 30px;
  font-weight: 900;
}

.difficulty-option-hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-option.active:not(:disabled) {
  color: var(--white);
  background: var(--red);
}

.difficulty-option.active:not(:disabled) .difficulty-option-hint {
  color: var(--charcoal);
}

.challenge-reps-summary small {
  color: var(--charcoal-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.difficulty-option.active:disabled {
  box-shadow: inset 0 0 0 1px var(--muted);
}

.completed-workout > .hero-title-shell,
.completed-workout > .workout-difficulty-control,
.completed-workout > .workout-body {
  filter: grayscale(1);
  opacity: 0.5;
}

.exercise-section {
  margin: 0;
}

.workout-body > .exercise-section + .exercise-section,
.workout-body > .session-history-panel {
  margin-top: var(--section-space);
}

.exercise-section-title {
  display: flex;
  gap: var(--detail-space);
  align-items: baseline;
  margin: 0 0 var(--item-space);
  font-size: 22px;
}

.exercise-section-title .dot {
  color: var(--muted);
}

.exercise-section-title .sets {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  text-transform: none;
}

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

.exercise-row {
  display: grid;
  min-height: 78px;
  grid-template-columns: 80px 1fr;
  gap: var(--item-space);
  align-items: center;
}

.exercise-thumb {
  position: relative;
  width: 80px;
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(235, 239, 241, 0.72)),
    linear-gradient(180deg, #f9fafa 0 64%, #c7c9c9 64% 100%);
  border-radius: var(--radius);
  clip-path: inset(0 round var(--radius));
}

.exercise-thumb::before {
  position: absolute;
  right: 0;
  bottom: 29%;
  left: 0;
  height: 1px;
  content: "";
  background: rgba(0, 0, 0, 0.08);
}

.exercise-thumb img,
.exercise-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: inherit;
  clip-path: inherit;
}

.exercise-preview-trigger {
  justify-self: start;
  padding: 0;
  border-radius: var(--radius);
}

.exercise-preview-backdrop {
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.exercise-preview-panel {
  width: min(100%, 390px, calc(100dvh - 140px));
  gap: var(--item-space);
  padding: var(--item-space);
  background: var(--surface-2);
  text-align: center;
  overflow-wrap: anywhere;
}

.exercise-preview-panel .exercise-thumb {
  width: 100%;
}

.equipment-preview-panel {
  width: min(100%, 560px);
  gap: var(--page-space);
  padding: var(--page-space);
}

.equipment-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--page-space);
}

.equipment-detail {
  display: grid;
  flex: 0 1 calc((100% - var(--page-space)) / 2);
  min-width: 0;
  justify-items: center;
  align-content: start;
  gap: var(--detail-space);
}

.equipment-detail .setup-photo {
  width: min(100%, 120px);
  height: auto;
  aspect-ratio: 1;
}

.equipment-detail .exercise-title {
  font-size: 18px;
}

@media (max-height: 480px) and (min-width: 480px) {
  .equipment-details {
    flex-wrap: nowrap;
  }

  .equipment-detail {
    flex: 1;
  }
}

.exercise-title {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
}

.exercise-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.amount-each {
  color: currentColor;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

.exercise-rest-row,
.rest-divider {
  display: grid;
  min-height: 18px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--detail-space);
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.exercise-rest-row {
  margin: -2px calc(-1 * var(--page-space));
}

.rest-divider {
  min-height: var(--section-space);
  margin: 0 calc(-1 * var(--page-space));
}

.rest-day-panel {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: var(--page-space) 0;
  text-align: center;
}

.rest-day-panel h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.rest-day-panel p {
  max-width: 280px;
}

.offline-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: hidden;
  place-items: center;
  width: min(100%, var(--app-width));
  margin: 0 auto;
  padding: 32px;
  background: var(--bg);
  color: var(--white);
}

/* Offline preparation must never block a usable login or online app. */
.offline-gate.offline-notice {
  inset: auto var(--page-space) max(88px, calc(16px + env(safe-area-inset-bottom)));
  width: min(calc(100% - 2 * var(--page-space)), 390px);
  padding: var(--item-space);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.offline-notice .offline-gate-card { min-height: 0; gap: var(--detail-space); padding-right: 36px; }
.offline-notice-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; }
.offline-notice :is(.offline-logo, .offline-loader) { display: none; }
.offline-notice p { max-width: none; }
.startup-screen { position: fixed; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: var(--page-space); text-align: center; background: var(--bg); animation: startup-reveal .2s ease .6s both; }
.startup-screen .app-logo,
.auth-status .app-logo { width: 160px; }
.startup-screen p { margin: 0; }
.loading-status { display: flex; align-items: center; justify-content: center; gap: var(--detail-space); font-size: 16px; font-weight: 400; }
@keyframes startup-reveal { from { opacity: 0; } to { opacity: 1; } }
.startup-screen .entry-open-app { color: var(--ink); background: var(--surface-2); }

.offline-gate-card {
  display: grid;
  gap: var(--page-space);
  width: 100%;
  min-height: 360px;
  align-content: center;
  justify-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.offline-logo {
  width: min(86vw, 360px);
}

.offline-loader {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: conic-gradient(from -90deg, var(--red) var(--offline-progress), rgba(255, 255, 255, 0.1) 0);
  box-shadow: 0 0 42px rgba(241, 25, 39, 0.16);
  animation: offline-breathe 1.8s ease-in-out infinite;
}

.offline-loader::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: #000;
  border-radius: inherit;
}

.offline-loader span {
  position: relative;
  width: 10px;
  height: 10px;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.58);
}

.offline-gate p {
  max-width: 220px;
  text-align: center;
}

@keyframes offline-breathe {
  0%,
  100% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.04);
  }
}

.player {
  position: relative;
  min-height: 100dvh;
  padding: calc(8px + env(safe-area-inset-top)) var(--page-space) calc(18px + env(safe-area-inset-bottom));
  color: var(--white);
  background: var(--bg);
}

.player-top {
  display: grid;
  min-height: 28px;
  grid-template-columns: 30px 1fr;
  gap: 4px;
  align-items: center;
}

.session-clock {
  justify-self: end;
  color: var(--white);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.player-close-button {
  width: 28px;
  height: 28px;
  justify-self: start;
}

.segments {
  --cell-gap: 3px;
  --segment-upcoming: rgba(255, 255, 255, 0.12);
  display: grid;
  width: 100%;
  max-width: calc((2 * var(--page-space) + var(--cell-gap)) * var(--segment-columns) - var(--cell-gap));
  overflow: hidden;
  grid-template-columns: repeat(var(--segment-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--segment-rows), auto);
  gap: var(--cell-gap);
  margin: 8px 0 14px;
}

.segments:has(> .segment:only-child) {
  visibility: hidden;
}

.segment {
  --cell-fill: var(--segment-upcoming);
  --previous-cell-fill: var(--segment-upcoming);
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  color: transparent;
  background: var(--cell-fill);
  border-radius: var(--radius);
}

.segment.done,
.finish-mark {
  --cell-fill: var(--completed-fill);
  box-shadow: var(--completed-highlight);
}

.consistency-day.pending {
  --cell-fill: rgba(255, 255, 255, 0.12);
}

.segment.active,
.consistency-day.pending {
  box-shadow: inset 0 0 0 1px var(--completed-fill);
}

.segment.active::before,
.consistency-day.pending::before {
  content: "";
  width: min(9px, 45%);
  aspect-ratio: 1;
  background: var(--completed-fill);
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M4 1.5 12.5 7 4 12.5Z' stroke='black' stroke-width='1.5' stroke-linejoin='round'/></svg>");
}

@media (prefers-reduced-motion: no-preference) {
  .segment.active,
  .segment.active::before,
  .consistency-day.pending,
  .consistency-day.pending::before {
    animation: pending-play 4.05s ease-in-out infinite;
  }

  .segment.active,
  .consistency-day.pending {
    animation-name: pending-frame;
  }
}

@keyframes pending-frame {
  50% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--completed-fill) 30%, transparent); }
}

@keyframes pending-play {
  50% { opacity: 0.3; }
}

.segment.done + .segment,
.consistency-day.trained + .consistency-day {
  --previous-cell-fill: var(--completed-fill);
}

.player-visual {
  display: grid;
  aspect-ratio: 1 / 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background: #f7f8f8;
}

.player-visual .exercise-thumb {
  width: 100%;
  height: auto;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(235, 239, 242, 0.92)),
    linear-gradient(180deg, #fff 0 64%, #c8c9c8 64% 100%);
}

.player-visual .exercise-thumb img,
.player-visual .exercise-thumb video {
  object-fit: contain;
}

.player-status-bar {
  display: grid;
  position: relative;
  width: 100%;
  min-height: 61px;
  align-items: center;
  margin: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 0;
}

.player-status-bar .timer-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--timer-left);
  background: var(--red);
  transition: width 0.25s linear;
}

.player-stage {
  display: grid;
  gap: var(--item-space);
  min-height: 0;
  align-content: safe center;
  overflow: auto;
  margin-top: -14px;
  text-align: center;
}

.player-stage-content {
  display: grid;
  justify-self: center;
  width: 100%;
  min-width: min(100%, 120px);
  height: max-content;
  container-type: inline-size;
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.rest-stage {
  min-height: 108px;
}

.player-status-bar.static-status {
  align-content: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.16);
}

.player-status-bar.static-status strong {
  padding: 0;
  font-size: clamp(23.76px, 10.56cqi, 34.32px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.player-prescription-note {
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.player-status-bar strong {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  padding: 0 10px;
  color: var(--white);
  font-size: 28.6px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.player-name {
  margin-top: 0;
  color: var(--white);
  font-size: 32px;
  line-height: 1.08;
}

.next-panel {
  --next-preview-size: 90px;
  z-index: 12;
  padding: var(--page-space) 32px calc(var(--page-space) + env(safe-area-inset-bottom));
  background: transparent;
}

.rest-next-panel,
.prepare-next-panel {
  isolation: isolate;
}

.rest-next-panel::before,
.prepare-next-panel::before {
  content: "";
  position: absolute;
  inset: 8px 20px calc(8px + env(safe-area-inset-bottom));
  z-index: -1;
}

.player-action-panel {
  padding-top: 18px;
  padding-inline: inherit;
}

.next-exercise .next-label {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 3px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9.9px;
}

.next-exercise {
  display: grid;
  grid-template-columns: var(--next-preview-size) minmax(0, 1fr);
  gap: var(--item-space);
  align-items: center;
}

.next-exercise > div {
  min-width: 0;
}

.next-exercise.finish-next {
  display: block;
}

.next-exercise .exercise-thumb {
  width: var(--next-preview-size);
  height: auto;
  border-radius: var(--radius);
}

.next-name {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--white);
  font-size: 16.2px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.next-meta {
  max-width: 100%;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.6px;
}

.player-action-control {
  position: relative;
  width: 100%;
  margin-top: var(--item-space);
}

.player-action-panel .player-action-control {
  margin-top: 0;
}

.player-back-button {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  display: flex;
  width: max-content;
  min-width: 60px;
  height: 32px;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  background: transparent;
  border: 0;
}

.player-back-button__surface {
  height: 27px;
  padding: 0 var(--detail-space);
  font-size: 10px;
  font-weight: 700;
}

.complete-button,
.skip-button {
  min-height: 64px;
  font-size: 30px;
}

.player-action-control > .complete-button,
.player-action-control > .skip-button {
  width: 100%;
  min-height: 128px;
}

.rest-next-panel .player-action-control > .skip-button {
  min-height: 64px;
  font-size: 20px;
}

.player-finished {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding-bottom: calc(160px + env(safe-area-inset-bottom));
}

.finish-panel {
  display: grid;
  min-height: 0;
  place-items: center;
  width: 100%;
  overflow: hidden;
  padding: 28px 0;
  text-align: center;
}

.finish-summary {
  display: grid;
  width: min(100%, 390px);
  max-width: 100%;
  gap: 18px;
  justify-items: center;
  min-width: 0;
}

.finish-panel h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--white);
  font-size: clamp(26.4px, 8.8vw, 44px);
  white-space: nowrap;
  text-align: center;
}

.finish-mark {
  display: grid;
  flex: 0 0 auto;
  width: 0.9em;
  aspect-ratio: 1;
  place-items: center;
  border-radius: var(--radius);
}

.finish-metadata {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 13.2px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.workout-rep-counter {
  display: grid;
  gap: var(--item-space);
  width: 100%;
}

.rep-counter-summary,
.rep-counter-value {
  display: flex;
  align-items: baseline;
  gap: var(--detail-space);
}

.rep-counter-summary {
  align-items: center;
  justify-content: space-between;
}

.rep-counter-value {
  flex-wrap: wrap;
  min-width: 0;
}

.rep-counter-value output {
  color: var(--ink);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: var(--display-tracking);
  line-height: 1;
}

.rep-counter-minus {
  flex: 0 0 40px;
  font-size: 13px;
}

.rep-counter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--detail-space);
}

.rep-counter-actions .primary-button {
  min-height: 96px;
  font-size: 30px;
}

.finish-button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 18px 24px;
  line-height: 1;
}

.finish-button small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 700;
}

button:disabled {
  color: var(--muted);
  background: var(--surface-3);
  cursor: default;
  opacity: 1;
}

button:disabled :is(.workout-action-difficulty, .difficulty-option-hint) {
  color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  .modal-backdrop,
  .entry-dialog[open]::backdrop,
  .confirmation-dialog[open]::backdrop {
    animation: modal-dim 0.3s ease-out;
  }

  button,
  a,
  [role="button"] {
    transition:
      transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      filter 0.3s ease,
      opacity 0.3s ease;
  }

  button:active:not(:disabled),
  a:active,
  [role="button"]:active {
    filter: brightness(1.08);
    transform: scale(0.965);
  }

  .story-tap-zone:active {
    filter: none;
    transform: none;
  }

  .motion-zoom {
    animation: motion-zoom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    transform-origin: 50% 52%;
  }

  .motion-slide-left {
    animation: motion-slide-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  }

  .motion-slide-right {
    animation: motion-slide-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  }
}

@keyframes modal-dim {
  from { background-color: transparent; }
}

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

@keyframes motion-zoom {
  0% {
    opacity: 0.82;
    transform: scale(0.975);
  }
  55% {
    opacity: 1;
    transform: scale(1.006);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes motion-slide-left {
  0% {
    opacity: 0.82;
    transform: translateX(34px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes motion-slide-right {
  0% {
    opacity: 0.82;
    transform: translateX(-34px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Center each action's icon and text together as one composition. */
:is(.secondary-button, .timed-complete-locked, .player-back-button__surface):has(> .icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}

:is(.secondary-button, .timed-complete-locked, .player-back-button__surface) > .icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* Contextual rows retain text-sized icons; standalone controls keep their own sizing. */
:is(.program-locked-note, .next-label) > .icon {
  width: 1em;
  height: 1em;
  flex: none;
}

/* Shared text roles; component rules keep layout, color, and responsive sizes. */
.program-day-label > span,
.next-label > span,
.exercise-rest-row strong,
.rest-divider strong {
  text-box: trim-both cap text;
}

.program-title,
.story-presentation-card h1,
.rest-day-panel h2,
.finish-panel h1,
.auth-card h1,
.onboarding-title,
.player-name,
.primary-button,
.secondary-button,
.auth-primary-button,
.auth-secondary-button,
.confirmation-stay,
.complete-button,
.skip-button,
.main-nav button,
.difficulty-option-label,
.offline-retry-button,
.challenge-reps-adjust {
  font-weight: 900;
  letter-spacing: var(--display-tracking);
}

.workout-action-difficulty,
.finish-button small,
.session-history-more small {
  letter-spacing: normal;
}

.program-title,
.story-presentation-card h1,
.rest-day-panel h2,
.finish-panel h1,
.onboarding-title {
  line-height: var(--display-leading);
}

.program-days h2,
.exercise-section-title,
.exercise-title {
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: var(--display-leading-soft);
}

.badge,
.program-day-label,
.story-kicker,
.exercise-rest-row,
.rest-divider,
.next-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.badge {
  font-weight: 600;
}

.home-tagline,
.program-equipment-copy,
.profile-membership-status,
.auth-card .auth-status-message,
.auth-card .auth-error,
.onboarding-error,
.profile-update-status,
.rep-counter-value small,
.offline-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.auth-card .auth-error,
.onboarding-error,
.profile-update-status.error,
.offline-gate.error p {
  color: var(--red);
}

@media (max-width: 380px) {
  .program-title {
    font-size: 30px;
  }

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

  .exercise-thumb {
    width: 78px;
    height: auto;
  }

  .exercise-title {
    font-size: 19px;
  }

  .exercise-meta {
    font-size: 17px;
  }

  .session-clock {
    font-size: 16px;
  }

  .player-name {
    font-size: 31px;
  }

  .next-panel {
    --next-preview-size: 78px;
  }
}
