:root {
  --bg-main: #0e1116;
  --bg-card: #161920;
  --bg-card-hover: #1c212a;
  --bg-input: #12151b;
  --border-color: #262c38;
  --border-active: #10b981;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-dim: rgba(16, 185, 129, 0.12);
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-blue: #38bdf8;
  --accent-amber: #fbbf24;
  --accent-rose: #f43f5e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --safe-top: env(safe-area-inset-top, 16px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

input, textarea {
  user-select: auto;
}

html {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  padding-bottom: calc(160px + var(--safe-bottom));
  overflow-x: hidden;
  width: 100%;
}


/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: max(12px, var(--safe-top)) 16px 12px;
}

.app-header .header-top,
.date-navigator,
.container,
.timer-content {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}


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

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

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

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:active {
  transform: scale(0.94);
  background: var(--bg-card-hover);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald-light);
}

/* Date Navigator */
.date-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 6px;
}

.date-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.date-nav-btn:active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.date-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.date-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-today-pill {
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.45);
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-today-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
}

.btn-today-pill:active {
  transform: scale(0.94);
  background: var(--accent-emerald);
  color: #042f1a;
}

/* Main Tabs Switcher */
.tabs-nav {
  display: flex;
  width: calc(100% - 32px);
  max-width: 480px;
  margin: 12px auto 6px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  gap: 4px;
  box-sizing: border-box;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn svg {
  flex-shrink: 0;
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--accent-emerald-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(16, 185, 129, 0.35);
}

/* Content Container */
.container {
  padding: 12px 16px;
  flex: 1;
}

/* Rest Day Card */
.rest-day-card {
  background: linear-gradient(145deg, #161a22 0%, #1a202c 100%);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-xl);
  padding: 32px 20px;
  text-align: center;
  margin-top: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.rest-icon {
  font-size: 52px;
  margin-bottom: 16px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.rest-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.rest-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.btn-rest-cardio {
  background: var(--accent-emerald-dim);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald-light);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Exercise Cards */
.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease;
}

.exercise-card.all-done {
  border-color: rgba(16, 185, 129, 0.4);
}

.exercise-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.exercise-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

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

.badge-target {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-rest {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
}

/* Previous Log Hint */
.prev-log-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.prev-icon {
  color: var(--accent-emerald-light);
  font-size: 13px;
}

.prev-text b {
  color: var(--text-primary);
}

/* Technique note */
.tech-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  padding: 4px 0;
}

/* Set Rows */
.sets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-row {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.set-row.is-done {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.35);
}

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

.set-row.is-done .set-index {
  color: var(--accent-emerald-light);
}

.set-inputs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

/* Individual field container (Weight, Reps, RIR) */
.field-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

/* Stepper Input wrapper */
.stepper-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  height: 38px;
  position: relative;
  overflow: hidden;
}

.stepper-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.stepper-btn:active {
  background: var(--bg-card-hover);
  color: var(--accent-emerald-light);
}

.stepper-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* RIR Quick Select Button */
.rir-btn-select {
  width: 100%;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rir-btn-select:active {
  border-color: var(--accent-emerald);
}

/* Done Checkmark button */
.btn-done-check {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-done-check.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #042f1a;
  box-shadow: 0 2px 10px var(--accent-emerald-glow);
  transform: scale(1.04);
}

.btn-done-check:active {
  transform: scale(0.92);
}

/* Floating Rest Timer Bar */
.timer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  background: rgba(16, 20, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px max(16px, var(--safe-bottom));
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.5);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
}

.timer-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.timer-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.timer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-display {
  font-size: 38px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.timer-meta-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.timer-status-hint {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  line-height: 1.2;
}

.timer-wakelock-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  line-height: 1.2;
  transition: opacity 0.2s ease;
}

.timer-display.running {
  color: var(--accent-emerald-light);
}

.timer-display.finished {
  color: var(--accent-emerald-light);
  animation: pulseFinish 0.6s ease-in-out 5;
}

@keyframes pulseFinish {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.4); }
}

.timer-toggle-btn {
  background: var(--accent-emerald);
  color: #042f1a;
  border: none;
  font-weight: 700;
  font-size: 15px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--accent-emerald-glow);
  transition: transform 0.15s ease;
  box-sizing: border-box;
}

.timer-toggle-btn:active {
  transform: scale(0.95);
}

/* Secondary controls row: presets + add 30s + reset */
.timer-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.timer-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.timer-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.timer-pill-btn:active, .timer-pill-btn.active {
  background: var(--accent-emerald-dim);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald-light);
}

.timer-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-add-btn,
.timer-reset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.timer-add-btn:hover,
.timer-reset-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--accent-emerald-light);
}

