:root {
  --bg: #070b14;
  --surface: #0e1524;
  --surface-raised: #131c2e;
  --surface-soft: #172237;
  --border: rgba(180, 198, 230, 0.13);
  --border-strong: rgba(180, 198, 230, 0.23);
  --text: #f4f7fb;
  --muted: #94a3b8;
  --muted-strong: #bac5d6;
  --brand: #7c93ff;
  --brand-bright: #9cadff;
  --red: #ef5a67;
  --red-soft: rgba(239, 90, 103, 0.12);
  --amber: #f3ae45;
  --amber-soft: rgba(243, 174, 69, 0.12);
  --green: #48c78e;
  --green-soft: rgba(72, 199, 142, 0.12);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: dark;
  scroll-padding-top: calc(5rem + env(safe-area-inset-top));
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background:
    radial-gradient(circle at 18% -10%, rgba(94, 114, 255, 0.13), transparent 32rem),
    radial-gradient(circle at 95% 45%, rgba(60, 194, 145, 0.06), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(124, 147, 255, 0.38);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: 12rem;
  left: -12rem;
  background: #7189ff;
}

.ambient-two {
  right: -13rem;
  bottom: 8rem;
  background: #42bc8a;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(7.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: max(0.5rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--brand-bright);
  border-radius: 10px;
  background: #101a2d;
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

main:focus {
  outline: 0;
}

main:focus-visible,
.screen h1:focus-visible {
  outline: 3px solid rgba(156, 173, 255, 0.55);
  outline-offset: 5px;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: max(0.35rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -0.45rem 2.5rem;
  padding: 0.42rem;
  border: 1px solid rgba(180, 198, 230, 0.1);
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.82);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.primary-nav {
  display: flex;
  width: 100%;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(156, 173, 255, 0.32);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.24), rgba(124, 147, 255, 0.07));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 8px 22px rgba(63, 81, 180, 0.18);
  color: #dbe2ff;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.icon-button {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(19, 28, 46, 0.72);
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.05);
  color: var(--muted-strong);
  cursor: pointer;
}

.topbar-action {
  display: inline-flex;
  min-height: 2.8rem;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.78rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.92), rgba(12, 18, 31, 0.92));
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.05);
  color: #dce3ef;
  font-size: 0.7rem;
  font-weight: 780;
  cursor: pointer;
}

.topbar-action[aria-expanded="true"] {
  border-color: rgba(156, 173, 255, 0.55);
  background: rgba(124, 147, 255, 0.18);
  color: #ffffff;
}

.icon-button svg,
.topbar-action svg,
.primary-button svg,
.back-button svg,
.type-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button svg {
  width: 1.25rem;
}

.topbar-action svg {
  width: 1.15rem;
}

.screen {
  display: none;
  animation: screen-in 260ms ease-out;
}

.screen.active {
  display: block;
}

.screen h1:focus:not(:focus-visible) {
  outline: 0;
}

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

@keyframes rest-flash {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .rest-overlay.is-urgent .rest-overlay-time {
    animation: none;
  }
}

.hero {
  max-width: 38rem;
  margin-bottom: 1.7rem;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--brand-bright);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

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

h1 {
  max-width: 15ch;
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 8vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.hero-copy {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  margin-bottom: 2.3rem;
  padding: 1rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(20, 30, 50, 0.96), rgba(12, 19, 33, 0.96));
  box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, 0.05);
}

.stats-strip article {
  display: grid;
  justify-items: center;
}

.stats-strip span {
  font-size: 1.4rem;
  font-weight: 780;
  letter-spacing: -0.04em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(156, 173, 255, 0.18);
}

.stats-strip small,
.completion-stats small {
  color: var(--muted);
  font-size: 0.69rem;
}

.stat-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.selection-section {
  margin-top: 2.15rem;
}

.section-heading {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1rem;
}

.section-heading.compact {
  margin-bottom: 1.2rem;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(124, 147, 255, 0.07);
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 800;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.type-card,
.level-card {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(21, 31, 51, 0.94), rgba(13, 20, 35, 0.94));
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.type-card:active,
.level-card:active,
.primary-button:active,
.finish-button:active {
  transform: translateY(1px) scale(0.995);
}

.type-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.type-card > span:nth-child(2),
.focus-card > span:nth-child(2),
.level-copy {
  min-width: 0;
  text-align: center;
}

.type-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(156, 173, 255, 0.18);
  border-radius: 13px;
  background: rgba(124, 147, 255, 0.08);
  color: #c6d0ff;
}

.type-icon svg {
  width: 1.45rem;
}

.type-card[data-type="other"] .type-icon {
  font-size: 1.55rem;
  font-weight: 300;
}

.type-card strong,
.type-card small,
.level-copy strong,
.level-copy small {
  display: block;
}

.type-card strong {
  margin-bottom: 0.12rem;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.type-card small,
.level-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.selection-tick {
  display: none;
}

.type-card.selected {
  border-color: rgba(145, 162, 255, 0.55);
  background: linear-gradient(150deg, rgba(66, 79, 150, 0.34), rgba(20, 29, 50, 0.98));
  box-shadow: 0 16px 36px rgba(15, 21, 55, 0.34), inset 0 1px rgba(255, 255, 255, 0.07);
}

.type-card.selected .selection-tick,
.focus-card.selected .selection-tick,
.level-card.selected .selection-tick {
  display: grid;
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #071024;
  font-size: 0.72rem;
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

.compact-selection {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(13, 20, 35, 0.6);
}

.other-activity-picker {
  display: grid;
  gap: 0.55rem;
}

.other-activity-picker label,
.custom-exercise-form label,
.exercise-filter-row label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 700;
}

.other-activity-picker input,
.custom-exercise-form input,
.custom-exercise-form textarea,
.exercise-search,
.rest-setup input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #0a101c;
  color: var(--text);
}

.other-activity-picker input {
  height: 3rem;
  padding: 0 0.75rem;
}

.choice-label,
.form-choice-field legend,
.swap-search-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.choice-chip-row {
  display: flex;
  gap: 0.42rem;
  overflow-x: auto;
  padding: 0.12rem 0 0.32rem;
  scrollbar-color: rgba(156, 173, 255, 0.34) transparent;
  scrollbar-width: thin;
}

.choice-chip-row button {
  flex: 0 0 auto;
  min-height: 2.55rem;
  padding: 0 0.78rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.92), rgba(8, 14, 25, 0.94));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  color: #d7dfeb;
  font-size: 0.7rem;
  font-weight: 760;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 120ms ease;
}

.choice-chip-row button.selected {
  border-color: rgba(156, 173, 255, 0.72);
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.43), rgba(72, 91, 190, 0.3));
  box-shadow: 0 7px 18px rgba(52, 69, 161, 0.22), inset 0 1px rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.choice-chip-row button:active {
  transform: scale(0.96);
}

.activity-choice-list {
  display: grid;
  gap: 0.65rem;
}

.activity-choice-group > small {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-choice-group .choice-chip-row {
  flex-wrap: wrap;
  overflow: visible;
}

.activity-choice {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.choice-check {
  display: grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(156, 173, 255, 0.16);
  color: transparent;
  font-size: 0.58rem;
}

.activity-choice.selected .choice-check {
  background: var(--brand-bright);
  color: #071024;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

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

.focus-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 0;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(21, 31, 51, 0.94), rgba(13, 20, 35, 0.94));
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.045);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.focus-card.full-body {
  grid-column: 1 / -1;
}

.focus-card.selected {
  border-color: rgba(145, 162, 255, 0.55);
  background: linear-gradient(150deg, rgba(66, 79, 150, 0.34), rgba(20, 29, 50, 0.98));
}

.focus-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid rgba(156, 173, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(124, 147, 255, 0.12), rgba(124, 147, 255, 0.035));
  color: #c6d0ff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.focus-icon svg {
  width: 2.25rem;
  height: 2.85rem;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.body-outline {
  stroke: rgba(214, 222, 255, 0.5);
  stroke-width: 1.55;
  vector-effect: non-scaling-stroke;
}

.focus-target {
  stroke: var(--brand-bright);
  stroke-width: 3.25;
  vector-effect: non-scaling-stroke;
}

.focus-target-rear {
  stroke-dasharray: 3 2;
}

.focus-card.selected .focus-icon {
  border-color: rgba(176, 189, 255, 0.54);
  background: linear-gradient(160deg, rgba(124, 147, 255, 0.27), rgba(79, 97, 196, 0.09));
}

.focus-card.selected .focus-target {
  stroke: #ffffff;
  filter: drop-shadow(0 0 3px rgba(156, 173, 255, 0.8));
}

.focus-card strong,
.focus-card small {
  display: block;
}

.focus-card strong {
  font-size: 0.83rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.focus-card small {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.level-list {
  display: grid;
  gap: 0.75rem;
}

.level-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.level-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.level-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke-linecap: round;
  stroke-width: 3.5;
}

.capacity-track { stroke: rgba(223, 229, 240, 0.18); }
.level-card.red .capacity-fill { stroke: var(--red); }
.level-card.amber .capacity-fill { stroke: var(--amber); }
.level-card.green .capacity-fill { stroke: var(--green); }
.level-card.red .level-icon { border-color: rgba(239, 90, 103, 0.2); background: var(--red-soft); }
.level-card.amber .level-icon { border-color: rgba(243, 174, 69, 0.2); background: var(--amber-soft); }
.level-card.green .level-icon { border-color: rgba(72, 199, 142, 0.2); background: var(--green-soft); }

.level-copy strong {
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-transform: capitalize;
}

.level-card.red.selected { border-color: rgba(239, 90, 103, 0.48); background: linear-gradient(135deg, var(--red-soft), rgba(13, 20, 35, 0.96)); }
.level-card.amber.selected { border-color: rgba(243, 174, 69, 0.48); background: linear-gradient(135deg, var(--amber-soft), rgba(13, 20, 35, 0.96)); }
.level-card.green.selected { border-color: rgba(72, 199, 142, 0.48); background: linear-gradient(135deg, var(--green-soft), rgba(13, 20, 35, 0.96)); }
.level-card.red.selected .selection-tick { background: var(--red); color: #22070b; }
.level-card.amber.selected .selection-tick { background: var(--amber); color: #281702; }
.level-card.green.selected .selection-tick { background: var(--green); color: #032015; }

.start-panel {
  position: fixed;
  z-index: 20;
  right: max(1rem, env(safe-area-inset-right), calc((100vw - 760px) / 2 + 1rem));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left), calc((100vw - 760px) / 2 + 1rem));
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.85rem 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(13, 20, 35, 0.88);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.active-workout-banner {
  position: fixed;
  z-index: 21;
  right: max(1rem, env(safe-area-inset-right), calc((100vw - 760px) / 2 + 1rem));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left), calc((100vw - 760px) / 2 + 1rem));
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  border: 1px solid rgba(72, 199, 142, 0.32);
  border-radius: var(--radius-md);
  background: rgba(12, 24, 30, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.active-workout-banner > div:first-child {
  display: grid;
  min-width: 0;
}

.active-workout-banner small {
  color: var(--green);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.active-workout-banner strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.banner-actions .secondary-button,
.banner-actions .primary-button {
  min-height: 2.65rem;
  padding: 0 0.8rem;
}

.start-panel div {
  display: grid;
  min-width: 0;
}

.start-panel small {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.start-panel strong {
  overflow: hidden;
  max-width: 28ch;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.finish-button {
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #a6b4ff, #7289ff);
  box-shadow: 0 12px 28px rgba(79, 100, 219, 0.3), inset 0 1px rgba(255, 255, 255, 0.4);
  color: #071024;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary-button {
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1rem;
  font-size: 0.81rem;
}

.primary-button svg {
  width: 1rem;
}

.primary-button:disabled {
  background: #293347;
  box-shadow: none;
  color: #78869d;
  cursor: not-allowed;
  opacity: 0.72;
}

.primary-button.wide {
  width: min(100%, 22rem);
  margin: 0 auto;
}

.workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.back-button,
.text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.back-button {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.5rem 0;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.back-button svg {
  width: 1.1rem;
}

.timer-pill {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(19, 28, 46, 0.8);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.015em;
  text-shadow: 0 0 18px rgba(156, 173, 255, 0.22);
}

.timer-controls {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.timer-toggle {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(19, 28, 46, 0.8);
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.live-dot.paused {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.workout-title-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.7rem;
}

.workout-title-row h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3rem);
}

.session-badge {
  flex: 0 0 auto;
  padding: 0.42rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.session-badge.red { border-color: rgba(239, 90, 103, 0.32); background: var(--red-soft); color: #ff9ba4; }
.session-badge.amber { border-color: rgba(243, 174, 69, 0.32); background: var(--amber-soft); color: #ffd18a; }
.session-badge.green { border-color: rgba(72, 199, 142, 0.32); background: var(--green-soft); color: #8be0b9; }

.adaptation-notice {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: -0.75rem 0 1.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(156, 173, 255, 0.25);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.13), rgba(12, 18, 31, 0.88));
  color: var(--muted-strong);
}

.adaptation-notice > svg {
  flex: 0 0 auto;
  width: 1.35rem;
  fill: none;
  stroke: var(--brand-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.adaptation-notice strong,
.adaptation-notice span {
  display: block;
}

.adaptation-notice strong {
  margin-bottom: 0.12rem;
  color: #e8ecff;
  font-size: 0.69rem;
}

.adaptation-notice span {
  color: #c4cede;
  font-size: 0.64rem;
  line-height: 1.4;
}

.workout-list {
  display: grid;
  gap: 1rem;
}

.exercise-controls {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(124, 147, 255, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.1), rgba(12, 18, 31, 0.92));
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.05);
}

.exercise-controls h2 {
  margin: 0.15rem 0 0.2rem;
}

.exercise-controls p:not(.section-kicker) {
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.exercise-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 0.65rem;
}

.exercise-search {
  height: 2.9rem;
  padding: 0 0.75rem;
}

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

.exercise-picker-meta {
  display: flex;
  min-height: 1.75rem;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.exercise-picker-meta small {
  color: var(--muted);
  font-size: 0.62rem;
}

.exercise-picker-meta .text-button {
  padding: 0.3rem 0;
  color: #a9b7f8;
  font-size: 0.64rem;
  font-weight: 750;
}

.exercise-area-choices {
  margin-bottom: 0.1rem;
}

.exercise-choice-list {
  max-height: 20rem;
  margin-top: 0.35rem;
  overflow-y: auto;
  border: 1px solid rgba(180, 198, 230, 0.12);
  border-radius: 14px;
  background: rgba(5, 9, 17, 0.46);
  scrollbar-color: rgba(156, 173, 255, 0.35) transparent;
  scrollbar-width: thin;
}

.exercise-choice-group + .exercise-choice-group {
  border-top: 1px solid var(--border);
}

.exercise-choice-group h3 {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0.48rem 0.65rem;
  background: rgba(15, 23, 39, 0.97);
  color: var(--brand-bright);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.exercise-choice-group h3 small {
  display: grid;
  min-width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.13);
  color: #dce3ff;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.exercise-choice-button {
  display: flex;
  width: 100%;
  min-height: 3.6rem;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.72rem;
  border: 0;
  border-top: 1px solid rgba(180, 198, 230, 0.075);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 140ms ease;
}

.exercise-choice-button > span:first-child {
  min-width: 0;
}

.exercise-choice-button strong,
.exercise-choice-button small {
  display: block;
}

.exercise-choice-button strong {
  font-size: 0.75rem;
  font-weight: 780;
}

.exercise-choice-button small {
  margin-top: 0.12rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-choice-action {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(156, 173, 255, 0.3);
  border-radius: 9px;
  background: rgba(124, 147, 255, 0.12);
  color: #dce3ff;
  font-size: 1rem;
  font-weight: 800;
}

.compact-empty {
  margin: 0;
  border: 0;
}

.workout-tools-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
}

.workout-tools-row > .text-button {
  color: #a9b7f8;
}

.rest-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 31rem);
  gap: 0.4rem;
  align-items: center;
}

.rest-setup .choice-label {
  grid-column: 1 / -1;
  margin: 0;
}

.rest-setup input {
  width: 6rem;
  height: 2.55rem;
  padding: 0 0.45rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.rest-duration-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  grid-column: 1 / -1;
  padding-bottom: 0.12rem;
}

.rest-duration-choices button {
  display: inline-flex;
  min-width: 3.25rem;
  min-height: 2.75rem;
  gap: 0.16rem;
  align-items: baseline;
  justify-content: center;
  padding: 0 0.58rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  cursor: pointer;
}

.rest-duration-choices button[aria-pressed="true"] {
  border-color: rgba(243, 174, 69, 0.48);
  background: rgba(243, 174, 69, 0.14);
  color: #ffd18a;
}

.rest-duration-choices strong {
  color: inherit;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.rest-duration-choices small {
  color: inherit;
  font-size: 0.54rem;
}

.rest-setup .text-button {
  grid-column: 2;
  padding: 0.45rem;
  color: var(--green);
}

.exercise-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 9, 17, 0.24);
}

.swap-exercise-button {
  min-height: 2.6rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(156, 173, 255, 0.25);
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.085);
  color: #cbd5ff;
  font-size: 0.7rem;
  font-weight: 780;
  text-align: left;
  cursor: pointer;
}

.remove-exercise {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(239, 90, 103, 0.2);
  border-radius: 10px;
  background: rgba(239, 90, 103, 0.07);
  color: #e98b93;
  font-size: 1rem;
  cursor: pointer;
}

.body-part-pill {
  flex: 0 0 auto;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(156, 173, 255, 0.18);
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.07);
  color: #b9c5ff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exercise-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(20, 30, 49, 0.98), rgba(12, 18, 31, 0.98));
  box-shadow: var(--shadow-sm), inset 0 1px rgba(255, 255, 255, 0.045);
}

.guided-card {
  padding: 1rem;
  background: linear-gradient(180deg, rgba(18, 27, 46, 0.96), rgba(9, 15, 25, 0.96));
}

.guided-prompt-card,
.guided-activity-card {
  display: grid;
  gap: 0.85rem;
}

.guided-summary {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.guided-prompt-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.25rem;
}

.guided-prompt-actions .primary-button,
.guided-prompt-actions .secondary-button,
.guided-prompt-actions .text-button {
  width: 100%;
}

.guided-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guided-activity-visual {
  display: grid;
  place-items: center;
  min-height: 7.5rem;
  padding: 1rem;
  border: 1px solid rgba(156, 173, 255, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 20%, rgba(124, 147, 255, 0.25), transparent 28%),
    linear-gradient(160deg, rgba(124, 147, 255, 0.12), rgba(10, 15, 24, 0.8));
}

.guided-visual-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(156, 173, 255, 0.22);
  border-radius: 999px;
  background: rgba(12, 17, 28, 0.86);
  color: #edf2ff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 40px rgba(48, 65, 139, 0.15);
}

.guided-activity-card h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  letter-spacing: -0.04em;
}

.guided-timer {
  font-size: clamp(2.2rem, 13vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(156, 173, 255, 0.2);
}

.guided-next-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.guided-activity-card .guided-prompt-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.guided-activity-card .guided-prompt-actions .text-button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.guided-prompt-card h2 {
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  line-height: 1.1;
}

.guided-card .section-kicker {
  margin-bottom: 0.15rem;
}

.exercise-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.exercise-order-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.3rem;
}

.exercise-order-actions button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(124, 147, 255, 0.05);
  color: var(--muted-strong);
  cursor: pointer;
}

.exercise-order-actions button:disabled {
  opacity: 0.28;
  cursor: default;
}

.exercise-header h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.exercise-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.exercise-number {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.08);
  color: #dce3ff;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.exercise-heading-copy {
  flex: 1;
}

.set-table {
  padding: 0.65rem 1rem 0.25rem;
}

.set-row {
  display: grid;
  grid-template-columns: 2rem minmax(8rem, 1fr) minmax(8rem, 1fr) 2.75rem 2rem;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.number-stepper {
  display: grid;
  grid-template-columns: 2.75rem minmax(2.5rem, 1fr) 2.75rem;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(124, 147, 255, 0.3);
  border-radius: 13px;
  background: rgba(5, 9, 17, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045), 0 7px 18px rgba(0, 0, 0, 0.16);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.number-stepper:focus-within {
  border-color: rgba(156, 173, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(124, 147, 255, 0.12), inset 0 1px rgba(255, 255, 255, 0.06);
}

.stepper-caption {
  display: none;
}

.stepper-button {
  display: grid;
  width: 2.75rem;
  min-height: 2.9rem;
  place-items: center;
  border: 0;
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.16), rgba(124, 147, 255, 0.07));
  color: var(--brand-bright);
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 150ms ease, color 150ms ease, transform 120ms ease;
}

.stepper-decrease {
  border-right: 1px solid rgba(124, 147, 255, 0.18);
}

.stepper-increase {
  border-left: 1px solid rgba(124, 147, 255, 0.22);
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.28), rgba(124, 147, 255, 0.12));
  color: #dbe2ff;
}

.stepper-button:active {
  background: rgba(156, 173, 255, 0.34);
  transform: scale(0.94);
}

.remove-set {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d17a82;
  cursor: pointer;
}

.set-row.labels {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.set-index {
  color: #eef2f8;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

.set-row input,
.run-fields input,
.reflection-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5, 9, 17, 0.55);
  color: var(--text);
}

.set-row input {
  min-width: 0;
  height: 2.65rem;
  padding: 0 0.55rem;
  text-align: center;
}

.number-stepper input {
  height: 2.9rem;
  padding: 0 0.25rem;
  border: 0;
  border-radius: 0;
  background: rgba(4, 8, 15, 0.52);
  box-shadow: none;
  color: #ffffff;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(156, 173, 255, 0.18);
  appearance: textfield;
}

.number-stepper input:focus-visible {
  outline: 0;
}

.number-stepper input::-webkit-inner-spin-button,
.number-stepper input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.set-row input::placeholder,
.reflection-card textarea::placeholder,
.run-fields input::placeholder {
  color: #5e6c81;
}

.complete-set {
  display: grid;
  width: 2.75rem;
  height: 2.9rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.complete-set.completed {
  border-color: rgba(72, 199, 142, 0.36);
  background: var(--green-soft);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  color: var(--green);
}

.add-set-button {
  width: 100%;
  padding: 0.72rem 1rem 0.85rem;
  border: 0;
  background: transparent;
  color: #a9b7f8;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.run-body {
  padding: 1rem;
}

.run-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.run-fields label,
.notes-label {
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 700;
}

.run-fields input {
  height: 2.8rem;
  margin-top: 0.35rem;
  padding: 0 0.7rem;
  color: #ffffff;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

.run-step {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 9, 17, 0.34);
}

.run-step input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--green);
}

