/* ==========================================================================
   TODAY'S SWIM WORKOUT - MOBILE PHONE APP STYLESHEET WITH PROGRESSION & SUPERSETS
   ========================================================================== */

:root {
  --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-heading: 'Outfit', sans-serif;

  /* TYPE SCALE: every font-size in the app uses one of these (12px is the floor). */
  --fs-xs: 0.75rem;   /* 12px: labels, captions, badges */
  --fs-sm: 0.875rem;   /* 14px: secondary text, small buttons */
  --fs-md: 1rem;      /* 16px: body text, buttons */
  --fs-lg: 1.25rem;   /* 20px: card and section titles */
  --fs-xl: 1.5rem;    /* 24px: screen titles */
  --fs-2xl: 2rem;     /* 32px: big numbers */
  --fs-display: 3.5rem; /* 56px: celebration emoji */
  --fs-timer: 5.5rem; /* 88px: guided countdown */

  /* COLOUR PALETTE. Colours that are also used see-through have an --rgb-* twin:
     use rgba(var(--rgb-cyan), 0.15) for a tint. */
  --rgb-bg: 5, 10, 23;
  --rgb-surface-1: 10, 20, 44;
  --rgb-surface-2: 15, 29, 56;
  --rgb-white: 255, 255, 255;
  --rgb-black: 0, 0, 0;
  --rgb-cyan: 0, 242, 254;
  --rgb-sky: 59, 158, 255;
  --rgb-green: 16, 185, 129;
  --rgb-amber: 245, 158, 11;
  --rgb-gold: 255, 215, 0;
  --rgb-orange: 249, 115, 22;
  --rgb-red: 239, 68, 68;
  --rgb-purple: 168, 85, 247;

  --color-bg: rgb(var(--rgb-bg));
  --color-surface-1: rgb(var(--rgb-surface-1));
  --color-surface-2: rgb(var(--rgb-surface-2));
  --color-white: rgb(var(--rgb-white));
  --color-black: rgb(var(--rgb-black));
  --color-cyan: rgb(var(--rgb-cyan));
  --color-sky: rgb(var(--rgb-sky));
  --color-green: rgb(var(--rgb-green));
  --color-amber: rgb(var(--rgb-amber));
  --color-gold: rgb(var(--rgb-gold));
  --color-orange: rgb(var(--rgb-orange));
  --color-red: rgb(var(--rgb-red));
  --color-purple: rgb(var(--rgb-purple));

  --color-bg-raised: #081024;
  --color-surface-3: #1E3A5F;
  --color-on-accent: #04121F;
  --color-text: #F8FAFC;
  --color-text-soft: #CBD5E1;
  --color-text-2: #94A3B8;
  --color-text-3: #64748B;
  --color-grey-600: #4B5563;
  --color-grey-700: #374151;
  --color-cyan-600: #0891B2;
  --color-teal-900: #164E63;
  --color-blue: #2563EB;
  --color-sky-light: #60A5FA;
  --color-sky-pale: #DBEAFE;
  --color-green-light: #34D399;
  --color-green-bright: #22C55E;
  --color-green-600: #059669;
  --color-green-700: #047857;
  --color-amber-light: #FBBF24;
  --color-amber-600: #D97706;
  --color-amber-700: #B45309;
  --color-yellow: #EAB308;
  --color-lime: #84CC16;
  --color-gold-light: #FFE680;
  --color-gold-pale: #FFF7D6;
  --color-orange-light: #FB923C;
  --color-bronze: #D08A52;
  --color-red-light: #F87171;
  --color-red-pale: #FECACA;
  --color-red-dark: #3B1219;
  --color-purple-light: #C084FC;
  --color-purple-pale: #F3E8FF;
  --color-pink: #F472B6;

  /* Semantic roles */
  --color-card: rgba(var(--rgb-surface-2), 0.85);
  --color-border: rgba(var(--rgb-white), 0.08);
  --color-border-accent: rgba(var(--rgb-cyan), 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Form controls use the app's fonts (browsers otherwise fall back to Arial / system UI).
   Rules below that set their own size or family still win. */
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.text-purple { color: var(--color-purple); }

.warmup-card {
  border-color: rgba(var(--rgb-purple), 0.4);
}

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-2);
  font-family: var(--font-family-heading);
}

.test-mode-banner {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--color-amber);
  color: var(--color-on-accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.3px;
}

.test-mode-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.test-mode-banner-actions button {
  border: 1px solid rgba(var(--rgb-black), 0.3);
  background: rgba(var(--rgb-black), 0.1);
  color: var(--color-on-accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.test-mode-banner-actions button:hover {
  background: rgba(var(--rgb-black), 0.2);
}

/* ==========================================================================
   PHONE CONTAINER WRAPPER
   ========================================================================== */

.phone-wrapper {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 0;
}

@media (max-width: 480px) {
  .phone-wrapper {
    padding: 0;
    max-width: 100%;
  }
}

.phone-container {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(var(--rgb-black), 0.6);
}

@media (max-width: 480px) {
  .phone-container {
    border-radius: 0;
    border: none;
    min-height: 100vh;
  }
}

.phone-content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   HEADER (PHONE TOP BAR)
   ========================================================================== */

.app-header {
  background: rgba(var(--rgb-surface-1), 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 30px;
  width: auto;
}

.brand-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-sm);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--color-cyan);
  text-transform: uppercase;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-md);
  line-height: 1;
}

.streak-count {
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--color-amber);
}

/* ==========================================================================
   PROFILE SELECTOR & AVATARS
   ========================================================================== */

.profile-selector-container {
  position: relative;
}

.profile-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--rgb-white), 0.06);
  border: 1px solid var(--color-border);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
}

/* Pixel avatar (ui/avatar/): a transparent PNG on its own colour tile. */
.avatar-img {
  display: block;
  flex: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.avatar-img.is-pixelated {
  image-rendering: pixelated;
}
.avatar-round {
  border-radius: 50%;
}

.profile-trigger-name {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: var(--fs-xs);
}

/* Phones: the header is avatar-only so the logo, counters and buttons all fit on one row. */
@media (max-width: 440px) {
  .profile-trigger-name,
  .profile-trigger-btn .chevron-icon {
    display: none;
  }
  .profile-trigger-btn {
    padding: 3px;
  }
}

.chevron-icon {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 220px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(var(--rgb-black), 0.6);
  padding: 10px;
  z-index: 100;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.profile-item:hover {
  background: rgba(var(--rgb-white), 0.06);
}

.profile-item.active {
  background: rgba(var(--rgb-cyan), 0.12);
}

/* ==========================================================================
   ONBOARDING STARTUP WIZARD WITH BASELINE CALIBRATION
   ========================================================================== */

.onboarding-overlay {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.onboarding-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 20px 50px rgba(var(--rgb-black), 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-card.onboarding-card-lg {
  max-width: 440px;
  padding: 20px 16px;
}

.onboarding-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.onboarding-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
}

.onboarding-desc {
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  line-height: 1.35;
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-2);
}

.form-group input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--color-text);
  font-size: var(--fs-sm);
  outline: none;
}

.form-group input:focus {
  border-color: var(--color-cyan);
}

.onboarding-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--color-cyan);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-on-accent);
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: var(--fs-sm);
  cursor: pointer;
  margin-top: 6px;
}

/* Baseline Calibration List */
.baseline-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.baseline-scroll-area {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.baseline-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.baseline-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(var(--rgb-cyan), 0.2);
  border-radius: 4px;
}

.baseline-category-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(var(--rgb-surface-2), 0.4);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.baseline-cat-header {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.baseline-exercise-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--rgb-white), 0.05);
}

.baseline-exercise-row:last-child {
  border-bottom: none;
}

.baseline-info {
  display: flex;
  flex-direction: column;
}

.baseline-name {
  font-size: var(--fs-xs);
  font-weight: 600;
}

.baseline-equip {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.baseline-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.baseline-controls .stepper-wrap { flex: 1; min-width: 0; }
.baseline-controls .stepper { width: 100%; }
.baseline-controls .stepper-val { flex: 1; min-width: 0; }

.stepper-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stepper-label {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-text-3);
  letter-spacing: 0.5px;
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}

.stepper-btn {
  background: rgba(var(--rgb-white), 0.06);
  border: none;
  color: var(--color-text);
  width: 44px;
  height: 44px;
  flex: none;
  font-weight: 800;
  font-size: var(--fs-lg, 20px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover {
  background: var(--color-cyan);
  color: var(--color-on-accent);
}

.stepper-val {
  min-width: 38px;
  text-align: center;
  font-size: var(--fs-sm, 14px);
  font-weight: 700;
  color: var(--color-cyan);
  padding: 0 4px;
}

.baseline-submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--rgb-black), 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 360px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-3);
  font-size: var(--fs-md);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.cancel-btn, .submit-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.cancel-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
}

.submit-btn {
  background: var(--color-cyan);
  border: none;
  color: var(--color-on-accent);
  font-weight: 700;
}

.end-confirm-card {
  text-align: center;
}

.end-confirm-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 8px 0;
}

.end-confirm-text {
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  line-height: 1.4;
  margin: 0 0 16px 0;
}

.end-confirm-actions {
  justify-content: center;
}

.end-confirm-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  background: rgba(var(--rgb-red), 0.15);
  border: 1px solid rgba(var(--rgb-red), 0.4);
  color: var(--color-red);
}

/* ==========================================================================
   SUPERSETS ROUTINE & CONTAINERS
   ========================================================================== */

.today-workout-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.section-title {
  white-space: nowrap;
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
}

/* LABELLED ACTIONS beside "Today's Workout" (mark done / bodyweight / shuffle).
   Each is an icon circle with a visible label under it; the whole column is the
   tap target (at least 44px tall). */
.title-bar-actions {
  /* fixed-pitch columns: icon circles (and the gaps between them) are evenly
     spaced; labels are centred under each icon and may exceed the column. */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62px;
  align-items: flex-start;
  gap: 0;
  flex-shrink: 0;
}

.title-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-cyan);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.title-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-cyan), 0.1);
  border: 1px solid var(--color-border-accent);
  transition: background 0.2s ease;
}

.title-action-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text-2);
  white-space: nowrap;
}

@media (hover: hover) {
  .title-action:hover .title-action-icon { background: rgba(var(--rgb-cyan), 0.2); }
}

.title-action:focus-visible {
  outline: none;
}
.title-action:focus-visible .title-action-icon {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}

.title-action.active .title-action-icon {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: var(--color-bg);
}
.title-action.active .title-action-label {
  color: var(--color-cyan);
}

.title-action:disabled {
  cursor: not-allowed;
}
.title-action:disabled .title-action-icon {
  opacity: 0.45;
  filter: grayscale(1);
  background: rgba(var(--rgb-white), 0.06);
  border-color: var(--color-border);
  color: var(--color-text-3);
}
.title-action:disabled .title-action-label {
  color: var(--color-text-3);
}

/* REST DAY CARD */
.rest-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 40px 20px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.rest-day-emoji {
  font-size: var(--fs-2xl);
}

.rest-day-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: 1px;
}

.rest-day-sub {
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  max-width: 320px;
  line-height: 1.4;
}

.completion-banner {
  background: rgba(var(--rgb-green), 0.15);
  border: 1px solid rgba(var(--rgb-green), 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
}

.banner-text {
  display: flex;
  flex-direction: column;
}

.undo-btn {
  background: transparent;
  border: 1px solid rgba(var(--rgb-white), 0.2);
  border-radius: 4px;
  color: var(--color-text);
  font-size: var(--fs-xs);
  padding: 4px 8px;
  cursor: pointer;
}

/* SUPERSET CONTAINER CARD */
.supersets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.superset-container-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(var(--rgb-black), 0.3);
}

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

.superset-title-wrap {
  display: flex;
  flex-direction: column;
}

.superset-tag {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-cyan);
  letter-spacing: 0.5px;
}

.superset-subtitle {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

/* Workout types: the block's rhythm, the day's type strip, reps hints on exercise rows */
.superset-rhythm {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.workout-type-strip {
  position: relative; /* anchors the ? help bubble */
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-white), 0.04);
  border: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--color-text-3);
}

.workout-type-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text);
}

.exercise-card-header .exercise-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-row-minute,
.exercise-row-reps {
  flex: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-3);
  white-space: nowrap;
}

.scheme-note {
  margin-top: 6px;
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--color-text-3);
}

.pool-iso-note {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.superset-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.superset-exercise-item {
  background: rgba(var(--rgb-surface-1), 0.7);
  border-left: 3px solid var(--color-cyan);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.superset-exercise-item:hover {
  background: rgba(var(--rgb-surface-2), 0.9);
}

/* COLLAPSED EXERCISE ROW (home page default) — overrides the card's default
   flex-column/padding since this rule comes after it in the cascade. */
.exercise-row-name {
  flex: 1;
  font-family: var(--font-family-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text);
}

.exercise-row-chevron {
  color: var(--color-text-3);
  font-size: var(--fs-md);
}

.item-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 4px;
}

.expandable-details-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--color-border);
  padding-top: 8px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.category-badge {
  padding: 2px 6px;
  border-radius: var(--radius-full);
  color: var(--color-white);
  font-weight: 800;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.equipment-tag {
  margin-left: auto;
  min-width: 0;
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  text-align: right;
}

/* SETS, WEIGHT, AND REPS LOGGING BAR
   Weight and reps sit in two even columns. Every stepper button is 44px so it can be
   hit reliably mid-workout. */
.exercise-tracker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 8px 10px;
  background: rgba(var(--rgb-white), 0.04);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.sets-pill {
  grid-column: 1 / -1;
  justify-self: start;
  font-size: var(--fs-xs);
  font-weight: 800;
  background: rgba(var(--rgb-cyan), 0.15);
  color: var(--color-cyan);
  padding: 2px 8px;
  border-radius: 4px;
}

.stepper-unit {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.unit-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-2);
}

/* No weight to set (only reps or time): that one stepper spans the full width */
.sets-pill + .stepper-unit:last-child {
  grid-column: 1 / -1;
}

.mini-stepper {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mini-stepper.is-static {
  justify-content: center;
}

.step-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(var(--rgb-white), 0.06);
  border: none;
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.step-btn:active {
  background: var(--color-cyan);
  color: var(--color-on-accent);
}

@media (hover: hover) {
  .step-btn:hover {
    background: rgba(var(--rgb-cyan), 0.18);
    color: var(--color-cyan);
  }
}

.step-btn:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: -2px;
}

.step-text {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 4px;
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* SCIENCE PROGRESSION RATIONALE BOX */
.science-rationale-box {
  background: rgba(var(--rgb-cyan), 0.05);
  border: 1px solid rgba(var(--rgb-cyan), 0.2);
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.science-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.science-tag {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-cyan);
  letter-spacing: 0.5px;
}

.status-pill {
  white-space: nowrap;
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.status-pill.active {
  background: rgba(var(--rgb-green), 0.2);
  color: var(--color-green);
}

.status-pill.new {
  background: var(--color-border);
  color: var(--color-text-3);
}

.status-pill.paused {
  background: rgba(var(--rgb-red), 0.2);
  color: var(--color-red);
}

.science-text {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.3;
}

.sport-benefit-box {
  background: rgba(var(--rgb-white), 0.03);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  line-height: 1.3;
}

.benefit-header {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-cyan);
}

.benefit-text {
  color: var(--color-text-2);
}


/* PROMINENT WORKOUT COMPLETED BUTTON */
/* ==========================================================================
   GUIDED WORKOUT MODE & HIGHLIGHTING
   ========================================================================== */

.superset-exercise-item.active-guided {
  border-left: 4px solid var(--color-cyan);
  box-shadow: 0 0 15px rgba(var(--rgb-cyan), 0.4);
  background: rgba(var(--rgb-cyan), 0.12) !important;
  opacity: 1 !important;
  filter: none !important;
  transform: scale(1.01);
  transition: all 0.3s ease;
}

.superset-exercise-item.dimmed-guided {
  opacity: 0.35 !important;
  filter: grayscale(70%) !important;
  transition: all 0.3s ease;
}

.superset-container-card.dimmed-guided {
  opacity: 0.4 !important;
  filter: grayscale(60%) !important;
  transition: all 0.3s ease;
}

.superset-container-card.active-guided {
  border-color: var(--color-cyan);
  box-shadow: 0 0 20px rgba(var(--rgb-cyan), 0.25);
  transition: all 0.3s ease;
}

/* FULL-SCREEN GUIDED WORKOUT
   Covers the whole viewport while active. Background color is the primary
   at-a-glance signal (green = work, orange = rest); everything else stays
   small and out of the way so the countdown is the one thing you have to
   read mid-set. */
.guided-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 0px), 18px) 18px max(env(safe-area-inset-bottom, 0px), 28px);
  transition: background-color 0.35s ease;
  color: var(--color-white);
}

.guided-fullscreen.mode-work {
  background: linear-gradient(160deg, var(--color-green-600) 0%, var(--color-green-700) 100%);
}

.guided-fullscreen.mode-rest {
  background: linear-gradient(160deg, var(--color-amber-600) 0%, var(--color-amber-700) 100%);
}

.guided-fullscreen.mode-complete {
  background: linear-gradient(160deg, var(--color-cyan-600) 0%, var(--color-teal-900) 100%);
  align-items: center;
  justify-content: center;
}

/* Paused: dim everything with a scrim rather than a third background color,
   so "paused" reads as an overlay state, not a different step type. */
.guided-fullscreen.is-paused::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--rgb-black), 0.45);
  pointer-events: none;
}

.guided-fs-topline {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.3px;
  opacity: 0.9;
}

.guided-fs-center {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.guided-fs-current-label {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(var(--rgb-black), 0.25);
}

.guided-fs-current-detail {
  font-size: var(--fs-md);
  font-weight: 700;
  opacity: 0.9;
  margin-top: -6px;
}

.guided-fs-countdown {
  font-family: var(--font-family-heading);
  font-size: var(--fs-timer);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 24px rgba(var(--rgb-black), 0.3);
}

.guided-fs-timerbar {
  width: min(78%, 300px);
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-black), 0.28);
  overflow: hidden;
}

