/* ===== LOADING SCREEN ===== */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.loading-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  animation: pulse-logo 1.6s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.7; transform: scale(0.95); }
}

.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== ONBOARDING ===== */
.onboarding-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 32px;
  gap: 24px;
  max-width: 480px;
  margin: 0 auto;
}

.onboarding-logo { font-size: 3rem; }

.onboarding-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.onboarding-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -12px;
}

.onboarding-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.onboarding-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onboarding-options.row {
  flex-direction: row;
}

.onboarding-opt {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: var(--transition);
  text-align: right;
}

.onboarding-options.row .onboarding-opt {
  align-items: center;
  font-size: 1.1rem;
}

.onboarding-opt span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.onboarding-opt.selected {
  border-color: var(--accent);
  background: rgba(70,130,180,.1);
  color: var(--accent);
}

.onboarding-opt.selected span { color: var(--accent); opacity: 0.8; }

.onboarding-opt:hover:not(.selected) { border-color: var(--accent); }

.onboarding-optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.muscle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.muscle-tag {
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.muscle-tag.selected {
  border-color: var(--accent);
  background: rgba(70,130,180,.12);
  color: var(--accent);
}

.muscle-tag:hover:not(.selected) { border-color: var(--accent); }

.recommended-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f5a623;
  background: rgba(245,166,35,.12);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: middle;
}

#onboarding-submit { width: 100%; max-width: 100%; margin-top: 8px; }
#onboarding-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.login-logo-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.4));
}

.login-sub { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 40px; }

.home-logo-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.3));
}

.btn-google {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  color: #1f1f1f;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.btn-google:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
.btn-google:active { transform: scale(0.98); }

.google-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ===== USER BAR ===== */
.home-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.signout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.signout-btn:hover { border-color: var(--accent2); color: var(--accent2); }

.admin-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity .15s;
}
.admin-btn:hover { opacity: 1; }

/* ===== ADMIN SCREEN ===== */
.admin-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.admin-stat-card.accent { border-color: var(--accent); background: rgba(70,130,180,.08); }

.admin-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
}
.admin-stat-card.accent .admin-stat-num { color: var(--accent); }

.admin-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.admin-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.admin-row:last-child { border-bottom: none; }
.admin-row strong { color: var(--accent); font-size: 1rem; }

.admin-chart { overflow-x: auto; padding: 4px 0; }

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --surface2:  #e4e8ee;
  --border:    #cdd3dc;
  --text:      #1e2a38;
  --text-muted:#6b7a90;
  --accent:    #4682b4;
  --accent2:   #2c5f8a;
  --push:      #e05c5c;
  --pull:      #4682b4;
  --legs:      #3a9e6e;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(70,130,180,.15);
  --transition:0.2s ease;
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== LAYOUT ===== */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  gap: 12px;
}

.header-back {
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.header-back:hover { background: var(--border); color: var(--text); }

.header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.header-spacer { width: 40px; flex-shrink: 0; }

/* ===== SCREEN ===== */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; }

/* ===== HOME SCREEN ===== */
.home-hero {
  padding: 28px 20px 20px;
  text-align: center;
}

.home-greeting {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.home-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.home-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== SECTION ===== */
.section { padding: 0 20px; margin-bottom: 28px; }
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* ===== WORKOUT CARDS ===== */
.workout-cards { display: flex; flex-direction: column; gap: 12px; }

.workout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.workout-card::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.workout-card.push::before  { background: var(--push); }
.workout-card.pull::before  { background: var(--pull); }
.workout-card.legs::before  { background: var(--legs); }

.workout-card:hover { background: var(--surface2); transform: translateX(-2px); }
.workout-card:active { transform: scale(0.98); }

.workout-card-letter {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: -0.5px;
}
.workout-card-letter.push { background: var(--push); }
.workout-card-letter.pull { background: var(--pull); }
.workout-card-letter.legs { background: var(--legs); }
.workout-card-letter.sm {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1rem;
}

.workout-card-info { flex: 1; }

.workout-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.workout-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.workout-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.badge-default { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-accent  { background: rgba(70,130,180,.15); color: var(--accent2); border: 1px solid rgba(70,130,180,.3); }

.workout-card-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===== DAILY TIP ===== */
.daily-tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.daily-tip-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.daily-tip-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* ===== TIPS CARD ===== */
.tip-card {
  background: rgba(70,130,180,.08);
  border: 1px solid rgba(70,130,180,.2);
  border-radius: var(--radius);
  padding: 16px;
}

.tip-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: 8px;
}

.tip-card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tip-card-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

.tip-card-list li::before {
  content: '✓';
  color: var(--accent2);
  flex-shrink: 0;
}

/* ===== WORKOUT SCREEN ===== */
.workout-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.workout-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.workout-emoji { font-size: 2rem; }

.workout-info h2 { font-size: 1.2rem; font-weight: 700; }
.workout-info p  { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.workout-progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
}

.workout-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

.workout-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}

