/* dialled. — Premium Minimalist Fitness App */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #000000;
  --surface: #111111;
  --surface2: #1a1a1a;
  --border: #2a2a2a;
  --text: #ffffff;
  --text2: #999999;
  --text3: #666666;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.15);
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}
.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.logo .dot { color: var(--green); }
.header-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.header-actions { display: flex; gap: 8px; }
.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

/* ===== MAIN CONTENT ===== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 120px;
}

/* ===== STREAK CALENDAR ===== */
.streak-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.streak-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.streak-count {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.streak-count span { color: var(--green); font-size: 16px; font-weight: 600; }
.streak-label { font-size: 14px; color: var(--text2); margin-top: 2px; }
.streak-dots {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.streak-day-label { font-size: 11px; color: var(--text3); font-weight: 600; }
.streak-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
}
.streak-dot.active {
  background: var(--green);
  border-color: var(--green);
}
.streak-dot.today {
  border-color: var(--green);
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 12px;
}

/* ===== WORKOUT TEMPLATES ===== */
.template-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--border);
}
.template-item:active { background: var(--surface2); }
.template-name { font-size: 17px; font-weight: 600; }
.template-meta { font-size: 14px; color: var(--text2); margin-top: 2px; }
.template-arrow { color: var(--text3); font-size: 20px; }

/* ===== PRIMARY BUTTON ===== */
.btn-primary {
  background: var(--green);
  color: #000;
  border: none;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: -0.3px;
}
.btn-primary:active { opacity: 0.85; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:active { background: var(--surface2); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: none;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== BOTTOM BAR ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
  z-index: 100;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 10px 0 calc(10px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
}
.nav-item {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 16px;
}
.nav-item.active { color: var(--green); }
.nav-icon { font-size: 22px; }

/* ===== ACTIVE WORKOUT ===== */
.workout-timer {
  text-align: center;
  padding: 8px 0 16px;
  font-size: 14px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

.exercise-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.exercise-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.exercise-cue {
  font-size: 14px;
  color: var(--green);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  display: none;
}
.exercise-cue.show { display: block; }
.last-session {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 16px;
  cursor: pointer;
}
.last-session:active { color: var(--green); }

/* Set rows */
.set-header {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 56px;
  gap: 8px;
  padding: 0 0 8px;
}
.set-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  text-align: center;
}
.set-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 56px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.set-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
}
.set-input {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  padding: 14px 8px;
  width: 100%;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.set-input:focus {
  outline: none;
  border-color: var(--green);
}
.set-input.warmup {
  border-style: dashed;
  color: var(--text2);
}
.set-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 auto;
  transition: all 0.2s;
}
.set-check.done {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}
.warmup-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}
.add-set-btn {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text3);
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.add-set-btn:active { border-color: var(--green); color: var(--green); }

/* ===== REST TIMER ===== */
.rest-timer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  text-align: center;
  z-index: 300;
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.rest-timer.active { transform: translateY(0); }
.rest-timer-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text2); }
.rest-timer-time { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0; }
.rest-timer-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.rest-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.rest-btn.skip { background: var(--green); color: #000; border: none; }

/* ===== EXERCISE PICKER ===== */
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 12px;
  -webkit-appearance: none;
}
.search-input:focus { outline: none; border-color: var(--green); }
.search-input::placeholder { color: var(--text3); }

.muscle-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.muscle-filters::-webkit-scrollbar { display: none; }
.muscle-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.muscle-filter.active {
  background: var(--green);
  color: #000;
  border-color: var(--green);
}

.exercise-list-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.exercise-list-item:active { opacity: 0.7; }
.exercise-list-name { font-size: 17px; font-weight: 600; }
.exercise-list-meta { font-size: 13px; color: var(--text3); margin-top: 2px; }

/* ===== HISTORY ===== */
.history-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
}
.history-item:active { opacity: 0.85; }
.history-date { font-size: 13px; color: var(--text2); font-weight: 600; }
.history-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.history-stats { font-size: 14px; color: var(--text3); margin-top: 6px; }
.history-stats span { color: var(--green); font-weight: 600; }

/* ===== SUMMARY ===== */
.summary {
  text-align: center;
  padding-top: 20px;
}
.summary-title { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.summary-subtitle { font-size: 16px; color: var(--text2); margin-top: 4px; }
.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}
.summary-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 12px;
}
.summary-stat-value { font-size: 28px; font-weight: 800; }
.summary-stat-label { font-size: 12px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  color: var(--green);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin: 4px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state-text { font-size: 15px; color: var(--text2); line-height: 1.5; }

/* ===== MISC ===== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.spacer { height: 20px; }

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* Smooth page transitions */
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Number pad modal */
.numpad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.numpad-overlay.show { opacity: 1; pointer-events: auto; }
.numpad {
  width: 100%;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
}
.numpad-display {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.numpad-display small { font-size: 18px; color: var(--text2); font-weight: 600; }
.numpad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.numpad-key {
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  padding: 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.numpad-key:active { background: var(--border); }
.numpad-key.done { background: var(--green); color: #000; font-size: 18px; font-weight: 700; }
.numpad-key.del { font-size: 18px; }

/* Quick fill hint */
.quick-fill {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin-top: -4px;
  margin-bottom: 8px;
}
.quick-fill span {
  color: var(--green);
  cursor: pointer;
  font-weight: 600;
}

/* Add exercise btn */
.add-exercise-btn {
  background: none;
  border: 2px dashed var(--border);
  color: var(--text3);
  width: 100%;
  padding: 20px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.add-exercise-btn:active { border-color: var(--green); color: var(--green); }

/* Progression suggestion */
.progression {
  font-size: 13px;
  color: var(--green);
  padding: 8px 12px;
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