.guided-fs-timerbar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.92);
  transition: width 1s linear;
}

.guided-fs-paused-badge {
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(var(--rgb-black), 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.guided-fs-next-line {
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0.85;
}

.guided-fs-controls {
  position: relative;
  width: 100%;
  display: flex;
  gap: 14px;
}

.guided-fs-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 6px;
  border-radius: 22px;
  font-family: var(--font-family-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(var(--rgb-white), 0.3);
  background: rgba(var(--rgb-black), 0.2);
  color: var(--color-white);
  transition: background 0.15s ease, transform 0.1s ease;
}

.guided-fs-btn:active {
  transform: scale(0.95);
  background: rgba(var(--rgb-black), 0.35);
}

.guided-fs-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.guided-fs-btn:disabled:active {
  transform: none;
}

.guided-fs-btn.primary {
  background: rgba(var(--rgb-white), 0.92);
  color: var(--color-on-accent);
  border-color: transparent;
}

.guided-fs-btn.primary:active {
  background: rgba(var(--rgb-white), 0.75);
}

.guided-fs-btn.danger {
  background: rgba(var(--rgb-black), 0.35);
  border-color: rgba(var(--rgb-white), 0.3);
  color: var(--color-red-pale);
}

.guided-fs-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}

.guided-fs-complete-emoji {
  font-size: var(--fs-display);
}

.guided-fs-complete-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xl);
  font-weight: 900;
}

.guided-fs-complete-sub {
  font-size: var(--fs-sm);
  opacity: 0.9;
  max-width: 280px;
}

.guided-fs-done-btn {
  margin-top: 14px;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(var(--rgb-white), 0.95);
  color: var(--color-teal-900);
  font-weight: 800;
  font-size: var(--fs-sm);
  cursor: pointer;
}

/* Calibration prompt (after a calibration set): big answers near the bottom, in thumb reach */
.cal-prompt {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  text-align: center;
}

.cal-prompt .guided-fs-current-detail {
  margin: 0 0 6px;
}

.cal-rate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-rate-btn,
.cal-save-btn,
.cal-prompt-back {
  flex: none;
  min-height: 56px;
}

.cal-rate-btn {
  flex-direction: column;
  gap: 2px;
}

.cal-rate-label {
  font-size: var(--fs-md);
}

.cal-rate-hint {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}

.cal-prompt-back {
  min-height: 44px;
  background: transparent;
  border-color: transparent;
}

.cal-reps-stepper {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.cal-reps-stepper .guided-fs-btn {
  flex: 0 0 72px;
  min-height: 64px;
  font-size: var(--fs-xl);
}

.cal-reps-stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-family-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  border-radius: 22px;
  border: 1px solid rgba(var(--rgb-white), 0.3);
  background: rgba(var(--rgb-black), 0.2);
  color: var(--color-white);
}

/* Calibration on the home screen: read-only sets and result (answered in the guided workout) */
.cal-log {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--fs-sm);
}

.cal-log-done {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-3);
  font-size: var(--fs-xs);
}

.cal-log-result {
  font-weight: 700;
  color: var(--color-text);
}

.superset-exercise-item.next-up-guided {
  border-left: 3px dashed var(--color-cyan) !important;
  opacity: 0.85 !important;
  filter: none !important;
  transition: all 0.3s ease;
}

/* COLLAPSED / COMPLETED SUPERSET STATE (guided mode) */
.superset-container-card.is-collapsed-guided {
  border-color: rgba(var(--rgb-green), 0.4);
  background: rgba(var(--rgb-green), 0.05);
}

.superset-complete-chip {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-green);
  background: rgba(var(--rgb-green), 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(var(--rgb-green), 0.35);
  white-space: nowrap;
}

.start-workout-big-btn {
  width: 100%;
  padding: 11px;
  background: var(--color-cyan);
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-on-accent);
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(var(--rgb-cyan), 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease;
}

.start-workout-big-btn:hover {
  transform: translateY(-2px);
}

/* ==========================================================================
   EXERCISE PROGRESS: gold 3-step bar, stars, crowns, streak celebration
   ========================================================================== */

.exercise-row-name {
  transition: color 0.6s ease;
}

.xp-badges {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: 6px;
  vertical-align: middle;
}

.xp-star,
.xp-crown {
  display: inline-block;
  line-height: 1;
}

.xp-star {
  color: var(--color-gold);
  font-size: var(--fs-xs);
  text-shadow: 0 0 4px rgba(var(--rgb-gold), 0.5);
}

.xp-crown {
  font-size: var(--fs-sm);
  margin-right: 2px;
}

@keyframes xpStarPop {
  0%   { transform: scale(0) rotate(-120deg); opacity: 0; }
  55%  { transform: scale(2) rotate(15deg); opacity: 1; text-shadow: 0 0 12px var(--color-gold); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes xpCrownDrop {
  0%   { transform: translateY(-16px) scale(0) rotate(-20deg); opacity: 0; }
  60%  { transform: translateY(2px) scale(1.8) rotate(8deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

/* Streak counter celebration */
.streak-badge {
  position: relative;
}

.streak-flame {
  display: inline-block;
  transform-origin: 50% 80%;
}

.streak-celebrating .streak-flame {
  animation: streakFlameBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes streakFlameBounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.9) rotate(-12deg); filter: drop-shadow(0 0 8px var(--color-amber)); }
  55%  { transform: scale(1.3) rotate(8deg); }
  100% { transform: scale(1) rotate(0); filter: none; }
}

.streak-count-wrap {
  position: relative;
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
}

.streak-celebrating .streak-count-wrap {
  animation: streakCountPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes streakCountPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.6); }
  100% { transform: scale(1); }
}

.streak-sizer {
  visibility: hidden;
}

.streak-roll-out,
.streak-roll-in {
  position: absolute;
  left: 0;
  top: 0;
}

.streak-roll-out {
  animation: streakRollOut 0.5s ease-in forwards;
}

.streak-roll-in {
  animation: streakRollIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes streakRollOut {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-110%); opacity: 0; }
}

@keyframes streakRollIn {
  0%   { transform: translateY(110%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.streak-spark {
  position: absolute;
  left: 9px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-gold-light);
  pointer-events: none;
  animation: streakSparkFly 0.85s ease-out forwards;
}

@keyframes streakSparkFly {
  0%   { transform: translate(0, 0) scale(1.3); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .prog-seg-fill,
  .prog-ring,
  .star-progress,
  .xp-star,
  .xp-crown,
  .streak-flame,
  .streak-count-wrap,
  .streak-roll-out,
  .streak-roll-in,
  .streak-spark {
    animation: none !important;
    transition: none !important;
  }
  .streak-roll-out { display: none; }
}

/* ==========================================================================
   6-MONTH WORKOUT HEATMAP (SETTINGS PAGE)
   ========================================================================== */

.heatmap-total {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-2);
}

.heatmap-grid {
  display: grid;
  gap: 3px;
  width: 100%;
  /* room for a month label that starts in the last week or two */
  padding-right: 14px;
}

.heatmap-month,
.heatmap-daylabel {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-3);
  white-space: nowrap;
  line-height: 1;
  align-self: center;
}

.heatmap-month {
  overflow: visible;
  padding-bottom: 2px;
}

/* Day labels are taller than a cell row: give them no height of their own (centred,
   overflowing both ways) so every row stays the same height. */
.heatmap-daylabel {
  display: flex;
  align-items: center;
  height: 0;
  overflow: visible;
}

.heatmap-cell {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: rgba(var(--rgb-white), 0.07);
}

.heatmap-cell.is-done {
  /* a workout with no "how did it feel" answer (e.g. ticked by hand): the app's cyan, so it
     never looks like one of the feeling colours */
  background: var(--color-cyan);
}

.heatmap-cell.is-today {
  outline: 1px solid var(--color-cyan);
  outline-offset: 0;
}

/* ==========================================================================
   PROFILE & SETTINGS PAGE MODAL
   ========================================================================== */

.profile-modal-card {
  max-width: 420px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface-1);
  border: 1px solid var(--color-cyan);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(var(--rgb-black), 0.7);
}

.profile-modal-card::-webkit-scrollbar {
  width: 5px;
}

.profile-modal-card::-webkit-scrollbar-thumb {
  background: rgba(var(--rgb-cyan), 0.2);
  border-radius: 4px;
}

.profile-header-edit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  background: rgba(var(--rgb-surface-2), 0.5);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.profile-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Settings: your avatar, tap to open the avatar maker */
.avatar-edit-btn {
  position: relative;
  flex: none;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.avatar-lg {
  box-shadow: 0 0 0 2px var(--color-cyan);
}

.avatar-upload-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cyan);
  color: var(--color-on-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-surface-1);
}

.profile-fields-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.profile-username-heading {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--color-text);
  word-break: break-all;
}

/* SEX, WEIGHT & HEIGHT */
.body-stats-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.body-sex-chips {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 6px;
}

.body-sex-chips .focus-chip {
  min-width: 0;
  padding: 8px 4px;
  font-size: var(--fs-xs);
  line-height: 1.15;
  text-align: center;
  border-radius: var(--radius-sm);
}

.body-measure-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.body-measure {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.body-measure-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.body-measure-input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

.body-measure-input-wrap:focus-within {
  border-color: var(--color-cyan);
}

.body-measure-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 0;
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.body-measure-unit {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  margin-left: 4px;
}

/* CONSISTENCY SCORE CARD (31-DAY WINDOW) */
.consistency-score-card {
  background: rgba(var(--rgb-surface-2), 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--color-text-2);
  letter-spacing: 0.5px;
}

.status-chip-badge {
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.status-chip-badge.green {
  background: rgba(var(--rgb-green), 0.2);
  color: var(--color-green);
  border: 1px solid var(--color-green);
}

.status-chip-badge.amber {
  background: rgba(var(--rgb-amber), 0.2);
  color: var(--color-amber);
  border: 1px solid var(--color-amber);
}

.score-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-val-big {
  font-family: var(--font-family-heading);
  font-size: var(--fs-2xl);
  font-weight: 900;
  line-height: 1;
}

.score-val-unit {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.score-desc-text {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.35;
}

/* TARGET WORKOUT DAYS SCHEDULER */
.target-schedule-card {
  background: rgba(var(--rgb-surface-2), 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.days-picker-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.day-pick-btn {
  flex: 1;
  padding: 8px 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-3);
  font-weight: 800;
  font-size: var(--fs-xs);
  cursor: pointer;
  text-align: center;
}

.day-pick-btn.selected {
  background: rgba(var(--rgb-cyan), 0.2);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

/* ATHLETIC FOCUS CHIPS */
.focus-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.focus-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-3);
  font-family: var(--font-family-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.focus-chip.selected {
  background: rgba(var(--rgb-cyan), 0.2);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

.onboarding-submit-btn:disabled,
.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* EXERCISE EXCLUSION POOL */
.exclusion-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pin-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--color-text-3);
  cursor: pointer;
}

.pin-btn.active {
  color: var(--color-amber);
}

.view-log-btn {
  background: rgba(var(--rgb-cyan), 0.15);
  color: var(--color-cyan);
  border: 1px solid rgba(var(--rgb-cyan), 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-log-btn:hover {
  background: rgba(var(--rgb-cyan), 0.25);
}

.log-exercise-card {
  background: rgba(var(--rgb-surface-1), 0.7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-block-badge {
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-cyan);
  letter-spacing: 0.5px;
}

.log-exercise-name {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--color-text);
}

.log-exercise-details {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.log-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--rgb-black), 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 350;
  padding: 16px;
}

.log-modal-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-cyan);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 380px;
  max-height: 85vh;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(var(--rgb-black), 0.9);
}

.log-exercises-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.log-list-scroll {
  max-height: none;
  flex: 1;
  min-height: 0;
}

.log-list-row {
  flex-shrink: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}

.log-list-row:hover {
  border-color: var(--color-cyan);
}

.remove-workout-btn {
  background: rgba(var(--rgb-red), 0.15);
  color: var(--color-red);
  border: 1px solid rgba(var(--rgb-red), 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.remove-workout-btn:hover {
  background: rgba(var(--rgb-red), 0.3);
}

/* ==========================================================================
   USERNAME FIELD
   ========================================================================== */

.username-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.username-input-wrap {
  display: flex;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color 0.15s ease;
}

.username-input-wrap:focus-within { border-color: var(--color-cyan); }
.username-input-wrap.status-available { border-color: var(--color-green); }
.username-input-wrap.status-taken,
.username-input-wrap.status-invalid { border-color: var(--color-red); }

.username-at {
  color: var(--color-text-3);
  font-weight: 700;
  margin-right: 4px;
}

.form-group .username-input,
.username-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 0;
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--fs-sm);
}

.username-status {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  min-height: 1em;
}

.username-status.status-available { color: var(--color-green); }
.username-status.status-taken,
.username-status.status-invalid,
.username-status.status-error { color: var(--color-red); }

.username-error {
  font-size: var(--fs-xs);
  color: var(--color-red);
}

.username-display-row,
.username-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.username-display {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--color-cyan);
}

.username-save-btn {
  width: auto;
  padding: 8px 18px;
}

/* ==========================================================================
   SOCIAL: header button, friends, clubs, leaderboards
   ========================================================================== */

.social-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.social-label {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--color-text-2);
}

.social-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.social-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.social-request-row {
  padding: 4px 0;
}

.social-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--fs-sm);
  outline: none;
}

.social-input:focus {
  border-color: var(--color-cyan);
}

.social-code-input {
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

.social-primary-btn,
.social-small-btn,
.social-danger-btn {
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-family-body);
  font-weight: 700;
  font-size: var(--fs-xs);
  cursor: pointer;
  white-space: nowrap;
}

.social-primary-btn {
  background: var(--color-cyan);
  border: none;
  color: var(--color-on-accent);
}

.social-small-btn {
  background: rgba(var(--rgb-white), 0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.social-danger-btn {
  background: rgba(var(--rgb-red), 0.12);
  border: 1px solid rgba(var(--rgb-red), 0.5);
  color: var(--color-red-light);
}

.social-leave-btn {
  align-self: stretch;
  padding: 12px;
}

.social-primary-btn:disabled,
.social-small-btn:disabled,
.social-danger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.social-notice {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.social-notice.ok {
  background: rgba(var(--rgb-green), 0.15);
  border: 1px solid rgba(var(--rgb-green), 0.5);
  color: var(--color-green);
}

.social-notice.error {
  background: rgba(var(--rgb-red), 0.12);
  border: 1px solid rgba(var(--rgb-red), 0.5);
  color: var(--color-red-light);
}

.social-empty {
  padding: 14px 4px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-3);
}

.club-title {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  color: var(--color-text);
  word-break: break-word;
}

.club-code {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--color-cyan);
}

.club-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 4px;
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  color: inherit;
  font-family: var(--font-family-body);
  text-align: left;
  cursor: pointer;
}

.club-row:first-of-type {
  border-top: none;
}

.club-row-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.club-row-chevron {
  color: var(--color-text-3);
  font-weight: 700;
}

.lb-name {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   DIFFICULTY LEVELS + GROUPED EXERCISE POOL
   ========================================================================== */

.level-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-3);
  font-family: var(--font-family-body);
  text-align: left;
  cursor: pointer;
}

.level-option-title {
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.level-option-desc {
  font-size: var(--fs-xs);
  line-height: 1.3;
}

.level-option.selected {
  background: rgba(var(--rgb-cyan), 0.15);
  border-color: var(--color-cyan);
}

.level-option.selected .level-option-title {
  color: var(--color-cyan);
}

.level-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.level-tag.level-beginner { background: rgba(var(--rgb-green), 0.18); color: var(--color-green-light); }
.level-tag.level-intermediate { background: rgba(var(--rgb-amber), 0.18); color: var(--color-amber-light); }
.level-tag.level-advanced { background: rgba(var(--rgb-red), 0.18); color: var(--color-red-light); }

.pool-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-group {
  background: rgba(var(--rgb-surface-2), 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pool-group.open {
  border-color: var(--color-border-accent);
}

.pool-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-family-body);
  cursor: pointer;
}

.pool-group-count {
  flex: 1;
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.pool-chevron {
  font-weight: 700;
  color: var(--color-text-3);
}

.pool-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px 12px;
}

/* Each pool exercise: a row (expand button + pool controls) and, when opened, the same
   details body as the home screen's exercise card. */
.pool-exercise {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(var(--rgb-surface-1), 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  font-size: var(--fs-xs);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pool-exercise.is-expanded {
  background: rgba(var(--rgb-surface-2), 0.9);
}

.pool-exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 8px;
}

.pool-exercise-left {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.pool-exercise-left:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}

.pool-exercise .pool-exercise-actions { gap: 4px; }

.pool-exercise .exercise-card-body {
  padding: 2px 8px 10px;
}

/* Settings is narrower than the home screen: stack Weight over Reps so each
   stepper keeps the full 44px buttons and a readable value. */
.pool-exercise .exercise-tracker-row {
  grid-template-columns: minmax(0, 1fr);
}

.pool-exercise-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pool-exercise-name {
  font-weight: 600;
  transition: color 0.6s ease;
}

.pool-exercise-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   ANIMATED EXPAND / COLLAPSE (exercise cards, superset + warm-up blocks,
   settings exercise pool)
   ========================================================================== */

.collapsible {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease,
    visibility 0s linear 0.35s;
}

.collapsible.open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease 0.05s,
    visibility 0s;
}

.collapsible-inner {
  min-height: 0;
  min-width: 0; /* never wider than the container */
  overflow: hidden; /* clips while animating */
}

/* Once fully open, stop clipping so glows and shadows inside aren't cut off */
.collapsible.settled > .collapsible-inner {
  overflow: visible;
}

/* Exercise card: header row always visible, body animates */
.superset-exercise-item.exercise-card {
  padding: 0;
  gap: 0;
  cursor: default;
}

.exercise-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

.exercise-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 10px 10px;
}

