/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
html { height: 100%; background: var(--bg); }
body { height: 100%; overflow: hidden; overscroll-behavior: none; }

:root {
  --bg: #ffffff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-input: #f2f2f7;
  --bg-elevated: #ffffff;
  --primary: #e8621a;
  --primary-dark: #c9510e;
  --primary-light: rgba(232, 98, 26, 0.08);
  --primary-soft: rgba(232, 98, 26, 0.12);
  --accent: #f59e0b;
  --text: #1a1207;
  --text-secondary: #5c4a33;
  --text-muted: #9a8b78;
  --separator: rgba(26, 18, 7, 0.1);
  --border: rgba(26, 18, 7, 0.18);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --nav-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #0d0b08;
  --bg-secondary: #15120d;
  --bg-card: #1e1a14;
  --bg-card-solid: #1e1a14;
  --bg-input: #28231b;
  --bg-elevated: #28231b;
  --primary: #f07a2f;
  --primary-dark: #e8621a;
  --primary-light: rgba(240, 122, 47, 0.12);
  --primary-soft: rgba(240, 122, 47, 0.15);
  --text: #f5f0ea;
  --text-secondary: #c9bfb2;
  --text-muted: #948a7d;
  --separator: rgba(245, 240, 234, 0.06);
  --border: rgba(245, 240, 234, 0.10);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* === App Shell === */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* === Pages === */
.page {
  display: none;
  flex-direction: column;
  height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  overflow: hidden;
}
.page.active { display: flex; }

/* Page transition animation */
@keyframes pageSlideIn {
  0% { opacity: 0.3; transform: translateX(var(--slide-from, 50px)); }
  100% { opacity: 1; transform: translateX(0); }
}
.page.animate-in {
  animation: pageSlideIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* === Header === */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--separator);
}
.page-header h1 {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
}
.page-header-large {
  padding: calc(var(--safe-top) + 20px) 20px 14px;
  background: var(--bg);
  border-bottom: none;
}
.page-header-large h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* === Bottom Nav === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--separator);
  padding: 6px 0 calc(14px + var(--safe-bottom, 0px));
  z-index: 200;
}

.nav-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--separator);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 16px;
  font-size: 0.62rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-btn:last-child { border-right: none; }
.nav-btn.active { color: var(--primary); }
.nav-btn svg { width: 22px; height: 22px; }

/* === Buttons === */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  color: white;
  text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-card); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: var(--danger); }
.btn-large { width: 100%; padding: 14px; font-size: 0.95rem; border-radius: var(--radius); }
.btn-small { padding: 6px 14px; font-size: 0.82rem; border-radius: var(--radius-xs); }
.btn-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 4px 4px 0;
}
.btn-icon-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
}

/* === Cards === */
.glass-card, .stat-card, .workout-card, .template-card, .builder-exercise, .detail-exercise, .settings-group, .streak-card, .pr-card, .summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* === Dashboard Stats === */
/* === Dashboard Hero (Buddy Card) === */
.dashboard-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  color: white;
  margin-bottom: 4px;
}
.buddy-message {
  display: flex;
  gap: 14px;
  align-items: center;
}
.buddy-emoji {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.buddy-text {
  flex: 1;
  min-width: 0;
}
.buddy-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.buddy-tip {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
  line-height: 1.4;
}
/* Streak Flame */
.streak-flame-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto;
  gap: 0;
  flex-shrink: 0;
}
.streak-flame {
  position: relative;
  display: flex;
  justify-content: center;
}
.flame-svg { filter: drop-shadow(0 0 6px rgba(249,115,22,0.5)); }
.streak-sm .flame-svg { width: 28px; }
.streak-md .flame-svg { width: 36px; }
.streak-lg .flame-svg { width: 46px; }
.streak-xl .flame-svg { width: 56px; }
.flame-outer {
  fill: #f97316;
  animation: flicker 1.5s ease-in-out infinite alternate;
}
.flame-mid {
  fill: #fb923c;
  animation: flicker 1.2s ease-in-out 0.15s infinite alternate;
}
.flame-inner {
  fill: #fde047;
  animation: flicker 1s ease-in-out 0.3s infinite alternate;
}
@keyframes flicker {
  0% { opacity: 0.85; transform: scaleX(1) scaleY(1); }
  50% { opacity: 1; transform: scaleX(1.04) scaleY(1.06); }
  100% { opacity: 0.9; transform: scaleX(0.96) scaleY(0.98); }
}
.streak-flame-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}
.streak-flame-label {
  font-size: 0.5rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.streak-warning {
  background: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #ffab40;
  text-align: center;
  margin: 8px 0 4px;
}
.dashboard-hero .dashboard-actions {
  margin-top: 16px;
}
.dashboard-hero .btn-start-workout {
  background: white;
  color: var(--primary);
  box-shadow: none;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
}
.dashboard-hero .btn-quick-workout {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.4);
}

/* === Stats Grid === */
.stats-row { margin-top: -4px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stat-card {
  padding: 14px 8px;
  text-align: center;
}
.stat-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }

/* === Week Overview === */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.week-nav .section-header { margin: 0; font-size: 0.82rem; }
.week-nav-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 4px 12px;
  cursor: pointer;
  line-height: 1;
}
.week-nav-btn:disabled { opacity: 0.3; cursor: default; }
.week-overview {
  display: flex;
  justify-content: space-between;
  gap: 6px;

}
.week-day {
  flex: 1;
  text-align: center;
  padding: 10px 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  transition: all 0.2s;
}
.week-day .day-label { color: var(--text-muted); font-size: 0.58rem; text-transform: uppercase; font-weight: 600; }
.week-day .day-num { font-weight: 700; margin-top: 3px; }
.week-day .day-check { font-size: 0.55rem; color: white; margin-top: 3px; }
.week-day.today { border-color: var(--primary); background: var(--primary-light); }
.week-day.trained { background: var(--primary); color: white; border-color: var(--primary); }
.week-day.trained .day-label { color: rgba(255,255,255,0.7); }

/* === Dashboard Action Buttons === */
.dashboard-actions {
  display: flex;
  gap: 10px;
}
.btn-start-workout {
  flex: 1;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transition: all 0.12s;
}
.btn-start-workout:active { transform: scale(0.98); }
.btn-quick-workout {
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.12s;
}
.btn-quick-workout:active { transform: scale(0.98); background: var(--primary-light); }

/* === Workout List === */
.workout-list { display: flex; flex-direction: column; gap: 8px; }