.run-step span {
  font-size: 0.78rem;
}

.reflection-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(20, 30, 49, 0.9), rgba(12, 18, 31, 0.9));
  box-shadow: var(--shadow-sm);
}

.feedback-field {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.feedback-field legend {
  margin-bottom: 0.55rem;
  color: #e7ebf4;
  font-size: 0.73rem;
  font-weight: 800;
}

.feedback-field legend span {
  margin-left: 0.25rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
}

.feedback-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.75rem), 1fr));
  gap: 0.55rem;
}

.feedback-options button {
  display: grid;
  min-width: 0;
  min-height: 5.6rem;
  gap: 0.42rem;
  place-items: center;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(20, 30, 49, 0.92), rgba(8, 14, 25, 0.94));
  color: #e2e8f2;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.feedback-options button > svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: var(--muted-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.feedback-options button strong,
.feedback-options button small {
  display: block;
  text-wrap: balance;
}

.feedback-options button strong {
  font-size: 0.7rem;
  line-height: 1.25;
}

.feedback-options button small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.25;
}

.feedback-options button.selected {
  border-color: rgba(156, 173, 255, 0.58);
  background: linear-gradient(150deg, rgba(124, 147, 255, 0.27), rgba(35, 47, 92, 0.46));
  box-shadow: 0 10px 22px rgba(35, 48, 116, 0.2), inset 0 1px rgba(255, 255, 255, 0.08);
}

.feedback-options button.selected > svg { stroke: #ffffff; }
.feedback-options button[data-feedback="strong"].selected { border-color: rgba(72, 199, 142, 0.5); background: linear-gradient(150deg, var(--green-soft), rgba(13, 20, 35, 0.94)); }
.feedback-options button[data-feedback="hard"].selected,
.feedback-options button[data-feedback="stopped"].selected { border-color: rgba(243, 174, 69, 0.5); background: linear-gradient(150deg, var(--amber-soft), rgba(13, 20, 35, 0.94)); }
.feedback-options button[data-feedback="pain"].selected { border-color: rgba(239, 90, 103, 0.52); background: linear-gradient(150deg, var(--red-soft), rgba(13, 20, 35, 0.94)); }

.reflection-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.voice-note-button,
.write-note-button {
  display: inline-flex;
  min-height: 2.8rem;
  gap: 0.48rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(12, 18, 31, 0.8);
  color: #dce3ed;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.voice-note-button {
  flex: 1;
  border-color: rgba(156, 173, 255, 0.42);
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.2), rgba(37, 50, 101, 0.2));
}

.voice-note-button svg,
.write-note-button svg,
.feedback-adaptation-preview svg {
  flex: 0 0 auto;
  width: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.voice-note-button.recording {
  border-color: rgba(239, 90, 103, 0.65);
  background: var(--red-soft);
  color: #ffadb4;
  box-shadow: 0 0 0 4px rgba(239, 90, 103, 0.08);
}

.voice-status {
  min-height: 1em;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.4;
}

.notes-panel {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.energy-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.energy-field legend {
  margin-bottom: 0.55rem;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 750;
}

.energy-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.38rem;
}

.energy-scale button {
  min-width: 0;
  min-height: 2.8rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.9), rgba(8, 14, 25, 0.92));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  color: #e0e6ef;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  font-weight: 880;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 120ms ease;
}

.energy-scale button.selected {
  border-color: rgba(156, 173, 255, 0.7);
  background: linear-gradient(145deg, rgba(124, 147, 255, 0.46), rgba(74, 94, 202, 0.3));
  box-shadow: 0 8px 20px rgba(63, 81, 180, 0.24), inset 0 1px rgba(255, 255, 255, 0.14);
  color: #f4f6ff;
}

.energy-scale button:active {
  transform: scale(0.95);
}

.energy-scale-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.58rem;
  font-weight: 750;
}

.energy-hint {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.reflection-card textarea {
  display: block;
  margin-top: 0.4rem;
  padding: 0.75rem;
}

.notes-label {
  display: block;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 750;
}

.feedback-adaptation-preview {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.07);
  color: var(--muted-strong);
  font-size: 0.61rem;
  line-height: 1.35;
}

.feedback-adaptation-preview svg {
  color: var(--brand-bright);
}

.reflection-card textarea {
  resize: vertical;
}

.finish-button {
  display: grid;
  width: 100%;
  min-height: 4.4rem;
  place-items: center;
  margin-top: 1rem;
  padding: 0.8rem;
}

.finish-button span {
  font-size: 0.95rem;
}

.finish-button small {
  opacity: 0.7;
  font-size: 0.63rem;
  font-weight: 650;
}

.completion-screen {
  max-width: 34rem;
  margin: 3rem auto 0;
  text-align: center;
}

.success-ring {
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  place-items: center;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(72, 199, 142, 0.32);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(72, 199, 142, 0.18), rgba(72, 199, 142, 0.04));
  box-shadow: 0 0 60px rgba(72, 199, 142, 0.18), inset 0 1px rgba(255, 255, 255, 0.08);
  color: var(--green);
}

.success-ring svg {
  width: 2.6rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.completion-screen h1 {
  max-width: none;
  margin: 0.3rem 0 0.7rem;
}

.completion-copy {
  max-width: 30rem;
  margin: 0 auto;
  color: var(--muted);
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 2rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(20, 30, 50, 0.96), rgba(12, 19, 33, 0.96));
  box-shadow: var(--shadow-lg);
}

.completion-stats article {
  display: grid;
  padding: 1rem 0.4rem;
  border-right: 1px solid var(--border);
}

.completion-stats article:last-child {
  border: 0;
}

.completion-stats span {
  color: #ffffff;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-shadow: 0 0 20px rgba(156, 173, 255, 0.18);
}

.completion-details {
  display: grid;
  gap: 0;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(12, 18, 31, 0.72);
  text-align: left;
}

.completion-details div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.completion-details div:last-child {
  border: 0;
}

.completion-details dt {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.completion-details dd {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 750;
}

.quote-card {
  position: relative;
  margin: 1rem 0;
  padding: 1.1rem 1.2rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(124, 147, 255, 0.06);
  color: var(--muted-strong);
}

.quote-card span {
  position: absolute;
  top: -1rem;
  left: 0.7rem;
  color: rgba(156, 173, 255, 0.14);
  font-family: Georgia, serif;
  font-size: 5rem;
}

.quote-card p {
  position: relative;
  margin: 0;
  font-size: 0.83rem;
}

.drawer {
  position: fixed;
  z-index: 100;
  inset: 0;
  visibility: hidden;
}

.drawer.open {
  visibility: visible;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.72);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity 220ms ease;
}

.drawer.open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(92%, 430px);
  height: 100%;
  padding:
    max(1.1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  overflow-y: auto;
  border-left: 1px solid var(--border-strong);
  background: #0b111e;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.drawer-header h2 {
  font-size: 1.45rem;
}

.drawer-header .icon-button {
  font-size: 1.5rem;
}