.exercise-row-chevron,
.pool-chevron,
.rotation-row-chevron {
  display: inline-block;
  transition: transform 0.3s ease;
}

.exercise-card.is-expanded .exercise-row-chevron,
.pool-group.open .pool-chevron {
  transform: rotate(90deg);
}

/* Blocks: close the gap between header and (collapsed) body smoothly */
.superset-container-card {
  transition: gap 0.35s ease, background 0.3s ease, border-color 0.3s ease;
}

.superset-container-card.is-collapsed-guided {
  gap: 0;
}

@media (prefers-reduced-motion: reduce) {
  .collapsible,
  .collapsible.open,
  .exercise-row-chevron,
  .pool-chevron,
  .superset-container-card {
    transition: none !important;
  }
}

/* ==========================================================================
   POPPIER CELEBRATION (progress bars, stars, crowns, streak)
   ========================================================================== */

/* Particle layer centred on the star + ring */
.xp-fx {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 6;
}

.xp-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s, 3px);
  height: var(--s, 3px);
  margin: calc(var(--s, 3px) / -2) 0 0 calc(var(--s, 3px) / -2);
  border-radius: 50%;
  background: var(--c, var(--color-gold));
  box-shadow: 0 0 6px var(--c, var(--color-gold));
  opacity: 0;
  animation: xpParticle var(--dur, 0.7s) cubic-bezier(0.1, 0.8, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes xpParticle {
  0%   { transform: translate(0, 0) scale(1.6); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* Shockwave rings */
.xp-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--color-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(var(--rgb-gold), 0.8);
  opacity: 0;
  animation: xpRing 0.75s ease-out forwards;
}

.xp-ring-2 { animation-delay: 0.12s; }

.xp-ring-crown {
  border-color: var(--color-purple-light);
  box-shadow: 0 0 14px rgba(var(--rgb-purple), 0.9);
  animation-name: xpRingBig;
  animation-duration: 1s;
}

@keyframes xpRing {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(5.5); opacity: 0; }
}

@keyframes xpRingBig {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(10); opacity: 0; }
}

/* Punchier star / crown arrivals */

@keyframes xpStarPop {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  45%  { transform: scale(2.9) rotate(20deg); opacity: 1; text-shadow: 0 0 16px var(--color-gold), 0 0 30px var(--color-gold); }
  70%  { transform: scale(0.85) rotate(-6deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes xpCrownDrop {
  0%   { transform: translateY(-26px) scale(0) rotate(-30deg); opacity: 0; }
  50%  { transform: translateY(3px) scale(2.5) rotate(10deg); opacity: 1; filter: drop-shadow(0 0 12px var(--color-purple)); }
  72%  { transform: translateY(-2px) scale(0.85) rotate(-4deg); }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; filter: none; }
}

/* The whole exercise row reacts */
.exercise-card {
  position: relative;
}

.exercise-card.fx-fill {
  animation: xpRowPulse 0.5s ease-out;
}

.exercise-card.fx-burst {
  animation: xpRowBurst 0.85s ease-out;
  z-index: 3;
}

.exercise-card.fx-crown {
  animation: xpRowCrown 1.15s ease-out;
  z-index: 3;
}

@keyframes xpRowPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.025); background-color: rgba(var(--rgb-gold), 0.12); }
  100% { transform: scale(1); }
}

@keyframes xpRowBurst {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.07); box-shadow: 0 0 22px rgba(var(--rgb-gold), 0.8); background-color: rgba(var(--rgb-gold), 0.22); }
  30%  { transform: scale(1.04) translateX(-4px); }
  45%  { transform: scale(1.05) translateX(4px); }
  60%  { transform: scale(1.02) translateX(-2px); }
  100% { transform: scale(1) translateX(0); box-shadow: 0 0 0 rgba(var(--rgb-gold), 0); }
}

@keyframes xpRowCrown {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.1); box-shadow: 0 0 34px rgba(var(--rgb-purple), 0.9); background-color: rgba(var(--rgb-purple), 0.25); }
  28%  { transform: scale(1.06) translateX(-6px) rotate(-0.6deg); }
  42%  { transform: scale(1.07) translateX(6px) rotate(0.6deg); }
  58%  { transform: scale(1.03) translateX(-3px); }
  100% { transform: scale(1) translateX(0); box-shadow: 0 0 0 rgba(var(--rgb-purple), 0); }
}

/* "+1 REP!", "+2kg!", "2/3", "👑 CROWN!" pops up and floats away */
.xp-float {
  position: absolute;
  right: 30px;
  top: 2px;
  z-index: 8;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-family-heading);
  font-weight: 900;
  font-size: var(--fs-md);
  color: var(--color-gold-light);
  text-shadow: 0 0 10px var(--color-gold), 0 2px 0 rgba(var(--rgb-black), 0.5);
  animation: xpFloatUp 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.xp-float-crown {
  font-size: var(--fs-md);
  color: var(--color-purple-pale);
  text-shadow: 0 0 12px var(--color-purple), 0 0 26px var(--color-purple), 0 2px 0 rgba(var(--rgb-black), 0.5);
  animation-duration: 1.9s;
}

@keyframes xpFloatUp {
  0%   { transform: translateY(8px) scale(0.3); opacity: 0; }
  16%  { transform: translateY(-4px) scale(1.6); opacity: 1; }
  34%  { transform: translateY(-9px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-38px) scale(1); opacity: 0; }
}

/* Full-screen colour flash (crown earned, streak up) */
.screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 299;
  opacity: 0;
  animation: screenFlash 0.8s ease-out forwards;
}

.screen-flash.crown {
  background: radial-gradient(circle at 50% 50%, rgba(var(--rgb-purple), 0.55), rgba(var(--rgb-gold), 0.22) 45%, transparent 75%);
}

.screen-flash.streak {
  background: radial-gradient(circle at 50% 10%, rgba(var(--rgb-amber), 0.6), rgba(var(--rgb-orange), 0.2) 40%, transparent 70%);
}

@keyframes screenFlash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Streak: bigger flame, slammed number, shockwave and more sparks */
.streak-celebrating {
  animation: streakBadgeGlow 1.5s ease-out;
}

@keyframes streakBadgeGlow {
  0%   { filter: none; }
  15%  { filter: drop-shadow(0 0 14px var(--color-amber)) drop-shadow(0 0 28px var(--color-orange-light)); }
  100% { filter: none; }
}

@keyframes streakFlameBounce {
  0%   { transform: scale(1) rotate(0); }
  18%  { transform: scale(2.8) rotate(-14deg); filter: drop-shadow(0 0 12px var(--color-amber)) brightness(1.4); }
  38%  { transform: scale(1.5) rotate(10deg); }
  55%  { transform: scale(2.2) rotate(-6deg); filter: drop-shadow(0 0 8px var(--color-amber)); }
  75%  { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1) rotate(0); filter: none; }
}

@keyframes streakCountPop {
  0%   { transform: scale(1); text-shadow: none; }
  28%  { transform: scale(2.4); text-shadow: 0 0 12px var(--color-amber), 0 0 24px var(--color-orange-light); }
  55%  { transform: scale(0.9); }
  100% { transform: scale(1); text-shadow: none; }
}

.streak-spark {
  width: var(--s, 4px);
  height: var(--s, 4px);
  background: var(--c, var(--color-gold-light));
  box-shadow: 0 0 6px var(--c, var(--color-gold-light));
  opacity: 0;
  animation: streakSparkFly 0.95s cubic-bezier(0.1, 0.8, 0.3, 1) var(--delay, 0s) forwards;
}

.streak-ring {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid var(--color-amber-light);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(var(--rgb-amber), 0.9);
  pointer-events: none;
  opacity: 0;
  animation: streakRing 0.85s ease-out forwards;
}

.streak-ring-2 { animation-delay: 0.15s; }

@keyframes streakRing {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-fx,
  .xp-float,
  .screen-flash,
  .streak-ring {
    display: none !important;
  }
  .exercise-card.fx-fill,
  .exercise-card.fx-burst,
  .exercise-card.fx-crown,
  .streak-celebrating {
    animation: none !important;
  }
}

/* ==========================================================================
   IN-APP CONFIRM PANELS (replace the browser's window.confirm)
   ========================================================================== */

.inline-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(var(--rgb-cyan), 0.07);
  border: 1px solid rgba(var(--rgb-cyan), 0.35);
  border-radius: var(--radius-md);
}

.inline-confirm.danger {
  background: rgba(var(--rgb-red), 0.08);
  border-color: rgba(var(--rgb-red), 0.45);
}

.inline-confirm-text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--color-text);
}

.inline-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inline-confirm-cancel,
.inline-confirm-ok {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}

.inline-confirm-cancel {
  background: rgba(var(--rgb-white), 0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.inline-confirm-ok {
  background: var(--color-cyan);
  border: none;
  color: var(--color-on-accent);
}

.inline-confirm-ok.danger {
  background: rgba(var(--rgb-red), 0.9);
  color: var(--color-white);
}

.inline-confirm-cancel:disabled,
.inline-confirm-ok:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   EXERCISE POOL: pause weight/rep progression
   ========================================================================== */

.pause-prog-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: var(--fs-md);
  line-height: 1;
  color: var(--color-text-3);
  opacity: 0.55;
  cursor: pointer;
}

.pause-prog-btn.active {
  color: var(--color-cyan);
  opacity: 1;
}

.pool-tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pool-paused-tag {
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(var(--rgb-cyan), 0.15);
  color: var(--color-cyan);
}

/* ==========================================================================
   SWAP A SINGLE EXERCISE + GUIDED CUE TOGGLES
   ========================================================================== */

.swap-ex-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.06);
  border: 1px solid var(--color-border);
  color: var(--color-cyan);
  cursor: pointer;
}

.swap-ex-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Invisible padding so the tap area is 44px while the circle stays small. */
.swap-ex-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
}

/* Focus exercise: the focus target replaces the swap button (it can't be swapped out). */
.swap-ex-btn.is-focus {
  /* greyed like a disabled swap, but still tappable to explain why */
  opacity: 0.35;
  cursor: help;
}

.swap-note {
  margin: 0 10px 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  line-height: 1.35;
  color: var(--color-text-2);
  background: rgba(var(--rgb-amber), 0.12);
  border: 1px solid rgba(var(--rgb-amber), 0.35);
}

.guided-fs-cue-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guided-fs-cue-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: var(--fs-md);
  line-height: 1;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.12);
  border: 1px solid rgba(var(--rgb-white), 0.25);
  color: inherit;
  cursor: pointer;
}

.guided-fs-cue-btn.off {
  opacity: 0.45;
}

/* ==========================================================================
   PER-EXERCISE PROGRESS TAB + CURVES
   ========================================================================== */

.ex-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(var(--rgb-white), 0.05);
  border-radius: var(--radius-full);
  align-self: flex-start;
}

.ex-tab {
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-3);
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}

.ex-tab.active {
  background: rgba(var(--rgb-cyan), 0.18);
  color: var(--color-cyan);
}

.progress-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-chips {
  display: flex;
  gap: 6px;
}

.progress-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}

.progress-chip.active {
  background: rgba(var(--rgb-cyan), 0.15);
  border-color: rgba(var(--rgb-cyan), 0.5);
  color: var(--color-cyan);
}

.progress-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.progress-grid {
  stroke: var(--color-border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.progress-axis-label,
.progress-axis-unit {
  fill: var(--color-text-3);
  font-size: 9px;
  font-family: var(--font-family-body);
}

.progress-line {
  stroke: var(--color-cyan);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.progress-dot {
  fill: var(--color-cyan);
  stroke: var(--color-card);
  stroke-width: 1.5;
}

.progress-dot.up {
  fill: var(--color-white);
  stroke: var(--color-cyan);
  stroke-width: 2;
}

.progress-dot.past {
  fill: var(--color-card);
  stroke: var(--color-cyan);
  stroke-width: 1.5;
}

.progress-star {
  fill: var(--color-amber);
  font-size: 11px;
}

.progress-selected-ring {
  fill: rgba(var(--rgb-cyan), 0.12);
  stroke: rgba(var(--rgb-cyan), 0.5);
  stroke-width: 1;
}

.progress-hit {
  fill: transparent;
  cursor: pointer;
}

.progress-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 2.4em;
}

.progress-readout-main {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text);
}

.progress-readout-tags {
  font-size: var(--fs-xs);
  color: var(--color-amber);
}

.progress-empty,
.progress-hint {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--color-text-2);
  background: rgba(var(--rgb-white), 0.04);
  border: 1px dashed var(--color-border);
}

/* ==========================================================================
   CLUB ACTIVITY FEED
   ========================================================================== */

/* ==========================================================================
   UNILATERAL NOTES, BUILD-UP NOTES, GUIDED SUB-NOTES
   ========================================================================== */

.ex-callout {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  background: rgba(var(--rgb-cyan), 0.08);
  border: 1px solid rgba(var(--rgb-cyan), 0.3);
}

.ex-callout.ramp {
  background: rgba(var(--rgb-amber), 0.1);
  border-color: rgba(var(--rgb-amber), 0.4);
}

.guided-fs-sub-note {
  margin-top: 6px;
  font-size: var(--fs-xs);
  opacity: 0.85;
}

/* ==========================================================================
   AVAILABLE EQUIPMENT
   ========================================================================== */

.equipment-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equipment-note {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--color-text-2);
  background: rgba(var(--rgb-amber), 0.1);
  border: 1px solid rgba(var(--rgb-amber), 0.35);
}

.pool-needs-tag {
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(var(--rgb-white), 0.1);
  color: var(--color-text-2);
}

/* ==========================================================================
   GUIDED WORKOUT: FIXED LAYOUT (nothing moves when the card text changes)
   Every slot below always exists at a fixed height; empty slots are just blank.
   ========================================================================== */

.guided-fs-center {
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.guided-fs-current-label {
  height: 3rem;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  overflow: hidden;
}

.guided-fs-current-label > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guided-fs-current-detail {
  height: 2.6rem;
  margin-top: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  overflow: hidden;
}

.guided-fs-sub-note {
  height: 1.2rem;
  margin-top: 0;
  line-height: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.guided-fs-paused-badge {
  height: 1.9rem;
  display: flex;
  align-items: center;
}

.guided-fs-paused-badge.is-hidden {
  visibility: hidden;
}

.guided-fs-next-line {
  height: 2.4rem;
  max-width: 100%;
  padding: 0 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.2;
  overflow: hidden;
}

.guided-fs-next-line > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   STARS: one star per exercise (count inside), tier colours, tier celebrations
   ========================================================================== */

.star-badge {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  --star-color: var(--color-gold);
}

.star-badge.tier-rare { --star-color: var(--color-sky); }
.star-badge.tier-epic { --star-color: var(--color-purple); }
.star-badge.tier-legendary { --star-color: var(--color-orange); }

.star-badge-inner {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0;
}

.star-badge-glyph {
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--star-color);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--star-color) 55%, transparent));
  transform-origin: 50% 55%;
}

.star-badge.unearned .star-badge-glyph {
  color: rgba(var(--rgb-white), 0.28);
  filter: none;
}

.star-badge-num {
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 900;
  line-height: 1;
  margin-top: 1px;
  color: var(--star-color);
  pointer-events: none;
}

/* ==========================================================================
   STAR + PROGRESS RING: three gold segments around the star, one per
   consistent session. Fills clockwise from the top, bursts at 3/3, then drains.
   ========================================================================== */

