/* ═══════════════════════════════════════ */
/* cidem's gym — Style System             */
/* ═══════════════════════════════════════ */

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #1e1e1e;
  --bg-elevated: #1c1c1c;
  --accent: #7c5cff;
  --accent-dim: rgba(124, 92, 255, 0.15);
  --accent-glow: rgba(124, 92, 255, 0.3);
  --text: #f0f0f0;
  --text-secondary: #888;
  --text-muted: #555;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --border: #222;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-height: 64px;
}

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

html {
  font-size: 16px;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

/* ─── App Shell ─── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ─── Header ─── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(env(safe-area-inset-top, 12px) + 4px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-header .date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition);
}

.header-btn:active {
  background: var(--bg-elevated);
}

/* ─── Tab Content ─── */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.tab-panel {
  display: none;
  padding: 16px 16px calc(var(--tab-height) + var(--safe-bottom) + 16px);
  min-height: 100%;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

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

/* ─── Bottom Navigation ─── */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg);
  border-top: 1px solid var(--border);
  height: var(--tab-height);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  min-width: 56px;
  min-height: 44px;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:active {
  transform: scale(0.92);
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: background var(--transition);
}

.card:active {
  background: var(--bg-card-hover);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-badge.strength { background: rgba(124, 92, 255, 0.15); color: #7c5cff; }
.card-badge.mobility { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.card-badge.stretch { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.card-badge.cardio { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* ─── Program Tab ─── */
.program-header {
  text-align: center;
  margin-bottom: 20px;
}

.program-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.program-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.week-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
}

.week-nav::-webkit-scrollbar { display: none; }

.day-chip {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-width: 60px;
}

.day-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.day-chip.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.day-chip .day-label {
  display: block;
  font-size: 0.65rem;
  opacity: 0.7;
  margin-bottom: 2px;
}

.day-chip .day-num {
  display: block;
  font-size: 1rem;
}

.program-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.program-day-card .day-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.program-day-card .day-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.program-exercise-list {
  list-style: none;
}

.program-exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.program-exercise-item:last-child {
  border-bottom: none;
}

.exercise-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.program-exercise-info {
  flex: 1;
}

.program-exercise-info .name {
  font-size: 0.9rem;
  font-weight: 500;
}

.program-exercise-info .meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.program-exercise-info .exercise-note {
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 2px;
  opacity: 0.85;
}

.program-section-header {
  padding: 14px 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  list-style: none;
}

.start-workout-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.start-workout-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.start-workout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Workout Tab (Active Workout) ─── */
.workout-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.workout-empty .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.workout-empty h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.workout-empty p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Active workout */
.workout-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.workout-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

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

.workout-progress .progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.exercise-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.exercise-view .video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.exercise-view .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.exercise-view .video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #111;
  color: var(--text-secondary);
  cursor: pointer;
}

.exercise-view .video-placeholder .play-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.exercise-details {
  padding: 16px;
}

.exercise-details h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.exercise-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.exercise-meta .tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.exercise-instructions {
  margin-bottom: 16px;
}

.exercise-instructions h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.exercise-instructions p,
.exercise-instructions .instruction-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}

.exercise-tips {
  padding: 12px;
  background: var(--accent-dim);
  border-radius: var(--radius-xs);
  margin-bottom: 16px;
}

.exercise-tips .tip-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.exercise-tips p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

/* ─── Set Tracking ─── */
.sets-container {
  margin-bottom: 16px;
}

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

.sets-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.add-set-btn {
  font-size: 0.75rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
}

.previous-data {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
}

.previous-data span {
  color: var(--accent);
  font-weight: 600;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.set-label {
  width: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.set-input {
  flex: 1;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  font-weight: 500;
  padding: 0 8px;
  -webkit-appearance: none;
  appearance: none;
}

.set-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.set-input::placeholder {
  color: var(--text-muted);
}

.set-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 24px;
}

.set-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.set-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #000;
}

/* Timer based exercises */
.timer-container {
  text-align: center;
  padding: 20px;
}

.timer-display {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 16px;
}

.timer-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timer-btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.timer-btn.primary {
  background: var(--accent);
  color: white;
}

.timer-btn.secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Rest timer */
.rest-timer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.95);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.rest-timer-overlay.visible {
  display: flex;
}

.rest-timer-overlay .rest-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.rest-timer-overlay .rest-time {
  font-size: 5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.rest-timer-overlay .rest-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.rest-timer-options {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.rest-option {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.rest-option.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Exercise navigation */
.exercise-nav {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.exercise-nav button {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.exercise-nav .prev-btn {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

.exercise-nav .next-btn {
  background: var(--accent);
  color: white;
}

.exercise-nav button:active {
  transform: scale(0.98);
}

.exercise-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.finish-workout-btn {
  width: 100%;
  padding: 16px;
  background: var(--success);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}

/* ─── Library Tab ─── */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0 16px 0 42px;
  -webkit-appearance: none;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.library-exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background var(--transition);
}

.library-exercise-card:active {
  background: var(--bg-card-hover);
}

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

.library-exercise-card .exercise-targets {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.library-exercise-card .exercise-equipment {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Exercise detail modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

/* ─── Videos Tab ─── */
.add-video-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.add-video-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.input-group {
  margin-bottom: 10px;
}

.input-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.input-group input,
.input-group select {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0 12px;
  -webkit-appearance: none;
}

.input-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.save-video-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-card .video-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.video-card .video-info {
  flex: 1;
  min-width: 0;
}

.video-card .video-url {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card .video-category {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.video-card .delete-video {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px;
}

/* ─── Profile Tab ─── */
.profile-section {
  margin-bottom: 24px;
}

.profile-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-item .history-date {
  font-size: 0.85rem;
  font-weight: 600;
}

.history-item .history-day {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.history-item .history-exercises {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item .history-duration {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.clear-data-btn {
  width: 100%;
  padding: 14px;
  background: none;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

/* ─── Workout Summary Modal ─── */
.summary-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.95);
  z-index: 250;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.summary-overlay.visible {
  display: flex;
}

.summary-content {
  text-align: center;
  max-width: 340px;
}

.summary-content .trophy {
  font-size: 4rem;
  margin-bottom: 16px;
}

.summary-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-content .summary-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}

.summary-content .summary-stat {
  text-align: center;
}

.summary-content .summary-stat .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.summary-content .summary-stat .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.summary-close-btn {
  padding: 14px 40px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}

/* ─── Utilities ─── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

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

/* ─── iOS PWA fixes ─── */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
  #app {
    min-height: -webkit-fill-available;
  }
}

/* ─── Wake lock indicator ─── */
.wake-lock-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-dim);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

.wake-lock-indicator.active {
  display: flex;
}

.wake-lock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

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

/* ─── Empty states ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-emoji {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Section headers ─── */
.section-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  margin-top: 20px;
}

.section-header:first-child {
  margin-top: 0;
}

/* ─── Input number arrows removal ─── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }
