/* IronLog - Dark Theme CSS */

:root {
  --bg: #0a0a0f;
  --surface: #1a1a2e;
  --surface-2: #222240;
  --surface-3: #2a2a4a;
  --primary: #e94560;
  --primary-dim: rgba(233, 69, 96, 0.15);
  --secondary: #3b82f6;
  --text: #eee;
  --text-muted: #888;
  --text-dim: #555;
  --success: #4ade80;
  --success-dim: rgba(74, 222, 128, 0.15);
  --warning: #fbbf24;
  --error: #ef4444;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

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

.header-action:active { background: var(--surface-2); }

/* Main content area */
.content {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: 24px;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  min-width: 56px;
}

.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--primary); }
.nav-item:active { color: var(--text); }

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

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

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Exercise card in workout */
.exercise-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.exercise-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
}

.exercise-name {
  font-size: 16px;
  font-weight: 700;
}

.exercise-target {
  font-size: 14px;
  color: var(--text-muted);
}

.exercise-weight {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.exercise-card-body {
  padding: 0 16px 16px;
}

/* Set rows */
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.set-label {
  width: 28px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}

.set-weight {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.set-weight:active { color: var(--primary); }

.set-target {
  font-size: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Set checkbox */
.set-check {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

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

.set-check:active {
  transform: scale(0.9);
}

/* Warmup section */
.warmup-section {
  border-left: 3px solid var(--warning);
  padding-left: 8px;
  margin-bottom: 4px;
}

.warmup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.warmup-chevron {
  font-size: 10px;
  transition: transform 0.2s;
}

.warmup-section.collapsed .warmup-sets {
  display: none;
}

.warmup-section.collapsed .warmup-header {
  opacity: 0.5;
}

.warmup-work-divider {
  height: 1px;
  background: var(--surface-3);
  margin: 6px 0;
}

/* Warmup set styling */
.set-row.warmup {
  opacity: 0.55;
}

.set-row.warmup .set-label {
  color: var(--warning);
  font-weight: 700;
}

.set-row.warmup .set-weight {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.warmup-pct {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* Warmup completed check (amber instead of green) */
.set-check.warmup-completed {
  background: var(--warning);
  border-color: var(--warning);
  color: #000;
}

/* RPE badge */
.rpe-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: pointer;
}

.rpe-badge.high { background: rgba(239, 68, 68, 0.2); color: var(--error); }

.distance-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  cursor: pointer;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:active { background: #d13353; }

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

.btn-success {
  background: var(--success);
  color: #000;
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-ghost {
  background: none;
  color: var(--text-muted);
  padding: 10px 16px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Rest Timer Overlay */
.timer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  gap: 32px;
}

.timer-overlay.hidden { display: none; }

.timer-ring {
  position: relative;
  width: 240px;
  height: 240px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 8;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-time {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timer-label {
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
}

.timer-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.timer-adjust {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-adjust:active { background: var(--surface-2); }

.timer-skip {
  padding: 12px 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Plate Calculator Overlay */
.plate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 60px) 20px 20px;
}

.plate-overlay.hidden { display: none; }

.plate-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

.plate-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.plate-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.plate-input:focus {
  outline: none;
  border-color: var(--primary);
}

.plate-result {
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Plate visual */
.plate-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
}

.plate-barbell {
  display: flex;
  align-items: center;
  gap: 0;
}

.plate-side {
  display: flex;
  align-items: center;
  gap: 2px;
}

.plate-left { flex-direction: row-reverse; }

.plate {
  width: 24px;
  min-height: 30px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.plate-bar-shaft {
  width: 120px;
  height: 12px;
  background: #666;
  border-radius: 2px;
}

.plate-bar-end {
  width: 8px;
  height: 24px;
  background: #888;
  border-radius: 2px;
}

.plate-bar-only {
  display: flex;
  align-items: center;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

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

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  left: 3px;
  top: 3px;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Setting row */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting-info {
  flex: 1;
}

.setting-label {
  font-size: 15px;
  font-weight: 600;
}

.setting-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* List items */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.list-item:active { background: var(--surface-2); }

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.list-item-text {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.list-item-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-dim);
  color: var(--primary);
}

.list-item-badge.active {
  background: var(--success-dim);
  color: var(--success);
}

/* History card */
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
}

.history-card:active { background: var(--surface-2); }

.history-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.history-program {
  font-size: 13px;
  color: var(--text-muted);
}

.history-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.history-stats span { display: flex; align-items: center; gap: 4px; }
.history-detail { margin-top: 12px; }

/* Progress page */
.chart-container {
  height: 250px;
  margin-bottom: 24px;
  position: relative;
}

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

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.range-pills {
  display: flex;
  gap: 4px;
}

.range-pill {
  padding: 4px 10px;
  border-radius: 12px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.range-pill.active {
  background: var(--primary);
  color: #fff;
}

/* Workout status */
.workout-status {
  text-align: center;
  padding: 32px 16px;
}

.workout-status-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.workout-status-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.workout-status-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* Workout active header */
.workout-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--primary-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.workout-timer {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* PR badge */
.pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.2);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* Modal / Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.hidden { display: none; }

.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.2s ease;
}

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

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

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

/* Sections */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  margin-top: 24px;
}

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

/* Chips / Tags */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
}

.chip.active {
  background: var(--primary-dim);
  color: var(--primary);
  border-color: var(--primary);
}

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Notification toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  border: 1px solid var(--border);
  animation: fadeInUp 0.2s ease;
  pointer-events: none;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.pr { border-color: var(--warning); background: rgba(251, 191, 36, 0.15); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Workout notes inline */
.workout-notes {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  margin-top: 12px;
}

.workout-notes:focus { outline: none; border-color: var(--primary); }

/* Weight input inline */
.weight-input-inline {
  width: 80px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.weight-input-inline:focus {
  outline: none;
  border-color: var(--primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }

/* Tab bar for sub-views */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.tab-item {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.tab-item.active {
  background: var(--primary);
  color: #fff;
}

/* AI analysis */
.ai-card {
  background: var(--surface-2);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-card-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Search */
.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  margin-bottom: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%23888' stroke-width='2'/%3E%3Cline x1='11' y1='11' x2='15' y2='15' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

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

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }

/* Reps badge (partial reps) */
.reps-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.reps-badge:active { background: var(--surface-3); }

.reps-badge.full {
  color: var(--success);
  background: var(--success-dim);
}

.reps-badge.partial {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.15);
}

/* Number strip for rep selection */
.reps-strip {
  display: flex;
  gap: 4px;
  padding: 8px 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reps-strip-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.reps-strip-btn:active { background: var(--surface-3); }

.reps-strip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Last time reference */
.last-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Program Editor - Day Card */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

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

.day-card-name {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 0;
  flex: 1;
  margin-right: 12px;
}

.day-card-name:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

/* Program Editor - Section Card */
.section-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary);
  padding: 12px;
  margin-bottom: 8px;
}

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

.section-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.section-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Section type badges */
.section-type-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-type-badge.straight { background: rgba(59,130,246,0.2); color: #3b82f6; }
.section-type-badge.circuit { background: rgba(251,191,36,0.2); color: #fbbf24; }
.section-type-badge.superset { background: rgba(139,92,246,0.2); color: #8b5cf6; }
.section-type-badge.emom { background: rgba(233,69,96,0.2); color: #e94560; }
.section-type-badge.amrap { background: rgba(74,222,128,0.2); color: #4ade80; }
.section-type-badge.warmup { background: rgba(251,146,60,0.2); color: #fb923c; }
.section-type-badge.cooldown { background: rgba(34,211,238,0.2); color: #22d3ee; }

/* Section exercises in editor */
.section-exercises {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 4px;
}

.section-exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.section-exercise-name {
  font-size: 14px;
  font-weight: 500;
}

.section-exercise-config {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Exercise picker */
.picker-item {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.picker-item:active { background: var(--surface-2); }

.picker-item-name {
  font-size: 15px;
  font-weight: 600;
}

.picker-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Section type chips in editor */
.chip.straight { border-color: #3b82f6; }
.chip.straight.active { background: rgba(59,130,246,0.2); color: #3b82f6; border-color: #3b82f6; }
.chip.circuit { border-color: #fbbf24; }
.chip.circuit.active { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: #fbbf24; }
.chip.superset { border-color: #8b5cf6; }
.chip.superset.active { background: rgba(139,92,246,0.2); color: #8b5cf6; border-color: #8b5cf6; }
.chip.emom { border-color: #e94560; }
.chip.emom.active { background: rgba(233,69,96,0.2); color: #e94560; border-color: #e94560; }
.chip.amrap { border-color: #4ade80; }
.chip.amrap.active { background: rgba(74,222,128,0.2); color: #4ade80; border-color: #4ade80; }
.chip.warmup { border-color: #fb923c; }
.chip.warmup.active { background: rgba(251,146,60,0.2); color: #fb923c; border-color: #fb923c; }
.chip.cooldown { border-color: #22d3ee; }
.chip.cooldown.active { background: rgba(34,211,238,0.2); color: #22d3ee; border-color: #22d3ee; }

/* Workout Section Headers */
.workout-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 16px 0 4px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.workout-section-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Round tag on sets */
.set-round-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 2px;
}

/* Timer mode label */
.timer-mode-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  min-height: 16px;
}

/* Timer pause button */
.timer-pause {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.timer-pause:active {
  background: var(--surface-2);
}

/* Timer mode ring colors */
.timer-overlay[data-mode="circuit"] .timer-ring-progress { stroke: #fbbf24; }
.timer-overlay[data-mode="emom"] .timer-ring-progress { stroke: #e94560; }
.timer-overlay[data-mode="amrap"] .timer-ring-progress { stroke: #4ade80; }
.timer-overlay[data-mode="superset"] .timer-ring-progress { stroke: #8b5cf6; }
.timer-overlay[data-mode="duration"] .timer-ring-progress { stroke: #3b82f6; }

/* Workout Summary */
.summary-header {
  text-align: center;
  padding: 24px 16px 16px;
}

.summary-header-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.summary-header-title {
  font-size: 24px;
  font-weight: 800;
}

.summary-header-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 4px;
  margin: 16px 0;
}

.summary-stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-stat span:first-child {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-stat span:last-child {
  font-size: 18px;
  font-weight: 700;
}

.summary-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 8px;
  padding: 0 4px;
}

.summary-exercise {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 6px;
}

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

.summary-exercise-name {
  font-weight: 700;
  font-size: 15px;
}

.summary-exercise-sets {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: monospace;
}

.summary-exercise-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.summary-stalls {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0;
}

.summary-stalls-header {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
}

.summary-stall-item {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 12px;
  border-left: 2px solid #fbbf24;
}

.summary-ai-section {
  margin: 16px 0;
  text-align: center;
}

.summary-notes {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Weight Editor */
.weight-editor {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.weight-editor-input {
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  text-align: center;
  width: 160px;
  padding: 0 4px;
  font-family: inherit;
}

.weight-editor-input:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

/* Remove number input spinner */
.weight-editor-input::-webkit-inner-spin-button,
.weight-editor-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.weight-editor-input[type=number] {
  -moz-appearance: textfield;
}

.weight-editor-unit {
  font-size: 18px;
  color: var(--text-muted);
}

.weight-editor-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.weight-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 52px;
}

.weight-btn:active { background: var(--surface-3); }

.weight-editor-plates {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
}

/* Day Selector (Workout A/B picker) */
.day-selector {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.day-selector-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.day-selector-btn.active {
  background: var(--primary);
  color: #fff;
}

.day-selector-btn:active {
  opacity: 0.8;
}

.day-selector-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 12px;
}

/* History Calendar / Streak View */
.calendar-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-month-label {
  font-size: 15px;
  font-weight: 700;
}

.calendar-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.calendar-nav-btn:active {
  background: var(--surface-2);
}

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

.calendar-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 6px;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day.calendar-today {
  color: var(--text);
  font-weight: 700;
}

.calendar-day.calendar-today::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  pointer-events: none;
}

.calendar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  bottom: 2px;
}