.star-progress {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.star-progress .star-badge {
  position: absolute;
  inset: 0;
  width: auto;
}

.prog-ring {
  position: absolute;
  inset: 0;
  overflow: visible;
  transform-origin: 50% 50%;
}

.prog-seg-track {
  stroke: rgba(var(--rgb-white), 0.12);
}

.prog-seg-fill {
  stroke: var(--color-gold);
  stroke-linecap: butt;
  stroke-dashoffset: var(--seg-len);
  transition: stroke-dashoffset 0.55s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.prog-seg.filled .prog-seg-fill {
  stroke-dashoffset: 0;
}

/* The segment that has just filled flares up */
.prog-seg.just-filled .prog-seg-fill {
  animation: progSegFlare 0.9s ease-out;
}

@keyframes progSegFlare {
  0%   { stroke-width: 3.6; filter: none; }
  45%  { stroke-width: 6.5; stroke: var(--color-gold-pale); filter: drop-shadow(0 0 4px var(--color-gold)) drop-shadow(0 0 8px rgba(var(--rgb-gold), 0.7)); }
  100% { stroke-width: 3.6; filter: none; }
}

/* Gentle pulse of the whole badge while a segment fills */
.star-progress.xp-fill .prog-ring {
  animation: progRingPulse 0.6s ease-out;
}

@keyframes progRingPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* 3/3: the full ring spins once, flashes gold and bursts */
.star-progress.xp-burst .prog-ring {
  animation: progRingBurst 0.9s cubic-bezier(0.3, 1.3, 0.5, 1);
}

@keyframes progRingBurst {
  0%   { transform: scale(1) rotate(0); filter: none; }
  30%  { transform: scale(1.45) rotate(200deg); filter: drop-shadow(0 0 8px var(--color-gold)) brightness(1.5); }
  65%  { transform: scale(1.12) rotate(340deg); filter: drop-shadow(0 0 5px var(--color-gold)); }
  100% { transform: scale(1) rotate(360deg); filter: none; }
}

.star-progress.xp-burst .prog-seg-fill {
  stroke: var(--color-gold-light);
}

/* Tier unlock: the ring takes the tier colour and spins with it */
.star-progress.xp-rare .prog-seg-fill { stroke: var(--color-sky-light); }
.star-progress.xp-epic .prog-seg-fill { stroke: var(--color-purple-light); }
.star-progress.xp-legendary .prog-seg-fill { stroke: var(--color-orange-light); }

.star-progress.xp-rare .prog-ring { animation: progRingTier 1.3s cubic-bezier(0.3, 1.3, 0.5, 1); --tier-glow: var(--color-sky); }
.star-progress.xp-epic .prog-ring { animation: progRingTier 1.7s cubic-bezier(0.3, 1.3, 0.5, 1); --tier-glow: var(--color-purple); }
.star-progress.xp-legendary .prog-ring { animation: progRingTierBig 2.4s cubic-bezier(0.3, 1.3, 0.5, 1); --tier-glow: var(--color-orange); }

@keyframes progRingTier {
  0%   { transform: scale(1) rotate(0); filter: none; }
  35%  { transform: scale(1.6) rotate(-360deg); filter: drop-shadow(0 0 10px var(--tier-glow)) brightness(1.4); }
  100% { transform: scale(1) rotate(-360deg); filter: none; }
}

@keyframes progRingTierBig {
  0%   { transform: scale(1) rotate(0); filter: none; }
  25%  { transform: scale(1.8) rotate(-540deg); filter: drop-shadow(0 0 12px var(--tier-glow)) drop-shadow(0 0 26px var(--color-gold)) brightness(1.5); }
  50%  { transform: scale(1.35) rotate(-720deg); }
  70%  { transform: scale(1.65) rotate(-720deg); filter: drop-shadow(0 0 16px var(--color-gold)); }
  100% { transform: scale(1) rotate(-720deg); filter: none; }
}

/* After a progression the ring drains, last segment first (anticlockwise) */
.star-progress.xp-drain .prog-seg-fill {
  transition: stroke-dashoffset 0.32s ease-in;
}
.star-progress.xp-drain .prog-seg-3 .prog-seg-fill { transition-delay: 0s; }
.star-progress.xp-drain .prog-seg-2 .prog-seg-fill { transition-delay: 0.12s; }
.star-progress.xp-drain .prog-seg-1 .prog-seg-fill { transition-delay: 0.24s; }

.star-pop {
  animation: starBadgePop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes starBadgePop {
  0%   { transform: scale(0.3) rotate(-140deg); opacity: 0.2; }
  55%  { transform: scale(1.9) rotate(18deg); opacity: 1; filter: drop-shadow(0 0 10px var(--star-color)); }
  100% { transform: scale(1) rotate(0); opacity: 1; filter: none; }
}

/* Exercise name colour by tier: rare (blue) 5 stars, epic (purple) 20, legendary (orange) 50 */
.exercise-row-name.tier-rare,
.pool-exercise-name.tier-rare {
  color: var(--color-sky-light);
  text-shadow: 0 0 8px rgba(var(--rgb-sky), 0.35);
}

.exercise-row-name.tier-epic,
.pool-exercise-name.tier-epic {
  color: var(--color-purple-light);
  text-shadow: 0 0 9px rgba(var(--rgb-purple), 0.4);
}

.exercise-row-name.tier-legendary,
.pool-exercise-name.tier-legendary {
  color: var(--color-orange-light);
  animation: legendaryNameGlow 2.6s ease-in-out infinite;
}

@keyframes legendaryNameGlow {
  0%, 100% { text-shadow: 0 0 6px rgba(var(--rgb-orange), 0.45); }
  50%      { text-shadow: 0 0 13px rgba(var(--rgb-amber), 0.95), 0 0 2px rgba(var(--rgb-gold), 0.8); }
}

/* Tier unlock: the whole row celebrates, with a light sweep across it */
.exercise-card.fx-rare,
.exercise-card.fx-epic,
.exercise-card.fx-legendary {
  position: relative;
  z-index: 3;
}

.exercise-card.fx-rare { animation: tierRowRare 1.5s ease-out; }
.exercise-card.fx-epic { animation: tierRowEpic 1.9s ease-out; }
.exercise-card.fx-legendary { animation: tierRowLegendary 2.8s ease-out; }

.exercise-card.fx-rare::after,
.exercise-card.fx-epic::after,
.exercise-card.fx-legendary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: tierShine 1.1s ease-out 0.15s both;
}

.exercise-card.fx-rare::after {
  background-image: linear-gradient(110deg, transparent 38%, rgba(var(--rgb-sky), 0.7) 50%, transparent 62%);
}
.exercise-card.fx-epic::after {
  background-image: linear-gradient(110deg, transparent 38%, rgba(var(--rgb-purple), 0.7) 50%, transparent 62%);
  animation-iteration-count: 2;
}
.exercise-card.fx-legendary::after {
  background-image: linear-gradient(110deg, transparent 38%, rgba(var(--rgb-gold), 0.8) 50%, transparent 62%);
  animation-iteration-count: 3;
}

@keyframes tierShine {
  0%   { background-position: 80% 0; opacity: 1; }
  99%  { opacity: 1; }
  100% { background-position: 20% 0; opacity: 0; }
}

.exercise-card.fx-rare .star-badge-glyph { animation: starSpinRare 1.3s cubic-bezier(0.3, 1.4, 0.5, 1); }
.exercise-card.fx-epic .star-badge-glyph { animation: starSpinEpic 1.7s cubic-bezier(0.3, 1.4, 0.5, 1); }
.exercise-card.fx-legendary .star-badge-glyph { animation: starSpinLegendary 2.4s cubic-bezier(0.3, 1.4, 0.5, 1); }

@keyframes starSpinRare {
  0%   { transform: scale(1) rotate(0); }
  40%  { transform: scale(2.2) rotate(360deg); filter: drop-shadow(0 0 12px var(--color-sky)); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes starSpinEpic {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(2.6) rotate(720deg); filter: drop-shadow(0 0 16px var(--color-purple)) drop-shadow(0 0 30px var(--color-purple-light)); }
  100% { transform: scale(1) rotate(720deg); }
}

@keyframes starSpinLegendary {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(3.2) rotate(1080deg); filter: drop-shadow(0 0 18px var(--color-orange)) drop-shadow(0 0 40px var(--color-gold)); }
  50%  { transform: scale(2.2) rotate(1080deg); }
  70%  { transform: scale(2.8) rotate(1080deg); filter: drop-shadow(0 0 22px var(--color-gold)); }
  100% { transform: scale(1) rotate(1080deg); }
}

@keyframes tierRowRare {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.07); box-shadow: 0 0 26px rgba(var(--rgb-sky), 0.85); background-color: rgba(var(--rgb-sky), 0.2); }
  35%  { transform: scale(1.04); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(var(--rgb-sky), 0); }
}

@keyframes tierRowEpic {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.1); box-shadow: 0 0 34px rgba(var(--rgb-purple), 0.95); background-color: rgba(var(--rgb-purple), 0.26); }
  26%  { transform: scale(1.06) translateX(-6px) rotate(-0.6deg); }
  40%  { transform: scale(1.07) translateX(6px) rotate(0.6deg); }
  55%  { transform: scale(1.1); box-shadow: 0 0 42px rgba(var(--rgb-purple), 0.95); }
  70%  { transform: scale(1.03) translateX(-3px); }
  100% { transform: scale(1) translateX(0); box-shadow: 0 0 0 rgba(var(--rgb-purple), 0); }
}

@keyframes tierRowLegendary {
  0%   { transform: scale(1); }
  8%   { transform: scale(1.13); box-shadow: 0 0 44px rgba(var(--rgb-orange), 1), 0 0 90px rgba(var(--rgb-gold), 0.6); background-color: rgba(var(--rgb-orange), 0.3); }
  18%  { transform: scale(1.08) translateX(-8px) rotate(-0.8deg); }
  28%  { transform: scale(1.1) translateX(8px) rotate(0.8deg); }
  40%  { transform: scale(1.14); box-shadow: 0 0 56px rgba(var(--rgb-orange), 1), 0 0 110px rgba(var(--rgb-gold), 0.7); }
  55%  { transform: scale(1.06) translateX(-4px); }
  68%  { transform: scale(1.12); box-shadow: 0 0 50px rgba(var(--rgb-orange), 0.95); }
  100% { transform: scale(1) translateX(0); box-shadow: 0 0 0 rgba(var(--rgb-orange), 0); background-color: transparent; }
}

/* Shockwave rings per tier */
.xp-ring-rare {
  border-color: var(--color-sky-light);
  box-shadow: 0 0 12px rgba(var(--rgb-sky), 0.9);
  animation-name: xpRingBig;
  animation-duration: 1s;
}
.xp-ring-epic {
  border-color: var(--color-purple-light);
  box-shadow: 0 0 16px rgba(var(--rgb-purple), 0.95);
  animation-name: xpRingBig;
  animation-duration: 1.2s;
}
.xp-ring-legendary {
  border-color: var(--color-orange-light);
  border-width: 3px;
  box-shadow: 0 0 20px rgba(var(--rgb-orange), 1), 0 0 36px rgba(var(--rgb-gold), 0.7);
  animation-name: xpRingBig;
  animation-duration: 1.5s;
}
.xp-ring-3 { animation-delay: 0.26s; }

/* Pop-up text per tier */
.xp-float-rare {
  font-size: var(--fs-md);
  color: var(--color-sky-pale);
  text-shadow: 0 0 12px var(--color-sky), 0 0 26px var(--color-sky), 0 2px 0 rgba(var(--rgb-black), 0.5);
  animation-duration: 1.8s;
}
.xp-float-epic {
  font-size: var(--fs-lg);
  color: var(--color-purple-pale);
  text-shadow: 0 0 14px var(--color-purple), 0 0 30px var(--color-purple-light), 0 2px 0 rgba(var(--rgb-black), 0.5);
  animation-duration: 2.2s;
}
.xp-float-legendary {
  font-size: var(--fs-lg);
  color: var(--color-gold-pale);
  text-shadow: 0 0 14px var(--color-orange), 0 0 32px var(--color-orange), 0 0 48px var(--color-gold), 0 2px 0 rgba(var(--rgb-black), 0.5);
  animation-duration: 2.8s;
}

/* Full-screen flashes per tier */
.screen-flash.rare {
  background: radial-gradient(circle at 50% 50%, rgba(var(--rgb-sky), 0.5), rgba(var(--rgb-sky), 0.2) 45%, transparent 75%);
}
.screen-flash.epic {
  background: radial-gradient(circle at 50% 50%, rgba(var(--rgb-purple), 0.6), rgba(var(--rgb-purple), 0.25) 45%, transparent 78%);
}
.screen-flash.legendary {
  background: radial-gradient(circle at 50% 50%, rgba(var(--rgb-gold), 0.55), rgba(var(--rgb-orange), 0.45) 40%, rgba(var(--rgb-orange), 0.15) 65%, transparent 82%);
  animation: screenFlashLong 1.8s ease-out forwards;
}

@keyframes screenFlashLong {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  30%  { opacity: 0.45; }
  45%  { opacity: 0.95; }
  100% { opacity: 0; }
}

/* Screen shake for epic and legendary */
body.shake-screen .phone-container { animation: screenShake 0.7s ease-in-out; }
body.shake-screen-big .phone-container { animation: screenShakeBig 1.1s ease-in-out; }

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-5px, 2px); }
  30% { transform: translate(5px, -2px); }
  45% { transform: translate(-4px, -2px); }
  60% { transform: translate(4px, 2px); }
  80% { transform: translate(-2px, 1px); }
}

@keyframes screenShakeBig {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-9px, 4px); }
  20% { transform: translate(9px, -4px); }
  30% { transform: translate(-8px, -3px); }
  40% { transform: translate(8px, 4px); }
  55% { transform: translate(-6px, 2px); }
  70% { transform: translate(5px, -2px); }
  85% { transform: translate(-3px, 1px); }
}

/* ==========================================================================
   TOTAL STARS COUNTER (header), LEADERBOARD SWITCH, BIO STAR COUNT
   ========================================================================== */

.stars-badge.streak-celebrating {
  animation: starsBadgeGlow 1.5s ease-out;
}

@keyframes starsBadgeGlow {
  0%   { filter: none; }
  15%  { filter: drop-shadow(0 0 14px var(--color-gold)) drop-shadow(0 0 28px var(--color-amber-light)); }
  100% { filter: none; }
}

.stars-badge .streak-ring {
  border-color: var(--color-gold);
}

.bio-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text-2);
}

.bio-stars-icon {
  color: var(--color-gold);
  font-size: var(--fs-md);
}

@media (prefers-reduced-motion: reduce) {
  .star-pop,
  .exercise-card.fx-rare,
  .exercise-card.fx-epic,
  .exercise-card.fx-legendary,
  .exercise-card.fx-rare::after,
  .exercise-card.fx-epic::after,
  .exercise-card.fx-legendary::after,
  .exercise-card.fx-rare .star-badge-glyph,
  .exercise-card.fx-epic .star-badge-glyph,
  .exercise-card.fx-legendary .star-badge-glyph,
  .exercise-row-name.tier-legendary,
  .pool-exercise-name.tier-legendary,
  body.shake-screen .phone-container,
  body.shake-screen-big .phone-container {
    animation: none !important;
  }
}

/* ==========================================================================
   WORKOUT ACTIVITY: tier colours (a workout that unlocked rare / epic / legendary)
   ========================================================================== */

/* ==========================================================================
   SETTINGS: hearts, pin, autosave footer, streak freezes in the bio
   ========================================================================== */

.heart-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: var(--fs-md);
  line-height: 1;
  color: var(--color-text-3);
  cursor: pointer;
}

.heart-btn.active {
  color: var(--color-red-light);
  text-shadow: 0 0 6px rgba(var(--rgb-red), 0.5);
}

/* "Always include" is a pushpin now (so it isn't confused with the progress stars) */
.pin-btn {
  font-size: var(--fs-md);
}

.pin-btn:not(.active) {
  filter: grayscale(1);
  opacity: 0.4;
}

.pin-btn.active {
  filter: none;
  opacity: 1;
}

.pin-btn:disabled {
  cursor: not-allowed;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-footer .submit-btn {
  flex: 0 0 auto;
  min-width: 110px;
}

.autosave-note {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  transition: color 0.3s ease;
}

.autosave-note.flash {
  color: var(--color-green);
  font-weight: 700;
}

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

.bio-freezes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text-2);
}

.bio-freezes-icon {
  font-size: var(--fs-md);
}

.timed-text {
  font-weight: 700;
}

/* Keep the weight/height inputs plain inside onboarding's .form-group (the wrapper draws the box). */
.form-group .body-measure-input,
.form-group .body-measure-input:focus {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0;
  width: 0;
}

/* Installed (Home Screen) app: no rubber-band bounce or long-press preview, so it
   feels like a native app rather than a web page. */
@media (display-mode: standalone) {
  html, body {
    overscroll-behavior-y: none;
  }
  body {
    -webkit-touch-callout: none;
  }
}

/* Very small phones (320px wide): slightly smaller logo lockup so the header still fits. */
@media (max-width: 340px) {
  .app-header { padding-left: 12px; padding-right: 12px; }
  .brand-wrap { gap: 6px; }
  .brand-logo { height: 26px; }
  .brand-title { font-size: var(--fs-xs); letter-spacing: 0.3px; }
  .header-right { gap: 6px; }
}

/* ==========================================================================
   PROFILE CARD (Settings): read-only details, with an Edit mode
   ========================================================================== */

.profile-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--rgb-white), 0.08);
}

.profile-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-detail-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.profile-detail-value {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.profile-detail-value.unset {
  font-weight: 500;
  color: var(--color-text-3);
}

.profile-edit-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--color-text);
}

.profile-edit-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  line-height: 1.35;
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.profile-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Icon-only edit button (pencil) on the profile card */
.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Timed holds in onboarding: a fixed time instead of a reps stepper */
.stepper-val.timed-fixed {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  padding: 0 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  white-space: nowrap;
}

/* ==========================================================================
   SOCIAL HUB (full screen): chips for Friends / each club, Leaderboard and
   Activity tabs, plus sheets for adding and managing
   ========================================================================== */

.social-hub {
  position: fixed;
  inset: 0;
  z-index: 600; /* above everything, including the Test Mode banner */
  display: flex;
  justify-content: center;
  background: rgba(var(--rgb-bg), 0.75);
}

.social-hub-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hub-top {
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
}

.hub-icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: rgba(var(--rgb-white), 0.04);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hub-icon-btn.accent {
  color: var(--color-cyan);
  border-color: rgba(var(--rgb-cyan), 0.45);
  background: rgba(var(--rgb-cyan), 0.1);
}

.hub-icon-btn.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