.workout-card {
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.12s;
}
.workout-card:active { transform: scale(0.98); }
.workout-card .workout-date { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.workout-card .workout-summary { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workout-card .workout-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.workout-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 4px;
}
.workout-badge-quick {
  background: var(--accent);
  color: #fff;
}
.workout-badge-template {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-save-as-template {
  width: 100%;
  padding: 10px;
  margin: 8px 0 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-save-as-template:disabled {
  opacity: 0.6;
  cursor: default;
}

/* === Section Headers === */
.section-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 2px;
}

/* === Search & Filters === */
.search-wrap {
  position: relative;
  width: 100%;
}
.search-input {
  width: 100%;
  padding: 11px 38px 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-input);
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear.hidden { display: none; }
select.search-input { appearance: auto; }

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips.small .chip { font-size: 0.68rem; padding: 5px 10px; }

.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Filter row: dropdowns + fav button */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filter-select {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.filter-select option { background: var(--bg-card); color: var(--text); }
.filter-fav-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-fav-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === Exercise List === */
.exercise-list { display: flex; flex-direction: column; gap: 6px; }

.exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.exercise-item:active { background: var(--bg-input); }
.exercise-item img {
  width: 44px; height: 44px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg-input);
}
.exercise-item img.exercise-gif {
  width: 52px; height: 52px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  background: var(--bg-card);
}
.exercise-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}
.exercise-item .exercise-info { flex: 1; min-width: 0; }
/* Namen umbrechen statt abschneiden: das Unterscheidende (Gerät, Ausführung) steht seit 7.12.4 hinten */
.exercise-item .exercise-name { font-weight: 600; font-size: 0.86rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.exercise-item .exercise-detail { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.exercise-item .exercise-badge { font-size: 0.58rem; padding: 3px 8px; border-radius: 8px; flex-shrink: 0; font-weight: 600; }
.exercise-badge.level-beginner { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.exercise-badge.level-intermediate { background: var(--primary-light); color: var(--primary); }
.exercise-badge.level-expert { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.btn-favorite {
  background: none; border: none;
  font-size: 1rem; color: var(--text-muted);
  cursor: pointer; padding: 4px;
  opacity: 0.3; transition: all 0.15s;
}
.btn-favorite.active { color: var(--warning); opacity: 1; }

.scroll-sentinel { height: 1px; }

/* ===================== */
/* === ACTIVE WORKOUT === */
/* ===================== */

.active-exercise-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-height) - var(--nav-height) - 32px);
}

.exercise-hero {
  position: relative;
  width: calc(100% + 32px);
  margin: -16px -16px 0 -16px;
  height: 220px;
  background: var(--bg-input);
  overflow: hidden;
}
.exercise-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--bg-card);
}
.exercise-hero img.exercise-gif {
  object-fit: contain;
  background: var(--bg-card);
}

/* GIF skeleton loading */
.exercise-item img.exercise-gif {
  background: var(--bg-input);
}
.exercise-hero img {
  background: var(--bg-input);
}