.calendar-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.95), rgba(12, 18, 31, 0.95));
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(0.35rem, 2vw, 0.65rem);
  align-items: center;
  margin-bottom: 0.75rem;
}

.calendar-header h3 {
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

.calendar-month-button {
  display: grid;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.05);
  color: var(--muted-strong);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.12rem, 0.75vw, 0.22rem);
}

.calendar-weekdays {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day,
.calendar-blank {
  min-width: 0;
  min-height: 2.75rem;
}

.calendar-day {
  display: grid;
  width: 100%;
  align-content: center;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.68rem;
  cursor: pointer;
}

.calendar-day.has-workout {
  border-color: var(--border);
  background: rgba(124, 147, 255, 0.045);
  color: var(--text);
}

.calendar-day.today {
  border-color: rgba(156, 173, 255, 0.34);
}

.calendar-day.selected {
  background: rgba(124, 147, 255, 0.16);
}

.calendar-markers {
  display: flex;
  gap: 0.15rem;
  min-height: 0.35rem;
  align-items: center;
}

.calendar-marker {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 999px;
}

.calendar-marker.red { background: var(--red); }
.calendar-marker.amber { background: var(--amber); }
.calendar-marker.green { background: var(--green); }

.calendar-more {
  color: var(--muted);
  font-size: 0.48rem;
}

.day-details {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(124, 147, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(124, 147, 255, 0.06);
}

.day-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.day-details h3 {
  margin: 0;
  font-size: 0.9rem;
}

.day-session {
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.day-session:first-child {
  border: 0;
}

.day-session strong,
.day-session small {
  display: block;
}

.day-session strong {
  font-size: 0.78rem;
}

.day-session small,
.day-session p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.history-section-heading {
  margin: 1.1rem 0 0.55rem;
}

.history-capacity-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.history-capacity-button {
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 23, 36, 0.8);
  color: var(--muted-strong);
  text-align: center;
  cursor: pointer;
}

.history-capacity-button strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-capacity-button small {
  color: var(--muted);
  font-size: 0.62rem;
}

.history-capacity-button.green.selected {
  border-color: rgba(72, 199, 142, 0.48);
  background: rgba(72, 199, 142, 0.12);
  box-shadow: inset 0 0 0 1px rgba(72, 199, 142, 0.16);
}

.history-capacity-button.amber.selected {
  border-color: rgba(243, 174, 69, 0.48);
  background: rgba(243, 174, 69, 0.12);
}

.history-capacity-button.red.selected {
  border-color: rgba(239, 90, 103, 0.48);
  background: rgba(239, 90, 103, 0.12);
}

.history-insight-card,
.history-deep-dive-panel,
.home-heat-map-panel {
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(124, 147, 255, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(18, 26, 39, 0.88), rgba(10, 16, 28, 0.94));
}

.history-insight-card {
  display: grid;
  gap: 0.6rem;
}

.history-insight-copy {
  display: grid;
  gap: 0.2rem;
}

.history-insight-copy strong {
  font-size: 0.95rem;
}

.history-insight-copy small,
.history-summary-card p,
.history-summary-card li,
.history-metric-card span,
.history-section-header small {
  color: var(--muted);
}

.history-deep-dive-toggle {
  justify-self: start;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.08);
  color: var(--muted-strong);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.history-deep-dive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.history-metric-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.65rem;
  border: 1px solid rgba(124, 147, 255, 0.16);
  border-radius: 12px;
  background: rgba(124, 147, 255, 0.04);
}

.history-metric-card strong {
  font-size: 1rem;
}

.history-analytics-layout {
  display: grid;
  gap: 0.9rem;
}

.training-heat-map {
  display: grid;
  gap: 0.55rem;
}

.body-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(5rem, 1fr));
  justify-items: center;
  gap: 0.6rem;
  min-height: 10rem;
  padding: 0.35rem 1rem 0;
}