/* Group switcher: the selected group (Friends or a club), its settings, then "2 more" to switch */
.hub-switcher {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding-right: 6px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-accent);
}
.hub-switcher-who {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 8px 12px;
  border: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: none;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.hub-switcher-gear {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(var(--rgb-white), 0.06);
  color: var(--color-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hub-switcher-divider { flex: 0 0 auto; width: 1px; height: 28px; margin: 0 6px; background: rgba(var(--rgb-white), 0.12); }
.hub-switcher-more {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 6px 0 8px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--color-cyan);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.hub-group-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--rgb-cyan), 0.15);
  color: var(--color-cyan);
  font-family: var(--font-family-heading);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.hub-group-mark.club { background: rgba(var(--rgb-purple), 0.18); color: var(--color-purple-light); }
.hub-group-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-group-name {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-group-meta { font-size: var(--fs-xs); color: var(--color-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The switcher's sheet: one row per group, the shown one ticked */
.hub-group-list { display: flex; flex-direction: column; gap: 8px; }
.hub-group-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(var(--rgb-surface-2), 0.5);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.hub-group-option.active { border-color: rgba(var(--rgb-cyan), 0.6); background: rgba(var(--rgb-cyan), 0.08); }
.hub-group-tick { flex: 0 0 auto; display: inline-flex; color: var(--color-cyan); }
.hub-group-add {
  min-height: 44px;
  border-radius: 12px;
  border: 1px dashed rgba(var(--rgb-cyan), 0.4);
  background: transparent;
  color: var(--color-cyan);
  font-size: var(--fs-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.hub-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 -16px;
}

.hub-tab {
  height: 46px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--color-text-2);
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.hub-tab.active {
  color: var(--color-text);
  font-weight: 700;
  border-bottom-color: var(--color-cyan);
}

.hub-tab-badge {
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.hub-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--color-text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

/* Rank hero */
.hub-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--color-surface-2);
  border: 1px solid rgba(var(--rgb-cyan), 0.35);
}

.hub-hero-ring {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-hero-ring-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hub-hero-rank {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--color-cyan);
}

.hub-hero-of {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-2);
  margin-top: 2px;
}

.hub-hero-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hub-hero-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hub-hero-sub {
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  line-height: 1.4;
}

/* Metric switch */
.hub-segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr); /* one equal column per button, however many */
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: var(--color-surface-2);
}

.hub-segment-btn {
  height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.hub-segment-btn.active {
  background: var(--color-surface-3);
  color: var(--color-text);
  font-weight: 700;
}

/* Board rows */
.hub-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 14px;
  box-sizing: border-box;
  border-radius: 14px;
  background: var(--color-surface-2);
}

.hub-row.is-me {
  background: var(--color-surface-2);
  border: 1px solid rgba(var(--rgb-cyan), 0.45);
}

.hub-rank {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(var(--rgb-white), 0.1);
  color: var(--color-text-soft);
  font-size: var(--fs-xs);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-rank.gold { background: var(--color-gold); color: var(--color-on-accent); }
.hub-rank.silver { background: var(--color-text-soft); color: var(--color-on-accent); }
.hub-rank.bronze { background: var(--color-bronze); color: var(--color-on-accent); }

/* Pixel avatar on boards and in the feed */
.hub-avatar {
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.hub-avatar.is-me {
  box-shadow: 0 0 0 2px var(--color-cyan);
}

.hub-avatar-img {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   AVATAR MAKER (ui/avatar/editor.js)
   ========================================================================== */
.avatar-editor-backdrop { z-index: 260; }
.avatar-editor {
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(var(--rgb-black), 0.6);
  overflow: hidden;
}
.avatar-editor-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 12px;
}
.avatar-editor-heading { flex: 1; min-width: 0; }
.avatar-editor-title {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
}
.avatar-editor-intro {
  margin: 6px 0 0;
  color: var(--color-text-2);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.avatar-editor-preview {
  position: relative;
  flex: none;
}
.avatar-editor-preview .avatar-img {
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.avatar-shuffle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--color-cyan);
  color: var(--color-on-accent);
  box-shadow: 0 0 0 3px var(--color-surface-1);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.avatar-shuffle:active { transform: rotate(-20deg) scale(0.92); }
/* Tabs are "wardrobe" cards: a small view of the part as worn, its name and the pick. */
.avatar-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px 14px;
  border-bottom: 1px solid var(--color-border);
}
.avatar-tab {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.avatar-tab:active { transform: scale(0.95); }
.avatar-tab.active {
  border-color: var(--color-cyan);
  background: rgba(var(--rgb-cyan), 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--rgb-cyan), 0.18);
}
.avatar-tab-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}
.avatar-tab-art .avatar-img { display: block; max-width: 100%; height: auto; border-radius: 0; }
.avatar-tab-label {
  margin-top: 2px;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.avatar-tab.active .avatar-tab-label { color: var(--color-cyan); }
.avatar-tab-pick {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-2);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-tab-new {
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--color-gold);
  color: var(--color-on-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.avatar-editor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain; /* don't scroll the screen behind at the ends */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--rgb-cyan), 0.3) transparent;
  padding: 14px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-bg-raised);
}
.avatar-editor-body > * { flex-shrink: 0; } /* groups keep their height; the body scrolls */
/* Each item is a card holding its options and the colours that change it. */
.avatar-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid rgba(var(--rgb-white), 0.08);
  border-radius: 16px;
  background: var(--color-surface-1);
}
.avatar-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.avatar-card-title {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: 17px;
  font-weight: 700;
}
.avatar-card-value {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-2);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-card-divider { height: 1px; background: rgba(var(--rgb-white), 0.08); }
.avatar-card-note { color: var(--color-text-2); font-size: var(--fs-xs); }
.avatar-card-link { display: flex; align-items: center; gap: 8px; }
.avatar-colour { display: flex; flex-direction: column; gap: 8px; }
.avatar-colour-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
}
.avatar-colour-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(var(--rgb-black), 0.35);
}
.avatar-colour-name { margin-left: auto; color: var(--color-text-2); font-weight: 500; }
.avatar-editor-body::-webkit-scrollbar { width: 5px; }
.avatar-editor-body::-webkit-scrollbar-thumb {
  background: rgba(var(--rgb-cyan), 0.3);
  border-radius: 4px;
}
.avatar-editor-body::-webkit-scrollbar-track { background: transparent; }
.avatar-group-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--color-text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.avatar-group-note {
  color: var(--color-text-3);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.avatar-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.avatar-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: var(--color-surface-2);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.avatar-option:active { transform: scale(0.94); }
.avatar-option .avatar-img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}
.avatar-option.selected { border-color: var(--color-cyan); }
.avatar-option { position: relative; }
.avatar-option.locked .avatar-img { opacity: 0.4; filter: grayscale(0.7); }
.avatar-option-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(var(--rgb-black), 0.7);
  color: var(--color-text);
  font-size: 11px;
  line-height: 1;
}
.avatar-option-badge.earned { color: var(--color-gold); }
.avatar-lock-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--color-text-soft);
  font-size: var(--fs-xs);
}
.avatar-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: none;
  box-shadow: inset 0 0 0 1px rgba(var(--rgb-black), 0.35);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.avatar-swatch:active { transform: scale(0.9); }
.avatar-swatch.selected {
  box-shadow: 0 0 0 2px var(--color-surface-1), 0 0 0 4px var(--color-cyan);
}
.avatar-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.avatar-editor-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
}
.avatar-editor-actions > button { flex: 1; padding: 11px 14px; }

.hub-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-row-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(var(--rgb-amber), 0.18);
  color: var(--color-amber-light);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
}

.hub-weekbars {
  display: flex;
  gap: 4px;
}

.hub-weekbar {
  width: 16px;
  height: 5px;
  border-radius: 3px;
  background: rgba(var(--rgb-white), 0.16);
}

.hub-weekbar.part { background: var(--color-amber); }
.hub-weekbar.met { background: var(--color-green-bright); }

.hub-metric {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
}

.hub-metric-streak { color: var(--color-amber); }
.hub-metric-stars { color: var(--color-gold); }
/* Activity */
.hub-request {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--color-surface-2);
  border: 1px solid rgba(var(--rgb-cyan), 0.35);
}

.hub-request-text {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 1.3;
}

.hub-btn-primary {
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: var(--color-cyan);
  color: var(--color-on-accent);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}

.hub-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-day-label {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-2);
}

.hub-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--color-surface-2);
}

.hub-event-avatar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}

.hub-event-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-surface-2);
  background: var(--color-bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-event-workout .hub-event-badge { color: var(--color-amber); }
.hub-event-member .hub-event-badge { color: var(--color-cyan); }

.hub-event-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-event-text {
  font-size: var(--fs-sm);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hub-event-sub {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.hub-event-time {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.hub-new-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-cyan);
}

.hub-event-tier {
  padding: 14px;
  --tier: var(--color-sky);
  background: color-mix(in srgb, var(--tier) 12%, var(--color-surface-2));
  border: 1px solid color-mix(in srgb, var(--tier) 60%, transparent);
}

.hub-event-tier.tier-rare { --tier: var(--color-sky); }
.hub-event-tier.tier-epic { --tier: var(--color-purple); }
.hub-event-tier.tier-legendary { --tier: var(--color-orange); }

.hub-event-tier .hub-event-badge {
  width: 22px;
  height: 22px;
  background: var(--tier);
  border-color: color-mix(in srgb, var(--tier) 12%, var(--color-surface-2));
  color: var(--color-on-accent);
}

.hub-event-kicker {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--tier) 70%, var(--color-white));
}

.hub-event-tier .hub-event-text {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* Sheets (add / manage friends / club settings) */
.hub-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(var(--rgb-bg), 0.6);
  display: flex;
  align-items: flex-end;
}

.hub-sheet {
  width: 100%;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-border-accent);
  border-radius: 22px 22px 0 0;
  overflow: hidden;
}

.hub-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
}

.hub-sheet-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.hub-sheet-body {
  overflow-y: auto;
  padding: 4px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-manage-row {
  gap: 10px;
}

/* ==========================================================================
   HOME: social ticker (one line of the latest friends activity, above Today's Workout)
   ========================================================================== */

.social-ticker {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  box-sizing: border-box;
  border-radius: 14px;
  background: var(--color-surface-2);
  border: 1px solid rgba(var(--rgb-cyan), 0.3);
  color: var(--color-text);
  font-family: var(--font-family-body);
  text-align: left;
  cursor: pointer;
}

.social-ticker:hover { border-color: rgba(var(--rgb-cyan), 0.55); }

.ticker-window {
  flex: 1 1 0;
  width: 0; /* never sized by its text, so long lines end in "…" instead of widening the page */
  min-width: 0;
  height: 24px;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.ticker-line {
  height: 24px;
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 24px;
}

.ticker-line-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tone, var(--color-cyan));
  background: color-mix(in srgb, var(--tone, var(--color-cyan)) 16%, transparent);
}

.ticker-line.tone-cyan { --tone: var(--color-cyan); }
.ticker-line.tone-streak { --tone: var(--color-amber); }
.ticker-line.tone-rare { --tone: var(--color-sky); }
.ticker-line.tone-epic { --tone: var(--color-purple); }
.ticker-line.tone-legendary { --tone: var(--color-orange); }

.ticker-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-time {
  flex: 0 0 auto;
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.ticker-chevron {
  flex: 0 0 auto;
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--color-text-2);
}

/* Unread count (friend requests + new friend activity) on the ticker's top-right corner */
.ticker-badge {
  position: absolute;
  top: -9px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 11px;
  background: var(--color-red);
  border: 2px solid var(--color-bg-raised);
  color: var(--color-white);
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Startup load failed: message with a retry button */
.loading-screen.load-failed {
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.loading-screen.load-failed .submit-btn {
  min-width: 160px;
}

/* A load or save that failed after retrying */
.sync-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 700;
  width: calc(100% - 32px);
  max-width: 408px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 12px;
  background: var(--color-red-dark);
  border: 1px solid rgba(var(--rgb-red), 0.6);
  color: var(--color-red-pale);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 6px 20px rgba(var(--rgb-black), 0.45);
}

.sync-banner span { flex: 1; min-width: 0; }

.sync-banner button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-red-pale);
  font-size: var(--fs-lg);
  cursor: pointer;
}

/* ==========================================================================
   TRAINING FOCUS (target icon): Settings card, exercise card note, graph bands
   ========================================================================== */

.focus-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.focus-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(var(--rgb-cyan), 0.12);
  color: var(--color-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.focus-card-label { flex: 1; }

.focus-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
}

.focus-effect {
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-family-body);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.focus-effect-strength { background: rgba(var(--rgb-cyan), 0.14); color: var(--color-cyan); }
.focus-effect-power { background: rgba(var(--rgb-amber), 0.16); color: var(--color-amber); }

.focus-card-week {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text-2);
}

.focus-weeks {
  display: flex;
  gap: 4px;
}

.focus-week {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(var(--rgb-white), 0.12);
}

.focus-week.done { background: rgba(var(--rgb-cyan), 0.55); }
.focus-week.now { background: var(--color-cyan); }

.focus-card-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.45;
}

.focus-card-warning {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-amber-light);
  line-height: 1.4;
}

.focus-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-group-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.focus-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.focus-option {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.focus-option.active {
  border-color: var(--color-cyan);
  background: rgba(var(--rgb-cyan), 0.12);
  color: var(--color-text);
}

.focus-warning {
  padding: 12px;
  border-radius: 12px;
  background: rgba(var(--rgb-red), 0.1);
  border: 1px solid rgba(var(--rgb-red), 0.5);
  color: var(--color-red-pale);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.focus-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Exercise card: focus note in the expanded details */
.ex-callout.focus-callout {
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-callout-icon {
  flex: 0 0 auto;
  display: inline-flex;
  line-height: 0;
  color: var(--color-cyan);
}

/* Exercise pool: focus tag, paused pins */
.pool-focus-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(var(--rgb-cyan), 0.14);
  color: var(--color-cyan);
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.pin-btn.paused {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Progress graph: focus periods */
.progress-focus-band.band-strength { fill: rgba(var(--rgb-cyan), 0.1); }
.progress-focus-band.band-power { fill: rgba(var(--rgb-amber), 0.12); }

.progress-focus-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.progress-focus-label.band-strength { fill: var(--color-cyan); }
.progress-focus-label.band-power { fill: var(--color-amber); }

/* Social: finished focus block */
.hub-event-focus {
  padding: 14px;
  background: color-mix(in srgb, var(--color-cyan) 8%, var(--color-surface-2));
  border: 1px solid rgba(var(--rgb-cyan), 0.45);
}

.hub-event-focus .hub-event-badge {
  width: 22px;
  height: 22px;
  background: var(--color-cyan);
  color: var(--color-on-accent);
  border-color: color-mix(in srgb, var(--color-cyan) 8%, var(--color-surface-2));
}

.hub-event-focus .hub-event-kicker { color: var(--color-cyan); }

/* ==========================================================================
   EQUIPMENT ICONS (outline; masks, so they take the text colour)
   ========================================================================== */
.equip-icon {
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.equip-bodyweight { -webkit-mask-image: url('icons/equipment/bodyweight.svg'); mask-image: url('icons/equipment/bodyweight.svg'); }
.equip-dumbbells { -webkit-mask-image: url('icons/equipment/dumbbells.svg'); mask-image: url('icons/equipment/dumbbells.svg'); }
.equip-kettlebell { -webkit-mask-image: url('icons/equipment/kettlebell.svg'); mask-image: url('icons/equipment/kettlebell.svg'); }
.equip-pullup_bar { -webkit-mask-image: url('icons/equipment/pullup_bar.svg'); mask-image: url('icons/equipment/pullup_bar.svg'); }
.equip-barbell { -webkit-mask-image: url('icons/equipment/barbell.svg'); mask-image: url('icons/equipment/barbell.svg'); }
.equip-resistance_band { -webkit-mask-image: url('icons/equipment/resistance_band.svg'); mask-image: url('icons/equipment/resistance_band.svg'); }
.equip-bench { -webkit-mask-image: url('icons/equipment/bench.svg'); mask-image: url('icons/equipment/bench.svg'); }
.equip-squat_rack { -webkit-mask-image: url('icons/equipment/squat_rack.svg'); mask-image: url('icons/equipment/squat_rack.svg'); }
.equip-parallel_bars { -webkit-mask-image: url('icons/equipment/parallel_bars.svg'); mask-image: url('icons/equipment/parallel_bars.svg'); }
.equip-weight_belt { -webkit-mask-image: url('icons/equipment/weight_belt.svg'); mask-image: url('icons/equipment/weight_belt.svg'); }
.equip-medicine_ball { -webkit-mask-image: url('icons/equipment/medicine_ball.svg'); mask-image: url('icons/equipment/medicine_ball.svg'); }

.equip-chip { gap: 8px; }
.equip-chip .equip-icon { opacity: 0.9; }

.equipment-tag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  overflow-wrap: anywhere; /* a long label wraps inside the tag instead of overflowing the card */
}

.equipment-tag-icons {
  display: inline-flex;
  gap: 3px;
  color: var(--color-text-2);
}

/* Bodyweight-only toggle (home title bar): same round button as the tick and dice */
.title-action.bw-toggle .equip-icon { color: var(--color-cyan); }
.title-action.bw-toggle.active .equip-icon { color: var(--color-on-accent); }

/* ==========================================================================
   HOW IT FELT: end of a guided workout, workout log, activity calendar
   ========================================================================== */
.feeling-question {
  margin-top: 18px;
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--color-text);
}

.feeling-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 12px 0 18px;
  flex-wrap: nowrap;
}

.feeling-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.feeling-btn:hover { transform: translateY(-2px); }

.feeling-btn.selected {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 14%, transparent);
  transform: scale(1.06);
}

.feeling-btn.dimmed { opacity: 0.45; }

.feeling-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-2);
  text-align: center;
  line-height: 1.15; /* "Very Weak" / "Very Strong" wrap to two lines on narrow phones */
}

.feeling-btn.selected .feeling-label { color: currentColor; }

.guided-fs-done-btn:disabled {
  background: rgba(var(--rgb-white), 0.12);
  color: var(--color-text-3);
  box-shadow: none;
  cursor: not-allowed;
}

.feeling-hint {
  margin-top: 10px;
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.log-feeling {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 0 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  vertical-align: middle;
}

.heatmap-cell.is-done.feeling-1 { background: var(--color-red); }
.heatmap-cell.is-done.feeling-2 { background: var(--color-orange); }
.heatmap-cell.is-done.feeling-3 { background: var(--color-yellow); }
.heatmap-cell.is-done.feeling-4 { background: var(--color-lime); }
.heatmap-cell.is-done.feeling-5 { background: var(--color-green-bright); }

/* Exercise pool legend: what the controls on each row mean */
.pool-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(var(--rgb-white), 0.03);
  font-size: var(--fs-xs);
  color: var(--color-text-2);
}

.pool-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pool-legend-icon {
  width: 16px;
  text-align: center;
  font-size: var(--fs-xs);
  line-height: 1;
  flex: 0 0 auto;
}

.pool-legend-icon.heart { color: var(--color-pink); }
.pool-legend-icon.pause { color: var(--color-amber); }


/* Equipment check before the guided timer */
.kit-check {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  justify-content: center;
  background: rgba(var(--rgb-bg), 0.75);
}

.kit-check-panel {
  width: 100%;
  max-width: 440px;
  height: 100%;
  box-sizing: border-box;
  padding: 12px 16px 24px;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.kit-sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--color-text-2);
}

.kit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.kit-item-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(var(--rgb-cyan), 0.1);
  color: var(--color-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kit-item-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.kit-item-name {
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-text);
}

.kit-item-uses {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.35;
}