/* Instructions collapsible */
.ex-detail-instructions { margin-top: 16px; }
.instructions-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.instructions-arrow { transition: transform 0.2s; font-size: 0.7rem; }
.instructions-content {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.instructions-content ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.instructions-content li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Muscle Map on Dashboard */
.muscle-map {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.muscle-map-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.muscle-map-count {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}
.muscle-map-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
/* Body Map */
.body-map-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.body-map-svg-wrap { width: 120px; flex-shrink: 0; }
.body-map-svg { width: 100%; height: auto; }
.body-map-svg .body-outline path {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 6;
  opacity: 0.5;
}
.body-map-svg .muscle-group path {
  fill: var(--bg-input);
  stroke: var(--border);
  stroke-width: 2;
  transition: fill 0.3s;
}
.body-map-svg .muscle-group.active path {
  fill: var(--primary);
  stroke: var(--primary);
  fill-opacity: 0.8;
}
.body-map-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.body-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}
.body-legend-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.body-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.body-legend-item.active .body-legend-dot {
  background: var(--primary);
}
.body-legend-sets {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.7;
}

/* Muscle Volume Popup */
.mv-popup { padding: 24px; }
.mv-header { text-align: center; margin-bottom: 16px; }
.mv-title { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.mv-subtitle { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.mv-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mv-stat { text-align: center; }
.mv-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.mv-stat-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.mv-exercises { display: flex; flex-direction: column; gap: 10px; }
.mv-exercise {}
.mv-ex-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mv-ex-name { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.mv-ex-sets { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.mv-bar-bg {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.mv-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Muscle chips (summary/other uses) */
.muscle-split { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.muscle-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.muscle-chip.inactive {
  background: var(--bg-input);
  color: var(--text-muted);
}

.exercise-hero .hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.exercise-hero-avatar {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
}

.exercise-active-info {
  text-align: center;
  padding: 10px 0 16px;
}
.exercise-active-name {
  font-size: 1.2rem;
  font-weight: 700;
}
.exercise-active-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Set dots */
.set-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.set-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
}
.set-dot::before {
  content: '';
  position: absolute;
  inset: -14px;
}
.set-dot.completed { background: var(--success); border-color: var(--success); }
.set-dot.warmup { border-color: var(--warning); }
.set-dot.warmup.completed { background: var(--warning); border-color: var(--warning); }
.set-dot.current { background: var(--primary); border-color: var(--primary); transform: scale(1.25); }
.set-dot.current.warmup { background: var(--warning); border-color: var(--warning); }

/* Set input card */
.set-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
}
.set-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Alles soll in EINE Zeile passen (Satzangabe, Zähler, Warmup/Max Out/Deload). Der Umbruch
     bleibt nur als Notnagel für sehr schmale Geräte — lieber rutschen die Schalter nach unten,
     als dass "Satz 1 von 3" zweizeilig zerfällt. */
  flex-wrap: wrap;
  gap: 8px 6px;
  margin-bottom: 16px;
}
.set-input-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.set-toggles { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.set-toggle-btn {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 4px 7px;
  white-space: nowrap;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.set-toggle-btn.active {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}
.set-toggle-btn.maxout.active {
  background: var(--danger);
  border-color: var(--danger);
}
.set-dot.maxout { border-color: var(--danger); }
.set-dot.maxout.completed { background: var(--danger); border-color: var(--danger); }
.set-dot.maxout.current { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.btn-confirm-set.maxout { background: var(--danger); border-color: var(--danger); }
.maxout-hint {
  font-size: 0.75rem;
  color: var(--danger);
  text-align: center;
  padding: 6px 0;
  font-weight: 600;
}
.detail-maxout {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
}
.set-input-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.set-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.set-input-group label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
}
.set-input-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: 14px;
  border: 1px solid var(--border);
}
.set-input-stepper input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 8px 4px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.set-input-stepper input::placeholder { color: var(--text-muted); font-size: 1.1rem; }
.set-input-stepper .btn-step {
  width: 48px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  flex-shrink: 0;
}
.set-input-stepper .btn-step:active { background: var(--primary-light); border-radius: 12px; }

.quick-weight-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}
.qw-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.qw-chip:active { background: var(--primary); color: #000; border-color: var(--primary); }

.btn-undo-set {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 6px;
}
.btn-undo-set:active { background: var(--bg-input); }

.set-input-card.set-confirmed {
  animation: setFlash 0.4s ease;
}
@keyframes setFlash {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(0, 230, 118, 0.15); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.btn-confirm-set {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--success);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-confirm-set:active { transform: scale(0.97); }
.btn-confirm-set.finish { background: var(--primary); }

/* Previous workout hint */
.previous-hint {
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}
.previous-hint-all {
  margin-top: 12px;
  text-align: center;
}
.prev-hint-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.prev-set-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.prev-set-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: 20px;
  border: 1px solid transparent;
}
.prev-set-chip.prev-set-active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-card);
}
/* Recap „Letztes Mal" im Pausebildschirm */
.rest-last-sets {
  margin-top: 4px;
}

/* Progression hint */
.progression-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  padding: 10px 14px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}
.progression-hint.deload { color: var(--warning); background: rgba(245, 158, 11, 0.1); }
.progression-hint.info { color: var(--text-secondary); background: var(--bg-input); }
.progression-hint.same { color: var(--primary); background: var(--primary-light); }
.progression-hint.plateau { color: #f97316; background: rgba(249, 115, 22, 0.1); }
/* Rückkehr nach Deload (teal) und Wiedereinstieg nach Pause (blau) */
.progression-hint.return { color: #0d9488; background: rgba(13, 148, 136, 0.1); }
.progression-hint.comeback { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
/* Erste Zeile im Hint: WARUM (z.B. "Deload · 3x nicht geschafft"), darunter die Zahlen */
.progression-hint .prog-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2px;
}
/* Deload-Schalter pro Übung (neben Warmup/Max Out) */
.set-toggle-btn.deload.active {
  background: #3b82f6;
  border-color: #3b82f6;
}
.set-toggle-btn.deload.suggested:not(.active) {
  border-color: var(--warning);
  color: var(--warning);
}
/* Badges für Deload-/Wiedereinstiegs-Sessions im Verlauf, Detail und in der Zusammenfassung */
.workout-badge-deload {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.workout-badge-comeback {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.45);
}
.prev-set-chip.prev-set-from { border-style: dashed; opacity: 0.85; }

/* Exercise pills */
.workout-exercise-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 12px 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-arrow {
  font-size: 0.55rem;
  transition: transform 0.2s;
}
.toggle-arrow.expanded {
  transform: rotate(180deg);
}
.workout-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 500px;
  opacity: 1;
}
.workout-exercise-list.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.workout-exercise-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.12s;
}
.workout-exercise-pill.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.workout-exercise-pill.done { opacity: 0.45; }
.pill-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.workout-exercise-pill.active .pill-num { background: var(--primary); color: white; }
.workout-exercise-pill.done .pill-num { background: var(--success); color: white; }
.pill-name { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.workout-exercise-pill .pill-status { font-size: 0.66rem; color: var(--text-muted); flex-shrink: 0; }
.workout-exercise-pill.done .pill-status { color: var(--success); }
.pill-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.workout-exercise-pill:active .pill-actions,
.workout-exercise-pill.active .pill-actions { opacity: 0.8; }
.pill-move {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1;
  padding: 8px 6px;
  cursor: pointer;
  transition: color 0.12s;
}
.pill-move:active:not(:disabled) { color: var(--primary); }
.pill-move:disabled { opacity: 0.15; cursor: default; }

/* Cardio inputs */
.cardio-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
}
.cardio-fields, .builder-cardio-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.builder-cardio-field label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
/* Timed Sets in Workout */
.timed-sets-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.timed-set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.timed-set-row:last-of-type { border-bottom: none; }
.timed-set-row.completed { opacity: 0.5; }
.timed-set-row.active-set { background: var(--primary-light); margin: 0 -16px; padding: 8px 16px; border-radius: var(--radius-xs); }
.timed-set-num { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); min-width: 44px; }
.timed-set-input { display: flex; align-items: center; gap: 4px; flex: 1; }
.timed-duration-input {
  width: 70px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
.timed-set-unit { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.btn-confirm-timed-set {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.timed-set-done { color: var(--success); font-weight: 700; font-size: 1.1rem; }
.btn-add-timed-set {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.builder-cardio-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.cardio-field { }
.cardio-field label {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}
.cardio-field input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

/* === Rest Timer Fullscreen === */
.rest-view.active-exercise-view {
  min-height: 0;
  height: calc(100dvh - var(--header-height) - var(--nav-height));
  max-height: calc(100dvh - var(--header-height) - var(--nav-height));
  overflow: hidden;
}
.page-content:has(.rest-view) { overflow: hidden; }
.rest-view .exercise-hero {
  min-height: 0;
  flex: 0 0 24vh;
}
.rest-timer-fullscreen {
  text-align: center;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 9px;
}
.rest-timer-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.rest-timer-display {
  font-size: 6.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -3px;
  line-height: 1;
}
.rest-timer-next {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
}
#btn-skip-rest {
  width: 100%;
  max-width: 320px;
  padding: 15px;
  font-size: 1.05rem;
  margin-bottom: 16px;
}
/* Kleine/kurze Displays: kompakter, damit der Button sichtbar bleibt */
@media (max-height: 720px) {
  .rest-view .exercise-hero { flex: 0 0 18vh; }
  .rest-timer-display { font-size: 4.25rem; }
  .rest-timer-fullscreen { gap: 6px; padding: 10px 18px 12px; }
  #btn-skip-rest { padding: 12px; margin-bottom: 10px; }
}
.timer-pulse { animation: pulse 1s ease infinite; color: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Modal === */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--bg-card-solid);
  width: 100%; max-width: 430px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 16px calc(var(--safe-bottom) + 24px);
}
.modal-content h2 { margin-bottom: 16px; font-size: 1.1rem; }
.modal-content label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 0.82rem; color: var(--text-muted); }
.modal-content input, .modal-content select {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text); font-size: 0.92rem;
}
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* === Templates (Entdecken) === */
.template-card {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.12s;
}
.template-card:active { transform: scale(0.98); }
.template-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--primary);
}
.template-icon svg { width: 24px; height: 24px; }
.template-info { flex: 1; min-width: 0; }
.template-name { font-weight: 600; font-size: 0.86rem; }
.template-meta { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.template-last { font-size: 0.65rem; color: var(--primary); margin-top: 2px; font-weight: 600; }
.template-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.template-group { margin-bottom: 16px; }

/* Template Detail */
.template-detail-header { text-align: center; padding: 12px 0 16px; }
.template-detail-icon { font-size: 2.5rem; }
.template-detail-header h2 { margin-top: 8px; font-size: 1.25rem; }
.template-detail-exercises { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.template-detail-exercise {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.tde-image { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--bg-input); flex-shrink: 0; }
.tde-image img { width: 100%; height: 100%; object-fit: cover; }
.tde-info { flex: 1; }
.tde-name { font-weight: 600; font-size: 0.84rem; }
.tde-meta { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.tde-rotation { font-size: 0.68rem; color: var(--success); font-weight: 600; margin-top: 2px; }
.tde-sets-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.tde-set-chip {
  font-size: 0.68rem; font-weight: 600;
  background: var(--primary-light); color: var(--primary);
  padding: 2px 7px; border-radius: 5px;
}

/* === Workout Builder === */
.builder-exercise-list { display: flex; flex-direction: column; gap: 10px; }

.builder-exercise {
  padding: 14px;
  animation: cardSlideUp 0.2s ease;
}
@keyframes cardSlideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.builder-exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.builder-ex-img {
  width: 40px; height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-input);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.builder-ex-img img { width: 100%; height: 100%; object-fit: cover; }
.builder-ex-name { flex: 1; font-weight: 600; font-size: 0.86rem; }
.builder-ex-actions { display: flex; gap: 2px; }

/* Builder: Rest time config */
.builder-rest-config {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.builder-rest-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.builder-rest-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.builder-rest-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
.builder-rest-stepper .btn-mini-step {
  width: 28px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.builder-rest-stepper .btn-mini-step:active { background: var(--primary-light); }
.builder-rest-value {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

/* Builder: Sets */
.builder-sets-header {
  margin-bottom: 6px;
  padding: 0 2px;
}

.builder-sets-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.builder-set-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
}
.builder-set-num {
  width: 18px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.builder-set-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.builder-set-x {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.builder-set-unit {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
  width: 24px;
}
.builder-mini-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.builder-mini-stepper .btn-mini-step,
.builder-set-row .btn-mini-step {
  width: 24px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.builder-mini-stepper .btn-mini-step:active { background: var(--primary-light); }
.builder-set-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  min-width: 0;
  width: 100%;
  -moz-appearance: textfield;
}
.builder-set-input::-webkit-inner-spin-button,
.builder-set-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.btn-remove-set {
  width: 22px; height: 22px;
  border: none; background: transparent;
  color: var(--danger); font-size: 0.72rem;
  cursor: pointer; flex-shrink: 0; padding: 0;
  border-radius: 4px;
}
.btn-remove-set:active { background: rgba(239, 68, 68, 0.1); }

.btn-add-builder-set {
  width: 100%;
  padding: 7px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.btn-add-builder-set:active { background: var(--primary-light); }

/* === Progress / Charts === */
.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pr-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 4px;
}
.pr-card .pr-exercise { font-weight: 600; font-size: 0.84rem; }
.pr-card .pr-1rm { font-size: 0.66rem; color: var(--text-muted); margin-left: 4px; }
.pr-card .pr-value { color: var(--warning); font-weight: 700; font-size: 0.88rem; }

/* Streak */
.streak-cards { display: flex; gap: 8px; }
.streak-card {
  flex: 1; text-align: center;
  padding: 14px 8px;
}
.streak-icon { font-size: 1.2rem; }
.streak-value { font-size: 1.35rem; font-weight: 800; margin: 4px 0; }
.streak-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

/* Heatmap */
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding: 6px 0; }
.heatmap-labels { display: flex; flex-direction: column; justify-content: space-between; font-size: 0.5rem; color: var(--text-muted); width: 14px; flex-shrink: 0; }
.heatmap-grid { display: flex; gap: 2px; flex: 1; }
.heatmap-week { display: flex; flex-direction: column; gap: 2px; }
.heatmap-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--bg-input); }
.heatmap-cell.level-1 { background: rgba(37,99,235,0.15); }
.heatmap-cell.level-2 { background: rgba(37,99,235,0.3); }
.heatmap-cell.level-3 { background: rgba(37,99,235,0.55); }
.heatmap-cell.level-4 { background: var(--primary); }

/* Muscle bars */
.muscle-bars { display: flex; flex-direction: column; gap: 6px; }
.muscle-bar-row { display: flex; align-items: center; gap: 8px; }
.muscle-label { width: 72px; font-size: 0.7rem; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.muscle-bar-track { flex: 1; height: 14px; background: var(--bg-input); border-radius: 7px; overflow: hidden; }
.muscle-bar-fill { height: 100%; background: var(--primary); border-radius: 7px; transition: width 0.5s; }
.muscle-sets { width: 22px; font-size: 0.68rem; color: var(--text-muted); }

/* Summary */
.summary-grid { display: flex; gap: 8px; }
.summary-item {
  flex: 1; text-align: center;
  padding: 12px 8px;
}
.summary-value { font-size: 1.15rem; font-weight: 800; }
.summary-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; }

/* === Workout Detail === */
.detail-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.detail-exercise {
  padding: 14px;
  margin-bottom: 8px;
}
.detail-exercise h3 { margin-bottom: 6px; font-size: 0.92rem; }
.detail-notes { font-size: 0.76rem; color: var(--text-muted); font-style: italic; margin-bottom: 6px; padding: 4px 8px; border-left: 2px solid var(--primary); }
.detail-set { display: flex; justify-content: space-between; padding: 3px 0; font-size: 0.8rem; color: var(--text-muted); }
.detail-set.completed { color: var(--success); }

/* === Settings === */
.settings-group {
  padding: 4px 16px;
  margin-bottom: 12px;
}
.settings-group h3 { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 0 6px; }
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--separator);
}
.setting-item:last-child { border-bottom: none; }
/* Textblock (Label + Hinweis) darf schrumpfen, damit ein langer Hinweis umbricht statt den
   Schalter nach unten oder in die Breite zu drücken. Der Schalter bleibt rechts stehen. */
.setting-item > div:first-child { flex: 1; min-width: 0; }
.setting-item label:first-child { font-size: 0.88rem; }
.setting-hint { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.setting-toggle { display: flex; gap: 4px; }

.stepper-control { display: flex; align-items: center; gap: 0; }
.stepper-control .btn-stepper {
  width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg-input);
  color: var(--primary); font-size: 1rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.stepper-control span { min-width: 48px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.rep-range-control { display: flex; align-items: center; gap: 6px; }
.rep-range-part { display: flex; align-items: center; gap: 0; }
.rep-range-dash { opacity: .5; font-weight: 600; }
.btn-stepper-sm {
  width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg-input);
  color: var(--primary); font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rep-range-part span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.theme-options { display: flex; gap: 8px; padding: 8px 0; }
.theme-btn {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer;
  text-align: center;
  font-size: 0.75rem; font-weight: 500;
  transition: all 0.15s;
  background: none;
  color: var(--text);
}
.theme-btn.active { border-color: var(--primary); }
.theme-preview {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.tp-light { color: #f0ebe5; }
.tp-dark { color: #2a2520; }
.tp-system { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.system-preview {
  background: linear-gradient(to right, #e8e3dc 50%, #2a2520 50%);
}
.light-preview {
  background: #e8e3dc;
}
.dark-preview {
  background: #2a2520;
}

/* flex-shrink:0 — in einer setting-item-Zeile mit langem Hinweistext wurde der Schalter
   sonst schmaler als 44px gequetscht und der Knopf saß nicht mehr sauber im Rahmen. */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-input); border-radius: 26px; transition: 0.25s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 20px; width: 20px; left: 2px; bottom: 2px;
  background: white; border-radius: 50%;
  transition: 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); border-color: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.file-import-label { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.settings-about { text-align: center; padding: 16px; }

/* === Toast === */
#toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: calc(100% - 32px); max-width: 400px;
  pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--bg-card-solid);
  color: var(--text);
  font-size: 0.84rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: translateY(-20px); opacity: 0;
  transition: all 0.2s ease;
  pointer-events: auto;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-pr { font-size: 0.78rem; padding: 8px 14px; border-color: var(--warning); }
.toast-pr .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }
.toast-icon { font-size: 1.05rem; flex-shrink: 0; }
.toast-msg { flex: 1; }

/* Confirm */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.confirm-overlay.show { opacity: 1; }
.confirm-dialog {
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  padding: 24px;
  width: calc(100% - 48px); max-width: 300px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.confirm-msg { font-size: 0.9rem; margin-bottom: 18px; line-height: 1.45; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }


/* === Active Workout Banner === */
.active-workout-banner {
  position: fixed;
  top: calc(var(--safe-top) + 0px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--success);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}
.active-workout-banner:active { opacity: 0.9; }
.awb-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  animation: awbPulse 1.5s ease infinite;
  flex-shrink: 0;
}
@keyframes awbPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.awb-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.awb-label {
  font-size: 0.78rem;
  font-weight: 600;
}
.awb-timer {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}
.awb-rest {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: none;
}
.active-workout-banner.resting {
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(232, 98, 26, 0.3);
}
.active-workout-banner.resting .awb-rest {
  display: inline;
}
.active-workout-banner.resting .awb-timer {
  font-size: 0.7rem;
  opacity: 0.6;
  font-weight: 500;
}

/* Push page content down when banner is visible */
.active-workout-banner:not(.hidden) ~ #app .page-header {
  padding-top: calc(var(--safe-top) + 48px);
}
.active-workout-banner:not(.hidden) ~ #app .page-header-large {
  padding-top: calc(var(--safe-top) + 52px);
}

/* === Action Sheet (Finish Menu) === */
.action-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.action-sheet-overlay.show { opacity: 1; }

.action-sheet {
  background: var(--bg-card-solid);
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 16px calc(var(--safe-bottom) + 16px);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.action-sheet-overlay.show .action-sheet {
  transform: translateY(0);
}

.action-sheet-title {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0;
}

.action-sheet-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border: none;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  margin-bottom: 8px;
  transition: all 0.1s;
}
.action-sheet-btn:active { transform: scale(0.98); }

.action-sheet-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.action-save .action-sheet-icon {
  background: var(--success-light);
  color: var(--success);
}
.action-discard .action-sheet-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.action-sheet-btn-label {
  font-size: 0.9rem;
  font-weight: 600;
}
.action-sheet-btn-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.action-cancel {
  justify-content: center;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 4px;
}

/* === Superset & Dropset (Builder) === */
.builder-exercise.superset-a { border-left: 3px solid var(--primary); }
.builder-exercise.superset-b { border-left: 3px solid var(--accent); }
.builder-exercise.superset-c { border-left: 3px solid var(--success); }

.builder-ex-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.superset-badge, .dropset-badge, .rotation-badge {
  white-space: nowrap;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.superset-badge.group-a { background: var(--primary-light); color: var(--primary); }
.superset-badge.group-b { background: rgba(124, 58, 237, 0.1); color: var(--accent); }
.superset-badge.group-c { background: var(--success-light); color: var(--success); }
.superset-badge.group-d { background: rgba(124, 58, 237, 0.1); color: var(--accent); }
.dropset-badge { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.rotation-badge { background: var(--success-light); color: var(--success); }

.btn-superset, .btn-dropset, .btn-rotation {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}
.btn-superset.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.btn-superset.active-b { border-color: var(--accent); background: rgba(124, 58, 237, 0.1); color: var(--accent); }
.btn-superset.active-c { border-color: var(--success); background: var(--success-light); color: var(--success); }
.btn-dropset.active { border-color: var(--warning); background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.btn-rotation { font-size: 0.85rem; }
.btn-rotation.active { border-color: var(--success); background: var(--success-light); color: var(--success); }

/* Builder: Rotation (Übungen wechseln sich von Training zu Training ab) */
.builder-rotation {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.builder-rotation-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.builder-rotation-hint { font-size: 0.66rem; color: var(--text-muted); }
.builder-rotation-item {
  display: flex; align-items: center; gap: 8px; min-height: 30px;
  padding: 2px 6px; margin: 0 -6px;
  border: 1.5px solid transparent; border-radius: 6px;
  cursor: pointer;
}
/* Gewählte Übung: deren Pausen und Sätze stehen darunter */
.builder-rotation-item.active { background: var(--bg-card); border-color: var(--success); }
.builder-rotation-item.active .builder-rotation-name { font-weight: 600; }
.builder-rotation-num {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.builder-rotation-name { flex: 1; min-width: 0; font-size: 0.8rem; line-height: 1.25; overflow-wrap: anywhere; }
.btn-remove-rotation {
  width: 26px; height: 26px;
  border: none; background: none; padding: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer; flex-shrink: 0;
}
.btn-remove-rotation:active { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.btn-add-rotation {
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 10px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}
.btn-add-rotation:active { background: var(--success-light); }

/* Superset & Dropset badges in active workout */
.workout-badges {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

/* Superset color indicators on exercise pills */
.workout-exercise-pill.superset-a { border-left: 3px solid var(--primary); }
.workout-exercise-pill.superset-b { border-left: 3px solid var(--accent); }
.workout-exercise-pill.superset-c { border-left: 3px solid var(--success); }

/* === Workout Summary === */
#page-workout-summary .page-header { background: var(--bg-secondary); border-bottom: none; }
.summary-hero {
  text-align: center;
  padding: 8px 0 20px;
}
.summary-checkmark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.summary-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.summary-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.summary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.summary-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.summary-stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  margin-top: 4px;
}

.summary-pr-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-pr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
}
.summary-pr-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.summary-pr-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.84rem;
}
.summary-pr-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warning);
  flex-shrink: 0;
}

/* Summary Comparison */
.summary-comparison {
  margin-bottom: 8px;
}
.summary-compare-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.summary-compare-item:last-of-type { border-bottom: none; }
.summary-compare-name {
  font-size: 0.82rem;
  color: var(--text);
}
.summary-compare-value {
  font-size: 0.82rem;
  font-weight: 700;
}
.summary-compare-value.positive { color: var(--success, #34c759); }
.summary-compare-value.negative { color: var(--text-muted); }
.summary-compare-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 8px;
}

.summary-exercises {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-exercise-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.summary-exercise-name {
  font-weight: 600;
  font-size: 0.84rem;
}
.summary-exercise-sets {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* === Exercise Detail === */
.ex-detail-hero {
  width: calc(100% + 32px);
  margin: -16px -16px 0 -16px;
  min-height: 240px;
  background: var(--bg-input);
  overflow: hidden;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex-detail-hero img {
  width: 100%;
  min-height: 240px;
  max-height: 400px;
  object-fit: contain;
  object-position: center;
  background: var(--bg-card);
  cursor: zoom-in;
}

/* GIF Lightbox */
.gif-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lightbox-in .2s ease;
}
.gif-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ex-detail-hero .exercise-hero-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
}

.ex-detail-info {
  text-align: center;
  padding: 14px 0 8px;
}
.ex-detail-name {
  font-size: 1.15rem;
  font-weight: 700;
}
.verified-tag {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  vertical-align: middle;
  margin-left: 2px;
}
.btn-header-verified {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-header-verified.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 4px;
}
.ex-detail-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.ex-detail-badges {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ex-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* Difficulty bar */
.ex-detail-section {
  padding: 12px 0;
  width: 100%;
}
.ex-detail-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.difficulty-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.difficulty-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.difficulty-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.difficulty-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 30px;
}

/* Muscle activation */
.muscle-activation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.muscle-activation-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.muscle-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  min-width: 80px;
}
.muscle-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.muscle-fill {
  height: 100%;
  border-radius: 3px;
}
.muscle-fill.primary { background: var(--primary); }
.muscle-fill.secondary { background: var(--accent); }
.muscle-pct {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}
.muscle-stabilizers {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Coaching cards */
.coaching-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coaching-card {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
.coaching-card.warning { border-color: var(--warning); background: rgba(245, 158, 11, 0.05); }
.coaching-card.breathing { border-color: var(--primary); background: var(--primary-light); }
.coaching-card-icon { font-size: 1.2rem; flex-shrink: 0; }
.coaching-card-content { flex: 1; }
.coaching-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.coaching-card-content ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coaching-card-content li, .coaching-card-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Sets/Reps grid */
.setsreps-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.setsreps-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  text-align: center;
  min-width: 80px;
  flex: 1;
}
.setsreps-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.setsreps-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

/* Equipment detail */
.equip-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.equip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.equip-tag {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
}
.equip-tag.required {
  background: var(--primary-light);
  color: var(--primary);
}
.equip-tag.optional {
  background: var(--bg-input);
  color: var(--text-muted);
}
.equip-optional-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.equip-tag.alt {
  background: var(--success-light);
  color: var(--success);
}

/* Workout info sheet coaching */
.info-sheet-coaching {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.info-coach-block {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
}
.info-coach-block.warn { background: rgba(245, 158, 11, 0.08); }
.info-coach-icon { font-size: 1rem; flex-shrink: 0; }
.info-coach-block strong {
  font-size: 0.75rem;
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}
.info-coach-block ul {
  padding-left: 14px;
  margin: 0;
}
.info-coach-block li, .info-coach-block p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin: 0;
}
}

.ex-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.ex-detail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 10px;
  text-align: center;
  min-width: 0;
}
.ex-detail-stat-value {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.ex-detail-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  font-weight: 600;
  margin-top: 2px;
  margin-top: 3px;
}

.ex-detail-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ex-history-session {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.ex-history-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ex-history-set {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

/* === Standalone Timer === */
.timer-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.timer-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
}
.timer-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.timer-display-big {
  text-align: center;
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  padding: 32px 0;
  color: var(--text);
}

.timer-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.timer-control-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.timer-control-btn:active { transform: scale(0.93); }
.timer-control-reset {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.timer-control-start {
  background: var(--success);
  color: white;
  width: 72px;
  height: 72px;
}
.timer-control-start.timer-control-pause {
  background: var(--warning);
}

.timer-picker {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 0 24px 16px;
}
.timer-picker-group {
  flex: 1;
  max-width: 180px;
}
.timer-picker-group .set-input-stepper input {
  min-width: 48px;
  font-size: 1.4rem;
  padding: 10px 2px;
}
.timer-picker-group .set-input-stepper .btn-step {
  width: 44px;
  height: 48px;
}
.timer-picker-group label {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

/* === Body Weight === */
.bw-entry-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === Progress Page Cards === */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.progress-card-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* Body Weight Card */
.bw-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.bw-current { display: flex; align-items: baseline; gap: 3px; }
.bw-current-num { font-size: 2rem; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.bw-current-unit { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.bw-trends-row { display: flex; gap: 8px; }
.bw-trend-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-input);
}
.bw-trend-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.bw-trend-val { font-size: 0.82rem; font-weight: 800; }
.bw-trend-val.up { color: var(--warning); }
.bw-trend-val.down { color: var(--success); }
.bw-trend-val.muted { color: var(--text-muted); }
.bw-chart-wrap { height: 80px; margin: 8px -4px; }
.bw-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--separator);
}
.bw-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
}
.bw-input:focus { border-color: var(--primary); outline: none; }
.bw-input-unit { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

/* Body Measurements */
.measurements-input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.measure-input-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.measure-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.measure-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  box-sizing: border-box;
}
.measure-input:focus { border-color: var(--primary); outline: none; }
.measure-save-btn { width: 100%; margin-bottom: 12px; }
.measure-chart-block { margin-top: 8px; }
.measure-chart-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.measure-chart-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}
.measure-chart-current {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.measure-chart-wrap { height: 60px; margin: 0 -4px; }

/* Progress Stats Grid */
.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.progress-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
}
.progress-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.progress-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

/* === Skeleton Loading === */
.skeleton {
  background: var(--bg-input) !important;
  border-color: transparent !important;
  color: transparent !important;
  overflow: hidden;
  pointer-events: none;
}
.skeleton * { visibility: hidden; }
.shimmer {
  position: relative;
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
[data-theme="light"] .shimmer::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* === Utilities === */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.75rem; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state p { margin-top: 6px; font-size: 0.84rem; }
.empty-icon { color: var(--text-muted); opacity: 0.25; }

/* Scrollbar */
::-webkit-scrollbar { width: 0; height: 0; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* === Buddy Insights (Progress page) === */
.buddy-insights-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.buddy-insight-msg {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.buddy-insight-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.buddy-insight-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}

/* === Summary Buddy Comment === */
.summary-buddy {
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

/* === Rest Timer Motivation === */
.rest-motivation {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
  letter-spacing: 0.2px;
  max-width: 260px;
  line-height: 1.3;
}

/* === RPE Selector === */
.rpe-selector {
  margin: 10px 0 4px;
  text-align: center;
}
.rpe-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rpe-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.rpe-btns-full { gap: 4px; }
.rpe-btn {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.rpe-btn:active { transform: scale(0.95); }
.rpe-btn.active.rpe-easy { background: #22c55e22; border-color: #22c55e; color: #22c55e; }
.rpe-btn.active.rpe-good { background: #eab30822; border-color: #eab308; color: #eab308; }
.rpe-btn.active.rpe-hard { background: #ef444422; border-color: #ef4444; color: #ef4444; }
.rpe-num { min-width: 38px; padding: 7px 0; }
.rpe-btn.active.rpe-num { background: var(--accent-light, var(--primary-light)); border-color: var(--accent); color: var(--accent); }

/* RPE dots in prev-set chips */
.rpe-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}
.rpe-dot.rpe-easy { background: #22c55e; }
.rpe-dot.rpe-good { background: #eab308; }
.rpe-dot.rpe-hard { background: #ef4444; }

/* === RPE Settings Options === */
.rpe-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rpe-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.rpe-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.rpe-option-icon { font-size: 1.1rem; line-height: 1; }
.rpe-option-label { font-size: 0.75rem; font-weight: 700; }

/* === Calorie Calculator === */
.cal-section { margin-bottom: 20px; flex-shrink: 0; }
.cal-result { flex-shrink: 0; }
.cal-formula-note { flex-shrink: 0; }
.cal-label { font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cal-gender-row, .cal-goal-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
}
.cal-gender-btn, .cal-goal-btn {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.cal-gender-btn.active, .cal-goal-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.cal-slider-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cal-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-slider-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cal-range-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.cal-range-value span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Custom range slider */
.cal-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
  border: 1px solid var(--border);
}
.cal-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.cal-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.cal-activity-list { display: flex; flex-direction: column; gap: 6px; }
.cal-activity-btn {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.cal-activity-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.cal-activity-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.cal-activity-btn.active .cal-activity-name { color: var(--primary); }
.cal-activity-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Result */
.cal-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.cal-result-main {
  text-align: center;
  padding: 24px 16px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.cal-result-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}
.cal-result-unit {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 4px;
}
.cal-result-goal {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-top: 6px;
}
.cal-result-details { padding: 12px 16px; }
.cal-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--separator);
}
.cal-detail-row:last-child { border-bottom: none; }
.cal-detail-row span:last-child { font-weight: 700; color: var(--text); }
.cal-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--separator);
}
.cal-macro {
  text-align: center;
  padding: 14px 8px;
}
.cal-macro-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}
.cal-macro-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cal-formula-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding: 0 12px 8px;
}

/* === Repeat Workout Button === */
.workout-card { display: flex; align-items: center; gap: 8px; }
.workout-card-main { flex: 1; min-width: 0; }
.btn-repeat-workout {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-repeat-workout:active { background: var(--primary-light); }

/* === Rest Timer Next Set Preview === */
.rest-next-set-preview {
  text-align: center;
}
.rest-next-set-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.rest-next-set-blocks {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}
.rest-next-block {
  flex: 1;
  max-width: 140px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.rest-next-block:first-child {
  border-radius: 12px 0 0 12px;
  border-right: none;
}
.rest-next-block:last-child {
  border-radius: 0 12px 12px 0;
  border-left: none;
}
.rest-next-block:only-child {
  border-radius: 12px;
  border: 1px solid var(--border);
}
.rest-next-block-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}
.rest-next-block-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.rest-next-block-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === Edit Set Popup === */
.edit-set-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.edit-set-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.edit-set-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}
.edit-set-fields {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.edit-set-group {
  flex: 1;
}
.edit-set-group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.edit-set-group input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  -webkit-appearance: none;
}
.edit-set-group input:focus {
  outline: none;
  border-color: var(--primary);
}
.edit-set-buttons {
  display: flex;
  gap: 10px;
}
.edit-set-buttons .btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* === Workout Edit Mode === */
.edit-set-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}
.edit-set-num {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 48px;
}
.edit-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
}
.edit-input:focus { border-color: var(--primary); outline: none; }
.edit-unit { font-size: 0.72rem; color: var(--text-muted); }
.edit-x { color: var(--text-muted); font-size: 0.8rem; }
.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.edit-actions .btn { flex: 1; }

/* === Summary Muscles === */
.summary-muscles { margin-bottom: 12px; }
.summary-exercise-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* === Workout Note === */
.summary-note-section { margin-bottom: 16px; }
.summary-note-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
}
.summary-note-input::placeholder { color: var(--text-muted); }
.summary-note-input:focus { border-color: var(--primary); outline: none; }
.detail-workout-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* === Empty States (improved) === */
.empty-state-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.empty-state-hero svg { color: var(--text-muted); margin-bottom: 16px; opacity: 0.4; }
.empty-state-hero h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.empty-state-hero p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; max-width: 260px; }

/* === Onboarding === */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.onboarding.hidden { display: none; }
.onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 24px 90px;
  width: 100%;
  max-width: 380px;
  overflow-y: auto;
  max-height: 100vh;
  gap: 0;
}
.onboarding-slide.active { display: flex; }
.onboarding-slide h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.onboarding-slide .btn { margin-top: 24px; }
.onboard-app-icon-wrap {
  margin-bottom: 16px;
}
.onboard-app-icon {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}
.onboard-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-top: 24px;
}
.onboard-input:focus { border-color: var(--primary); outline: none; }
.onboard-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  margin-top: 16px;
  padding: 8px;
}
.onboard-skip:active { color: var(--text); }
.onboard-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
}
.onboard-option {
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.onboard-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.onboard-body-stats { width: 100%; margin-top: 16px; }
.onboard-gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.onboard-gender {
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.onboard-gender.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.onboard-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.onboard-stat { text-align: center; }
.onboard-stat label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
/* Scroll Picker */
.scroll-picker {
  height: 120px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  position: relative;
  mask-image: linear-gradient(transparent, black 35%, black 65%, transparent);
  -webkit-mask-image: linear-gradient(transparent, black 35%, black 65%, transparent);
}
.scroll-picker::-webkit-scrollbar { display: none; }
.scroll-picker { scrollbar-width: none; }
.scroll-picker-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  scroll-snap-align: center;
  transition: color 0.1s, transform 0.1s;
}
.scroll-picker-item.active {
  color: var(--primary);
  font-size: 1.3rem;
}
.scroll-picker-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-top: 1.5px solid var(--primary);
  border-bottom: 1.5px solid var(--primary);
  pointer-events: none;
  border-radius: 4px;
}
.onboard-activity { margin-top: 4px; }
.onboard-activity label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  text-align: left;
}
.onboard-calorie-card {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  margin: 16px 0;
  text-align: center;
}
.onboard-cal-number {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}
.onboard-cal-unit { font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }
.onboard-cal-label { font-size: 0.75rem; opacity: 0.6; margin-top: 8px; }
.onboard-cal-macros {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.onboard-cal-macro-val { font-size: 1.2rem; font-weight: 800; }
.onboard-cal-macro-label { font-size: 0.6rem; opacity: 0.7; text-transform: uppercase; }
.onboard-days {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.onboard-day-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.onboard-day-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.onboard-rest-days {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.onboard-rest-day {
  flex: 1;
  padding: 10px 2px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.onboard-rest-day.active {
  border-color: var(--warning);
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}
.onboard-dots {
  position: fixed;
  bottom: 32px;
  display: flex;
  gap: 8px;
}
.onboard-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}
.onboard-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

/* === Plan Assistant Wizard === */
.plan-wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}
.plan-wizard-step .wizard-icon { font-size: 3rem; margin-bottom: 16px; }
.plan-wizard-step h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.plan-wizard-step .text-muted { margin-bottom: 16px; }
.plan-wizard-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}
.plan-wizard-option {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-wizard-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.plan-wizard-equip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}
.plan-wizard-equip-btn {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-wizard-equip-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.plan-wizard-days {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.plan-wizard-day-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-wizard-day-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.plan-wizard-result {
  width: 100%;
  text-align: left;
}
.plan-wizard-result h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.plan-result-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--separator);
}
.plan-result-card .plan-result-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.plan-result-card .plan-result-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.plan-wizard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.plan-wizard-progress .step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.plan-wizard-progress .step-dot.active {
  background: var(--primary);
}
.plan-wizard-progress .step-dot.done {
  background: var(--success);
}

/* === Progression Strategy Buttons === */
.progression-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.progression-btn {
  padding: 10px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.progression-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.progression-btn-label {
  font-size: 0.78rem;
  font-weight: 700;
}

/* === Header Favorite Button === */
.btn-header-fav {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-header-fav.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* === Header Icons === */
.page-header-large {
  position: relative;
  display: flex;
  align-items: center;
}
.page-header-large h1 { flex: 1; }
.header-logo-wrap {
  flex: 1;
  height: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.header-logo {
  height: 90px;
  width: auto;
  margin-left: -8px;
  margin-top: 2px;
}
.header-icons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-header-icon {
  width: 36px; height: 36px;
  border: none;
  background: var(--bg-input);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-header-icon:active { background: var(--border); }

/* Tips */
.tips-list { display: flex; flex-direction: column; gap: 10px; }
.tip-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tip-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.tip-body { flex: 1; min-width: 0; }
.tip-title { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.tip-text { font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }

/* === Exercise Name Link in Workout === */
.exercise-name-link { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.exercise-name-link:active { opacity: 0.7; }
.info-hint {
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

/* === Exercise Info Sheet (Bottom Sheet in Workout) === */
.exercise-info-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 16px 24px;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
}
.action-sheet-overlay.show .exercise-info-sheet { transform: translateY(0); }
.exercise-info-gif {
  width: calc(100% + 32px);
  margin: 0 -16px;
  height: 200px;
  background: var(--bg-input);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
.exercise-info-gif img {
  height: 100%;
  object-fit: contain;
}
.exercise-info-header { padding: 16px 0 8px; }
.exercise-info-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.exercise-info-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.exercise-info-instructions {
  padding: 8px 0 16px;
}
.exercise-info-instructions ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exercise-info-instructions li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Workout Action Row === */
.workout-action-row {
  display: flex;
  gap: 10px;
}
.workout-action-row .btn { flex: 1; }

/* === Swap Exercise Sheet === */
.swap-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
}
.action-sheet-overlay.show .swap-sheet { transform: translateY(0); }
.swap-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.swap-title { font-size: 1.05rem; font-weight: 700; }
.swap-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.swap-search {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}
.swap-search:focus { border-color: var(--accent); }
.swap-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.swap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
.swap-item:active { background: var(--bg-input); }
.swap-gif {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  flex-shrink: 0;
}
.swap-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.swap-info { min-width: 0; }
.swap-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.swap-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.swap-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* === Milestones === */
.milestones-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.milestone-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 8px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.milestone-card.locked { opacity: 0.4; }
.milestone-card.earned { border-color: var(--primary); background: var(--primary-light); }
.milestone-emoji { font-size: 1.8rem; margin-bottom: 6px; }
.milestone-name { font-size: 0.72rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.milestone-desc { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.milestone-category { margin-bottom: 16px; }
.milestone-category-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }

/* === Recently Used Exercises === */
.recent-exercises-section { margin-bottom: 4px; }
.recent-exercises-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 4px 6px;
}

/* === Swipe to Delete === */
.workout-card { position: relative; overflow: hidden; }
.workout-card-swipe {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 80px;
  background: var(--danger);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transform: translateX(100%);
  transition: transform 0.2s;
}
.workout-card.swiped .workout-card-swipe { transform: translateX(0); }
.workout-card.swiped .workout-card-main { transform: translateX(-80px); }
.workout-card-main { transition: transform 0.2s; position: relative; z-index: 1; background: var(--bg-card); }

/* === Number Count-Up Animation === */
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-num { animation: countUp 0.4s ease-out; }

/* === Rest Day === */
.week-day.rest-day { background: var(--bg-elevated); border-style: dashed; }
.week-day.rest-day .day-check { color: var(--text-muted); }

/* Day Popup */
.day-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 24px;
}
.day-popup-overlay.show { opacity: 1; }
.day-popup {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 340px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.2s;
}
.day-popup-overlay.show .day-popup { transform: scale(1); }
.day-popup-header {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.day-popup-workout {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.day-popup-workout:first-of-type { border-top: none; padding-top: 0; }
.day-popup-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.day-popup-exercises {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Day Popup Redesign */
.dp-popup { padding: 20px; }
.dp-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.dp-stat { text-align: center; }
.dp-stat-num { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.dp-stat-label { font-size: 0.58rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.dp-exercises { display: flex; flex-direction: column; gap: 6px; }
.dp-ex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
}
.dp-ex-name { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.dp-ex-detail { font-size: 0.72rem; font-weight: 700; color: var(--primary); white-space: nowrap; margin-left: 8px; }

/* === Social Share Card === */
.share-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 12px;
}
.share-card-title { font-size: 1.1rem; font-weight: 800; }
.share-card-stats { display: flex; justify-content: center; gap: 24px; margin: 16px 0; }
.share-card-stat-val { font-size: 1.5rem; font-weight: 800; }
.share-card-stat-label { font-size: 0.6rem; opacity: 0.7; text-transform: uppercase; }
.share-card-exercises { font-size: 0.78rem; opacity: 0.85; line-height: 1.5; }
.share-card-brand { font-size: 0.68rem; opacity: 0.4; margin-top: 14px; }
/* Builder Customize */
.builder-customize {
  margin: 10px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.builder-icon-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.builder-icon-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  color: var(--primary);
}
.builder-icon-preview svg { width: 28px; height: 28px; }
.builder-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.builder-icon-btn {
  width: 34px;
  height: 34px;
  border: 2px solid transparent;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 4px;
}
.builder-icon-btn svg { width: 100%; height: 100%; }
.builder-icon-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.builder-color-section {
  display: flex;
  align-items: center;
  gap: 10px;
}
.builder-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
}
.builder-color-grid {
  display: flex;
  gap: 6px;
}
.builder-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
}
.builder-color-btn.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text);
}
.builder-desc-input {
  margin-top: 0 !important;
  font-size: 0.82rem !important;
}

/* Template Filter Toggle */
.template-filter-toggle {
  display: flex;
  gap: 0;
  margin: 12px 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
}
.template-filter-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.template-filter-btn.active {
  background: var(--primary);
  color: #fff;
}

.share-actions { display: flex; flex-direction: column; gap: 10px; }
.share-theme-toggle {
  display: flex;
  gap: 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
}
.share-theme-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.share-theme-btn.active {
  background: var(--primary);
  color: #fff;
}
.share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.share-btn:active { background: var(--bg-input); }

/* === Remove Exercise Button in Pills === */
.pill-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 6px;
}
.pill-remove:active { color: var(--danger); }

/* === Set Count Buttons === */
.set-input-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex: 1;
  /* Die Satzangabe bleibt einzeilig; der Trennstrich nach rechts ist entfallen, weil er
     beim Umbruch als loser Strich am Zeilenende stehen blieb. */
  white-space: nowrap;
}
/* Etwas kleiner als der Fließtext: macht Platz, damit die Schalter in derselben Zeile
   bleiben, und passt besser zu den kleinen Beschriftungen der Eingabefelder. */
.set-input-label-row > span { font-size: 0.8rem; font-weight: 600; }
.set-count-btns { display: flex; gap: 2px; }
.set-count-btn {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.set-count-btn:disabled { opacity: 0.3; }
.set-count-btn:active:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }

/* === Superset Visual Connection === */
.workout-exercise-pill.superset-a { border-left: 3px solid var(--primary); }
.workout-exercise-pill.superset-b { border-left: 3px solid var(--warning); }
.workout-exercise-pill.superset-c { border-left: 3px solid var(--success); }
.workout-exercise-pill.superset-d { border-left: 3px solid var(--accent); }

/* === Long Exercise Name === */
.exercise-active-name {
  min-width: 0;
  line-height: 1.25;
}
/* bis zu zwei Zeilen, ausgewogen umbrochen — vorher einzeilig mit "…", dann fehlte das Gerät */
.exercise-active-name .exercise-name-text {
  min-width: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.exercise-active-name.long { font-size: 0.9rem; }

/* === Pull to Refresh Spinner === */
#ptr-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 8px auto;
  border: 2.5px solid var(--separator);
  border-top-color: var(--primary);
  border-radius: 50%;
}
#ptr-indicator.spinning {
  display: flex;
  animation: spin 0.6s linear infinite;
}

/* === Theme Transition === */
html.theme-transition, html.theme-transition * {
  transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease !important;
}

/* === Progress Time Filter === */
.progress-time-filter {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.progress-time-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.progress-time-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* === Auth Pages === */
.auth-page {
  background: var(--bg);
}
.auth-page .page-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
  padding-top: calc(var(--safe-top) + 20px);
  padding-bottom: calc(var(--safe-bottom) + 20px);
}
.auth-container {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-header {
  text-align: center;
  margin-bottom: 8px;
}
.auth-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus {
  border-color: var(--primary);
}
.auth-input::placeholder {
  color: var(--text-muted);
}
.auth-submit {
  margin-top: 4px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}
.btn-google:active {
  background: var(--bg-input);
}
.btn-google svg {
  flex-shrink: 0;
}
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
}
.auth-link strong {
  color: var(--primary);
}
.auth-skip {
  margin-top: 8px;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === Update Spinner Overlay === */
#update-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.update-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
#update-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.update-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--separator);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Guest Banner === */
.guest-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.guest-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guest-banner-text strong {
  font-size: 0.82rem;
  color: var(--text);
}
.guest-banner-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* === Account Section in Settings === */
.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.account-info {
  flex: 1;
  min-width: 0;
}
.account-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.sync-dot.syncing {
  background: var(--warning);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