/* ===== EXERCISE LIST ===== */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
}

.exercise-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}

.exercise-item:hover { background: var(--surface2); }
.exercise-item.done  { opacity: 0.45; }

.exercise-item.done .exercise-num {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.exercise-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.exercise-details { flex: 1; }

.exercise-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.exercise-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.exercise-arrow {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ===== ACTIVE EXERCISE SCREEN ===== */
.active-header {
  padding: 20px;
}

.active-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

.active-exercise-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.active-muscles {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== TIP BOX ===== */
.tip-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  gap: 10px;
}

.tip-box-icon { font-size: 1rem; flex-shrink: 0; }

/* ===== SET TRACKER ===== */
.set-tracker { margin-bottom: 24px; }

.set-tracker-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.set-dots {
  display: flex;
  gap: 10px;
}

.set-dot {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.set-dot:hover { border-color: var(--accent); }

.set-dot.active {
  border-color: var(--accent);
  background: rgba(70,130,180,.15);
  color: var(--accent2);
}

.set-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== REPS DISPLAY ===== */
.reps-display {
  text-align: center;
  margin-bottom: 24px;
}

.reps-number {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.reps-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== REST TIMER ===== */
.rest-timer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  display: none;
}

.rest-timer.visible { display: block; }

.rest-timer-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.rest-timer-count {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.rest-timer-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.rest-timer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1s linear;
  width: 100%;
}

.rest-skip-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.rest-skip-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* ===== PRIMARY BUTTON ===== */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  margin-bottom: 12px;
}

.btn-primary:hover  { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== DONE SCREEN ===== */
.done-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.done-emoji { font-size: 5rem; margin-bottom: 20px; }
.done-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.done-sub   { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 32px; }

.done-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  width: 100%;
  max-width: 320px;
}

.done-stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
}

.done-stat-num  { font-size: 1.5rem; font-weight: 700; color: var(--accent2); }
.done-stat-label{ font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ===== LEVEL BADGES & PROGRESS ===== */
.exercise-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.level-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(70,130,180,.12);
  color: var(--accent2);
  border: 1px solid rgba(70,130,180,.25);
  white-space: nowrap;
}

.level-badge-max {
  background: rgba(70,130,180,.12);
  color: var(--accent2);
  border-color: rgba(70,130,180,.3);
}

.level-up-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.progress-pips {
  display: flex;
  gap: 4px;
  align-items: center;
}

.progress-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid var(--border);
}

.progress-pip.filled {
  background: var(--accent2);
  border-color: var(--accent2);
}