.kit-need { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px; padding: 8px 10px; border-radius: 10px; background: rgba(var(--rgb-cyan), 0.08); font-size: var(--fs-sm); color: var(--color-text); }
.kit-need-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-cyan); }
.kit-need-line b { font-weight: 700; }
.kit-ex { display: flex; flex-direction: column; gap: 1px; padding-top: 6px; border-top: 1px solid var(--color-border); }
.kit-ex-name { font-size: var(--fs-sm); font-weight: 700; color: var(--color-text); }
.kit-ex-line { font-size: var(--fs-sm); color: var(--color-text-2); line-height: 1.4; }
.kit-ex-line b { color: var(--color-text); font-weight: 600; }
.kit-none {
  display: flex;
  justify-content: center;
  padding: 32px 0;
  color: var(--color-cyan);
}

.kit-edit-btn {
  align-self: center;
  min-height: 44px;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-cyan);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.kit-ready-btn {
  margin-top: auto;
  min-height: 56px;
  border: none;
  border-radius: 16px;
  background: var(--color-cyan);
  color: var(--color-on-accent);
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* Onboarding: collapsed weights list + home-screen note */
.baseline-expander .pool-group-title { flex: 1; text-align: left; font-weight: 600; font-size: var(--fs-sm); }
.baseline-note { margin: 0; font-size: var(--fs-xs); line-height: 1.4; color: var(--color-text-2); }
.baseline-form .baseline-scroll-area { max-height: 300px; }

@media (prefers-reduced-motion: reduce) {
  .prog-ring,
  .prog-seg-fill {
    animation: none !important;
  }
  .prog-seg-fill {
    transition: none !important;
  }
}

/* ONBOARDING: hints shown when Next / Start is tapped before a step is ready */
.onboarding-hint {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(var(--rgb-red), 0.1);
  border: 1px solid rgba(var(--rgb-red), 0.35);
  color: var(--color-red-pale);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.form-group.needs-attention .username-input-wrap {
  border-color: var(--color-red);
  animation: needsAttention 0.45s ease-in-out;
}

@keyframes needsAttention {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .form-group.needs-attention .username-input-wrap { animation: none; }
}

/* Example values read as hints, not as values already entered */
.body-measure-input::placeholder {
  color: var(--color-text-3);
  font-weight: 400;
  font-style: italic;
  opacity: 1;
}

/* GUIDED: the form cue (a few words) for the current exercise. Fixed height like the other
   slots, so the timer never moves; a dark panel keeps the text readable on the green and orange screens. */
.guided-fs-form-cue {
  width: min(100%, 360px);
  height: 3.6rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-black), 0.24);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.guided-fs-form-cue > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guided-fs-form-cue strong {
  font-weight: 800;
}

.guided-fs-form-cue.is-empty {
  visibility: hidden;
}


/* ==========================================================================
   PRIMARY BUTTONS: one look for every main call to action. Dark text on solid
   cyan (14:1 contrast); the white-on-gradient version failed at 1.4:1.
   ========================================================================== */
.onboarding-submit-btn,
.start-workout-big-btn,
.social-primary-btn,
.submit-btn,
.hub-btn-primary,
.kit-ready-btn,
.inline-confirm-ok:not(.danger) {
  background: var(--color-cyan);
  color: var(--color-on-accent);
  border: none;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .onboarding-submit-btn:hover:not(:disabled),
  .start-workout-big-btn:hover:not(:disabled),
  .social-primary-btn:hover:not(:disabled),
  .submit-btn:hover:not(:disabled),
  .hub-btn-primary:hover:not(:disabled),
  .kit-ready-btn:hover:not(:disabled),
  .inline-confirm-ok:not(.danger):hover:not(:disabled) {
    background: color-mix(in srgb, var(--color-cyan) 85%, var(--color-white));
  }
}

.onboarding-submit-btn:active:not(:disabled),
.start-workout-big-btn:active:not(:disabled),
.social-primary-btn:active:not(:disabled),
.submit-btn:active:not(:disabled),
.hub-btn-primary:active:not(:disabled),
.kit-ready-btn:active:not(:disabled),
.inline-confirm-ok:not(.danger):active:not(:disabled) {
  background: color-mix(in srgb, var(--color-cyan) 82%, var(--color-on-accent));
  transform: translateY(1px);
}

.onboarding-submit-btn:focus-visible,
.start-workout-big-btn:focus-visible,
.social-primary-btn:focus-visible,
.submit-btn:focus-visible,
.hub-btn-primary:focus-visible,
.kit-ready-btn:focus-visible,
.inline-confirm-ok:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

@media (max-width: 389px) {
  .title-bar-actions { grid-auto-columns: 58px; }
}
/* Narrow phones (<375px): tighten the pitch so the actions still fit beside the title */
@media (max-width: 374px) {
  .title-bar-actions { grid-auto-columns: 52px; }
  .title-action-label { letter-spacing: -0.2px; }
}


/* Link to the exercise on MuscleWiki, at the end of the card's details */
.wiki-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: rgba(var(--rgb-cyan), 0.08);
  border: 1px solid var(--color-border-accent);
  color: var(--color-cyan);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.wiki-link-arrow {
  font-size: var(--fs-md);
  flex-shrink: 0;
}

@media (hover: hover) {
  .wiki-link:hover { background: rgba(var(--rgb-cyan), 0.16); }
}

.wiki-link:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}


/* Crash fallback (AppErrorBoundary) */
.crash-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--color-bg);
}
.crash-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
}
.crash-details { font-size: var(--fs-xs); color: var(--color-text-3); }
.crash-details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }

/* YOUR DATA (Settings): download / delete account */
.your-data-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.your-data-actions .view-log-btn { min-height: 44px; }
.danger-link-btn {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: none;
  color: var(--color-red-light);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.delete-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-red), 0.08);
  border: 1px solid rgba(var(--rgb-red), 0.45);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.delete-confirm p { margin: 0; }
.delete-confirm-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-2);
}
.text-input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--fs-md);
  letter-spacing: 1px;
}
.text-input:focus { outline: none; border-color: var(--color-cyan); }
.danger-btn {
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: #B91C1C; /* white on this red: 6.4:1 */
  color: var(--color-white);
  font-weight: 800;
  cursor: pointer;
}
.danger-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.your-data-msg { margin-top: 10px; font-size: var(--fs-sm); }
.your-data-msg.ok { color: var(--color-green, #22C55E); }
.your-data-msg.error { color: var(--color-red-light); }
.your-data-links { margin-top: 10px; }
.your-data-links a { color: var(--color-cyan); }

/* Health note (onboarding step 1) and legal line (login screen) */
.health-ack {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-white), 0.04);
  border: 1px solid var(--color-border);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--color-text-2);
  cursor: pointer;
}
.health-ack input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--color-cyan);
  cursor: pointer;
}
.health-ack strong { color: var(--color-text); }
.health-ack a, .auth-legal a { color: var(--color-cyan); }
.auth-legal { font-size: var(--fs-xs); margin-top: 8px; }

/* Offline / syncing notice */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 150;
  padding: 8px 16px;
  background: #3A2A06;
  color: #FDE68A;
  border-bottom: 1px solid rgba(var(--rgb-amber), 0.45);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
}
.offline-banner.syncing {
  background: rgba(var(--rgb-cyan), 0.12);
  color: var(--color-cyan);
  border-bottom-color: var(--color-border-accent);
}

/* kg / lb switch */
.units-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.units-switch-label { font-size: var(--fs-sm); color: var(--color-text-2); font-weight: 600; }
.units-switch .hub-segment { min-width: 140px; }
.units-switch .hub-segment-btn { min-height: 40px; }

/* First-week note (home) */
.first-week-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-cyan), 0.07);
  border: 1px solid var(--color-border-accent);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--color-text-2);
}
.first-week-note p { margin: 6px 0 0; }
.first-week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--color-text); }
.first-week-close {
  flex: none;
  width: 44px; height: 44px; margin: -12px -12px -12px 0;
  background: none; border: none; color: var(--color-text-3);
  font-size: var(--fs-xl); line-height: 1; cursor: pointer;
}

/* Training load notices (home) and Season card (Settings) */
.load-notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-white), 0.04);
  border: 1px solid var(--color-border);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--color-text-2);
}
.load-notice strong { color: var(--color-text); }
.load-notice p { margin: 6px 0 0; }
.load-notice.taper { border-color: var(--color-border-accent); background: rgba(var(--rgb-cyan), 0.07); }
.load-notice-link {
  min-height: 44px;
  padding: 0 2px;
  background: none;
  border: none;
  color: var(--color-cyan);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lighter-callout { border-color: rgba(var(--rgb-amber), 0.5); }
.season-date { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--color-text-2); }
.season-date .text-input { letter-spacing: 0; color-scheme: dark; }
.comp-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comp-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.comp-date { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; justify-self: start; border-radius: var(--radius-sm); background: var(--color-surface-2); font-size: var(--fs-sm); font-weight: 700; color: var(--color-text); cursor: pointer; }
/* The native picker sits invisibly over the DD/MM/YYYY text. */
.comp-date input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; color-scheme: dark; cursor: pointer; }
.comp-date:focus-within { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.comp-priority { grid-column: 1 / -1; grid-row: 2; }
.comp-priority .hub-segment-btn { min-height: 44px; }
.comp-delete { grid-column: 2; grid-row: 1; width: 44px; height: 44px; }
.comp-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px; }

/* Milestones + Month in review (Settings) */
.milestone-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(var(--rgb-white), 0.04);
  font-size: var(--fs-sm);
}
.milestone-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-full); background: rgba(var(--rgb-cyan), 0.12); color: var(--color-cyan); }
.milestone.tier-rare .milestone-icon { color: #60A5FA; background: rgba(96, 165, 250, 0.14); }
.milestone.tier-epic .milestone-icon { color: #C084FC; background: rgba(192, 132, 252, 0.14); }
.milestone.tier-legendary .milestone-icon { color: #FBBF24; background: rgba(251, 191, 36, 0.14); }
.milestone-title { flex: 1; min-width: 0; color: var(--color-text); font-weight: 600; }
.milestone-date { flex: none; color: var(--color-text-3); font-size: var(--fs-xs); }
.milestone-hint { margin-top: 8px; }
.month-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.month-switch { min-width: 190px; }
.month-switch .hub-segment-btn { min-height: 40px; font-size: var(--fs-xs); }
.month-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.month-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--radius-sm); background: rgba(var(--rgb-white), 0.04); font-size: var(--fs-xs); color: var(--color-text-2); }
.month-stat-val { font-family: var(--font-family-heading); font-size: var(--fs-2xl); font-weight: 800; color: var(--color-text); line-height: 1.1; }
.month-gains { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.month-gains li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.month-gain-val { color: var(--color-green-light); font-weight: 700; white-space: nowrap; }

/* Competition rest day (day before / day of): firm rest screen instead of the workout */
.competition-rest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 4px;
  padding: 28px 20px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(var(--rgb-red), 0.16), rgba(var(--rgb-red), 0.05));
  border: 2px solid rgba(var(--rgb-red), 0.6);
}
.competition-rest-icon { font-size: var(--fs-display); line-height: 1; }
.competition-rest-title {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  text-transform: uppercase;
}
.competition-rest-lead { margin: 0; font-size: var(--fs-md); line-height: 1.5; color: var(--color-text); }
.competition-rest-tips {
  align-self: stretch;
  margin: 4px 0 0;
  padding: 12px 14px 12px 32px;
  text-align: left;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-black), 0.25);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--color-text-2);
}
.competition-train-link {
  min-height: 44px;
  margin-top: 4px;
  padding: 0 8px;
  background: none;
  border: none;
  color: var(--color-text-3);
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.competition-confirm {
  align-self: stretch;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-black), 0.3);
  border: 1px solid rgba(var(--rgb-red), 0.5);
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-align: left;
  color: var(--color-text-2);
}
.competition-confirm p { margin: 0; }
.competition-confirm strong { color: var(--color-text); }
.competition-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.competition-confirm-actions button { min-height: 44px; }
.load-notice.rest-alert { border: 2px solid rgba(var(--rgb-red), 0.6); background: rgba(var(--rgb-red), 0.1); }

/* HOW THE TRAINING WORKS (modal) */
.training-info-backdrop { align-items: flex-start; overflow-y: auto; z-index: 400; }
.training-info-card {
  position: relative;
  width: 100%;
  max-width: 408px;
  margin: 8px auto 24px;
  padding: 20px 22px 22px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
}
/* Title bar like the Profile & Settings pages; stays at the top while the page scrolls */
.training-info-card > .training-info-header {
  position: sticky; top: -16px; z-index: 5;
  margin: -20px -22px 14px; padding: 20px 22px 12px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.training-info-header .hub-title { color: var(--color-text); }
.training-info-title {
  margin: 8px 0 14px;
  font-family: var(--font-family-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text);
}
.training-info-text { margin: 0 0 14px; font-size: var(--fs-md); line-height: 1.6; color: var(--color-text-2); }
.training-info-section { margin: 0 0 4px; }
.training-info-para-title { margin: 14px 0 4px; font-family: var(--font-family-heading); font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; color: var(--color-cyan); }
.training-info-section:first-of-type .training-info-para-title { margin-top: 4px; }
.training-info-done { margin-top: 6px; }
.training-info-link {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-cyan);
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.training-info-link.first-week-link { display: inline-block; min-height: 44px; margin-top: 4px; font-size: var(--fs-sm); }
.training-info-link.about-training-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 14px; text-decoration: none; }
.onboarding-intro { margin-top: -4px; }

/* SETTINGS MENU (Profile & Settings hub -> one page per area) */
.settings-menu { display: flex; flex-direction: column; gap: 8px; }
.settings-menu-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 12px 12px 12px 14px;
  background: rgba(var(--rgb-surface-2), 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text); text-align: left; cursor: pointer;
  font: inherit;
}
.settings-menu-row:hover { border-color: rgba(var(--rgb-cyan), 0.45); }
.settings-menu-row:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.settings-menu-icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(var(--rgb-cyan), 0.1); color: var(--color-cyan);
}
.settings-menu-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-menu-title { font-weight: 700; font-size: var(--fs-md); }
.settings-menu-summary { font-size: var(--fs-sm); line-height: 1.35; color: var(--color-text-2); overflow-wrap: anywhere; }
.settings-menu-chevron { flex: 0 0 auto; display: inline-flex; color: var(--color-text-3); }

/* Profile & Settings title bar stays at the top while the page scrolls (it is the only way out) */
.profile-modal-card > .profile-modal-header {
  position: sticky; top: -20px; z-index: 5;
  margin: -20px -16px 0; padding: 20px 16px 12px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.profile-modal-heading { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-modal-heading .hub-title { flex: 0 0 auto; line-height: 1.15; }
.profile-modal-heading .hub-title.settings-page-title { font-size: var(--fs-lg); }

/* ==========================================================================
   WHERE YOU TRAIN (home screen menu, Settings and onboarding cards) and HOME WEIGHTS
   ========================================================================== */
.location-menu { position: static; display: flex; justify-content: center; }
.section-title-bar { position: relative; }
.title-action.location-toggle .equip-icon { color: var(--color-cyan); }
.title-action.location-toggle.active .equip-icon { color: var(--color-on-accent); }
.location-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  width: min(260px, 100%); padding: 10px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(var(--rgb-black), 0.6);
  display: flex; flex-direction: column; gap: 6px;
}
.location-pop-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-3); padding: 2px 4px; }
.location-pop-note { font-size: var(--fs-xs); color: var(--color-text-3); padding: 2px 4px; }
.location-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px;
  background: rgba(var(--rgb-surface-2), 0.5); border: 1px solid var(--color-border); border-radius: var(--radius-sm, 10px);
  color: var(--color-text); text-align: left; cursor: pointer; font: inherit;
}
.location-opt.selected { border-color: var(--color-cyan); background: rgba(var(--rgb-cyan), 0.1); }
.location-opt-icon { display: inline-flex; color: var(--color-cyan); }
.location-opt-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.location-opt-label { font-weight: 700; font-size: var(--fs-sm); }
.location-opt-blurb { font-size: var(--fs-xs); color: var(--color-text-2); }
.location-opt-check { color: var(--color-cyan); display: inline-flex; }

.location-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.location-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; padding: 10px 6px;
  background: rgba(var(--rgb-surface-2), 0.5); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  color: var(--color-text); cursor: pointer; font: inherit; text-align: center;
}
.location-card.selected { border-color: var(--color-cyan); background: rgba(var(--rgb-cyan), 0.12); box-shadow: 0 0 0 1px var(--color-cyan) inset; }
.location-card-icon { color: var(--color-cyan); display: inline-flex; }
.location-card-label { font-weight: 700; font-size: var(--fs-sm); }
.location-card-blurb { font-size: var(--fs-xs); color: var(--color-text-2); line-height: 1.25; }

.inventory-editor { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.inv-intro, .inv-empty { margin: 0; font-size: var(--fs-sm); color: var(--color-text-2); }
.inv-section { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: rgba(var(--rgb-surface-2), 0.35); }
.inv-section-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0; background: none; border: none; color: var(--color-cyan); font: inherit; text-align: left; cursor: pointer; }
.inv-section-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-section-head strong { color: var(--color-text); font-size: var(--fs-sm); }
.inv-section-summary { font-size: var(--fs-xs); color: var(--color-text-2); }
.inv-section-edit { flex: 0 0 auto; font-size: var(--fs-sm); font-weight: 700; color: var(--color-cyan); padding: 6px 4px; }
.inv-sub { font-size: var(--fs-xs); color: var(--color-text-3); margin-top: 4px; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-chip { min-height: 40px; padding: 0 12px; }
.inv-row { display: flex; align-items: center; gap: 6px; }
.inv-row-weight { flex: 0 0 50px; font-size: var(--fs-sm); font-weight: 700; color: var(--color-text); white-space: nowrap; }
.inv-row-icons { flex: 1 1 auto; min-width: 0; max-width: 228px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.inv-icon {
  width: 100%; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  color: var(--color-text-3); opacity: 0.55; transition: opacity 0.15s ease, color 0.15s ease;
}
.inv-icon.on { color: var(--color-cyan); opacity: 1; background: rgba(var(--rgb-cyan), 0.1); border-color: rgba(var(--rgb-cyan), 0.35); }
.inv-icon:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 1px; }
.inv-add { display: flex; gap: 6px; align-items: center; }
.inv-add-input { flex: 1 1 0; width: 0; min-width: 0; min-height: 40px; }
.inv-add-btn { min-height: 40px; }
.inv-summary { font-size: var(--fs-xs); color: var(--color-text-2); }
.inv-toggle { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); min-height: 36px; }
.inv-adj-group { border: 1px solid var(--color-border, rgba(255,255,255,0.14)); border-radius: 10px; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.inv-adj-group-off { padding-bottom: 2px; }
.kit-duration { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-1, var(--color-text-2)); }
.inv-adj { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inv-adj-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-xs); color: var(--color-text-3); }
.inv-adj-field .text-input { min-height: 40px; min-width: 0; width: 100%; }

