:root {
  --graphite: #121416;
  --bone: #f5efe7;
  --chartreuse: #cbed46;
  --page-top: #faf7f1;
  --page-bottom: #f1eae1;
  --surface: #fffcf7;
  --media: #f3efe8;
  --secondary: #5d6061;
  --accent-soft: #eaf5c9;
  --outline: #b8b3aa;
  --outline-soft: #d8d2c8;
  --route-inactive: #d3cec5;
  --ready: #1b1e21;
  --ready-highlight: #262a2d;
  --ready-outline: #3c4144;
  --move-surface: #f0c7cc;
  --move-text: #681e27;
  --move-accent: #a42e3a;
  --move-track: #d9959e;
  --rest-surface: #cbe1f2;
  --rest-text: #194f77;
  --rest-accent: #2d6f9f;
  --rest-track: #98c5e3;
  --completion-top: #202427;
  --completion-bottom: #121416;
  --range-progress: 50%;
  color: var(--graphite);
  background: var(--bone);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 280px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: linear-gradient(180deg, var(--page-top), var(--page-bottom));
}

button,
input,
output {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

[hidden] {
  display: none !important;
}

.app-screen {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--page-top), var(--page-bottom));
}

.duration-screen {
  display: flex;
  flex-direction: column;
}

.duration-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: none;
  scrollbar-width: none;
}

.duration-scroll::-webkit-scrollbar {
  display: none;
}

.duration-content {
  width: min(100%, 600px);
  min-height: 100%;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.duration-identity {
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nomadic-method-icon {
  display: block;
  width: 56px;
  height: 56px;
}

.duration-dial {
  width: 250px;
  height: 250px;
  margin-top: 22px;
  border: 2px solid var(--chartreuse);
  border-radius: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--bone);
  background:
    radial-gradient(circle at 35% 28%, rgb(255 255 255 / 4%), transparent 44%),
    linear-gradient(135deg, var(--completion-top), var(--completion-bottom));
  box-shadow: 0 8px 18px rgb(18 20 22 / 22%);
  transition: transform 160ms ease;
}

.duration-dial::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
}

.duration-value {
  z-index: 1;
  border: 0;
  color: var(--bone);
  font-size: clamp(56px, 20vw, 88px);
  font-weight: 500;
  line-height: 0.95;
  transition: opacity 160ms ease, transform 160ms ease;
}

.duration-unit {
  z-index: 1;
  margin-top: 3px;
  color: var(--chartreuse);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.duration-lock {
  width: 22px;
  height: 22px;
  position: absolute;
  bottom: 18px;
  z-index: 1;
  display: none;
  fill: none;
  stroke: var(--chartreuse);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.end-session { display: none; }
.active-workout-setup .end-session {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 13px;
  border: 1px solid var(--outline);
  border-radius: 16px;
  background: var(--surface);
  color: var(--graphite);
  box-shadow: 0 2px 4px rgb(18 20 22 / 10%);
}
.end-session svg { width: 100%; fill: currentColor; }
.end-session-dialog {
  max-width: min(380px, calc(100vw - 40px));
  border: 1px solid var(--outline);
  border-radius: 24px;
  padding: 28px;
  background: var(--surface);
  color: var(--graphite);
  box-shadow: 0 16px 64px rgb(0 0 0 / 24%);
}
.end-session-dialog::backdrop { background: rgb(18 20 22 / 40%); }
.end-session-dialog h2 { margin: 0 0 12px; font-size: 22px; }
.end-session-dialog p { margin: 0 0 24px; line-height: 1.5; }
.end-session-dialog-actions { display: flex; gap: 12px; justify-content: flex-end; }
.end-session-dialog-actions button { min-height: 48px; padding: 0 22px; border-radius: 16px; }

.duration-screen.active-workout-setup .forward-arrow::before {
  width: 0;
  height: 0;
  top: 2px;
  left: 7px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--graphite);
  border-radius: 2px;
  background: transparent;
}

.duration-screen.active-workout-setup .forward-arrow::after {
  display: none;
}

.duration-dial.pulse {
  animation: dial-pulse 160ms ease-out;
}

.duration-dial.pulse .duration-value {
  animation: value-pulse 160ms ease-out;
}

.duration-controls {
  width: 100%;
}

.duration-step-row {
  width: 100%;
  height: 64px;
  margin-top: 28px;
  display: flex;
  align-items: center;
}

.step-button,
.quiet-button {
  flex: 0 0 auto;
  border: 1px solid var(--outline);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(18 20 22 / 12%);
}

.step-button {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.step-button:disabled {
  opacity: 0.42;
}

.minus-icon,
.plus-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
}

.minus-icon::before,
.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--graphite);
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.duration-range {
  width: 100%;
  height: 48px;
  min-width: 0;
  margin: 0 10px;
  padding: 0 16px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.duration-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--graphite) 0 var(--range-progress),
    var(--route-inactive) var(--range-progress) 100%
  );
}