.timer-add-btn:active,
.timer-reset-btn:active {
  transform: scale(0.95);
  background: var(--accent-emerald-dim);
}

.timer-reset-btn {
  font-size: 16px;
  padding: 0 12px;
}


/* Cardio & Session Styles */
.cardio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cardio-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.cardio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.cardio-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.2s ease;
}

.cardio-item:focus-within {
  border-color: var(--accent-emerald);
}

.cardio-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cardio-item-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cardio-input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
}

.cardio-unit {
  font-size: 12px;
  color: var(--text-muted);
}

/* Sliders for RPE and Energy */
.slider-group {
  margin-bottom: 20px;
}

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

.slider-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-val-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald-light);
  background: var(--accent-emerald-dim);
  padding: 3px 8px;
  border-radius: 12px;
}

/* Custom Range Slider */
.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: #1c212a;
  outline: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  margin: 8px 0;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-emerald);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-emerald-glow);
  border: 2px solid #ffffff;
}

.custom-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-emerald);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-emerald-glow);
  border: 2px solid #ffffff;
}

.slider-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 18px;
}

/* Energy Emoji Display */
.energy-emojis {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 0;
  font-size: 20px;
}

.energy-emojis span {
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}

.energy-emojis span.selected {
  opacity: 1;
  transform: scale(1.3);
}

/* Session notes */
.session-notes-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 16px;
}

.session-notes-input:focus {
  border-color: var(--accent-emerald);
}

/* Primary Action Button */
.btn-primary {
  width: 100%;
  background: var(--accent-emerald);
  color: #042f1a;
  border: none;
  border-radius: var(--radius-lg);
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-emerald-glow);
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.92;
}

/* Sync status toast */
.sync-toast {
  position: fixed;
  top: max(16px, var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(22, 25, 32, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sync-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.sync-dot.syncing {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: pulse 0.8s infinite;
}

/* Modal dialog for settings / RIR picker */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 500px;
  padding: 24px 20px max(32px, var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}


.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.chip-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 8px;
  cursor: pointer;
  text-align: center;
}

.chip-btn.active {
  background: var(--accent-emerald);
  color: #042f1a;
  border-color: var(--accent-emerald);
}

.chip-btn:active {
  transform: scale(0.95);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #161920 25%, #222733 50%, #161920 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Full Screen Visual Flash Alert */
.screen-flash {
  position: fixed;
  inset: 0;
  background: rgba(16, 185, 129, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.screen-flash.active {
  animation: flashStrobe 1.4s ease-in-out;
}

@keyframes flashStrobe {
  0% { opacity: 0; }
  15% { opacity: 1; background: rgba(255, 255, 255, 0.75); }
  30% { opacity: 0.15; }
  45% { opacity: 0.95; background: rgba(16, 185, 129, 0.65); }
  60% { opacity: 0.2; }
  75% { opacity: 0.85; background: rgba(16, 185, 129, 0.55); }
  100% { opacity: 0; }
}

.timer-wakelock-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-emerald-light);
  opacity: 0.75;
}

/* ==================== STATISTICS VIEW ==================== */
.stats-hero-card {
  background: linear-gradient(135deg, #13221b 0%, #161b24 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.stats-hero-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.stats-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stats-hero-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald-light);
  padding: 3px 8px;
  border-radius: 20px;
}

.stats-hero-workouts {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald-light);
}

.stats-hero-metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.stats-tonnage-val {
  font-size: 46px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1.5px;
}

.stats-tonnage-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.stats-hero-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stats-hero-sub b {
  color: var(--text-primary);
}

/* 2x2 Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stats-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.stats-item-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.stats-item-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
}

.stats-item-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stats-item-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Sections */
.stats-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 18px 16px;
  margin-bottom: 14px;
}

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

.stats-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.stats-badge-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 12px;
}

.stats-section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* PRs List */
.prs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  gap: 10px;
}

.pr-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pr-ex-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.pr-date-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.pr-stats-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pr-weight-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-emerald-light);
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.3px;
}

.pr-e1rm-tag {
  font-size: 10px;
  color: var(--text-muted);
}

/* Weeks dynamic list */
.weeks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.week-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.week-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.week-tonnage {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-emerald-light);
}

/* Gym Tip Card */
.gym-tip-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.gym-tip-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.gym-tip-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.gym-tip-text b {
  color: #fef08a;
}

/* Sound Options Selector */
.sound-options {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
}

.sound-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.sound-option-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sound-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
}

.sound-radio-label input[type="radio"] {
  accent-color: var(--accent-emerald);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-sound-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-emerald-light);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sound-preview:active {
  transform: scale(0.95);
  background: var(--accent-emerald-dim);
}