/* Bridging between big weight jumps (exercise card) */
.set-plan { font-size: var(--fs-sm); font-weight: 700; color: var(--color-text); padding: 8px 10px; border-radius: var(--radius-sm, 10px); background: rgba(var(--rgb-cyan), 0.08); border: 1px dashed rgba(var(--rgb-cyan), 0.4); }
.load-howto { font-size: var(--fs-sm); color: var(--color-text-2); }
.load-howto-label { color: var(--color-text-3); font-weight: 600; }
.bridge-callout { display: flex; flex-direction: column; gap: 4px; border-color: rgba(var(--rgb-amber), 0.45); }
.bridge-tag { align-self: flex-start; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-amber); }
.bridge-callout.is-ceiling .bridge-tag { color: var(--color-text-2); }
.set-plan-hint { display: block; margin-top: 4px; font-size: var(--fs-xs); font-weight: 500; color: var(--color-text-3); }
.location-card-blurb { overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.location-card-label { white-space: nowrap; }
.location-card { min-width: 0; }
@media (max-width: 360px) {
  .location-card { padding: 10px 2px; }
  .location-card-label { font-size: var(--fs-xs); }
}
@media (max-width: 340px) {
  .location-card-label { font-size: 0.7rem; letter-spacing: -0.1px; }
}
/* Very narrow phones (320px): the title may wrap so the three actions still fit. */
@media (max-width: 359px) {
  .section-title-bar .section-title { white-space: normal; min-width: 0; line-height: 1.15; }
}
.training-info-sources-title { margin: 8px 0 8px; font-size: var(--fs-md); font-family: var(--font-family-heading); color: var(--color-text); }
.training-info-sources { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.training-info-sources li { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); line-height: 1.4; }
.training-info-sources a { color: var(--color-cyan); overflow-wrap: anywhere; }
.training-info-cite { color: var(--color-text-3); font-size: var(--fs-xs); }

/* YOUR MAX (exercise cards, Settings, onboarding) and today's sets */
.max-panel { container-type: inline-size; display: flex; flex-direction: column; gap: 8px; background: rgba(var(--rgb-white), 0.04); padding: 10px; border-radius: var(--radius-sm); }
.max-panel-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.max-editor { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.max-value { flex: 1 1 auto; min-width: 4.5ch; display: flex; align-items: baseline; justify-content: center; gap: 2px; padding: 0 2px; cursor: text; }
.max-input {
  width: 100%; min-width: 3ch; max-width: 5.5ch; padding: 0; border: none; background: transparent; text-align: right;
  font-family: var(--font-family-heading); font-size: var(--fs-md); font-weight: 700; color: var(--color-text);
  -moz-appearance: textfield; appearance: textfield;
}
.max-input::-webkit-outer-spin-button, .max-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.max-input:focus { outline: none; }
.max-value:focus-within { box-shadow: inset 0 -2px 0 var(--color-cyan); }
.max-unit { font-size: var(--fs-xs); font-weight: 700; color: var(--color-text-2); }
.sets-today { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sets-today-text { min-height: 44px; display: flex; align-items: center; font-family: var(--font-family-heading); font-size: var(--fs-sm); font-weight: 700; color: var(--color-cyan); line-height: 1.25; }
.max-help { margin: 0; font-size: var(--fs-xs); color: var(--color-text-3); line-height: 1.4; }
.step-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.baseline-max { display: flex; flex-direction: column; gap: 4px; }
.baseline-first { font-size: var(--fs-xs); color: var(--color-cyan); font-weight: 600; }
.baseline-first-label { color: var(--color-text-3); font-weight: 500; }
.progression-panel { display: flex; flex-direction: column; gap: 6px; }
.progression-header { display: flex; align-items: center; justify-content: space-between; }
.progression-stepper { width: 100%; display: flex; align-items: stretch; justify-content: space-between; height: auto; min-height: 44px; }
.progression-stepper .step-btn { height: auto; min-height: 44px; }
.progression-display {
  flex: 1 1 auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-cyan);
  line-height: 1.25;
  text-align: center;
  padding: 4px 8px;
}
.baseline-progression { margin-top: 2px; }
.baseline-stepper { width: 100%; max-width: 260px; }
.baseline-display {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-cyan);
  text-align: center;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Narrow panels (pool inside Settings, small phones): max above Today, so the value never collapses */
@container (max-width: 280px) {
  .max-panel-row { grid-template-columns: 1fr; }
  .sets-today-text { min-height: 0; }
}
@media (max-width: 359px) {
  .max-panel-row { grid-template-columns: 1fr; }
  .sets-today-text { min-height: 0; }
}

/* Unbridgeable jump between owned weights (inventory editor) */
.inv-gap-warning { margin: 8px 0 2px; padding: 8px 10px; border: 1px solid rgba(var(--rgb-amber), 0.45); border-radius: 10px; background: rgba(var(--rgb-amber), 0.08); color: var(--color-text-soft); font-size: var(--fs-xs); line-height: 1.45; }
.inv-gap-warning strong { color: var(--color-amber); }

/* ==========================================================================
   ON FIRE: 3+ workouts this week (Monday to Sunday). Animated streak flame in the header
   and flames around the person's photo wherever friends and clubs see them.
   ========================================================================== */
.streak-badge.on-fire:not(.streak-celebrating) .streak-flame {
  animation: onFireFlicker 1.3s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(var(--rgb-orange), 0.9));
}
@keyframes onFireFlicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  25% { transform: scale(1.12, 1.2) rotate(2deg); }
  50% { transform: scale(0.96, 1.05) rotate(-1deg); }
  75% { transform: scale(1.08, 1.14) rotate(3deg); }
}

.flame-ring {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: var(--ring);
  height: var(--ring);
  isolation: isolate;
}
.flame-ring > :last-child {
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 2px #fb923c;
  border-radius: 50%;
}
.flame-ring-glow {
  position: absolute;
  inset: -4px;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f59e0b, #ef4444, #f97316, #fde68a, #fb923c, #f59e0b);
  filter: blur(3px);
  opacity: 0.85;
  animation: flameSpin 3.2s linear infinite;
}
.flame-ring-tongues {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.flame-tongue {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--ring) * 0.3);
  height: calc(var(--ring) * 0.46);
  margin-left: calc(var(--ring) * -0.15);
  margin-top: calc(var(--ring) * -0.23);
  transform: rotate(calc(var(--i) * 45deg)) translateY(calc(var(--ring) * -0.47));
}
.flame-tongue::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: radial-gradient(ellipse at 50% 78%, #fff7cc 0 14%, #fbbf24 34%, #f97316 58%, rgba(239, 68, 68, 0) 76%);
  transform-origin: 50% 100%;
  animation: flameTongue 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.137s);
}
@keyframes flameTongue {
  0% { transform: scale(0.85, 0.75); opacity: 0.85; }
  50% { transform: scale(0.95, 1.12); opacity: 1; }
  100% { transform: scale(0.8, 0.9) skewX(6deg); opacity: 0.9; }
}
@keyframes flameSpin { to { transform: rotate(360deg); } }
.profile-trigger-btn.is-on-fire { border-color: rgba(var(--rgb-orange), 0.6); }
.hub-tag.hub-tag-fire { background: rgba(var(--rgb-orange), 0.2); color: #fdba74; }
.hub-event-onfire .hub-event-kicker { color: #fb923c; }
.on-fire-note { color: #fdba74; font-weight: 600; }

/* Still flames (no movement) for people who turn motion down. */
@media (prefers-reduced-motion: reduce) {
  .streak-badge.on-fire .streak-flame,
  .flame-ring-glow,
  .flame-tongue::before { animation: none !important; }
}

/* HELP TIP: grey circled "?" beside a label, opening a small explanation bubble */
.max-panel { position: relative; }
.max-editor-label { display: inline-flex; align-items: center; gap: 6px; }
.help-tip { display: inline-flex; }
.help-tip-btn {
  position: relative;
  width: 18px; height: 18px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-text-3);
  background: none; color: var(--color-text-3);
  font-family: var(--font-family-heading); font-size: 11px; font-weight: 800; line-height: 1;
  cursor: pointer;
}
.help-tip-btn::after { content: ''; position: absolute; inset: -13px; } /* 44px tap target */
.help-tip-btn:hover, .help-tip-btn.open { color: var(--color-text-2); border-color: var(--color-text-2); }
.help-tip-btn:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.help-tip-bubble {
  position: absolute; left: 8px; right: 8px; top: 34px; z-index: 20;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2, #1b2540);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(var(--rgb-black), 0.55);
  font-size: var(--fs-sm); line-height: 1.45; color: var(--color-text-2);
  animation: helpTipIn 0.14s ease-out;
}
@keyframes helpTipIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .help-tip-bubble { animation: none; } }

/* ==========================================================================
   YOUR ROTATION (Settings) and the EXERCISE LIBRARY behind its + button
   ========================================================================== */
.rotation-header { gap: 12px; }
.rotation-section .pool-exercise-actions { gap: 2px; }
.rotation-add-btn { width: 40px; height: 40px; }
.rotation-desc { margin: 2px 0 0; }
.pool-legend-minus {
  width: 16px; height: 16px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-text-3); color: var(--color-text-2);
}
.rotation-remove-btn {
  /* Same size and hit area as the pause / heart / pin icons beside it. */
  padding: 0 2px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; line-height: 1;
  color: var(--color-text-3);
  cursor: pointer;
}
.rotation-remove-btn:hover:not([aria-disabled="true"]) { color: var(--color-red-light); }
.rotation-row-chevron { margin-left: 10px; padding-left: 4px; cursor: pointer; }
.pool-exercise.is-expanded .rotation-row-chevron { transform: rotate(90deg); }
.rotation-remove-btn:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.rotation-remove-btn[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
.pool-group.is-empty .pool-group-count { color: var(--color-amber); }
.rotation-empty {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(var(--rgb-cyan), 0.45);
  background: rgba(var(--rgb-cyan), 0.06);
  color: var(--color-cyan); font-weight: 600; font-size: var(--fs-sm); text-align: left;
  cursor: pointer;
}

.library-card { padding-bottom: 18px; }
.library-top {
  position: sticky; top: -16px; z-index: 5;
  margin: -20px -22px 8px; padding: 20px 22px 12px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.library-header .hub-title { color: var(--color-text); }
.library-search {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 0; padding: 0 10px 0 12px; min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.library-search:focus-within { border-color: rgba(var(--rgb-cyan), 0.6); }
.library-search-icon { display: inline-flex; color: var(--color-text-3); flex: 0 0 auto; }
.library-search-input {
  flex: 1 1 auto; min-width: 0; height: 46px;
  border: 0; outline: 0; background: transparent;
  color: var(--color-text); font: inherit; font-size: var(--fs-md);
}
.library-search-input::-webkit-search-cancel-button { display: none; }
.library-search-clear {
  width: 32px; height: 32px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.08); color: var(--color-text-2); cursor: pointer;
}
.library-results { min-height: 1.2em; margin: 0 0 4px; font-size: var(--fs-sm); color: var(--color-text-3); }
.library-group { margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.library-group-title { margin: 4px 0 0; }
.library-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  background: rgba(var(--rgb-white), 0.03);
  min-width: 0;
}
.library-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 8px 10px 8px 12px;
  border-radius: var(--radius-sm);
}
.library-row-left { gap: 10px; }
.library-item.is-expanded .library-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.library-row-text { flex: 1 1 auto; }
.library-row.is-added { background: rgba(var(--rgb-cyan), 0.05); }
.library-add-btn { width: 40px; height: 40px; }
.library-added {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  min-height: 40px; padding: 0 4px; border: 0; background: none; cursor: default;
  font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-3);
}
.library-history-tag {
  padding: 1px 7px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.3px;
  background: rgba(var(--rgb-amber), 0.14); color: var(--color-amber);
}
.library-done { margin-top: 16px; }

/* A callout right above the details section: the gap below it matches the gap above it. */
.ex-callout + .expandable-details-section { margin-top: 0; }

.loading-screen.load-failed .load-failed-detail { margin: 0; max-width: 32ch; font-size: var(--fs-xs); color: var(--color-text-3); overflow-wrap: anywhere; }

/* Sign-in screen */
.auth-card { text-align: left; }
.auth-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 46px; margin-top: 16px; padding: 0 16px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: var(--radius-sm);
  font-family: var(--font-family-body); font-size: var(--fs-md); font-weight: 600; cursor: pointer;
}
.auth-google-btn:disabled { opacity: 0.6; cursor: default; }
.auth-google-btn:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--color-text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-2); }
.auth-input-wrap { position: relative; display: flex; }
.auth-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 12px;
  background: var(--color-surface-2); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: var(--font-family-body); font-size: 16px; /* 16px stops iPhones zooming in */
}
.auth-input:focus { outline: none; border-color: var(--color-cyan); }
.auth-input-wrap .auth-input { padding-right: 64px; }
.auth-show-btn {
  position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 10px;
  background: none; border: none; border-radius: var(--radius-sm);
  color: var(--color-cyan); font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}
.auth-hint { margin: -4px 0 0; font-size: var(--fs-xs); color: var(--color-text-3); }
.auth-error {
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.4;
  color: var(--color-text); background: rgba(var(--rgb-red, 239, 68, 68), 0.12); border: 1px solid rgba(var(--rgb-red, 239, 68, 68), 0.45);
}
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.auth-link-btn { background: none; border: none; padding: 6px 0; color: var(--color-cyan); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* GUIDED: bigger exercise name and weight/reps, and the MuscleWiki link beside the form cue */
.guided-fs-current-label { height: 4rem; font-size: var(--fs-xl); }
.guided-fs-current-detail { height: 3.4rem; font-size: var(--fs-xl); font-weight: 800; opacity: 1; margin-top: -4px; }
.guided-fs-sub-note { font-size: var(--fs-md); height: 1.4rem; line-height: 1.4rem; }
.guided-fs-cue-row { display: flex; align-items: stretch; justify-content: center; gap: 8px; width: min(100%, 400px); }
.guided-fs-cue-row .guided-fs-form-cue { flex: 1; min-width: 0; width: auto; }
.guided-fs-wiki-link { flex: 0 0 3.6rem; height: 3.6rem; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: rgba(var(--rgb-black), 0.24); color: inherit; text-decoration: none; }
.guided-fs-wiki-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.start-workout-resume { display: flex; flex-direction: column; gap: 6px; }
.start-workout-big-btn .resume-sub { display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; opacity: 0.8; }
.start-over-btn { background: none; border: none; color: var(--color-text-2); font-size: var(--fs-sm); text-decoration: underline; cursor: pointer; padding: 6px; }

/* FOCUS BLOCK POOL (popup at block start, and the Settings focus card) */
.block-intro-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-2);
}
.block-intro-title { margin: 14px 0 10px; }
.block-intro-next { margin: 14px 0 16px; }
.block-pool { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.block-pool-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; }
.block-pool dt { font-size: var(--fs-xs); font-weight: 700; color: var(--color-text-2); }
.block-pool dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.block-pool-ex {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(var(--rgb-white), 0.07);
  font-size: var(--fs-sm); font-weight: 600; color: var(--color-text);
}
.block-pool-ex.is-focus { background: rgba(var(--rgb-cyan), 0.14); color: var(--color-cyan); }

/* Known max entry (onboarding) and calibration status */
.known-max-fields { display: flex; align-items: center; gap: 6px; }
.known-max-input {
  width: 72px; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: rgba(var(--rgb-surface-2), 0.6); color: inherit; font-size: var(--fs-sm);
}
.known-max-x { color: var(--color-text-3); }
.known-max-q { display: flex; gap: 8px; }
.known-max-q button { flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: transparent; color: var(--color-text-2); font-weight: 700; cursor: pointer; }
.known-max-q button.active { background: var(--color-cyan); border-color: var(--color-cyan); color: var(--color-on-accent); }
.known-max-help { font-size: var(--fs-xs); color: var(--color-text-3); margin: 0; }
.pool-calibrate-tag {
  padding: 1px 7px; border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: 700;
  background: rgba(var(--rgb-amber), 0.15); color: var(--color-amber);
}
.pool-tag-row .pool-calibrate-tag, .pool-tag-row .pool-needs-tag { flex: 0 0 100%; max-width: max-content; }
.calibration-unlock { display: flex; justify-content: center; margin-top: 8px; }
.calibration-actions { gap: 8px; }
.calibration-actions .calibration-btn { flex: 1; padding: 10px 12px; }
.calibration-btn.primary { background: var(--color-cyan); border-color: var(--color-cyan); color: var(--color-on-accent); }
.calibration-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.calibration-btn { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: transparent; color: var(--color-text-2); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.library-note { font-size: var(--fs-xs); color: var(--color-text-3); }

/* ==========================================================================
   TRAINING-DAY REMINDERS (Settings → Schedule)
   ========================================================================== */

.reminder-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--rgb-white), 0.1);
}

.reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-title {
  font-family: var(--font-family-heading);
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--color-text);
}

.reminder-sub {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
  margin-top: 2px;
}