.body-figure { width: min(100%, 8.5rem); height: 15rem; overflow: visible; }
.body-region { stroke: rgba(207, 218, 244, 0.42); stroke-width: 1.15; stroke-linejoin: round; fill: #152238; transition: fill 180ms ease, filter 180ms ease; }
.body-region.hot { fill: #ed4652; filter: drop-shadow(0 0 5px rgba(237, 70, 82, 0.55)); }
.body-region.warm { fill: #f28538; }
.body-region.soft { fill: #f3c84c; }
.body-region.neutral { fill: #17263b; }

.body-figure.front .body-region.neutral:first-child,
.body-figure.back .body-region.neutral:first-child { fill: #263852; }

.heat-map-status {
  color: var(--muted);
  font-size: 0.58rem;
  white-space: nowrap;
}

.heat-legend { display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem; color: var(--muted); font-size: 0.58rem; }
.heat-legend span { display: inline-flex; gap: 0.28rem; align-items: center; }
.heat-legend i { width: 0.48rem; height: 0.48rem; border-radius: 50%; }
.heat-legend .hot { background: #ed4652; }
.heat-legend .warm { background: #f28538; }
.heat-legend .soft { background: #f3c84c; }
.heat-legend .neutral { border: 1px solid var(--border-strong); background: #17263b; }
.muscle-breakdown { display: grid; gap: 0.42rem; margin-top: 0.2rem; }
.muscle-breakdown > strong { margin-bottom: 0.1rem; font-size: 0.67rem; }

.heat-map-empty {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.history-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.history-section-header h3 {
  margin: 0;
  font-size: 0.82rem;
}

.heat-map-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 1fr) minmax(0, 2.2fr);
  gap: 0.45rem;
  align-items: center;
  font-size: 0.64rem;
  color: var(--muted-strong);
}

.heat-map-bar {
  position: relative;
  overflow: hidden;
  height: 0.6rem;
  border: 1px solid rgba(180, 198, 230, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.heat-level {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.heat-level.neutral { background: #263752; }
.heat-level.soft { background: #f3c84c; }
.heat-level.warm { background: #f28538; }
.heat-level.hot { background: #ed4652; }

.history-summary-card {
  display: grid;
  gap: 0.5rem;
}

.history-summary-card p {
  margin: 0;
  font-size: 0.74rem;
}

.history-summary-card ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.28rem;
  font-size: 0.68rem;
}

.home-heat-map-panel {
  margin-top: 0.7rem;
}

.history-list {
  display: grid;
  gap: 0.7rem;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.95), rgba(12, 18, 31, 0.95));
  box-shadow: var(--shadow-sm);
}

button.history-item {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-colour {
  width: 0.55rem;
  height: 2.25rem;
  border-radius: 999px;
}

.history-colour.red { background: var(--red); }
.history-colour.amber { background: var(--amber); }
.history-colour.green { background: var(--green); }

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  font-size: 0.82rem;
  text-transform: capitalize;
}

.history-item small {
  color: var(--muted);
  font-size: 0.66rem;
}

.history-duration {
  color: #e7ebf2;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 820;
}

.empty-state {
  padding: 3rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted-strong);
}

.drawer-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.secondary-button {
  min-height: 2.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--muted-strong);
  font-size: 0.77rem;
  font-weight: 750;
  cursor: pointer;
}

.text-button {
  padding: 0.7rem;
  font-size: 0.71rem;
}

.danger-text {
  color: #e78089;
}

/* Training data drawer */
#historyDrawer .calendar-card,
#historyDrawer .day-details,
#historyDrawer > .drawer-panel > .drawer-actions {
  display: none;
}

.training-data-header {
  position: relative;
  margin: 0.4rem 0 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(124, 147, 255, 0.24);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(28, 38, 67, 0.9), rgba(13, 20, 35, 0.96));
  box-shadow: 0 18px 44px rgba(30, 40, 100, 0.18);
}

.training-data-header h2,
.training-data-header p { margin: 0; }
.training-data-header h2 { font-size: clamp(1.55rem, 5vw, 2rem); letter-spacing: -0.02em; }
.training-data-header > p:not(.section-kicker) { color: var(--muted-strong); font-size: 0.84rem; }
.analysis-period { display: inline-flex; margin-top: 0.9rem; padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; color: var(--brand-bright); font-size: 0.68rem; font-weight: 750; }
.training-summary { margin: 0 0 1rem; color: var(--muted-strong); font-size: 0.92rem; line-height: 1.55; }
.training-insights { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10.5rem, 1fr); gap: 0.65rem; margin: 0 -0.1rem 1.2rem; overflow-x: auto; padding: 0.1rem; scroll-snap-type: x proximity; }
.training-insight-card { min-height: 9.6rem; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(19, 28, 46, 0.82); scroll-snap-align: start; }
.training-insight-card .insight-icon { display: grid; width: 1.9rem; height: 1.9rem; margin-bottom: 0.65rem; place-items: center; border-radius: 10px; background: rgba(124, 147, 255, 0.13); color: var(--brand-bright); }
.training-insight-card strong, .training-insight-card small, .training-insight-card p { display: block; }
.training-insight-card strong { font-size: 1.15rem; }
.training-insight-card small { margin-top: 0.1rem; color: var(--muted); font-size: 0.68rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.training-insight-card p { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.recent-session-card { margin-bottom: 1.25rem; padding: 1rem; border: 1px solid rgba(124, 147, 255, 0.25); border-radius: var(--radius-md); background: linear-gradient(145deg, rgba(21, 32, 54, 0.98), rgba(12, 18, 31, 0.98)); box-shadow: var(--shadow-sm); }
.recent-session-heading, .history-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; }
.recent-session-heading h3 { margin: 0.2rem 0 0; font-size: 1rem; text-transform: uppercase; }
.recent-session-name { display: block; margin: 1.2rem 0 0.7rem; font-size: 1.1rem; }
.recent-session-meta { display: flex; align-items: center; gap: 0.7rem; color: var(--muted-strong); font-size: 0.82rem; }
.recent-session-card p { margin: 0.85rem 0 0; color: var(--muted); font-size: 0.78rem; }
.effort-pill { padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.67rem; font-weight: 800; }
.effort-pill.green { background: var(--green-soft); color: var(--green); }
.effort-pill.amber { background: var(--amber-soft); color: var(--amber); }
.effort-pill.red { background: var(--red-soft); color: var(--red); }
.edit-workout-button { display: inline-flex; min-height: 2.65rem; gap: 0.35rem; align-items: center; padding: 0 0.7rem; border: 1px solid var(--border-strong); border-radius: 10px; background: rgba(124, 147, 255, 0.08); color: var(--muted-strong); font-size: 0.73rem; font-weight: 800; cursor: pointer; }
.effort-history { margin-bottom: 1.25rem; }
.history-results-heading h3 { margin: 0; font-size: 0.9rem; }
.history-results-heading small { color: var(--muted); font-size: 0.7rem; }
.history-capacity-button { min-height: 3.6rem; }
.history-capacity-button.green strong { color: var(--green); }
.history-capacity-button.amber strong { color: var(--amber); }
.history-capacity-button.red strong { color: var(--red); }
.history-results { display: grid; gap: 0.7rem; margin-bottom: 1.25rem; }
.history-results .history-item { grid-template-columns: auto 1fr auto; display: grid; }
.history-results .history-item strong { color: var(--text); }
.history-results .history-item small { color: var(--muted); }
.activity-catalogue { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.activity-catalogue h3 { margin: 0.15rem 0 0; font-size: 1rem; }
.activity-tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.8rem; }
.activity-tile { display: grid; min-height: 5.2rem; gap: 0.25rem; place-items: center; padding: 0.6rem 0.3rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(19, 28, 46, 0.82); color: var(--muted-strong); cursor: pointer; }
.activity-tile span { font-size: 1.35rem; color: var(--brand-bright); }
.activity-tile strong { font-size: 0.72rem; }
.history-tools { display: grid; gap: 0.55rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.edit-workout-form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.edit-workout-form label { display: grid; gap: 0.35rem; color: var(--muted-strong); font-size: 0.75rem; font-weight: 750; }
.edit-workout-form input, .edit-workout-form select, .edit-workout-form textarea { width: 100%; min-height: 2.8rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.edit-exercises { display: grid; gap: 0.65rem; margin: 0; padding: 0.8rem; border: 1px solid var(--border); border-radius: 12px; }
.edit-exercises legend { padding: 0 0.3rem; color: var(--muted-strong); font-size: 0.75rem; font-weight: 800; }
.edit-exercise { display: grid; gap: 0.4rem; }
.edit-exercise strong { font-size: 0.78rem; }
.edit-set-row { display: grid; grid-template-columns: 3.5rem 1fr 1fr; gap: 0.4rem; align-items: center; color: var(--muted); font-size: 0.7rem; }
.edit-set-row input { min-height: 2.4rem; }
.form-note { margin: 0; color: var(--muted); font-size: 0.78rem; }

@media (min-width: 700px) {
  .training-insights { grid-auto-flow: initial; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .activity-tile-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.rest-toast {
  position: fixed;
  z-index: 80;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  min-width: 12rem;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.8rem 0.75rem 1rem;
  border: 1px solid rgba(124, 147, 255, 0.34);
  border-radius: 16px;
  background: rgba(15, 23, 41, 0.94);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  backdrop-filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.rest-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rest-toast div {
  display: grid;
}

.rest-toast.finished {
  border-color: rgba(72, 199, 142, 0.48);
  background: rgba(10, 35, 29, 0.96);
}

.rest-toast-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 0.4rem;
}

.rest-toast small {
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.rest-toast strong {
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-size: 1.14rem;
  font-weight: 880;
  text-shadow: 0 0 18px rgba(156, 173, 255, 0.2);
}

.rest-toast button {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 0.7rem;
  cursor: pointer;
}

.rest-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(1, 6, 12, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.rest-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.rest-overlay.is-warning {
  background: rgba(33, 17, 6, 0.82);
}

.rest-overlay.is-urgent {
  background: rgba(45, 9, 10, 0.88);
}

.rest-overlay.is-urgent .rest-overlay-time {
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 110, 110, 0.38);
  animation: rest-flash 0.9s ease-in-out infinite alternate;
}

.rest-overlay-panel {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  width: min(100%, 22rem);
  padding: 1.25rem 1rem 1rem;
  border: 1px solid rgba(157, 172, 255, 0.32);
  border-radius: 22px;
  background: rgba(10, 18, 29, 0.96);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.rest-overlay .section-kicker {
  margin: 0;
  color: var(--muted);
}

.rest-overlay-time {
  font-size: clamp(3.4rem, 16vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.rest-overlay-subtitle {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
}

.rest-overlay-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.rest-overlay-actions button,
.rest-overlay-skip {
  flex: 1 1 0;
  min-height: 3rem;
}

.manual-activity-panel {
  width: min(100%, 28rem);
}

.manual-activity-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.manual-choice {
  min-height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 41, 0.7);
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.manual-choice.selected {
  border-color: rgba(124, 147, 255, 0.5);
  background: rgba(124, 147, 255, 0.14);
  color: #dfe7ff;
}

.manual-form {
  display: grid;
  gap: 0.8rem;
}

.manual-form-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.manual-form label {
  display: grid;
  gap: 0.42rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 700;
}

.manual-form input,
.manual-form textarea {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5, 9, 17, 0.65);
  color: var(--text);
}

.manual-entry-summary {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(124, 147, 255, 0.18);
  border-radius: 12px;
  background: rgba(124, 147, 255, 0.06);
}

.manual-entry-summary strong {
  display: block;
  font-size: 0.8rem;
}

.manual-entry-summary p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.manual-action-row {
  display: flex;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  z-index: 200;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(19, 28, 46, 0.94);
  box-shadow: var(--shadow-lg);
  color: var(--muted-strong);
  font-size: 0.74rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.7rem);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-undo {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(124, 147, 255, 0.4);
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.12);
  color: #dfe7ff;
  font-weight: 800;
  cursor: pointer;
}

.modal-shell {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.modal-shell.open {
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.78);
  opacity: 0;
  backdrop-filter: blur(5px);
  transition: opacity 180ms ease;
}

.modal-shell.open .modal-backdrop {
  opacity: 1;
}

.modal-panel {
  position: relative;
  width: min(100%, 34rem);
  max-height: 90vh;
  padding: 1.1rem;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #0b111e;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(0.75rem) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.modal-shell.open .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.small-modal {
  width: min(100%, 25rem);
}

.modal-panel h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.35rem;
}

.modal-panel p:not(.section-kicker) {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.modal-actions .secondary-button,
.modal-actions .primary-button {
  min-width: 6.5rem;
  min-height: 2.9rem;
  padding: 0 1rem;
}

.modal-actions .danger-action {
  background: linear-gradient(135deg, #ff8a94, #ef5a67);
  box-shadow: 0 12px 28px rgba(239, 90, 103, 0.2);
  color: #25070a;
}

.library-modal {
  width: min(100%, 38rem);
}

.modal-intro {
  margin-top: -0.55rem;
}

.custom-exercise-form {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(124, 147, 255, 0.045);
}

.custom-exercise-form input {
  height: 2.75rem;
  padding: 0 0.7rem;
}

.custom-exercise-form textarea {
  padding: 0.7rem;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.form-choice-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-choice-field legend {
  padding: 0;
}

.custom-area-choices {
  flex-wrap: wrap;
  overflow: visible;
}

.custom-area-choices button {
  min-height: 2.4rem;
}

.swap-modal {
  width: min(100%, 39rem);
}

.swap-search-label {
  margin-top: 0.25rem;
}

.swap-modal .exercise-search {
  width: 100%;
  margin-bottom: 0.55rem;
}

.swap-choice-list {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(5, 9, 17, 0.42);
}

.swap-result-section h3 {
  margin: 0;
  padding: 0.45rem 0.6rem 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--brand-bright);
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.swap-exercise-card {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 2.7rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  min-height: 4rem;
  padding: 0.42rem 0.55rem;
  border: 0;
  border-bottom: 1px solid rgba(180, 198, 230, 0.08);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.swap-exercise-card:last-child {
  border-bottom: 0;
}

.swap-exercise-card.is-featured {
  grid-template-columns: 3.3rem minmax(0, 1fr) auto;
  min-height: 5.25rem;
  margin: 0.5rem;
  padding: 1.35rem 0.55rem 0.5rem;
  border: 1px solid rgba(156, 173, 255, 0.48);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(91, 83, 196, 0.3), rgba(27, 38, 72, 0.65));
  box-shadow: 0 5px 18px rgba(75, 74, 190, 0.16), inset 0 1px rgba(255, 255, 255, 0.08);
}

.swap-card-label {
  position: absolute;
  top: 0.38rem;
  left: 0.55rem;
  color: #c6c9ff;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.swap-alternatives-heading {
  margin-top: 0.25rem !important;
  border-top: 1px solid rgba(180, 198, 230, 0.08);
}

.swap-alternatives-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.55rem;
}

.swap-alternatives-grid .swap-exercise-card {
  min-height: 4.25rem;
  padding: 0.42rem;
  border: 1px solid rgba(180, 198, 230, 0.12);
  border-radius: 10px;
  background: rgba(12, 23, 39, 0.72);
}

.swap-exercise-card:not(.is-featured):hover {
  border-color: rgba(156, 173, 255, 0.38);
  background: rgba(124, 147, 255, 0.1);
}

.swap-exercise-card:active {
  background: rgba(124, 147, 255, 0.18);
  transform: scale(0.99);
}

.swap-exercise-card:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

.swap-exercise-card.is-featured:hover {
  border-color: rgba(185, 187, 255, 0.78);
  background: linear-gradient(135deg, rgba(105, 96, 218, 0.38), rgba(33, 49, 88, 0.72));
}

.swap-exercise-visual {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(124, 147, 255, 0.06);
}

.swap-exercise-visual .exercise-body-map {
  width: 2.25rem;
  height: 2.45rem;
}

.swap-exercise-card .swap-exercise-copy {
  min-width: 0;
}

.swap-exercise-card strong,
.swap-exercise-card small {
  display: block;
}

.swap-exercise-card strong {
  overflow: hidden;
  font-size: 0.72rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.15;
}

.swap-exercise-card small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.56rem;
}

.swap-exercise-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swap-exercise-chevron {
  color: var(--brand-bright);
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 350px) {
  .swap-alternatives-grid {
    grid-template-columns: 1fr;
  }
}

.swap-modal-actions {
  align-items: center;
  margin-top: 0.75rem;
}

.swap-modal-actions .text-button {
  min-height: 2.75rem;
}

.set-history-modal {
  width: min(100%, 35rem);
}

.set-history-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.set-history-row {
  display: grid;
  grid-template-columns: 3rem minmax(6rem, 1fr) minmax(5rem, 0.8fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(124, 147, 255, 0.045);
}

.set-history-row > strong {
  align-self: center;
  font-size: 0.67rem;
}

.set-history-row label {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
}

.set-history-row label > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.set-history-row input {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  padding: 0 0.55rem;
}

.set-history-row label > span input {
  border-radius: 10px 0 0 10px;
}

.set-history-row label > span small {
  display: grid;
  height: 2.75rem;
  padding: 0 0.42rem;
  place-items: center;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: rgba(20, 30, 49, 0.85);
  color: var(--muted);
  font-size: 0.5rem;
  text-transform: uppercase;
}

.set-history-row > button {
  min-height: 2.75rem;
  padding: 0 0.62rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
}

.form-actions {
  align-items: center;
}

.custom-exercise-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.custom-exercise-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(20, 30, 49, 0.82);
}

.custom-exercise-item strong,
.custom-exercise-item small {
  display: block;
}

.custom-exercise-item strong {
  font-size: 0.78rem;
}

.custom-exercise-item small {
  color: var(--muted);
  font-size: 0.64rem;
}

.custom-exercise-actions {
  display: flex;
  gap: 0.35rem;
}

.custom-exercise-actions button {
  min-height: 2.3rem;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--muted-strong);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}

.custom-exercise-actions button:last-child {
  border-color: rgba(239, 90, 103, 0.2);
  color: #e98b93;
}

@media (hover: hover) {
  .type-card:hover,
  .focus-card:hover,
  .level-card:hover,
  .choice-chip-row button:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
  }

  .feedback-options button:hover,
  .voice-note-button:hover,
  .write-note-button:hover {
    border-color: rgba(156, 173, 255, 0.48);
    transform: translateY(-1px);
  }

  .primary-button:not(:disabled):hover,
  .finish-button:hover {
    filter: brightness(1.06);
  }

  .stepper-button:hover {
    background: linear-gradient(145deg, rgba(156, 173, 255, 0.32), rgba(124, 147, 255, 0.15));
    color: #f0f3ff;
  }

  .energy-scale button:hover {
    border-color: rgba(156, 173, 255, 0.45);
    background: linear-gradient(145deg, rgba(124, 147, 255, 0.18), rgba(16, 25, 43, 0.94));
    color: var(--text);
  }

  .exercise-choice-button:hover {
    background: rgba(124, 147, 255, 0.09);
  }

  .topbar-action:hover {
    border-color: rgba(156, 173, 255, 0.4);
    color: #ffffff;
  }
}

@media (min-width: 640px) {
  .app-shell {
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-left: max(1.5rem, env(safe-area-inset-left));
  }

  .topbar {
    margin-top: 0.5rem;
  }

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

  .level-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    justify-items: center;
    min-height: 0;
    padding: 0.9rem 0.75rem;
  }

}

@media (max-width: 639px) {
  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .type-card[data-type="other"] {
    grid-column: 1 / -1;
  }

  .workout-tools-row {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (max-width: 560px) {
  .guided-card {
    padding: 0.9rem;
  }

  .guided-prompt-actions,
  .guided-activity-card .guided-prompt-actions {
    grid-template-columns: 1fr;
  }

  .guided-activity-card .guided-prompt-actions .text-button {
    grid-column: auto;
  }

  .set-table {
    padding: 0.7rem 0.75rem 0.2rem;
  }

  .set-row.labels {
    display: none;
  }

  .set-row:not(.labels) {
    grid-template-areas:
      "index weight done remove"
      "index reps done remove";
    grid-template-columns: 1.7rem minmax(0, 1fr) 2.75rem 2rem;
    gap: 0.45rem 0.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(180, 198, 230, 0.08);
  }

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

  .set-index {
    display: grid;
    grid-area: index;
    place-items: center;
  }

  .weight-stepper {
    grid-area: weight;
  }

  .reps-stepper {
    grid-area: reps;
  }

  .number-stepper {
    grid-template-columns: 2.25rem 2.75rem minmax(2.5rem, 1fr) 2.75rem;
  }

  .stepper-caption {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .complete-set {
    grid-area: done;
    align-self: stretch;
    height: auto;
  }

  .remove-set {
    grid-area: remove;
    align-self: stretch;
    height: auto;
  }
}

@media (max-width: 420px) {
  .topbar {
    margin-bottom: 2rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-action {
    padding: 0 0.65rem;
  }

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

  .type-card[data-type="other"] {
    grid-column: auto;
  }

  .start-panel > div {
    display: none;
  }

  .start-panel .primary-button {
    width: 100%;
  }

  .active-workout-banner > div:first-child {
    display: none;
  }

  .banner-actions {
    width: 100%;
  }

  .banner-actions button {
    flex: 1;
  }

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

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

  .feedback-options button:last-child {
    grid-column: 1 / -1;
  }

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

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

  .focus-card.full-body {
    grid-column: auto;
  }

  .exercise-filter-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .exercise-header {
    gap: 0.55rem;
  }

  .exercise-order-actions {
    flex-direction: column;
  }

}

@media (forced-colors: active) {
  .topbar,
  .topbar-action,
  .type-card,
  .focus-card,
  .level-card,
  .choice-chip-row button,
  .exercise-card,
  .modal-panel,
  .drawer-panel {
    border: 1px solid CanvasText;
  }

  .selection-tick,
  .choice-check,
  .live-dot {
    forced-color-adjust: none;
  }
}

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

/* ---------- Compact decision flow and sequential workout ---------- */

.app-shell {
  width: min(100%, 720px);
  padding-top: max(0.65rem, env(safe-area-inset-top));
}

.topbar {
  margin-bottom: 1rem;
}

.hero {
  margin-bottom: 0.8rem;
}

.hero h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.75rem, 6vw, 2.6rem);
}

.hero-copy {
  font-size: 0.8rem;
}

.stats-strip {
  margin-bottom: 0.8rem;
  padding: 0.55rem 0.65rem;
  border-radius: 15px;
}

.stats-strip span {
  font-size: 1.15rem;
}

.selection-section {
  margin-top: 0.8rem;
}

.section-heading {
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.section-heading .step-number {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 9px;
  font-size: 0.62rem;
}

.section-heading h2 {
  font-size: 0.95rem;
}

.section-heading .section-kicker {
  font-size: 0.56rem;
}

.type-grid {
  gap: 0.55rem;
}

.type-card {
  min-height: 4.4rem;
  gap: 0.48rem;
  padding: 0.55rem;
  border-radius: 15px;
  text-align: left;
}

.type-card > span:nth-child(2) {
  text-align: left;
}

.type-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
}

.type-icon svg {
  width: 1.15rem;
}

.type-card strong {
  font-size: 0.82rem;
}

.type-card small {
  display: none;
}

.collapsed-choice {
  display: grid;
  width: 100%;
  min-height: 3.3rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.58rem 0.75rem;
  border: 1px solid rgba(124, 147, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(23, 34, 57, 0.96), rgba(11, 18, 31, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.collapsed-choice > span:first-child {
  display: grid;
  min-width: 0;
}

.collapsed-choice small {
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.collapsed-choice strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-confirmed {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(72, 199, 142, 0.15);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
}

.change-label {
  color: var(--brand-bright);
  font-size: 0.67rem;
  font-weight: 800;
}

#activitySection.is-collapsed .section-heading,
#activitySection.is-collapsed #typeOptions,
#focusSection.is-collapsed .section-heading,
#focusSection.is-collapsed .recommended-workout-card,
#focusSection.is-collapsed .focus-quick-grid,
#otherActivitySection.is-collapsed .section-heading,
#otherActivitySection.is-collapsed .other-activity-picker,
#effortSection.is-collapsed .section-heading,
#effortSection.is-collapsed #levelOptions {
  display: none;
}

.focus-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.recommended-workout-card {
  display: grid;
  min-height: 4.25rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(137, 145, 255, 0.82);
  border-radius: 16px;
  background: linear-gradient(135deg, #5564f4, #765af4 58%, #3d8bff);
  box-shadow: 0 12px 30px rgba(74, 83, 232, 0.34), inset 0 1px rgba(255, 255, 255, 0.28);
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.recommended-workout-card.selected {
  box-shadow: 0 0 0 3px rgba(182, 190, 255, 0.24), 0 14px 34px rgba(74, 83, 232, 0.44), inset 0 1px rgba(255, 255, 255, 0.3);
}

.recommended-workout-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.recommended-workout-card strong { font-size: 0.92rem; }
.recommended-workout-card small { color: rgba(255, 255, 255, 0.78); font-size: 0.62rem; line-height: 1.25; }

.recommended-workout-icon,
.recommended-workout-arrow {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.15rem;
}

.recommended-workout-arrow { width: 2rem; height: 2rem; border-radius: 50%; font-size: 1rem; }

.focus-quick-grid button {
  display: flex;
  min-height: 3.25rem;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(20, 30, 49, 0.94), rgba(9, 15, 27, 0.95));
  color: var(--text);
  cursor: pointer;
}

.focus-quick-grid button > span {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 8px;
  background: rgba(124, 147, 255, 0.1);
  color: var(--brand-bright);
  font-size: 0.55rem;
  font-weight: 900;
}

.focus-quick-grid button strong {
  min-width: 0;
  font-size: 0.7rem;
  line-height: 1.1;
  text-align: left;
}

.focus-quick-grid button.selected {
  border-color: rgba(156, 173, 255, 0.62);
  background: linear-gradient(145deg, rgba(66, 79, 150, 0.34), rgba(20, 29, 50, 0.98));
}

.focus-quick-grid .more-targets-button > span {
  font-size: 1rem;
}

.focus-section > .focus-grid {
  display: none;
}

.compact-selection {
  padding: 0;
  border: 0;
  background: transparent;
}

.level-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.level-card {
  min-height: 4.25rem;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.4rem;
  padding: 0.5rem;
  border-radius: 14px;
  text-align: left;
}

.level-copy {
  display: grid;
  gap: 0.08rem;
  align-content: center;
  text-align: left;
}

.level-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
}

.level-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.level-copy strong {
  font-size: 0.78rem;
}

.level-copy small {
  display: block;
  color: #aeb8ca;
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1.15;
  overflow-wrap: normal;
  text-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 390px) {
  .level-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.22rem;
    min-height: 4.35rem;
    padding: 0.36rem 0.24rem;
    text-align: left;
  }

  .level-copy {
    justify-items: start;
    text-align: left;
  }

  .level-icon {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 8px;
  }

  .level-icon svg {
    width: 1.12rem;
    height: 1.12rem;
  }

  .level-copy small {
    font-size: 0.58rem;
  }

  .level-card.selected .selection-tick {
    top: 0.28rem;
    right: 0.28rem;
    width: 1rem;
    height: 1rem;
    font-size: 0.55rem;
  }
}

.start-panel {
  padding: 0.65rem 0.7rem 0.65rem 0.85rem;
  border-radius: 16px;
}

.start-panel small {
  font-size: 0.52rem;
}

.start-panel strong {
  font-size: 0.68rem;
}

.start-panel .primary-button {
  min-height: 2.75rem;
}

.target-picker-panel,
.exercise-picker-modal .exercise-controls {
  width: min(calc(100% - 1rem), 640px);
  max-height: min(88svh, 760px);
  overflow-y: auto;
}

.target-picker-panel .focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.target-picker-panel .focus-card,
.target-picker-panel .focus-card.full-body {
  min-height: 3.5rem;
  grid-column: auto;
  gap: 0.5rem;
  padding: 0.45rem;
  text-align: left;
}

.target-picker-panel .focus-icon {
  width: 2.3rem;
  height: 2.7rem;
}

.target-picker-panel .focus-icon svg {
  width: 1.75rem;
  height: 2.25rem;
}

.target-picker-panel .focus-card > span:nth-child(2) {
  text-align: left;
}

.target-picker-panel .focus-card strong {
  font-size: 0.72rem;
}

.target-picker-panel .focus-card small {
  display: none;
}

.target-picker-actions {
  position: sticky;
  bottom: 0;
  margin: 0.7rem -0.1rem -0.1rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 18, 31, 0.95);
}

.workout-active .topbar {
  display: none;
}

.workout-active .app-shell {
  width: min(100%, 680px);
  padding-top: max(0.25rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
}

.workout-header {
  position: sticky;
  z-index: 45;
  top: max(0.25rem, env(safe-area-inset-top));
  display: grid;
  gap: 0.45rem;
  margin: 0 -0.45rem 0.75rem;
  padding: 0.48rem;
  border: 1px solid rgba(180, 198, 230, 0.14);
  border-radius: 16px;
  background: rgba(7, 11, 20, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.workout-header-topline,
.workout-header-actions {
  display: grid;
  gap: 0.4rem;
  align-items: center;
}

.workout-header-topline {
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  justify-self: stretch;
}

.workout-header .back-button {
  min-height: 2.35rem;
  padding: 0 0.4rem;
}

.header-progress {
  color: #e8ecff;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.workout-header .timer-controls {
  justify-content: flex-end;
}

.workout-header .timer-pill {
  display: inline-flex;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  font-size: 0.7rem;
}

.timer-value-wrap {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1;
  text-align: left;
}

.timer-value-wrap small {
  color: #9eb7d3;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.workout-header .timer-toggle {
  min-height: 2.35rem;
  padding: 0 0.55rem;
  font-size: 0.63rem;
}

.workout-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  justify-self: center;
}

.workout-header-actions > button {
  display: inline-flex;
  min-height: 2.75rem;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(20, 30, 49, 0.84);
  color: #dce3ff;
  font-size: 0.69rem;
  font-weight: 800;
  cursor: pointer;
}

.workout-header-actions .finish-header-button {
  border-color: rgba(72, 199, 142, 0.32);
  background: rgba(72, 199, 142, 0.12);
  color: #9ae7c3;
}

.workout-header-actions > button.timer-active {
  border-color: rgba(243, 174, 69, 0.48);
  background: rgba(243, 174, 69, 0.14);
  color: #ffd18a;
}

.rest-popover {
  display: grid;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid rgba(243, 174, 69, 0.2);
  border-radius: 13px;
  background: rgba(12, 18, 31, 0.97);
}

.rest-popover .rest-setup {
  width: 100%;
}

.rest-popover .rest-duration-choices {
  justify-content: center;
}

.rest-popover .start-rest-button {
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(243, 174, 69, 0.3);
  border-radius: 10px;
  background: rgba(243, 174, 69, 0.13);
  color: #ffd18a;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.rest-toast,
.rest-toast.visible {
  position: static;
  display: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem;
  border-radius: 12px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.rest-toast.visible {
  display: flex;
}

.rest-readout {
  display: grid;
}

.rest-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.rest-toast-actions button {
  min-width: 4.25rem;
  min-height: 2.75rem;
  padding: 0 0.65rem;
}

.workout-title-row {
  align-items: center;
  margin: 0 0 0.65rem;
  padding: 0 0.1rem;
}

.workout-title-row h1 {
  margin-top: 0.1rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.workout-title-row .eyebrow {
  font-size: 0.54rem;
}

.workout-session-copy {
  min-width: 0;
}

.workout-session-copy h1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: #dce9f5;
  font-size: clamp(0.68rem, 3.2vw, 0.82rem);
  font-weight: 780;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.session-badge {
  padding: 0.35rem 0.5rem;
  font-size: 0.56rem;
}

.adaptation-notice {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
}

.workout-list {
  gap: 0.65rem;
  scroll-margin-top: 7.8rem;
}

.active-exercise {
  --muted: #aab6c8;
  --muted-strong: #cbd4e1;
  overflow: visible;
  border-color: rgba(156, 173, 255, 0.24);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(20, 30, 49, 0.99), rgba(10, 16, 28, 0.99));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.05);
}

.active-exercise-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.68rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.exercise-navigation {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) auto minmax(5.5rem, 1fr);
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 9, 17, 0.38);
}

.exercise-nav-button {
  display: inline-flex;
  width: 100%;
  max-width: 8.75rem;
  min-height: 2.75rem;
  gap: 0.38rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  border: 1px solid rgba(156, 173, 255, 0.3);
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.14);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  color: var(--brand-bright);
  font-size: 0.65rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.exercise-nav-previous {
  justify-self: start;
}

.exercise-nav-next {
  justify-self: end;
  border-color: rgba(156, 173, 255, 0.72);
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  box-shadow: 0 5px 14px rgba(82, 104, 224, 0.2), inset 0 1px rgba(255, 255, 255, 0.24);
  color: #081126;
}

.exercise-nav-arrow {
  font-size: 0.9rem;
  line-height: 1;
}

.exercise-nav-label {
  white-space: nowrap;
}

.exercise-nav-button:not(:disabled):active {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22);
  transform: translateY(1px);
}

.exercise-nav-button:focus-visible {
  outline-color: rgba(156, 173, 255, 0.8);
}

.exercise-nav-button:disabled {
  border-color: rgba(180, 198, 230, 0.12);
  background: rgba(124, 147, 255, 0.055);
  box-shadow: none;
  color: var(--muted);
  cursor: default;
  opacity: 0.42;
}

.exercise-progress {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-align: center;
}

.exercise-progress-count {
  white-space: nowrap;
}

@media (hover: hover) {
  .exercise-nav-previous:not(:disabled):hover {
    border-color: rgba(156, 173, 255, 0.5);
    background: rgba(124, 147, 255, 0.22);
  }

  .exercise-nav-next:not(:disabled):hover {
    border-color: #cbd4ff;
    background: linear-gradient(135deg, #b3c0ff, #879cff);
  }
}

.current-label {
  color: var(--brand-bright);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.active-exercise-title h2 {
  margin: 0.18rem 0 0.22rem;
  font-size: clamp(1.28rem, 5.2vw, 1.75rem);
  line-height: 1.08;
}

.active-exercise-title p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 650;
}

.active-exercise-title .last-performance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
  margin-top: 0.42rem;
  color: #d1d9e6;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.last-performance span {
  color: #b6c1d1;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.active-exercise-visual {
  display: grid;
  justify-items: center;
  padding: 0.3rem;
  border: 1px solid rgba(156, 173, 255, 0.16);
  border-radius: 12px;
  background: rgba(5, 9, 17, 0.55);
}

.active-exercise-visual .exercise-body-map {
  width: 3.5rem;
  height: 4.25rem;
}

.active-exercise-visual span {
  margin-top: 0.15rem;
  color: var(--muted-strong);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.completed-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  overflow: visible;
  padding: 0.45rem 0.75rem 0;
}

.completed-sets button {
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(72, 199, 142, 0.34);
  border-radius: 999px;
  background: rgba(72, 199, 142, 0.12);
  color: #b2f0d1;
  font-size: 0.63rem;
  font-weight: 750;
  cursor: pointer;
}

.active-set-card {
  padding: 0.68rem 0.75rem;
  transition: opacity 160ms ease, transform 160ms ease, max-height 180ms ease, padding 180ms ease;
}

.active-set-card.is-completing {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
}

.current-set-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.current-set-heading span {
  color: #b8c3d3;
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.current-set-heading strong {
  color: #e7ecf4;
  font-size: 0.78rem;
}

.active-set-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.active-set-field {
  display: grid;
  min-width: 0;
  gap: 0.3rem;
  color: #d5dde8;
  font-size: 0.68rem;
  font-weight: 800;
}

.active-set-field small {
  color: var(--muted);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.active-set-card .number-stepper {
  width: max-content;
  max-width: 100%;
  grid-template-columns: 2.75rem minmax(3rem, auto) 2.75rem;
  border-color: rgba(156, 173, 255, 0.4);
}

.active-set-card .weight-stepper {
  grid-template-columns: 2.75rem 4rem 2.75rem;
}

.active-set-card .reps-stepper {
  grid-template-columns: 2.75rem 3.25rem 2.75rem;
}

.active-set-card .stepper-value {
  display: flex;
  min-width: 0;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.32rem;
  background: rgba(4, 8, 15, 0.68);
}

.active-set-card .stepper-value input {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  color: #f8faff;
  font-size: 1.02rem;
  text-align: center;
}

.active-set-card .stepper-button {
  width: 2.75rem;
  min-height: 2.75rem;
}

.active-set-card .stepper-unit {
  flex: 0 0 auto;
  margin-left: 0.18rem;
  color: #bcc7d7;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: lowercase;
}

.primary-set-action {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.7rem;
  border: 1px solid rgba(72, 199, 142, 0.36);
  border-radius: 12px;
  background: linear-gradient(135deg, #57d49d, #3db984);
  box-shadow: 0 10px 26px rgba(35, 151, 101, 0.2);
  color: #052015;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.add-another-set-action {
  display: flex;
  width: min(100%, 15rem);
  min-height: 2.75rem;
  gap: 0.38rem;
  align-items: center;
  justify-content: center;
  margin: 0.55rem auto 0;
  padding: 0 0.85rem;
  border: 1px solid rgba(156, 173, 255, 0.5);
  border-radius: 11px;
  background: rgba(124, 147, 255, 0.19);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  color: #e4e9ff;
  font-size: 0.68rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.add-another-set-action > span {
  color: var(--brand-bright);
  font-size: 1rem;
  line-height: 1;
}

.add-another-set-action:active {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}

@media (hover: hover) {
  .add-another-set-action:hover {
    border-color: rgba(179, 192, 255, 0.75);
    background: rgba(124, 147, 255, 0.28);
  }
}

.exercise-overflow {
  position: relative;
  border-top: 1px solid var(--border);
}

.exercise-overflow > summary {
  display: flex;
  min-height: 2.6rem;
  gap: 0.42rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  color: var(--muted-strong);
  font-size: 0.69rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
  list-style: none;
}

.exercise-overflow > summary::-webkit-details-marker {
  display: none;
}

.exercise-overflow > summary:focus-visible {
  outline: 3px solid rgba(124, 147, 255, 0.38);
  outline-offset: -3px;
}

.exercise-overflow > summary::after {
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 140ms ease;
}

.exercise-overflow[open] > summary::after {
  transform: translateY(0.12rem) rotate(225deg);
}

.exercise-overflow-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem 0.58rem;
}

.exercise-overflow-menu button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(180, 198, 230, 0.2);
  border-radius: 10px;
  background: rgba(124, 147, 255, 0.08);
  color: #d3dce9;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
}

.exercise-overflow-menu button.danger-text {
  border-color: rgba(239, 90, 103, 0.28);
  background: rgba(239, 90, 103, 0.075);
  color: #f1a0a8;
}

.exercise-overflow-menu button:not(:disabled):active {
  transform: translateY(1px);
}

.exercise-overflow-menu button:disabled {
  color: #bdc7d6;
  cursor: default;
  opacity: 0.62;
}

@media (hover: hover) {
  .exercise-overflow-menu button:not(:disabled):hover {
    border-color: rgba(180, 198, 230, 0.34);
    background: rgba(124, 147, 255, 0.14);
    color: #edf2f8;
  }

  .exercise-overflow-menu button.danger-text:not(:disabled):hover {
    border-color: rgba(239, 90, 103, 0.42);
    background: rgba(239, 90, 103, 0.13);
    color: #ffc0c6;
  }
}

.active-exercise-name-row {
  display: flex;
  min-width: 0;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.active-exercise-name-row h2 {
  min-width: 0;
  flex: 1 1 12rem;
}

.compact-swap-button {
  display: inline-flex;
  min-height: 2.75rem;
  flex: 0 0 auto;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  border: 1px solid rgba(69, 174, 244, 0.42);
  border-radius: 9px;
  background: rgba(12, 35, 51, 0.82);
  color: #e8f5fc;
  font-size: 0.64rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.compact-swap-icon {
  color: #68bcf3;
  font-size: 1.1rem;
  line-height: 1;
}

.compact-swap-button:active {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22);
  transform: translateY(1px);
}

.compact-swap-button:focus-visible {
  outline: 2px solid rgba(104, 188, 243, 0.9);
  outline-offset: 2px;
}

@media (hover: hover) {
  .compact-swap-button:hover {
    border-color: rgba(104, 188, 243, 0.78);
    background: rgba(22, 65, 89, 0.9);
  }
}

.exercise-complete-panel {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
}

.exercise-complete-panel > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.05rem 0.4rem;
  align-items: center;
}

.exercise-complete-panel i {
  grid-row: 1 / 3;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(72, 199, 142, 0.16);
  color: var(--green);
  font-style: normal;
}

.exercise-complete-panel strong {
  color: #f0f5fa;
  font-size: 0.8rem;
}

.exercise-complete-panel small {
  color: #b8c3d3;
  font-size: 0.65rem;
  font-weight: 650;
}

.exercise-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.exercise-complete-actions .add-another-set-action {
  width: auto;
  margin: 0;
}

.next-exercise-action {
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(72, 199, 142, 0.3);
  border-radius: 10px;
  background: rgba(72, 199, 142, 0.12);
  color: #9ae7c3;
  font-size: 0.65rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.all-planned-message {
  max-width: 9rem;
  line-height: 1.35;
  text-align: right;
}

.up-next {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(12, 18, 31, 0.7);
}

.up-next-heading,
.queue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.48rem 0.65rem;
}

.up-next-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--border);
}

.up-next-heading h2 {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.up-next-heading span,
.queue-row small {
  color: var(--muted);
  font-size: 0.56rem;
}

.queue-row + .queue-row {
  border-top: 1px solid rgba(180, 198, 230, 0.08);
}

.queue-row > span {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 7px;
  background: rgba(124, 147, 255, 0.08);
  color: var(--muted-strong);
  font-size: 0.6rem;
  font-weight: 800;
}

.queue-row strong {
  font-size: 0.69rem;
}

.completed-exercise-count {
  margin: 0;
  color: var(--green);
  font-size: 0.62rem;
  text-align: center;
}

.all-done-card {
  padding: 1.2rem;
  border: 1px solid rgba(72, 199, 142, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(72, 199, 142, 0.1), rgba(12, 18, 31, 0.96));
  text-align: center;
}

.all-done-card > span {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #052015;
  font-weight: 900;
}

.all-done-card h2 {
  margin: 0.2rem 0;
}

.all-done-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.reflection-card {
  margin-top: 0.7rem;
  padding: 0;
  border-radius: 15px;
}

.reflection-card > summary {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  color: #d0d8e5;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.reflection-card > summary::-webkit-details-marker {
  display: none;
}

.reflection-card > summary span {
  color: #aeb9ca;
  font-size: 0.64rem;
  font-weight: 650;
}

.reflection-content {
  padding: 0.25rem 0.75rem 0.75rem;
}

.exercise-picker-modal .exercise-controls {
  display: block;
  margin: 0;
  padding: 0.8rem;
  border-radius: 20px 20px 0 0;
}

.exercise-picker-modal .exercise-choice-list {
  display: block;
  max-height: 48svh;
}

.exercise-picker-section > h3 {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 39, 0.98);
  color: var(--brand-bright);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exercise-picker-modal .exercise-browser-card {
  grid-template-columns: 5rem minmax(0, 1fr);
  min-height: 5.5rem;
  border: 0;
  border-bottom: 1px solid rgba(180, 198, 230, 0.08);
  border-radius: 0;
}

.exercise-picker-modal .exercise-browser-visual {
  min-height: 5.5rem;
}

.exercise-picker-modal .exercise-body-map {
  width: 3.35rem;
  height: 4.2rem;
}

.exercise-picker-modal .exercise-view-label,
.exercise-picker-modal .exercise-target-detail {
  display: none;
}

@media (min-width: 700px) {
  .exercise-picker-modal .exercise-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-picker-section {
    display: contents;
  }

  .exercise-picker-section > h3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-right: max(0.7rem, env(safe-area-inset-right));
    padding-left: max(0.7rem, env(safe-area-inset-left));
  }

  .brand-copy small,
  .hero-copy {
    display: none;
  }

  .topbar {
    margin-bottom: 0.65rem;
  }

  .hero {
    margin-bottom: 0.55rem;
  }

  .hero h1 {
    margin-bottom: 0;
    font-size: 1.65rem;
  }

  .stats-strip {
    margin-bottom: 0.65rem;
  }

  .type-card {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 4.2rem;
    text-align: center;
  }

  .type-card > span:nth-child(2) {
    text-align: center;
  }

  .focus-quick-grid button {
    min-height: 3rem;
  }

  .exercise-navigation {
    grid-template-columns: minmax(4.9rem, 1fr) auto minmax(4.9rem, 1fr);
    gap: 0.25rem;
    padding-right: 0.25rem;
    padding-left: 0.25rem;
  }

  .exercise-progress-label {
    display: none;
  }

  .exercise-nav-button {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .workout-header-topline {
    grid-template-columns: auto auto auto;
  }

  .workout-header .back-button {
    font-size: 0.68rem;
  }

  .workout-header .timer-toggle {
    display: none;
  }

  .workout-header-actions > button {
    min-height: 2.8rem;
  }

  .active-exercise-header {
    grid-template-columns: minmax(0, 1fr) 4.1rem;
  }

  .queue-row small {
    display: none;
  }

  .exercise-complete-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-complete-actions {
    justify-content: stretch;
  }

  .exercise-complete-actions .add-another-set-action,
  .exercise-complete-actions .next-exercise-action {
    flex: 1 1 9rem;
  }

  .all-planned-message {
    max-width: none;
    text-align: left;
  }

  .set-history-row {
    grid-template-columns: 2.8rem minmax(0, 1fr) minmax(0, 0.8fr);
  }

  .set-history-row > button {
    grid-column: 2 / -1;
  }
}

@media (max-width: 360px) {
  .focus-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workout-header-actions > button span[aria-hidden="true"] {
    display: none;
  }

  .active-set-inputs {
    grid-template-columns: 1fr;
  }

  .exercise-complete-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .swap-exercise-card {
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    padding-right: 0.4rem;
  }

  .swap-exercise-card button {
    padding: 0 0.55rem;
  }
}

/* Compact visual exercise browser */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.exercise-controls {
  width: min(68rem, calc(100vw - 2rem));
  margin: 0 50% 1.25rem;
  padding: 1.1rem;
  border-color: rgba(124, 147, 255, 0.2);
  background: rgba(10, 16, 28, 0.94);
  transform: translateX(-50%);
}

.exercise-browser-heading {
  width: min(100%, 32rem);
  margin: 0 auto;
  text-align: center;
}

.exercise-browser-heading .section-kicker {
  margin: 0;
  color: #9cafff;
  letter-spacing: 0.13em;
}

.exercise-controls .exercise-browser-heading h2 {
  margin: 0.16rem 0 0.12rem;
  color: #ffffff;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.18;
}

.exercise-controls .exercise-browser-heading p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
}

.exercise-filter-row {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0 0.65rem;
}

.exercise-filter-row .exercise-search-label {
  position: relative;
  display: block;
  width: min(100%, 21rem);
}

.exercise-search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0.8rem;
  width: 1rem;
  fill: none;
  stroke: #8793a8;
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
  transform: translateY(-50%);
}

.exercise-search {
  height: 2.65rem;
  padding: 0 2.7rem 0 2.3rem;
  border-radius: 999px;
  background: #080e19;
  font-size: 0.76rem;
  appearance: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.exercise-search::-webkit-search-cancel-button {
  display: none;
}

.exercise-search:hover {
  border-color: rgba(156, 173, 255, 0.36);
}

.exercise-search:focus {
  border-color: rgba(156, 173, 255, 0.68);
  background: #0b1220;
  box-shadow: 0 0 0 3px rgba(124, 147, 255, 0.1);
}

.exercise-search-clear {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0.36rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.11);
  color: #bcc8f9;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 160ms ease, color 160ms ease;
}

.exercise-search-clear svg {
  width: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.exercise-search-clear:hover {
  background: rgba(124, 147, 255, 0.2);
  color: #ffffff;
}

.exercise-area-label {
  margin: 0 0 0.4rem;
  text-align: center;
}

.exercise-area-choices {
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}

.exercise-area-choices button {
  min-height: 2.2rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(18, 27, 45, 0.86);
  font-size: 0.64rem;
  line-height: 1;
}

.exercise-area-choices button[data-area-choice="__targets__"] {
  border-color: rgba(255, 125, 95, 0.36);
  color: #ffc0ad;
}

.exercise-area-choices button[data-area-choice="__targets__"].selected {
  border-color: rgba(255, 137, 105, 0.78);
  background: rgba(165, 65, 49, 0.42);
  box-shadow: 0 6px 18px rgba(91, 31, 23, 0.2), inset 0 1px rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.exercise-area-choices button:focus-visible {
  outline-color: rgba(255, 147, 119, 0.58);
}

.exercise-picker-meta {
  width: min(100%, 46rem);
  min-height: 1.55rem;
  margin: 0.48rem auto 0;
}

.exercise-picker-meta small {
  font-size: 0.61rem;
}

.exercise-controls .exercise-choice-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: none;
  gap: 0.7rem;
  margin-top: 0.35rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.exercise-controls .exercise-choice-list > .compact-empty {
  grid-column: 1 / -1;
  padding: 1.4rem;
  border: 1px dashed rgba(180, 198, 230, 0.16);
  border-radius: 14px;
  background: rgba(5, 9, 17, 0.38);
  text-align: center;
}

.exercise-browser-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(180, 198, 230, 0.13);
  border-radius: 16px;
  outline: 0;
  background: linear-gradient(155deg, rgba(21, 31, 50, 0.98), rgba(10, 16, 28, 0.98));
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.exercise-browser-card:hover {
  border-color: rgba(156, 173, 255, 0.32);
  background: linear-gradient(155deg, rgba(25, 37, 59, 0.99), rgba(12, 19, 32, 0.99));
  transform: translateY(-2px);
}

.exercise-browser-card:focus-visible {
  outline: 3px solid rgba(124, 147, 255, 0.42);
  outline-offset: 2px;
  border-color: rgba(156, 173, 255, 0.62);
}

.exercise-browser-card.is-expanded {
  border-color: rgba(156, 173, 255, 0.48);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.23), inset 0 1px rgba(255, 255, 255, 0.055);
}

.exercise-browser-card.is-added {
  border-color: rgba(255, 114, 83, 0.72);
  background: rgba(74, 31, 28, 0.94);
  transform: scale(0.985);
}

.exercise-browser-visual {
  position: relative;
  display: grid;
  height: 8.6rem;
  padding: 0.55rem 2.65rem 0.25rem;
  place-items: center;
  border-bottom: 1px solid rgba(180, 198, 230, 0.08);
  background: rgba(5, 9, 17, 0.28);
}

.exercise-view-label {
  position: absolute;
  top: 0.65rem;
  left: 0.68rem;
  padding: 0.22rem 0.38rem;
  border: 1px solid rgba(180, 198, 230, 0.12);
  border-radius: 999px;
  background: rgba(9, 15, 26, 0.76);
  color: #8f9aae;
  font-size: 0.47rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exercise-body-map {
  display: block;
  width: auto;
  max-width: 100%;
  height: 7.65rem;
  overflow: visible;
}

.exercise-body-map.shows-both {
  width: min(100%, 8.8rem);
}

.muscle-shape {
  stroke: rgba(225, 232, 244, 0.13);
  stroke-width: 0.8;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 180ms ease, opacity 180ms ease;
}

.muscle-muted {
  fill: #2a3444;
  opacity: 0.82;
}

.muscle-secondary {
  fill: #c26d4d;
  opacity: 0.78;
}

.muscle-primary {
  fill: #ff6557;
  opacity: 1;
}

.exercise-add-button {
  position: absolute;
  top: 0.58rem;
  right: 0.58rem;
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 128, 97, 0.5);
  border-radius: 12px;
  background: rgba(116, 45, 38, 0.56);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  color: #ffb19e;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 140ms ease;
}

.exercise-add-button svg {
  width: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.exercise-add-button:hover {
  border-color: #ff8068;
  background: rgba(158, 61, 47, 0.72);
  color: #ffffff;
}

.exercise-add-button:active {
  transform: scale(0.94);
}

.exercise-add-button:disabled {
  border-color: rgba(255, 151, 121, 0.5);
  background: rgba(129, 64, 48, 0.7);
  color: #ffffff;
  cursor: default;
}

.exercise-browser-copy {
  padding: 0.7rem 0.78rem 0.76rem;
}

.exercise-primary-area {
  display: block;
  margin-bottom: 0.18rem;
  color: #ff9b83;
  font-size: 0.53rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.exercise-browser-copy h3 {
  min-height: 2.1em;
  margin: 0;
  overflow: hidden;
  color: #f7f9ff;
  font-size: 0.8rem;
  font-weight: 790;
  line-height: 1.22;
}

.exercise-browser-copy > p {
  margin: 0.25rem 0 0;
  overflow: hidden;
  color: #8995a9;
  font-size: 0.59rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-target-detail {
  display: grid;
  max-height: 0;
  gap: 0.25rem;
  margin-top: 0;
  overflow: hidden;
  color: #aeb8c8;
  font-size: 0.55rem;
  line-height: 1.25;
  opacity: 0;
  transition: max-height 180ms ease, margin 180ms ease, opacity 160ms ease;
}

.exercise-browser-card.is-expanded .exercise-target-detail {
  max-height: 4.2rem;
  margin-top: 0.55rem;
  opacity: 1;
}

.exercise-target-detail span {
  display: flex;
  min-width: 0;
  gap: 0.35rem;
  align-items: center;
}

.target-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
}

.target-swatch.primary {
  background: #ff6557;
}

.target-swatch.secondary {
  background: #c26d4d;
}

.show-more-exercises {
  display: block;
  min-width: 8.5rem;
  min-height: 2.45rem;
  margin: 0.8rem auto 0;
  padding: 0 0.95rem;
  border: 1px solid rgba(156, 173, 255, 0.25);
  border-radius: 999px;
  background: rgba(124, 147, 255, 0.08);
  color: #c8d2ff;
  font-size: 0.66rem;
  font-weight: 780;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.show-more-exercises:hover {
  border-color: rgba(156, 173, 255, 0.48);
  background: rgba(124, 147, 255, 0.15);
  color: #ffffff;
}

.exercise-controls .workout-tools-row {
  width: min(100%, 46rem);
  margin: 0.95rem auto 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(180, 198, 230, 0.08);
}

@media (min-width: 360px) {
  .exercise-controls .exercise-choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  .exercise-controls {
    padding: 1.25rem;
  }

  .exercise-controls .exercise-choice-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
  }
}

@media (min-width: 980px) {
  .exercise-controls .exercise-choice-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .exercise-controls {
    width: calc(100vw - 1.25rem);
    padding: 0.85rem;
  }

  .exercise-browser-visual {
    height: 8rem;
  }
}

@media (forced-colors: active) {
  .exercise-browser-card,
  .exercise-add-button,
  .exercise-area-choices button,
  .show-more-exercises {
    border: 1px solid CanvasText;
  }

  .muscle-primary {
    fill: Highlight;
  }

  .muscle-secondary {
    fill: LinkText;
  }
}

/* Exercise picker is a sheet, not part of the workout document flow. */
.exercise-picker-modal .modal-panel.exercise-controls {
  width: min(calc(100% - 1rem), 640px);
  max-height: min(88svh, 760px);
  margin: 0;
  overflow-y: auto;
  transform: none;
}

.exercise-picker-modal .exercise-controls .exercise-choice-list {
  display: block;
  max-height: 48svh;
  overflow-y: auto;
  border: 1px solid rgba(180, 198, 230, 0.12);
  border-radius: 14px;
  background: rgba(5, 9, 17, 0.45);
}

.exercise-picker-modal .exercise-browser-card {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  min-height: 5.5rem;
  border: 0;
  border-bottom: 1px solid rgba(180, 198, 230, 0.08);
  border-radius: 0;
}

.exercise-picker-modal .exercise-browser-visual {
  height: 5.5rem;
  min-height: 5.5rem;
  padding: 0.3rem;
  border-right: 1px solid rgba(180, 198, 230, 0.08);
  border-bottom: 0;
}

.exercise-picker-modal .exercise-add-button {
  top: auto;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 2.25rem;
  height: 2.25rem;
}

.exercise-picker-modal .exercise-browser-copy h3 {
  min-height: 0;
}

@media (min-width: 700px) {
  .exercise-picker-modal .exercise-controls .exercise-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-picker-modal .exercise-picker-section {
    display: contents;
  }

  .exercise-picker-modal .exercise-picker-section > h3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .workout-header .timer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Premium active-workout experience */
:root {
  --workout-bg: #071018;
  --workout-surface: #0b1721;
  --workout-surface-raised: #10212d;
  --workout-border: rgba(151, 191, 219, 0.18);
  --workout-blue: #45aef4;
  --workout-blue-soft: rgba(69, 174, 244, 0.14);
  --workout-green: #27c86a;
  --muscle-primary: #ff4136;
  --muscle-secondary: #ff792e;
}

.workout-active {
  background:
    radial-gradient(circle at 88% 10%, rgba(52, 142, 204, 0.1), transparent 20rem),
    linear-gradient(180deg, #08121a, #050c12 70%);
}

.workout-active .app-shell {
  width: min(100%, 620px);
  padding-right: max(clamp(0.45rem, 2.4vw, 0.8rem), env(safe-area-inset-right));
  padding-left: max(clamp(0.45rem, 2.4vw, 0.8rem), env(safe-area-inset-left));
}

.workout-header {
  top: max(0.2rem, env(safe-area-inset-top));
  gap: 0.35rem;
  margin: 0 -0.1rem 0.48rem;
  padding: 0.38rem;
  border-color: rgba(151, 191, 219, 0.14);
  border-radius: 14px;
  background: rgba(6, 14, 21, 0.93);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
}

.workout-header-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  width: 100%;
  gap: clamp(0.35rem, 1.6vw, 0.5rem);
  align-items: center;
  justify-self: stretch;
}

.workout-header-leading {
  display: flex;
  min-width: 0;
  gap: clamp(0.3rem, 1.3vw, 0.45rem);
  align-items: center;
  justify-self: start;
}

.workout-header .workout-back-button {
  display: grid;
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c8e5fa;
  font-size: 1.5rem;
}

.workout-wordmark {
  overflow: hidden;
  padding-right: 0.45rem;
  border-right: 1px solid rgba(151, 191, 219, 0.27);
  color: #f7f9fb;
  font-size: clamp(0.68rem, 3vw, 0.82rem);
  font-weight: 950;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-session-copy {
  width: 100%;
  min-width: 0;
  justify-self: center;
  text-align: center;
}

.workout-session-copy h1 {
  overflow: hidden;
  margin: 0;
  color: #dce9f5;
  font-size: clamp(0.68rem, 3.2vw, 0.82rem);
  font-weight: 780;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-session-copy h1:focus {
  outline: 0;
}

.workout-session-meta {
  display: flex;
  min-width: 0;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.workout-session-meta .eyebrow {
  margin: 0;
  color: #aebfd0;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.workout-session-meta .session-badge {
  padding: 0.12rem 0.32rem;
  border-radius: 6px;
  font-size: 0.48rem;
  letter-spacing: 0.03em;
}

.workout-header .timer-controls {
  gap: 0.25rem;
  justify-self: end;
}

.workout-header .timer-pill {
  gap: 0.28rem;
  padding: 0.25rem 0.34rem;
  border: 0;
  background: transparent;
  color: #c8dded;
  font-size: 0.61rem;
}

.workout-header .timer-pill .live-dot {
  width: 0.28rem;
  height: 0.28rem;
}

.workout-header .timer-value-wrap {
  gap: 0.06rem;
}

.workout-header .timer-value-wrap small {
  font-size: 0.36rem;
  letter-spacing: 0.1em;
}

.workout-header .timer-toggle {
  display: inline-grid;
  min-width: 2.45rem;
  min-height: 2.75rem;
  padding: 0 0.3rem;
  place-items: center;
  border-color: rgba(69, 174, 244, 0.38);
  border-radius: 999px;
  background: rgba(30, 91, 132, 0.16);
  color: #8ed0fb;
  font-size: 0.52rem;
  font-weight: 850;
}

.workout-header-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 0.32rem;
}

.workout-header-actions > button {
  min-height: 2.75rem;
  padding: 0 0.35rem;
  border-color: rgba(151, 191, 219, 0.13);
  border-radius: 8px;
  background: rgba(15, 31, 43, 0.72);
  color: #afc4d5;
  font-size: 0.56rem;
}

.workout-header-actions .finish-header-button {
  color: #89e5b1;
}

.rest-popover {
  padding: 0.5rem;
  background: rgba(8, 20, 29, 0.98);
}

.rest-toast,
.rest-toast.visible {
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(243, 174, 69, 0.24);
  background: rgba(33, 25, 12, 0.96);
}

.adaptation-notice {
  margin-bottom: 0.48rem;
}

.workout-list {
  gap: 0.58rem;
  scroll-margin-top: 6.4rem;
}

.active-exercise.premium-workout-card {
  overflow: hidden;
  border: 1px solid var(--workout-border);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(15, 33, 45, 0.98), rgba(7, 18, 26, 0.99));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.035);
}

.premium-workout-card .active-exercise-header {
  display: block;
  padding: 0.64rem;
  border-bottom: 1px solid var(--workout-border);
}

.current-exercise-line {
  display: flex;
  gap: 0.48rem;
  align-items: center;
  color: #9cafc0;
  font-size: 0.59rem;
  font-weight: 750;
}

.current-exercise-line .current-label {
  padding: 0.2rem 0.38rem;
  border: 1px solid rgba(69, 174, 244, 0.42);
  border-radius: 7px;
  background: rgba(69, 174, 244, 0.15);
  color: #68bcf3;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
}

.premium-workout-card .active-exercise-title h2 {
  margin: 0.38rem 0 0.36rem;
  color: #f8fafb;
  font-size: clamp(1.18rem, 6.25vw, 1.62rem);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1;
  text-transform: uppercase;
}

.exercise-meta-line {
  display: flex;
  min-width: 0;
  gap: 0.42rem;
  align-items: center;
}

.equipment-badge {
  display: inline-flex;
  min-height: 1.9rem;
  gap: 0.32rem;
  align-items: center;
  padding: 0.2rem 0.48rem;
  border: 1px solid rgba(126, 174, 207, 0.38);
  border-radius: 8px;
  background: rgba(14, 30, 42, 0.95);
  color: #bdd2e3;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.equipment-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.equipment-icon,
.utility-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.exercise-target {
  overflow: hidden;
  color: #9eb2c3;
  font-size: 0.58rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-workout-card .last-performance {
  display: flex;
  gap: 0.28rem;
  margin: 0.35rem 0 0;
  color: #8fa3b5;
  font-size: 0.55rem;
}

.premium-workout-card .last-performance span {
  color: #6fb9e7;
  font-size: inherit;
}

.exercise-hero-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(8.2rem, 0.9fr);
  height: clamp(10.2rem, 45vw, 13.25rem);
  gap: 0.48rem;
  margin-top: 0.55rem;
}

.media-frame {
  position: relative;
  overflow: hidden;
}

.media-frame > img {
  position: absolute;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
  object-position: center;
  transition: opacity 180ms ease;
}

.media-frame.is-loaded > img {
  opacity: 1;
}

.media-frame.is-loaded > .media-placeholder,
.media-frame.is-loaded > .muscle-map-fallback {
  visibility: hidden;
}

.exercise-photo-frame {
  min-width: 0;
  border: 1px solid rgba(151, 191, 219, 0.15);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 30%, rgba(69, 174, 244, 0.09), transparent 55%),
    #07121a;
}

.exercise-photo-frame > img {
  object-fit: cover;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 0.75rem;
  color: #87a1b5;
  text-align: center;
}

.media-placeholder-icon {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 0.5rem;
  place-items: center;
  border: 1px solid rgba(69, 174, 244, 0.3);
  border-radius: 12px;
  background: rgba(69, 174, 244, 0.09);
  color: #65baf2;
}

.media-placeholder-icon .equipment-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.media-placeholder strong {
  max-width: 10rem;
  color: #d7e2ea;
  font-size: 0.69rem;
  line-height: 1.2;
}

.media-placeholder small {
  margin-top: 0.16rem;
  color: #6f879a;
  font-size: 0.51rem;
}

.muscle-map-panel {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(151, 191, 219, 0.15);
  border-radius: 12px;
  background: rgba(5, 14, 21, 0.72);
}

.muscle-map-views {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem;
  padding: 0.26rem 0.2rem 0.18rem;
}

.muscle-view {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
}

.muscle-view > img {
  bottom: 0.8rem;
  height: calc(100% - 0.8rem);
}

.muscle-map-fallback {
  min-width: 0;
  min-height: 0;
}

.muscle-map-fallback .exercise-body-map {
  width: 100%;
  height: 100%;
  padding: 0.05rem;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.34));
}

.muscle-view figcaption {
  min-height: 0.8rem;
  color: #7e9ab0;
  font-size: 0.43rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.muscle-primary {
  fill: var(--muscle-primary);
}

.muscle-secondary {
  fill: var(--muscle-secondary);
}

.muscle-muted {
  fill: #27333d;
}

.muscle-summary {
  display: grid;
  margin: 0;
  padding: 0.32rem 0.42rem 0.4rem;
  border-top: 1px solid rgba(151, 191, 219, 0.14);
}

.muscle-summary div {
  min-width: 0;
}

.muscle-summary div + div {
  margin-top: 0.2rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(151, 191, 219, 0.1);
}

.muscle-summary dt {
  color: #64b8ef;
  font-size: 0.43rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.muscle-summary dd {
  overflow: hidden;
  margin: 0.02rem 0 0;
  color: #e1e8ed;
  font-size: 0.54rem;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-workout-card .completed-sets {
  display: grid;
  gap: 0.28rem;
  padding: 0.48rem 0.62rem 0;
}

.premium-workout-card .completed-set-row {
  display: flex;
  width: 100%;
  min-height: 2.4rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.62rem;
  border: 1px solid rgba(151, 191, 219, 0.17);
  border-radius: 9px;
  background: rgba(8, 19, 27, 0.7);
  color: #aac0d0;
  font-size: 0.63rem;
  font-weight: 720;
}

.premium-workout-card .completed-set-row i {
  padding: 0 0.16rem;
  color: #70899c;
  font-style: normal;
}

.premium-workout-card .completed-set-row strong {
  color: #bdebd0;
  font-size: 0.78rem;
}

.premium-workout-card .active-set-card {
  padding: 0.62rem;
  border-bottom: 1px solid var(--workout-border);
}

.premium-workout-card .current-set-heading {
  margin-bottom: 0.44rem;
}

.premium-workout-card .current-set-heading strong {
  color: #f0f5f8;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.premium-workout-card .active-set-inputs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 4vw, 1.6rem);
  row-gap: 0.75rem;
  align-items: end;
}

.premium-workout-card .active-set-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 0.2rem;
  color: #aebfd0;
  font-size: 0.53rem;
  letter-spacing: 0.035em;
  text-align: center;
}

.premium-workout-card .number-stepper,
.premium-workout-card .weight-stepper,
.premium-workout-card .reps-stepper {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(2.75rem, 3.25rem) minmax(3rem, 1fr) minmax(2.75rem, 3.25rem);
  gap: clamp(0.25rem, 1vw, 0.5rem);
  overflow: visible;
  border: 0;
  background: transparent;
}

.premium-workout-card .stepper-button {
  width: 100%;
  min-width: 2.75rem;
  min-height: clamp(3.25rem, 13vw, 3.625rem);
  border: 1px solid rgba(69, 174, 244, 0.62);
  border-radius: 11px;
  background: rgba(21, 51, 70, 0.66);
  color: #badcf3;
  font-size: 1.1rem;
}

.premium-workout-card .stepper-value {
  width: 100%;
  min-width: 0;
  height: clamp(3.25rem, 13vw, 3.625rem);
  padding: 0 0.22rem;
  background: transparent;
}

.premium-workout-card .stepper-value input {
  height: 100%;
  color: #ffffff;
  font-size: clamp(1.35rem, 7vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.premium-workout-card .stepper-unit {
  color: #9fb2c1;
  font-size: 0.52rem;
}

.premium-workout-card .weight-stepper .stepper-value {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  align-content: center;
  justify-items: stretch;
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
}

.premium-workout-card .weight-stepper .stepper-value input {
  align-self: end;
  line-height: 1;
}

.premium-workout-card .weight-stepper .stepper-unit {
  align-self: start;
  margin: -0.02rem 0 0;
  line-height: 1;
  text-align: center;
}

.premium-workout-card .primary-set-action {
  display: flex;
  min-height: 3rem;
  gap: 0.46rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  border-color: rgba(53, 227, 119, 0.72);
  border-radius: 11px;
  background: linear-gradient(135deg, #20ae5a, #248a49);
  box-shadow: 0 7px 18px rgba(27, 151, 78, 0.22), inset 0 1px rgba(255, 255, 255, 0.16);
  color: #f4fff8;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.premium-workout-card .primary-set-action:active {
  background: linear-gradient(135deg, #1d9a50, #207840);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.24);
  transform: translateY(1px);
}

.set-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.42rem;
}

.premium-workout-card .set-secondary-action {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  gap: 0.36rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 0.45rem;
  border: 1px solid rgba(126, 174, 207, 0.3);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(20, 43, 57, 0.9), rgba(12, 29, 40, 0.9));
  color: #c9dbe8;
  font-size: 0.64rem;
  font-weight: 800;
}

.premium-workout-card .set-secondary-action > span {
  color: #9bc9e8;
  font-size: 0.94rem;
}

.premium-workout-card .set-secondary-action:disabled {
  opacity: 0.4;
}

.premium-workout-card .exercise-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
  padding: 0.52rem 0.62rem;
  border-bottom: 1px solid var(--workout-border);
  background: transparent;
}

.premium-workout-card .exercise-nav-button {
  max-width: none;
  min-height: 2.85rem;
  border-color: rgba(126, 174, 207, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 43, 58, 0.92), rgba(11, 27, 38, 0.92));
  color: #d8e5ee;
  font-size: 0.7rem;
}

.premium-workout-card .exercise-nav-next {
  border-color: rgba(83, 190, 255, 0.78);
  background: linear-gradient(135deg, #3cacf3, #2385dc);
  box-shadow: 0 7px 17px rgba(35, 133, 220, 0.25), inset 0 1px rgba(255, 255, 255, 0.24);
  color: #f8fcff;
}

.premium-workout-card .exercise-nav-arrow {
  font-size: 1.25rem;
}

.premium-workout-card .exercise-nav-button:disabled {
  border-color: rgba(126, 174, 207, 0.14);
  background: rgba(12, 27, 38, 0.55);
  box-shadow: none;
  color: #708495;
}

.workout-utilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.5rem 0.62rem;
  border-bottom: 1px solid var(--workout-border);
}

.workout-utilities > button {
  display: grid;
  min-width: 0;
  min-height: 3.4rem;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem;
  border: 1px solid rgba(126, 174, 207, 0.22);
  border-radius: 10px;
  background: rgba(12, 29, 40, 0.7);
  color: #c0d4e3;
  text-align: left;
  cursor: pointer;
}

.workout-utilities > button:nth-child(2) {
  border-color: rgba(69, 174, 244, 0.36);
  background: rgba(22, 57, 78, 0.54);
}

.utility-icon {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  color: #79c4f4;
}

.workout-utilities strong,
.workout-utilities small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workout-utilities strong {
  color: #e2ebf1;
  font-size: 0.55rem;
  white-space: nowrap;
}

.workout-utilities small {
  margin-top: 0.08rem;
  color: #8da6b8;
  font-size: 0.44rem;
  line-height: 1.2;
}

.premium-workout-card .exercise-overflow {
  border-top: 0;
}

.premium-workout-card .exercise-overflow > summary {
  min-height: 2.75rem;
  padding: 0.36rem;
  color: #8297a8;
  font-size: 0.55rem;
}

.exercise-complete-panel {
  border-bottom: 1px solid var(--workout-border);
}

.up-next,
.completed-exercises {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.up-next-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.52rem 0.18rem 0.34rem;
  border: 0;
}

.up-next-heading h2 {
  margin: 0;
  color: #b9d8ed;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.up-next-heading span {
  color: #8ca9bd;
  font-size: 0.55rem;
}

.up-next-list,
.completed-exercises > div:last-child {
  display: grid;
  gap: 0.34rem;
}

.upcoming-exercise-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 4.75rem;
  grid-template-columns: 4.4rem minmax(0, 1fr) 3.55rem 0.8rem;
  gap: 0.44rem;
  align-items: center;
  padding: 0.3rem 0.5rem 0.3rem 0.3rem;
  overflow: hidden;
  border: 1px solid var(--workout-border);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(14, 31, 42, 0.94), rgba(8, 20, 29, 0.94));
  color: #dce7ee;
  text-align: left;
  cursor: pointer;
}

.exercise-photo-frame.is-compact {
  width: 4.4rem;
  height: 4.12rem;
  border-radius: 9px;
}

.exercise-photo-frame.is-compact .media-placeholder {
  padding: 0.25rem;
}

.exercise-photo-frame.is-compact .media-placeholder-icon {
  width: 2rem;
  height: 2rem;
  margin: 0;
  border-radius: 9px;
}

.exercise-photo-frame.is-compact .media-placeholder strong,
.exercise-photo-frame.is-compact .media-placeholder small {
  display: none;
}

.upcoming-exercise-copy {
  min-width: 0;
}

.upcoming-exercise-copy strong,
.upcoming-exercise-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-exercise-copy strong {
  color: #edf3f7;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}

.upcoming-exercise-copy strong i {
  margin-right: 0.2rem;
  color: #8fb8d4;
  font-style: normal;
}

.upcoming-exercise-copy small {
  margin-top: 0.22rem;
  color: #8eabc0;
  font-size: 0.55rem;
  white-space: nowrap;
}

.muscle-map-panel.is-compact {
  display: block;
  height: 3.8rem;
  overflow: visible;
  border: 0;
  background: transparent;
}

.muscle-map-panel.is-compact .muscle-map-views {
  height: 100%;
  padding: 0;
}

.muscle-map-panel.is-compact .muscle-view figcaption {
  display: none;
}

.muscle-map-panel.is-compact .muscle-view > img {
  bottom: 0;
  height: 100%;
}

.upcoming-chevron {
  color: #9fc7e2;
  font-size: 1.4rem;
}

.completed-exercises {
  margin-top: 0.2rem;
}

.completed-exercise-row {
  display: grid;
  width: 100%;
  min-height: 4rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.48rem 0.75rem;
  border: 1px solid rgba(49, 176, 103, 0.23);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(22, 72, 50, 0.22), rgba(8, 26, 26, 0.72));
  color: #a9c2b6;
  text-align: left;
}

.completed-exercise-check {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: #26c76a;
  color: #062313;
  font-weight: 950;
}

.completed-exercise-row strong,
.completed-exercise-row small {
  display: block;
}

.completed-exercise-row strong {
  color: #dcebe3;
  font-size: 0.7rem;
}

.completed-exercise-row small {
  margin-top: 0.12rem;
  color: #85aa98;
  font-size: 0.55rem;
}

@media (max-width: 390px) {
  .workout-header-topline {
    gap: 0.34rem;
  }

  .workout-header-leading {
    gap: 0.25rem;
  }

  .workout-wordmark {
    padding-right: 0.28rem;
    font-size: 0.62rem;
  }

  .exercise-hero-visuals {
    grid-template-columns: minmax(0, 1.2fr) minmax(7.55rem, 0.88fr);
  }

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

  .workout-utilities > button {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .upcoming-exercise-row {
    grid-template-columns: 4rem minmax(0, 1fr) 3.15rem 0.7rem;
    gap: 0.35rem;
  }

  .exercise-photo-frame.is-compact {
    width: 4rem;
  }

  .premium-workout-card .stepper-value input {
    font-size: clamp(1.2rem, 5.7vw, 1.55rem);
  }
}

@media (max-width: 350px) {
  .workout-wordmark {
    display: none;
  }

  .workout-header-topline {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .premium-workout-card .active-set-inputs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .premium-workout-card .number-stepper,
  .premium-workout-card .weight-stepper,
  .premium-workout-card .reps-stepper {
    grid-template-columns: minmax(2.5rem, 3.05rem) minmax(4.375rem, 1fr) minmax(2.5rem, 3.05rem);
  }

  .premium-workout-card .stepper-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .media-frame > img {
    transition: none;
  }
}

/* Image-led swap picker */
.swap-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 40rem);
  max-height: min(92vh, 48rem);
  height: min(88dvh, 48rem);
  padding: clamp(0.8rem, 2.5vw, 1.2rem);
  overflow: hidden;
}

.swap-modal h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.2rem, 4.8vw, 1.55rem);
}

.swap-modal .swap-search-label {
  margin-top: 0;
}

.swap-modal .exercise-search {
  height: 3rem;
  margin-bottom: 0.45rem;
  border-radius: 13px;
}

.swap-filter-row {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding-bottom: 0.2rem;
  overflow: visible;
  background: rgba(10, 17, 28, 0.92);
  backdrop-filter: blur(8px);
}

.swap-filter-row button {
  min-height: 2.35rem;
  padding: 0.4rem 0.62rem;
  border-color: rgba(156, 173, 255, 0.18);
  font-size: 0.58rem;
  white-space: nowrap;
}

.swap-filter-row .swap-more-filter-button {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  border-color: rgba(180, 198, 230, 0.12);
  color: var(--muted);
}

.swap-secondary-filters:not([hidden]) {
  display: contents;
}

.swap-result-count {
  margin: 0.32rem 0 0.4rem !important;
  font-size: 0.6rem !important;
}

.swap-choice-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 0;
  background: transparent;
}

.swap-result-section h3 {
  display: none;
}

.swap-exercise-card.is-featured {
  grid-template-columns: minmax(8.5rem, 1.15fr) minmax(0, 1fr) auto;
  min-height: clamp(9.3rem, 31vw, 12rem);
  margin: 0;
  padding: 0.62rem;
  border-color: rgba(156, 173, 255, 0.58);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(83, 75, 188, 0.36), rgba(19, 31, 59, 0.92));
  box-shadow: 0 10px 30px rgba(54, 49, 157, 0.2), inset 0 1px rgba(255, 255, 255, 0.1);
}

.swap-card-label {
  top: 0.6rem;
  left: 0.7rem;
  z-index: 1;
  padding: 0.24rem 0.4rem;
  border: 1px solid rgba(211, 213, 255, 0.25);
  border-radius: 999px;
  background: rgba(8, 12, 30, 0.62);
  font-size: 0.5rem;
}

.swap-exercise-visual {
  width: 100%;
  height: 100%;
  min-height: 6.2rem;
  border: 0;
  border-radius: 12px;
  background: rgba(4, 8, 18, 0.5);
}

.swap-exercise-visual .exercise-photo-frame {
  width: 100%;
  height: 100%;
  border-color: rgba(160, 180, 255, 0.12);
  border-radius: 12px;
}

.swap-exercise-visual .media-placeholder {
  padding: 0.45rem;
}

.swap-exercise-visual .media-placeholder-icon {
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 0.25rem;
}

.swap-exercise-visual .media-placeholder strong {
  display: none;
}

.swap-exercise-visual .media-placeholder small {
  display: none;
}

.swap-exercise-visual .media-frame > img {
  opacity: 1;
}

.swap-exercise-card .swap-exercise-copy {
  align-self: center;
}

.swap-exercise-card strong {
  font-size: clamp(0.72rem, 2.7vw, 0.92rem);
}

.swap-exercise-card small {
  font-size: 0.58rem;
}

.swap-alternatives-heading {
  display: block !important;
  padding: 0.7rem 0 0.38rem !important;
  border: 0 !important;
  color: var(--muted) !important;
  font-size: 0.55rem !important;
}

.swap-alternatives-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.35rem, 2vw, 0.65rem);
  padding: 0;
}

.swap-alternatives-grid .swap-exercise-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 5.1rem auto;
  gap: 0.35rem;
  min-height: 8.5rem;
  padding: 0.35rem;
  border-radius: 13px;
  background: rgba(14, 23, 42, 0.82);
}

.swap-alternatives-grid .swap-exercise-visual {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 0;
  height: 5.1rem;
}

.swap-alternatives-grid .swap-exercise-copy {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.swap-alternatives-grid .swap-exercise-chevron {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.swap-alternatives-grid .swap-exercise-card strong {
  font-size: 0.64rem;
}

.swap-alternatives-grid .swap-exercise-card small {
  margin-top: 0.1rem;
  font-size: 0.5rem;
}

.swap-modal-actions {
  justify-content: center;
  margin-top: 0.65rem;
}

.swap-modal-actions .secondary-button {
  display: none;
}

.swap-modal-actions .text-button {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid rgba(156, 173, 255, 0.28);
  border-radius: 12px;
  background: rgba(124, 147, 255, 0.1);
}

@media (max-width: 380px) {
  .swap-modal {
    padding: 0.7rem;
  }

  .swap-modal .exercise-search {
    height: 2.7rem;
  }

  .swap-filter-row button {
    min-height: 2.1rem;
    padding-inline: 0.5rem;
  }

  .swap-alternatives-grid .swap-exercise-card {
    height: 8rem;
    min-height: 0;
    align-content: start;
    grid-template-rows: 4.6rem 2.7rem;
  }

  .swap-exercise-card.is-featured {
    grid-template-columns: minmax(7.2rem, 1fr) minmax(0, 1fr) auto;
  }

  .swap-alternatives-grid .swap-exercise-card {
    grid-template-rows: 4.6rem auto;
    min-height: 8rem;
  }

  .swap-alternatives-grid .swap-exercise-visual {
    height: 4.6rem;
  }
}

/* Tap-first swap browsing */
.swap-search-panel[hidden] {
  display: none;
}

.swap-search-panel {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(156, 173, 255, 0.22);
  border-radius: 13px;
  background: rgba(12, 20, 39, 0.92);
  backdrop-filter: blur(8px);
}

.swap-search-panel .swap-search-label {
  margin: 0;
}

.swap-search-panel .exercise-search {
  height: 2.75rem;
  margin: 0;
}

.swap-search-close {
  min-height: 2.35rem;
  justify-self: start;
  padding: 0 0.55rem;
  color: var(--muted);
  font-size: 0.58rem;
}

.swap-search-quick-row {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 0.5rem;
  padding-top: 0.25rem;
  background: linear-gradient(180deg, rgba(9, 15, 25, 0), rgba(9, 15, 25, 0.92) 22%);
}

.swap-search-trigger {
  display: flex;
  width: 100%;
  min-height: 2.9rem;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  border: 1px solid rgba(180, 198, 230, 0.14);
  border-radius: 12px;
  background: rgba(14, 23, 42, 0.62);
  color: var(--muted);
  font-size: 0.6rem;
  cursor: pointer;
}

.swap-search-trigger strong {
  color: #dce2ff;
  font-size: inherit;
}

.swap-search-trigger:hover,
.swap-search-trigger:focus-visible {
  border-color: rgba(156, 173, 255, 0.5);
  background: rgba(124, 147, 255, 0.12);
  color: #ffffff;
}

.swap-browse-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.swap-browse-results .swap-exercise-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 5.8rem auto;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 0.35rem;
  border: 1px solid rgba(180, 198, 230, 0.12);
  border-radius: 13px;
  background: rgba(14, 23, 42, 0.82);
}

.swap-browse-results .swap-exercise-visual {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  height: 5.8rem;
  min-height: 0;
}

.swap-browse-results .swap-exercise-copy {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.swap-browse-results .swap-exercise-chevron {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.swap-browse-results .swap-exercise-card strong {
  font-size: 0.64rem;
}

.swap-browse-results .swap-exercise-card small {
  margin-top: 0.1rem;
  font-size: 0.5rem;
}

.swap-browse-results .exercise-photo-frame {
  width: 100%;
  height: 100%;
}

.swap-browse-results + .swap-search-trigger {
  grid-column: 1 / -1;
}

@media (max-width: 380px) {
  .swap-browse-results {
    gap: 0.35rem;
  }

  .swap-browse-results .swap-exercise-card {
    grid-template-rows: 4.7rem auto;
    min-height: 8rem;
  }

  .swap-browse-results .swap-exercise-visual {
    height: 4.7rem;
  }
}