.level-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Active exercise level row */
.active-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.active-level-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.active-level-num {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.level-adj-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.level-adj-btn:hover:not(:disabled) {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(70,130,180,.1);
}

.level-adj-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ===== LEVEL-UP PANEL (done screen) ===== */
.levelup-container {
  width: 100%;
  max-width: 320px;
  background: rgba(70,130,180,.07);
  border: 1px solid rgba(70,130,180,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.levelup-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.share-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 280px;
}

.share-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-block;
  background: var(--surface2);
  color: var(--text);
  transition: opacity .15s;
}
.share-btn:hover { opacity: 0.85; }
.share-btn.whatsapp { background: #25d366; color: #fff; }
.share-btn.telegram { background: #2aabee; color: #fff; }

.levelup-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(70,130,180,.15);
}

.levelup-item:last-child { border-bottom: none; padding-bottom: 0; }

.levelup-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.levelup-arrow {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.levelup-arrow strong { color: var(--accent); }

/* ===== INSTRUCTIONS PANEL ===== */
.instructions-toggle {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  transition: var(--transition);
  text-align: right;
  direction: rtl;
}

.instructions-toggle:hover { background: var(--surface2); }

.instructions-toggle.open {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: transparent;
  background: var(--surface2);
}

.instructions-toggle-icon {
  transition: transform 0.25s ease;
  color: var(--accent2);
  font-size: 1rem;
}

.instructions-toggle.open .instructions-toggle-icon {
  transform: rotate(180deg);
}

.instructions-toggle-right {
  margin-right: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.instructions-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
  margin-bottom: 16px;
}

.instructions-panel.open {
  max-height: 600px;
  padding: 16px;
}

/* Steps */
.instructions-steps-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.step-item {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(70,130,180,.15);
  border: 1px solid rgba(70,130,180,.3);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.5;
}

/* Mistakes */
.instructions-mistakes {
  margin-top: 14px;
  background: rgba(70,130,180,.06);
  border: 1px solid rgba(70,130,180,.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.instructions-mistakes-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.mistake-item {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mistake-item::before {
  content: '✗';
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 700;
}

.mistake-item:last-child { margin-bottom: 0; }

/* Video link */
.instructions-video-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 16px;
  background: rgba(70,130,180,.08);
  border: 1px solid rgba(70,130,180,.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.instructions-video-link:hover {
  background: rgba(70,130,180,.14);
  color: var(--accent2);
}

/* ===== WARMUP SCREEN ===== */
.warmup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  text-align: center;
}

.warmup-intro-emoji { font-size: 4rem; margin-bottom: 12px; }
.warmup-intro-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.warmup-intro-sub   { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }

.warmup-exercise-preview {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.warmup-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.warmup-preview-item:last-child { border-bottom: none; }

.warmup-preview-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(70,130,180,.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.warmup-preview-dur {
  margin-right: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 10px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
}

/* Active warmup */
.warmup-progress-row {
  width: 100%;
  margin-bottom: 20px;
  text-align: right;
}

.warmup-step-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.warmup-progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.warmup-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.warmup-exercise-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.warmup-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
  max-width: 300px;
}

/* Countdown ring */
.warmup-countdown-wrap {
  position: relative;
  width: 140px; height: 140px;
  margin-bottom: 28px;
}

.warmup-ring { width: 140px; height: 140px; transform: rotate(-90deg); }

.warmup-ring-bg {
  fill: none;
  stroke: var(--surface2);
  stroke-width: 8;
}

.warmup-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.warmup-countdown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.warmup-btns {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== PR CELEBRATION MODAL ===== */
.pr-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pr-modal.visible { display: flex; animation: fade-in 0.25s ease; }

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

.pr-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pr-modal-emoji { font-size: 4rem; animation: bounce 0.6s ease; }

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  40%     { transform: translateY(-16px); }
  70%     { transform: translateY(-8px); }
}

.pr-modal-title { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.pr-modal-sub   { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }

.pr-modal-list  { width: 100%; display: flex; flex-direction: column; gap: 8px; }

.pr-modal-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pr-modal-ex    { font-size: 0.9rem; font-weight: 600; }
.pr-modal-level { font-size: 0.78rem; color: var(--accent2); font-weight: 600; }

/* ===== PR SCREEN ===== */
.section-title-btns { display: flex; gap: 8px; }

.pr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pr-card-trophy { font-size: 1.8rem; flex-shrink: 0; }

.pr-card-name  { font-size: 0.95rem; font-weight: 600; margin-bottom: 3px; }
.pr-card-level { font-size: 0.8rem; color: var(--accent2); font-weight: 600; margin-bottom: 2px; }
.pr-card-date  { font-size: 0.75rem; color: var(--text-muted); }

/* ===== WORKOUT TIMER ===== */
.workout-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.workout-timer {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ===== DONE TIMES ===== */
.done-times {
  width: 100%;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.done-time-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.done-time-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.done-time-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.done-time-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* ===== HISTORY SCREEN ===== */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title-row .section-title { margin-bottom: 0; }

.history-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}
.history-btn:hover { border-color: var(--accent); color: var(--accent); }

.history-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 8px;
}

.history-chart-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.history-chart {
  display: flex;
  justify-content: center;
}

.history-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.history-stat { text-align: center; }

.history-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.history-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.history-list {
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  gap: 8px;
  overflow-y: auto;
}

.history-week-sep {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 0 6px;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}


.history-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.history-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.history-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history-loading,
.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 48px 20px;
  line-height: 1.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .home-title { font-size: 1.4rem; }
  .reps-number { font-size: 3.5rem; }
}