.reminder-switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--color-grey-700);
  border: 1px solid var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.reminder-switch.on {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-blue) 100%);
  box-shadow: 0 0 10px rgba(var(--rgb-cyan), 0.4);
}

.reminder-switch:disabled {
  opacity: 0.5;
  cursor: default;
}

.reminder-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-white);
  transition: transform 0.2s ease;
}

.reminder-switch.on .reminder-switch-knob {
  transform: translateX(20px);
}

.reminder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reminder-time-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-2);
}

.reminder-time-input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  color-scheme: dark;
  outline: none;
}

.reminder-time-input:focus {
  border-color: var(--color-cyan);
}

.reminder-row .view-log-btn {
  margin-left: auto;
}

.reminder-note {
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.4;
}

.reminder-msg {
  font-size: var(--fs-xs);
  font-weight: 700;
}

.reminder-msg.ok { color: var(--color-green); }
.reminder-msg.error { color: var(--color-red); }


/* ==========================================================================
   SETTINGS: PRIVACY
   ========================================================================== */
.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--rgb-white), 0.08);
}

.privacy-row:first-child { padding-top: 0; }

.privacy-text { min-width: 0; }

/* ActionRow: a privacy-row with a button, last in its card (Test my jump now, lighter week). */
.action-row { padding: 2px 0 0; border-bottom: none; }
.action-row .view-log-btn { flex-shrink: 0; min-width: 76px; min-height: 44px; padding: 0 16px; font-size: var(--fs-sm); }

.privacy-foot { margin-top: 12px; }

/* ==========================================================================
   WELCOME, GUEST MODE AND SHORT ONBOARDING
   ========================================================================== */
.auth-secondary-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.auth-guest-link { display: block; margin: 6px auto 0; }

.onboarding-dots { display: flex; gap: 6px; margin-bottom: 4px; }
.onboarding-dot {
  width: 22px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.15);
  transition: background 0.25s ease, width 0.25s ease;
}
.onboarding-dot.on { width: 34px; background: var(--color-cyan); }
.health-more { padding: 0; font-size: var(--fs-sm); }
.health-more-text { font-size: var(--fs-xs); color: var(--color-text-2); line-height: 1.45; margin: -4px 0 0; }
.health-more-text a { color: var(--color-cyan); }

.guest-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(var(--rgb-cyan), 0.07);
  border: 1px solid var(--color-border-accent);
}
.guest-card-title { font-family: var(--font-family-heading); font-weight: 800; font-size: var(--fs-sm); color: var(--color-text); }
.guest-card-sub { font-size: var(--fs-xs); color: var(--color-text-2); margin-top: 2px; }
.guest-card-btn {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-cyan);
  color: var(--color-on-accent);
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.guest-limit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 16px;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
}
.guest-limit-icon { color: var(--color-orange); }
.guest-limit-title { font-family: var(--font-family-heading); font-size: var(--fs-xl); font-weight: 800; }
.guest-limit-sub { font-size: var(--fs-sm); color: var(--color-text-2); line-height: 1.4; max-width: 300px; }

/* ==========================================================================
   LOADING SKELETON (shown while the app and today's workout load)
   ========================================================================== */
.skel-screen { padding: 16px; gap: 14px; }
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(var(--rgb-white), 0.05) 0%, rgba(var(--rgb-white), 0.11) 50%, rgba(var(--rgb-white), 0.05) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.3s ease-in-out infinite;
}
.skel-header { display: flex; align-items: center; gap: 10px; }
.skel-logo { width: 110px; height: 30px; margin-right: auto; }
.skel-pill { width: 90px; height: 28px; border-radius: var(--radius-full); }
.skel-avatar { width: 32px; height: 32px; border-radius: 50%; }
.skel-ticker { height: 44px; border-radius: 14px; }
.skel-title { width: 55%; height: 24px; }
.skel-cta { height: 52px; border-radius: var(--radius-md); }
.skel-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.skel-line-short { width: 40%; height: 14px; }
.skel-row { height: 44px; }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* "Why?" link that opens a longer explanation (MoreInfo in ui/common.js) */
.more-info { margin-top: 4px; }
.more-info-btn {
  min-height: 32px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-cyan);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}
.more-info-text { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--color-text-2); line-height: 1.45; }
.block-intro-card .more-info { margin: 10px 0 14px; }
.onboarding-form .location-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ==========================================================================
   GESTURES: swipe to swap, pull to refresh (ui/gestures.js)
   ========================================================================== */
.exercise-card-header { touch-action: pan-y; transition: transform 0.2s ease; position: relative; z-index: 1; }
.exercise-card-header.is-swiping { transition: none; }
.swipe-swap-hint {
  position: absolute;
  top: 0;
  right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--color-text-2);
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: color 0.15s ease;
}
.swipe-swap-hint.ready { color: var(--color-cyan); }
.hub-content { touch-action: pan-y; }
.social-hub-panel { transition: transform 0.2s ease; }
.pull-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.2s ease;
}
.pull-refresh-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(var(--rgb-cyan), 0.25);
  border-top-color: var(--color-cyan);
}
.pull-refresh.is-refreshing .pull-refresh-spinner { animation: pull-spin 0.8s linear infinite; }
@keyframes pull-spin { to { transform: rotate(360deg); } }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Share today's workout" card (ui/share-workout.js) */
.share-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(var(--rgb-cyan), 0.12), rgba(var(--rgb-purple), 0.12));
  border: 1px solid var(--color-border-accent);
}
.share-card-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.share-card-done { font-family: var(--font-family-heading); font-weight: 800; font-size: var(--fs-sm); color: var(--color-text); }
.share-card-stat { font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-soft); }
.share-card-btn {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-cyan);
  color: var(--color-on-accent);
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.training-info-section .training-info-text:not(:last-child) { margin-bottom: 10px; }

/* Finish on a calibration day: dimmed, and a note saying to use the guided workout */
.title-action.locked { opacity: 0.45; }
.finish-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(var(--rgb-cyan), 0.08);
  border: 1px solid var(--color-border-accent);
  font-size: var(--fs-xs);
  color: var(--color-text-2);
  line-height: 1.45;
}

/* ==========================================================================
   JUMP TEST (ui/jump-test/): full screen. Intro and results are dark; the warm-up
   reuses the guided look; on camera, colour = state (amber adjusting, green in
   position, red recording) as a frame and a banner readable from 3 m.
   ========================================================================== */
.jt-root { position: fixed; inset: 0; z-index: 150; }
/* Test Mode: the banner (z-index 500) would cover the top bar and ✕; above it the confetti (300) would be hidden, so hide the banner instead */
body:has(.jt-root) .test-mode-banner { display: none; }
.jt-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top, 0px), 16px) 16px max(env(safe-area-inset-bottom, 0px), 20px);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-y: auto;
}
.jt-close {
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: var(--radius-full);
  border: 1px solid rgba(var(--rgb-white), 0.25);
  background: rgba(var(--rgb-black), 0.35);
  color: var(--color-white);
  font-size: var(--fs-md);
  cursor: pointer;
}
.jt-topline-right { display: flex; align-items: center; gap: 10px; }
.jt-step-name {
  font-family: var(--font-family-heading);
  font-size: var(--fs-2xl);
  font-weight: 900;
  line-height: 1.1;
  max-width: 100%;
}
.jt-step-cue { font-size: var(--fs-md); font-weight: 600; opacity: 0.92; min-height: 1.4em; }
.jt-warmup .guided-fs-btn { min-height: 52px; }

/* Buttons: one primary per screen */
.jt-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; margin: 0 auto; }
.jt-btn {
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-family-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(var(--rgb-white), 0.2);
  background: rgba(var(--rgb-black), 0.35);
  color: var(--color-text);
}
.jt-btn.primary { background: var(--color-cyan); border-color: transparent; color: var(--color-on-accent); }
.jt-btn:disabled { opacity: 0.5; cursor: default; }
.jt-btn:active:not(:disabled) { transform: scale(0.97); }
.jt-link-btn {
  min-height: 44px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--color-cyan);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
}

/* Intro */
.jt-intro-top { display: flex; }
.jt-intro-body { flex: 1; width: 100%; max-width: 420px; margin: 0 auto; padding: 8px 0 20px; display: flex; flex-direction: column; gap: 14px; }
.jt-title { font-family: var(--font-family-heading); font-size: var(--fs-2xl); font-weight: 900; }
.jt-lead { font-size: var(--fs-md); color: var(--color-text-soft); line-height: 1.45; }
.jt-height-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  padding: 6px 8px 6px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  font-size: var(--fs-md);
}
.jt-height-edit { display: flex; align-items: center; gap: 10px; flex: 1; }
.jt-height-edit input {
  width: 90px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-accent);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--fs-lg);
  font-weight: 700;
}
.jt-error { color: var(--color-red-light); font-size: var(--fs-sm); margin-top: -6px; }
.jt-checklist { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.jt-checklist li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-md); color: var(--color-text-soft); line-height: 1.35; }
.jt-check-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--rgb-cyan), 0.12);
  color: var(--color-cyan);
}

/* Camera: the video fills the screen letterboxed (what you see is what's analysed) */
.jt-cam { padding: 0; overflow: hidden; background: var(--color-black); --jt-tone: rgba(var(--rgb-white), 0.15); }
.jt-cam::after { content: ""; position: absolute; inset: 0; border: 10px solid var(--jt-tone); pointer-events: none; transition: border-color 0.3s ease; }
.jt-cam.tone-adjust { --jt-tone: var(--color-amber); }
.jt-cam.tone-ready, .jt-cam.tone-go { --jt-tone: var(--color-green); }
.jt-cam.tone-rec { --jt-tone: var(--color-red); background: var(--color-red-dark); }
.jt-cam.tone-rest { --jt-tone: var(--color-surface-3); background: var(--color-surface-1); }
.jt-cam.tone-error { --jt-tone: rgba(var(--rgb-red), 0.5); }
.jt-cam.tone-measure { --jt-tone: rgba(var(--rgb-cyan), 0.35); background: var(--color-bg); }
.jt-cam.tone-measure .jt-video { display: none; }
.jt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.jt-sim { background: repeating-linear-gradient(135deg, var(--color-surface-1) 0 20px, var(--color-bg) 20px 40px); }
.jt-cam.tone-rest .jt-video, .jt-cam.tone-error .jt-video { opacity: 0.25; }
.jt-cam-top, .jt-banner, .jt-cam-center, .jt-cam-bottom { position: relative; z-index: 1; }
.jt-cam-top { display: flex; align-items: center; gap: 10px; padding: max(env(safe-area-inset-top, 0px), 18px) 18px 0; }
.jt-stage { font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.4px; text-shadow: 0 1px 6px rgba(var(--rgb-black), 0.8); }
.jt-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-black), 0.55);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.jt-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-red); animation: jt-blink 1s steps(2, start) infinite; }
@keyframes jt-blink { to { visibility: hidden; } }
.jt-banner {
  margin: 12px 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--jt-tone);
  color: var(--color-white);
  font-family: var(--font-family-heading);
  font-size: var(--fs-2xl);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 4px rgba(var(--rgb-black), 0.35);
}
.jt-cam.tone-adjust .jt-banner { color: var(--color-on-accent); text-shadow: none; }
.jt-cam.tone-idle .jt-banner, .jt-cam.tone-rest .jt-banner { background: rgba(var(--rgb-black), 0.65); }
.jt-cam.tone-error .jt-banner { background: var(--color-surface-1); border: 1px solid rgba(var(--rgb-red), 0.5); font-size: var(--fs-lg); }
.jt-cam-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  text-align: center;
  text-shadow: 0 2px 16px rgba(var(--rgb-black), 0.7);
}
.jt-cam-title { font-family: var(--font-family-heading); font-size: var(--fs-xl); font-weight: 900; letter-spacing: 1px; }
.jt-cam-big { font-family: var(--font-family-heading); font-size: var(--fs-timer); font-weight: 900; line-height: 1; }
.jt-cam-sub { font-size: var(--fs-lg); font-weight: 700; }
.jt-progress { width: min(78%, 300px); height: 10px; border-radius: var(--radius-full); background: rgba(var(--rgb-white), 0.15); overflow: hidden; }
.jt-progress-fill { height: 100%; background: var(--color-cyan); transition: width 0.2s linear; }
.jt-cam-bottom { display: flex; flex-direction: column; gap: 10px; padding: 0 18px max(env(safe-area-inset-bottom, 0px), 22px); }
.jt-placement { font-size: var(--fs-sm); color: var(--color-text-soft); text-align: center; line-height: 1.4; text-shadow: 0 1px 6px rgba(var(--rgb-black), 0.9); }
.jt-results-attempts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.jt-strip-chip {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-black), 0.55);
  border: 1px solid rgba(var(--rgb-white), 0.2);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-align: center;
}
.jt-strip-chip.invalid { color: var(--color-text-3); }
.jt-strip-chip.best { border-color: var(--color-cyan); color: var(--color-cyan); }

/* Results */
.jt-results-body { flex: 1; width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 8px 0 20px; }
.jt-results-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 2px; color: var(--color-text-2); }
.jt-results-big { font-family: var(--font-family-heading); font-size: var(--fs-timer); font-weight: 900; line-height: 1; color: var(--color-cyan); }
.jt-results-unit { font-size: var(--fs-2xl); }
.jt-results-in { font-size: var(--fs-lg); font-weight: 700; color: var(--color-text-soft); margin-top: -6px; }
.jt-results-change { font-size: var(--fs-md); color: var(--color-text-soft); }
.jt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-gold), 0.15);
  color: var(--color-gold);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.jt-chart { display: flex; align-items: flex-end; justify-content: center; gap: 10px; width: 100%; height: 140px; margin-top: 10px; }
.jt-bar-col { flex: 0 1 44px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.jt-bar { width: 100%; min-height: 6px; border-radius: 6px 6px 2px 2px; background: var(--color-surface-3); }
.jt-bar-col.today .jt-bar { background: var(--color-cyan); }
.jt-bar-val { font-size: var(--fs-xs); font-weight: 800; color: var(--color-text-soft); }
.jt-bar-date { font-size: var(--fs-xs); color: var(--color-text-3); }
.jt-confirm { z-index: 200; }

/* Jump replay (review.js): the clip with its overlay, a scrubber with takeoff/peak/landing marks, controls */
.jt-review { gap: 10px; overflow: hidden; }
.jt-review-top { display: flex; align-items: center; gap: 10px; }
.jt-review-tabs { flex: 1; display: flex; gap: 8px; overflow-x: auto; }
.jt-review-tabs .jt-strip-chip { min-height: 44px; cursor: pointer; color: var(--color-text); }
.jt-review-tabs .jt-strip-chip.invalid { color: var(--color-text-3); }
.jt-review-tabs .jt-strip-chip.best { color: var(--color-cyan); }
.jt-review-stage { position: relative; flex: 1; min-height: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--color-black); }
.jt-review-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Kept in the DOM (some mobile browsers don't decode hidden or detached videos), but not seen */
.jt-review-video { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.jt-review-info { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-soft); }
.jt-review-result { color: var(--color-cyan); font-weight: 900; }
.jt-review-result.invalid { color: var(--color-text-3); }
.jt-review-scrub { position: relative; }
.jt-review-scrub input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--color-cyan); }
/* Ticks under the track; the range thumb is ~16px, so the track runs 8px in from each side */
.jt-review-marks { position: absolute; left: 8px; right: 8px; bottom: 2px; height: 8px; pointer-events: none; }
.jt-review-tick { position: absolute; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--color-green); }
.jt-review-tick.mark-peak { background: var(--color-gold); }
.jt-review-jumps { display: flex; gap: 8px; }
.jt-review-mark {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgba(var(--rgb-white), 0.15);
  border-radius: var(--radius-full);
  background: rgba(var(--rgb-white), 0.06);
  color: var(--color-green);
  font-size: var(--fs-sm);
  font-weight: 800;
  cursor: pointer;
}
.jt-review-mark.mark-peak { color: var(--color-gold); }
.jt-review-mark.is-on { border-color: currentColor; }
.jt-review-controls { display: grid; grid-template-columns: 56px 1fr 56px auto; gap: 8px; }
.jt-review-controls .jt-btn { min-height: 48px; padding: 0 12px; }

/* Landscape phones: less vertical room */
@media (max-height: 500px) {
  .jt-banner { font-size: var(--fs-xl); padding: 8px 14px; margin-top: 8px; }
  .jt-cam-big, .jt-results-big { font-size: var(--fs-display); }
  .jt-step-name { font-size: var(--fs-xl); }
  .jt-warmup .guided-fs-countdown { font-size: var(--fs-display); }
  .jt-warmup { padding-bottom: 12px; }
  .jt-warmup .guided-fs-center { gap: 4px; }
  .jt-warmup .guided-fs-current-label, .jt-warmup .guided-fs-next-line { height: auto; font-size: var(--fs-sm); }
  .jt-warmup .guided-fs-paused-badge.is-hidden { display: none; }
  .jt-warmup .guided-fs-btn { min-height: 44px; padding: 8px 6px; }
  .jt-chart { height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .jt-rec-dot { animation: none; }
  .jt-cam::after, .jt-progress-fill { transition: none; }
  .jt-btn:active:not(:disabled) { transform: none; }
}

/* ==========================================================================
   TESTING DAY (home, settings): the home cards, the Jump tests and Vertical jump cards
   ========================================================================== */
.testing-day-body {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--color-text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.testing-day-muted,
.testing-day-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-3);
}
.testing-day-hint { margin: 0; text-align: center; }
.testing-day-best {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--color-text);
}
.testing-day-stats { display: flex; gap: 24px; }
.testing-day-stats > div { display: flex; flex-direction: column; gap: 2px; }
.testing-day-stats strong {
  font-family: var(--font-family-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--color-text);
}

/* Strength / Power badge beside the category badge on an expanded exercise */
.style-badge {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.style-badge.strength { background: rgba(var(--rgb-cyan), 0.18); color: var(--color-cyan); }
.style-badge.power { background: rgba(var(--rgb-red), 0.18); color: var(--color-red); }