.duration-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--graphite) 0 var(--range-progress),
    var(--route-inactive) var(--range-progress) 100%
  );
}

.duration-range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: radial-gradient(circle, var(--chartreuse) 0 5px, var(--graphite) 5.5px);
  box-shadow: 0 1px 3px rgb(18 20 22 / 25%);
}

.duration-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: radial-gradient(circle, var(--chartreuse) 0 5px, var(--graphite) 5.5px);
  box-shadow: 0 1px 3px rgb(18 20 22 / 25%);
}

.duration-labels {
  margin: -8px 80px 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  color: var(--secondary);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.duration-labels span {
  opacity: 0.72;
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.duration-labels span.selected {
  color: var(--graphite);
  opacity: 1;
  transform: scale(1.08);
}

.duration-modifiers {
  min-height: 56px;
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.modifier-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid #9f978d;
  border-radius: 22px;
  background: #e8e0d6;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 35%),
    0 1px 3px rgb(18 20 22 / 12%);
}

.modifier-tile {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 12px;
  border: 1px solid var(--outline);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--graphite);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(18 20 22 / 12%);
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 80ms ease;
}

button.modifier-tile:not(:disabled):active {
  transform: scale(0.92);
}

.modifier-tile[aria-pressed="true"] {
  border: 2px solid var(--chartreuse);
  color: var(--chartreuse);
  background: var(--graphite);
  box-shadow:
    0 2px 6px rgb(18 20 22 / 22%),
    0 0 0 4px rgb(203 237 70 / 9%);
}

.modifier-tile:focus-visible {
  outline: 3px solid rgb(18 20 22 / 46%);
  outline-offset: 3px;
}

.modifier-icon {
  display: block;
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.no-clap-slash-cutout,
.no-clap-slash {
  fill: none;
  stroke-linecap: round;
}

.no-clap-slash-cutout {
  stroke: var(--surface);
  stroke-width: 34;
}

.modifier-tile[aria-pressed="true"] .no-clap-slash-cutout {
  stroke: var(--graphite);
}

.no-clap-slash {
  stroke: currentColor;
  stroke-width: 18;
}

.modifier-icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.light-mode-glyph {
  background: currentColor;
  mask-image: url("./assets/ic_light_workout.3cdace9e7724.png");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-image: url("./assets/ic_light_workout.3cdace9e7724.png");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.light-mode-countdown {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  padding-inline: 3px;
  height: 18px;
  border: 1px solid var(--graphite);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--graphite);
  background: var(--chartreuse);
  box-shadow: 0 1px 3px rgb(18 20 22 / 24%);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}

.light-mode-countdown[hidden] {
  display: none;
}

.floor-glyph {
  display: none;
  width: 100%;
  height: 100%;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.floor-glyph-hard {
  mask-image: url("./assets/ic_hard_floor.80356a86c1a1.png");
  -webkit-mask-image: url("./assets/ic_hard_floor.80356a86c1a1.png");
}

.floor-glyph-soft {
  mask-image: url("./assets/ic_soft_floor.801e0db3705a.png");
  -webkit-mask-image: url("./assets/ic_soft_floor.801e0db3705a.png");
}

.modifier-tile[data-hard-floor="hard"] .floor-glyph-hard,
.modifier-tile[data-hard-floor="soft"] .floor-glyph-soft {
  display: block;
}

.mirror-detail {
  stroke-width: 1.7;
}

.mirror-glyph {
  display: none;
}

.wall-glyph {
  display: none;
}

.wall-no-sole-mask {
  mask-image: url("./assets/ic_wall_no_sole.047ad1baea72.png");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-image: url("./assets/ic_wall_no_sole.047ad1baea72.png");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.modifier-tile[data-wall-equipment="none"] .wall-glyph-none,
.modifier-tile[data-wall-equipment="soles-stay-off"] .wall-glyph-soles-stay-off,
.modifier-tile[data-wall-equipment="soles-may-touch"] .wall-glyph-soles-may-touch {
  display: inline;
}

.modifier-tile[data-mirror-equipment="none"] .mirror-glyph-none,
.modifier-tile[data-mirror-equipment="compact"] .mirror-glyph-compact,
.modifier-tile[data-mirror-equipment="tall"] .mirror-glyph-tall {
  display: inline;
}

.modifier-feedback {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 15px 24px;
  border: 2px solid var(--chartreuse);
  border-radius: 18px;
  color: var(--chartreuse);
  background: var(--graphite);
  box-shadow: 0 10px 28px rgb(18 20 22 / 32%);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.modifier-feedback.show {
  animation: modifier-feedback-blink 2040ms ease-out both;
}

.modifier-feedback[data-detail]:not([data-detail=""]) {
  width: max-content;
}

.modifier-feedback[data-detail]:not([data-detail=""])::after {
  content: attr(data-detail);
  display: block;
  margin-top: 5px;
  font-size: 0.65em;
  line-height: 1.4;
  white-space: normal;
}

.modifier-feedback[data-detail]:not([data-detail=""]).show {
  animation-duration: 3240ms;
}

@keyframes modifier-feedback-blink {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
  }

  7% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }

  11%,
  66% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.duration-action-bar {
  flex: 0 0 auto;
  padding: 12px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
  background: var(--surface);
}

.active-workout-setup .duration-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.active-workout-setup .begin-workout { margin: 0; flex: 1; }

.primary-button,
.completion-button {
  min-height: 48px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 600;
  transition: opacity 120ms ease, transform 80ms ease, background-color 120ms ease;
}

.primary-button {
  border: 1px solid var(--graphite);
  background: var(--chartreuse);
  box-shadow: 0 3px 8px rgb(18 20 22 / 18%);
}

.primary-button:disabled {
  opacity: 0.5;
}

.begin-workout {
  width: min(100%, 552px);
  height: 68px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.forward-arrow {
  width: 30px;
  height: 20px;
  position: relative;
  display: block;
}

.forward-arrow::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 3px;
  width: 23px;
  height: 2px;
  border-radius: 1px;
  background: var(--graphite);
}

.forward-arrow::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--graphite);
  border-right: 2px solid var(--graphite);
  transform: rotate(45deg);
}

.workout-screen {
  overflow: hidden;
}

.phase-surface {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.phase-surface.visible {
  opacity: 1;
}

.phase-half {
  width: 50%;
  height: 100%;
  background: var(--move-surface);
  transition: background-color 120ms ease;
}

.workout-content {
  position: relative;
  z-index: 1;
  width: min(100%, 1200px);
  height: 100dvh;
  margin: 0 auto;
  padding:
    calc(12px + env(safe-area-inset-top))
    calc(20px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.workout-header {
  flex: 0 0 auto;
  min-width: 0;
}

.workout-meta {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.workout-progress-text {
  flex: 0 0 auto;
  min-height: 36px;
  display: grid;
  place-items: center;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.progress-track {
  overflow: hidden;
  border-radius: 3px;
}

.progress-track > span {
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(0);
  transform-origin: left center;
}

.workout-progress {
  height: 5px;
  margin-top: 6px;
  background: var(--route-inactive);
}

.workout-progress > span {
  background: var(--chartreuse);
  transition: transform 160ms ease;
}

.exercise-name {
  max-height: 4.8em;
  margin: 8px 0 0;
  overflow: hidden;
  -webkit-touch-callout: none;
  color: var(--graphite);
  font-size: clamp(16px, 5vw, 23px);
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  user-select: none;
}

.execution-signifier {
  width: 42px;
  height: 52px;
  margin-left: auto;
  position: relative;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 4px rgb(18 20 22 / 16%));
}

.workout-setup-button {
  width: 40px;
  height: 40px;
  margin-left: 6px;
  padding: 8px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: var(--secondary);
  background: transparent;
}

.workout-setup-button:hover,
.workout-setup-button:focus-visible {
  color: var(--graphite);
  background: rgb(18 20 22 / 7%);
}

.workout-setup-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.execution-block-track {
  height: 32px;
  position: absolute;
  inset: 12px 0 auto;
  display: flex;
  gap: 5px;
}

.execution-set {
  height: 32px;
  min-width: 0;
  padding: 3px;
  position: relative;
  display: grid;
  flex: var(--execution-set-block-count) 1 0;
  grid-template-columns:
    repeat(var(--execution-set-block-count), minmax(0, 1fr));
  gap: 3px;
  border: 3px solid var(--graphite);
  border-radius: 11px;
  background: var(--surface);
}

.execution-work-block {
  min-width: 0;
  position: relative;
  border-radius: 4px;
}

.execution-work-block.blue {
  background: var(--rest-accent);
}

.execution-work-block.red {
  background: var(--move-accent);
}

.execution-work-block.neutral {
  background: var(--chartreuse);
}

.execution-work-block.current::before {
  content: "";
  width: 0;
  height: 0;
  position: absolute;
  z-index: 1;
  top: -16px;
  left: 50%;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 7px solid var(--graphite);
  transform: translateX(-50%);
}

.exercise-media-area {
  min-height: 72px;
  margin: 12px 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.exercise-media-card {
  width: min(68vw, 42dvh, 420px);
  aspect-ratio: 1;
  padding: 4px;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--outline-soft);
  border-radius: 24px;
  background: var(--media);
  box-shadow: 0 5px 14px rgb(18 20 22 / 16%);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.workout-screen.phase-move .exercise-media-card {
  border-color: var(--move-accent);
  background: var(--move-surface);
  box-shadow:
    0 5px 14px rgb(18 20 22 / 18%),
    0 0 0 4px rgb(164 46 58 / 18%);
}

.workout-screen.phase-rest .exercise-media-card {
  border-color: var(--rest-accent);
  background: var(--rest-surface);
  box-shadow:
    0 5px 14px rgb(18 20 22 / 18%),
    0 0 0 4px rgb(45 111 159 / 18%);
}

.exercise-media-card.resting {
  opacity: 0.92;
  transform: scale(0.985);
}

.exercise-media-card video,
.hold-frame {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 20px;
  background: var(--media);
  object-fit: contain;
  transform: scaleX(var(--media-scale-x, 1));
}

.hold-frame {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
}

.hold-badge {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  padding: 5px 10px;
  border: 1px solid var(--chartreuse);
  border-radius: 10px;
  color: var(--rest-text);
  background: var(--rest-surface);
  box-shadow: 0 2px 5px rgb(18 20 22 / 15%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.media-scrim,
.media-error {
  position: absolute;
  inset: 4px;
  z-index: 4;
  border-radius: 20px;
  background: var(--media);
}

.media-scrim {
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 160ms ease;
}

.media-scrim.revealed {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid var(--outline-soft);
  border-top-color: var(--graphite);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.media-error {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  text-align: center;
}

.quiet-button {
  min-width: 48px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
}

.workout-action-host {
  height: 148px;
  min-height: 148px;
  flex: 0 0 148px;
  position: relative;
}

.workout-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.ready-panel {
  min-height: 120px;
  border: 1px solid var(--ready-outline);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--ready-highlight), var(--ready));
}

.ready-controls {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.action-button {
  min-width: 0;
  min-height: 68px;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
}

.shuffle-button {
  width: 68px;
  min-height: 68px;
  flex: 0 0 68px;
  padding: 20px;
  color: var(--chartreuse);
  border: 1px solid var(--chartreuse);
  border-radius: 20px;
  background: var(--ready-highlight);
  box-shadow: 0 2px 5px rgb(18 20 22 / 18%);
}

.shuffle-button svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-playback-icon {
  width: 34px;
  height: 34px;
  display: block;
  fill: currentColor;
}

.move-panel {
  padding: 8px 12px;
  color: var(--move-text);
}

.phase-row {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.media-controls {
  min-height: 48px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.media-control {
  width: 48px;
  height: 48px;
  padding: 12px;
  color: currentColor;
  border: 1px solid var(--move-accent);
  border-radius: 14px;
  background: var(--move-track);
}

.media-control-primary {
  width: 56px;
}

.media-control svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.media-control[data-state="playing"] .playback-play-icon,
.media-control[data-state="paused"] .playback-pause-icon {
  display: none;
}

.media-control:disabled {
  opacity: 0.35;
}

.movement-time-row {
  min-height: 60px;
  position: relative;
  display: grid;
  place-items: center;
}

.movement-countdown {
  color: currentColor;
  font-size: clamp(32px, 14vw, 60px);
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.movement-track {
  height: 5px;
  margin-top: 8px;
  background: var(--move-track);
}

.movement-track > span {
  background: var(--move-accent);
  transform: scaleX(1);
}

.move-panel.change {
  color: var(--rest-text);
}

.move-panel.change .media-control {
  border-color: var(--rest-accent);
  background: var(--rest-track);
}

.move-panel.change .movement-track {
  background: var(--rest-track);
}

.move-panel.change .movement-track > span {
  background: var(--rest-accent);
}

.rest-panel {
  min-height: 148px;
  padding: 8px 12px;
  color: var(--rest-text);
}

.rest-row {
  min-height: 44px;
}

.rest-playback-control {
  flex: 1;
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 48px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.rest-playback-control svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.rest-playback-control[data-state="playing"] .rest-play-icon,
.rest-playback-control[data-state="paused"] .rest-pause-icon {
  display: none;
}

.rest-playback-control:focus-visible {
  outline: 3px solid var(--rest-accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.rest-countdown {
  font-size: clamp(28px, 10vw, 40px);
  font-weight: 600;
  line-height: 1;
}

.rest-track {
  height: 5px;
  margin-top: 4px;
  background: var(--rest-track);
}

.rest-track > span {
  background: var(--rest-accent);
  transform: scaleX(1);
}

.keep-button {
  width: 100%;
  min-height: 68px;
  margin-top: 10px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 18px;
  border-color: var(--rest-text);
  color: white;
  background: var(--rest-accent);
}

.keep-love-icon {
  width: 48px;
  height: 48px;
  display: block;
  fill: currentColor;
}

.completion-screen {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--completion-top), var(--completion-bottom));
}

.completion-hero {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
}

.completion-halo {
  width: min(70vw, 34dvh, 280px);
  aspect-ratio: 1;
  padding: 18px;
  border: 2px solid rgb(203 237 70 / 32%);
  border-radius: 50%;
  background: rgb(255 255 255 / 3%);
  animation: completion-in 240ms ease-out both;
}

.completion-halo-inner {
  width: 100%;
  height: 100%;
  padding: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  background: rgb(255 255 255 / 3%);
}

.completion-mark {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid var(--chartreuse);
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 8%));
}

.completion-mark span {
  width: 42%;
  height: 24%;
  margin-top: -7%;
  display: block;
  border-bottom: 8px solid var(--chartreuse);
  border-left: 8px solid var(--chartreuse);
  border-radius: 2px;
  transform: rotate(-45deg);
  animation: mark-in 200ms 40ms ease-out both;
}

.completion-action-bar {
  flex: 0 0 auto;
  padding:
    12px
    calc(24px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    calc(24px + env(safe-area-inset-left));
}

.completion-button {
  width: min(100%, 552px);
  height: 68px;
  margin: 0 auto;
  display: block;
  background: var(--surface);
  color: var(--completion-bottom);
  box-shadow: 0 3px 8px rgb(0 0 0 / 18%);
  animation: button-in 180ms 60ms ease-out both;
}

button:not(:disabled):active {
  transform: scale(0.985);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(61 113 155 / 75%);
  outline-offset: 3px;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes dial-pulse {
  from { transform: scale(0.98); }
  to { transform: scale(1); }
}

@keyframes value-pulse {
  from { opacity: 0.62; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes completion-in {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes mark-in {
  from { opacity: 0; transform: rotate(-45deg) scale(0.8); }
  to { opacity: 1; transform: rotate(-45deg) scale(1); }
}

@keyframes button-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (orientation: landscape) {
  .duration-screen {
    flex-direction: row;
  }

  .duration-scroll {
    height: 100dvh;
  }

  .duration-content {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding:
      calc(10px + env(safe-area-inset-top))
      16px
      calc(10px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
    flex-direction: row;
    align-items: center;
  }

  .duration-identity {
    width: 216px;
    padding: 0;
    flex: 0 0 216px;
  }

  .nomadic-method-icon {
    width: 40px;
    height: 40px;
  }

  .duration-dial {
    width: 188px;
    height: 188px;
    margin-top: 8px;
  }

  .duration-value {
    font-size: clamp(44px, 9dvh, 78px);
  }

  .duration-controls {
    min-width: 0;
    margin-left: 12px;
    flex: 1;
  }

  .duration-step-row {
    height: 56px;
    margin-top: 0;
  }

  .step-button {
    width: 56px;
    height: 56px;
  }

  .duration-labels {
    margin-right: 68px;
    margin-left: 68px;
    font-size: 9px;
  }

  .duration-modifiers {
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    margin-top: 16px;
    padding-block: 4px;
    flex-wrap: nowrap;
    justify-content: safe center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .duration-modifiers::-webkit-scrollbar {
    display: none;
  }

  .duration-modifiers > .modifier-group {
    flex: 0 0 auto;
  }

  .modifier-tile {
    width: 56px;
    height: 56px;
    padding: 12px;
  }

  .duration-action-bar {
    width: calc(104px + env(safe-area-inset-right));
    height: 100dvh;
    padding:
      calc(16px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      16px;
    display: grid;
    place-items: center;
    border-top: 0;
    border-left: 1px solid var(--outline);
  }

  .begin-workout {
    width: 68px;
    height: 68px;
    margin: 0;
  }

  .workout-content {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .workout-header {
    flex: 0.92 1 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .exercise-name {
    max-height: 3.6em;
    font-size: clamp(11px, 2.4vw, 19px);
  }

  .exercise-media-area {
    min-width: 0;
    min-height: 0;
    margin: 0;
    flex: 1.28 1 0;
  }

  .exercise-media-card {
    width: min(100%, calc(100dvh - 40px), 420px);
  }

  .workout-action-host {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    flex: 0.96 1 0;
  }

  .ready-panel {
    min-height: 96px;
  }

  .completion-screen {
    flex-direction: row;
  }

  .completion-halo {
    width: min(50vw, 68dvh, 260px);
  }

  .completion-action-bar {
    width: calc(190px + env(safe-area-inset-right));
    padding:
      calc(16px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      16px;
    display: grid;
    place-items: center;
  }

  .completion-button {
    width: 100%;
    margin: 0;
  }
}

@media (orientation: landscape) and (max-width: 639px) {
  .duration-content {
    padding:
      calc(6px + env(safe-area-inset-top))
      8px
      calc(6px + env(safe-area-inset-bottom))
      calc(8px + env(safe-area-inset-left));
  }

  .duration-identity {
    width: 160px;
    flex-basis: 160px;
  }

  .nomadic-method-icon {
    width: 32px;
    height: 32px;
  }

  .duration-dial {
    width: 140px;
    height: 140px;
    margin-top: 4px;
  }

  .duration-controls {
    margin-left: 8px;
  }

  .duration-step-row,
  .step-button {
    height: 48px;
  }

  .step-button {
    width: 48px;
  }

  .duration-labels {
    margin-right: 58px;
    margin-left: 58px;
    font-size: 8px;
  }

  .duration-modifiers {
    min-height: 48px;
    margin-top: 10px;
  }

  .modifier-tile {
    width: 48px;
    height: 48px;
    padding: 10px;
  }

  .duration-action-bar {
    width: calc(80px + env(safe-area-inset-right));
    padding:
      calc(10px + env(safe-area-inset-top))
      calc(10px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      10px;
  }

  .begin-workout {
    width: 60px;
    height: 60px;
  }
}

@media (min-width: 1000px) {
  .duration-screen {
    padding: clamp(32px, 4vw, 72px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(32px, 4dvh, 52px);
    overflow: auto;
  }

  .duration-scroll {
    width: min(100%, 1240px);
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    overflow: visible;
  }

  .duration-content {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .duration-identity {
    width: auto;
    padding: 0;
    flex: 0 0 auto;
  }

  .nomadic-method-icon {
    width: clamp(68px, 4.2vw, 88px);
    height: clamp(68px, 4.2vw, 88px);
  }

  .duration-dial {
    width: clamp(300px, min(20vw, 34dvh), 420px);
    height: clamp(300px, min(20vw, 34dvh), 420px);
    margin-top: clamp(20px, 2.5dvh, 32px);
    border-width: 3px;
  }

  .duration-dial::after {
    inset: 14px;
  }

  .duration-value {
    font-size: clamp(100px, min(8vw, 13dvh), 150px);
  }

  .duration-unit {
    font-size: clamp(16px, 1vw, 20px);
  }

  .duration-controls {
    width: min(100%, clamp(760px, 58vw, 1120px));
    margin: clamp(32px, 4dvh, 52px) auto 0;
    flex: 0 0 auto;
  }

  .duration-step-row {
    height: clamp(74px, 6vw, 92px);
  }

  .step-button {
    width: clamp(74px, 6vw, 92px);
    height: clamp(74px, 6vw, 92px);
    border-radius: 20px;
  }

  .duration-range {
    height: 64px;
    margin: 0 clamp(14px, 1.5vw, 24px);
    padding: 0 clamp(16px, 1.5vw, 24px);
  }

  .duration-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
  }

  .duration-range::-moz-range-track {
    height: 8px;
    border-radius: 4px;
  }

  .duration-range::-webkit-slider-thumb {
    width: 36px;
    height: 36px;
    margin-top: -14px;
    background: radial-gradient(circle, var(--chartreuse) 0 7px, var(--graphite) 7.5px);
  }

  .duration-range::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, var(--chartreuse) 0 7px, var(--graphite) 7.5px);
  }

  .duration-labels {
    margin-right: calc(clamp(74px, 6vw, 92px) + clamp(34px, 2.4vw, 48px));
    margin-left: calc(clamp(74px, 6vw, 92px) + clamp(34px, 2.4vw, 48px));
    font-size: clamp(11px, 0.75vw, 14px);
  }

  .duration-modifiers {
    min-height: clamp(74px, 6vw, 92px);
    margin-top: clamp(24px, 3dvh, 40px);
    gap: 24px;
  }

  .modifier-group {
    gap: 12px;
    padding: 8px;
    border-radius: 28px;
  }

  .modifier-tile {
    width: clamp(74px, 6vw, 92px);
    height: clamp(74px, 6vw, 92px);
    padding: clamp(18px, 1.5vw, 24px);
    border-radius: 20px;
  }

  .modifier-icon {
    width: 100%;
    height: 100%;
  }

  .duration-action-bar {
    width: auto;
    height: auto;
    padding: 0;
    display: block;
    border: 0;
    background: transparent;
  }

  .begin-workout {
    width: clamp(112px, 8vw, 144px);
    height: clamp(112px, 8vw, 144px);
    margin: 0 auto;
    border-radius: 32px;
  }

  .forward-arrow {
    transform: scale(1.7);
  }

  .workout-screen {
    overflow: auto;
  }

  .workout-content {
    width: min(calc(100% - 64px), 1600px);
    height: 100dvh;
    min-height: 560px;
    padding: clamp(28px, 5dvh, 64px) 0;
    display: grid;
    grid-template-columns: minmax(360px, 500px) minmax(520px, 900px);
    grid-template-rows: auto auto;
    column-gap: clamp(48px, 5vw, 96px);
    row-gap: 24px;
    align-content: center;
    align-items: stretch;
    justify-content: center;
  }

  .workout-header {
    padding: clamp(24px, 2.5vw, 36px);
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    display: block;
    border: 1px solid rgb(18 20 22 / 12%);
    border-radius: 24px;
    background: rgb(255 252 247 / 74%);
    box-shadow: 0 12px 30px rgb(18 20 22 / 10%);
    backdrop-filter: blur(8px);
  }

  .workout-progress-text {
    min-height: 52px;
    font-size: clamp(15px, 1vw, 18px);
  }

  .workout-progress {
    height: 7px;
    margin-top: 10px;
  }

  .exercise-name {
    max-height: 4.8em;
    margin-top: 16px;
    font-size: clamp(32px, 2.5vw, 46px);
    line-height: 1.12;
  }

  .execution-signifier {
    min-height: 60px;
  }

  .exercise-media-area {
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    overflow: visible;
  }

  .exercise-media-card {
    width: min(100%, 78dvh, 900px);
    border-width: 2px;
    box-shadow: 0 18px 48px rgb(18 20 22 / 18%);
  }

  .workout-action-host {
    width: 100%;
    height: 300px;
    min-width: 0;
    min-height: 300px;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    overflow: hidden;
    border: 1px solid rgb(18 20 22 / 12%);
    border-radius: 24px;
    background: rgb(255 252 247 / 74%);
    box-shadow: 0 12px 30px rgb(18 20 22 / 10%);
    backdrop-filter: blur(8px);
  }

  .workout-panel {
    padding: 30px;
  }

  .ready-panel {
    min-height: 300px;
    border: 0;
    border-radius: 23px;
  }

  .action-button {
    min-height: 88px;
  }

  .shuffle-button {
    width: 88px;
    min-height: 88px;
    flex-basis: 88px;
    padding: 27px;
  }

  .start-playback-icon {
    width: 44px;
    height: 44px;
  }

  .phase-row {
    min-height: 64px;
  }

  .media-controls {
    min-height: 64px;
    gap: 18px;
  }

  .media-control {
    width: 64px;
    height: 64px;
    padding: 16px;
    border-radius: 18px;
  }

  .media-control-primary {
    width: 72px;
  }

  .movement-time-row {
    min-height: 132px;
  }

  .movement-countdown {
    font-size: clamp(84px, 7vw, 132px);
  }

  .movement-track {
    height: 10px;
    margin-top: 18px;
  }

  .rest-panel {
    min-height: 0;
    padding: 24px 30px;
  }

  .rest-row {
    min-height: 72px;
  }

  .rest-playback-control svg {
    width: 44px;
    height: 44px;
  }

  .rest-countdown {
    font-size: 72px;
  }

  .rest-track {
    height: 10px;
    margin-top: 10px;
  }

  .keep-button {
    min-height: 80px;
    margin-top: 18px;
  }

  .keep-love-icon {
    width: 56px;
    height: 56px;
  }

  .completion-screen {
    padding: clamp(32px, 5vw, 72px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(40px, 5dvh, 64px);
    overflow: auto;
  }

  .completion-hero {
    min-height: auto;
    flex: 0 0 auto;
  }

  .completion-halo {
    width: clamp(340px, min(32vw, 50dvh), 540px);
    padding: clamp(20px, 2vw, 32px);
    border-width: 3px;
  }

  .completion-halo-inner {
    padding: clamp(30px, 3vw, 48px);
  }

  .completion-mark span {
    border-bottom-width: clamp(8px, 0.7vw, 12px);
    border-left-width: clamp(8px, 0.7vw, 12px);
  }

  .completion-action-bar {
    width: clamp(320px, 26vw, 500px);
    padding: 0;
    display: block;
  }

  .completion-button {
    width: 100%;
    height: clamp(76px, 6vw, 96px);
    margin: 0;
    font-size: clamp(22px, 2vw, 28px);
  }
}

@media (max-height: 650px) and (orientation: portrait) {
  .duration-content {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .nomadic-method-icon {
    width: 44px;
    height: 44px;
  }

  .duration-dial {
    width: 190px;
    height: 190px;
    margin-top: 10px;
  }

  .duration-step-row {
    margin-top: 12px;
  }

  .duration-modifiers {
    min-height: 56px;
    margin-top: 16px;
  }

  .modifier-tile {
    width: 56px;
    height: 56px;
    padding: 12px;
  }

  .exercise-media-card {
    width: min(58vw, 34dvh, 300px);
  }
}

@media (max-width: 360px) {
  .duration-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .duration-action-bar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .step-button {
    width: 56px;
    height: 56px;
  }

  .duration-labels {
    margin-right: 68px;
    margin-left: 68px;
    font-size: 9px;
  }
}

@media (max-width: 340px) {
  .duration-modifiers {
    gap: 8px;
  }

  .modifier-group {
    gap: 4px;
  }

  .modifier-tile {
    width: 48px;
    height: 48px;
    padding: 10px;
  }
}

@media (orientation: landscape) and (max-width: 999px) {
  .active-workout-setup .duration-action-bar { flex-direction: column; gap: 24px; }
  .active-workout-setup .begin-workout { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .modifier-feedback.show {
    opacity: 1;
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
