/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #FAF6FD;
  color: #1C1C1E;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  min-height: 100dvh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
#app-header {
  background: #fff;
  border-bottom: 1px solid #EAE0F0;
  padding: calc(env(safe-area-inset-top) + 12px) 20px 12px;
  flex-shrink: 0;
  text-align: center;
}

#header-title {
  font-size: 18px;
  font-weight: 700;
  color: #1C1C1E;
  letter-spacing: -0.3px;
}

/* ── Main / Panels ──────────────────────────────────────────────────────────── */
#main-content {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 24px;
}

.panel.active { display: flex; }

/* ── Tab Bar ────────────────────────────────────────────────────────────────── */
#tab-bar {
  display: flex;
  background: #fff;
  border-top: 1px solid #EAE0F0;
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #B0A0BC;
  transition: color 0.15s;
}

.tab.active { color: #E8728C; }
.tab-icon   { font-size: 22px; line-height: 1; }
.tab-label  { font-size: 10px; font-weight: 600; }

/* ── Demo Banner ────────────────────────────────────────────────────────────── */
.demo-banner {
  background: #1C1C1E;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.demo-banner button {
  background: none;
  border: none;
  color: #F09AB8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
}

/* ── Countdown Card ─────────────────────────────────────────────────────────── */
.countdown-card {
  background: linear-gradient(140deg, #F09AB8 0%, #C05882 100%);
  border-radius: 20px;
  padding: 28px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.countdown-card::before {
  content: '🏃‍♀️';
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 42px;
  opacity: 0.2;
}

.countdown-greeting {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin-bottom: 10px;
  letter-spacing: 0.1px;
}

.countdown-days {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -4px;
  color: #fff;
}

.countdown-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.88);
  margin-top: 2px;
  font-weight: 500;
}

.countdown-race {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  margin-top: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── Workout Card ───────────────────────────────────────────────────────────── */
.workout-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  border-left: 4px solid transparent;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

.workout-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.workout-distance-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.workout-miles {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  color: #1C1C1E;
}

.workout-unit {
  font-size: 20px;
  font-weight: 600;
  color: #A090AC;
}

.workout-est-time {
  font-size: 13px;
  color: #A090AC;
  margin-bottom: 12px;
}

.workout-tip {
  background: #F8F2FC;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  color: #4A3A56;
  line-height: 1.55;
}

.workout-phase {
  font-size: 12px;
  color: #A090AC;
  margin-top: 10px;
  font-weight: 500;
}

.rest-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

.rest-emoji   { font-size: 44px; margin-bottom: 8px; }
.rest-title   { font-size: 20px; font-weight: 700; color: #1C1C1E; margin-bottom: 6px; }
.rest-tip     { font-size: 14px; color: #8E8E93; line-height: 1.5; }

.logged-badge {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #5EC4A0;
}

.log-today-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: rgba(232,114,140,0.1);
  border: 1.5px solid #E8728C;
  border-radius: 12px;
  color: #E8728C;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Week Strip Card ─────────────────────────────────────────────────────────── */
.week-strip-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.week-strip {
  display: flex;
  gap: 4px;
}

.strip-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.strip-day-label {
  font-size: 10px;
  color: #A090AC;
  font-weight: 500;
}

.strip-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.strip-check {
  font-size: 9px;
  height: 12px;
}

.pre-plan-note {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

.pre-plan-date {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 6px;
  color: #E8728C;
}

.pre-plan-tip {
  font-size: 13px;
  color: #8E8E93;
  line-height: 1.5;
}

/* ── Archive divider ────────────────────────────────────────────────────────── */
/* Schedule settings */
.schedule-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

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

.schedule-title {
  font-size: 18px;
  font-weight: 800;
  color: #1C1C1E;
  line-height: 1.2;
}

.schedule-toggle {
  min-width: 54px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 2px solid #EAE0F0;
  background: #F5EEF9;
  color: #A090AC;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.schedule-toggle.on {
  background: rgba(94,196,160,0.15);
  border-color: #5EC4A0;
  color: #3A8A70;
}

.schedule-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.schedule-label {
  font-size: 11px;
  font-weight: 800;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.schedule-time,
.schedule-select {
  width: 100%;
  min-height: 42px;
  background: #FAF6FD;
  border: 1.5px solid #EAE0F0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #1C1C1E;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.schedule-note {
  grid-column: 2;
  font-size: 12px;
  color: #8E7A98;
  margin-top: -4px;
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 14px;
}

.schedule-day-btn {
  min-width: 0;
  min-height: 34px;
  border: 1.5px solid #EAE0F0;
  border-radius: 10px;
  background: #FAF6FD;
  color: #A090AC;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.schedule-day-btn.selected {
  background: rgba(94,196,160,0.14);
  border-color: #5EC4A0;
  color: #3A8A70;
}

.schedule-day-btn.long-day {
  background: rgba(232,114,140,0.12);
  border-color: #E8728C;
  color: #C05882;
}

.archive-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px 4px;
}

.archive-divider::before,
.archive-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #EAE0F0;
}

.archive-divider span {
  font-size: 11px;
  font-weight: 700;
  color: #C0B0CC;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Archive rows are fully greyed — all colors muted */
.archive-row .pwc-num,
.archive-row .pwc-phase,
.archive-row .pwc-stats { color: #C0B0CC !important; }

/* ── Collapsed past week ────────────────────────────────────────────────────── */
.plan-week-collapsed {
  background: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(180,120,180,0.06);
  cursor: pointer;
  transition: background 0.12s;
}

.plan-week-collapsed:active { background: #F8F2FC; }

.pwc-left  { display: flex; align-items: center; gap: 10px; }
.pwc-right { display: flex; align-items: center; gap: 10px; }

.pwc-num {
  font-size: 13px;
  font-weight: 700;
  color: #C0B0CC;
  min-width: 52px;
}

.pwc-phase {
  font-size: 12px;
  font-weight: 600;
}

.pwc-stats {
  font-size: 12px;
  color: #C0B0CC;
  font-weight: 500;
}

.pwc-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.pwc-done    { background: #5EC4A0; color: #fff; }
.pwc-partial { background: #F0E8F8; color: #C0B0CC; font-size: 9px; }

/* ── Plan Tab ───────────────────────────────────────────────────────────────── */
.phase-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 2px;
}

.plan-week-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
  overflow: hidden;
}

/* ── Current week — unmissable rose header ── */
.plan-week-card.current-week {
  border: 2px solid #E8728C;
  box-shadow: 0 4px 18px rgba(232,114,140,0.22);
  padding: 0 0 14px;
}

.cw-header {
  background: linear-gradient(135deg, #F09AB8 0%, #C05882 100%);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cw-header-left { display: flex; align-items: center; gap: 10px; }

.cw-badge {
  background: rgba(255,255,255,0.28);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 20px;
}

.cw-week-num {
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  font-weight: 700;
}

.cw-miles {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
}

/* Non-current week header */
.plan-week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.plan-week-num   { font-size: 15px; font-weight: 700; color: #1C1C1E; }
.plan-week-miles { font-size: 13px; color: #A090AC;   font-weight: 500; }

/* Dots row */
.plan-week-dots {
  display: flex;
  gap: 4px;
  padding: 0 14px;
}

.current-week .plan-week-dots { padding: 0 14px; }

.plan-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Plan dot button wrapper (removes default button styling) */
.pd-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

/* Base dot */
.pd {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: transform 0.1s;
}

.pd-btn:active .pd { transform: scale(0.88); }

/* States */
.pd-rest   { background: #EDE4F3; }
.pd-done   { background: #5EC4A0; }
.pd-check  { color: #fff; font-size: 15px; font-weight: 900; }
.pd-today  { }
.pd-missed { }
.pd-future { opacity: 0.55; }

/* Labels */
.plan-dot-label {
  font-size: 9px;
  color: #A090AC;
  font-weight: 500;
}

.today-label {
  color: #E8728C;
  font-weight: 800;
}

.plan-dot-miles {
  font-size: 9px;
  color: #8E8E93;
  font-weight: 600;
  min-height: 11px;
}

/* ── Timer Card ─────────────────────────────────────────────────────────────── */
.timer-card {
  border-radius: 24px;
  padding: 32px 20px 28px;
  text-align: center;
}

/* Idle */
.timer-idle {
  background: #fff;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

.timer-idle-prompt {
  font-size: 13px;
  font-weight: 700;
  color: #C0B0CC;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.timer-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 48px;
  background: linear-gradient(135deg, #F09AB8 0%, #C05882 100%);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(192,88,130,0.35);
  letter-spacing: 0.3px;
}

.timer-start-btn:active { transform: scale(0.97); opacity: 0.92; }

.timer-or {
  font-size: 12px;
  color: #C0B0CC;
  margin-top: 18px;
  font-weight: 500;
}

/* Running */
.timer-running {
  background: linear-gradient(140deg, #F09AB8 0%, #C05882 100%);
  box-shadow: 0 6px 24px rgba(192,88,130,0.3);
}

.timer-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.timer-display {
  font-size: 76px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -3px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 24px;
}

.timer-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.2px;
}

.timer-stop-btn:active { background: rgba(255,255,255,0.35); }

/* Stopped / done */
.timer-done {
  background: rgba(94,196,160,0.1);
  border: 1.5px solid #5EC4A0;
}

.timer-display-done {
  font-size: 56px;
  font-weight: 900;
  color: #5EC4A0;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 8px;
}

.timer-done-sub {
  font-size: 13px;
  color: #5EC4A0;
  font-weight: 600;
  margin-top: 4px;
}

/* Form note + new run link */
.form-autofill-note {
  font-size: 13px;
  font-weight: 600;
  color: #5EC4A0;
  background: rgba(94,196,160,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  text-align: center;
}

.timer-new-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  color: #C0B0CC;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
}

/* ── Log Tab ────────────────────────────────────────────────────────────────── */
.log-form-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(180,120,180,0.1);
}

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

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  background: #F5EEF9;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  color: #1C1C1E;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus { background: #EDE4F3; }

.effort-btns {
  display: flex;
  gap: 6px;
}

.effort-btn {
  flex: 1;
  padding: 8px 4px;
  background: #F5EEF9;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #A090AC;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
}

.effort-btn.selected {
  border-color: #E8728C;
  color: #E8728C;
  background: rgba(232,114,140,0.1);
}

.log-submit-btn {
  width: 100%;
  padding: 14px;
  background: #E8728C;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.2px;
}

.log-submit-btn:active { opacity: 0.85; }

/* Run history */
.run-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.run-emoji { font-size: 28px; flex-shrink: 0; }

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

.run-date     { font-size: 12px; color: #A090AC; margin-bottom: 2px; }
.run-distance { font-size: 18px; font-weight: 800; color: #1C1C1E; }
.run-sub      { font-size: 13px; color: #A090AC; margin-top: 2px; }

.run-effort-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Run detail modal */
.run-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28,28,30,0.42);
}

.rd-sheet {
  position: relative;
  width: min(100%, 430px);
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -12px 36px rgba(45,30,55,0.22);
}

.rd-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #F5EEF9;
  color: #8E7A98;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rd-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #E8728C;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.rd-title {
  max-width: calc(100% - 44px);
  font-size: 20px;
  font-weight: 900;
  color: #1C1C1E;
  line-height: 1.2;
}

.rd-planned {
  font-size: 13px;
  color: #8E7A98;
  margin-top: 6px;
}

.rd-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 12px;
}

.rd-metrics div {
  background: #FAF6FD;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.rd-metrics span {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #1C1C1E;
  line-height: 1;
}

.rd-metrics small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.rd-effort {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.rd-notes {
  background: #F8F2FC;
  border-radius: 12px;
  padding: 12px;
}

.rd-label {
  font-size: 10px;
  font-weight: 800;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 6px;
}

.rd-notes p {
  font-size: 14px;
  color: #4A3A56;
  line-height: 1.45;
}

.rd-edit {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #E8728C;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #C0B0CC;
}

.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.empty-text  { font-size: 15px; margin-bottom: 4px; color: #A090AC; }
.empty-sub   { font-size: 13px; color: #C0B0CC; }

/* ── Stats Tab ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.stat-val {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.stat-lbl {
  font-size: 12px;
  color: #A090AC;
  margin-top: 4px;
  font-weight: 500;
}

.pace-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.pace-left .stat-lbl { margin-top: 2px; }

.pace-hint {
  font-size: 12px;
  color: #A090AC;
  text-align: right;
  max-width: 140px;
  line-height: 1.4;
}

/* Weekly chart */
.chart-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.chart-title {
  font-size: 12px;
  font-weight: 700;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.chart-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 88px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  height: 100%;
}

.chart-mi-label {
  font-size: 8px;
  color: #A090AC;
  margin-bottom: 3px;
  font-weight: 600;
  min-height: 12px;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 0;
}

.chart-bar.current { background: #E8728C; }
.chart-bar.past    { background: #F0C8D8; }

.chart-base {
  width: 100%;
  height: 1px;
  background: #EAE0F0;
}

.chart-date {
  font-size: 8px;
  color: #C0B0CC;
  margin-top: 5px;
  text-align: center;
  line-height: 1.2;
}

/* Milestones */
.milestone-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.milestone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F0EAF5;
}

.milestone-row:last-child { border-bottom: none; }

.milestone-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.milestone-emoji { font-size: 22px; }

.milestone-name  { font-size: 14px; font-weight: 600; color: #1C1C1E; }
.milestone-sub   { font-size: 12px; color: #A090AC; margin-top: 1px; }

.milestone-pct {
  font-size: 14px;
  font-weight: 700;
  color: #C0B0CC;
}

.milestone-pct.done { color: #5EC4A0; }

.milestone-bar-wrap {
  flex: 1;
  margin: 0 12px;
  height: 4px;
  background: #EAE0F0;
  border-radius: 2px;
}

.milestone-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: #E8728C;
}

/* ── Onboarding Overlay ──────────────────────────────────────────────────────── */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  background: #FAF6FD;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 20px) 24px
           calc(env(safe-area-inset-bottom) + 32px);
  overflow-y: auto;
  max-width: 430px;
  margin: 0 auto;
}

#onboarding-overlay.visible { display: flex; }

/* Progress dots */
#ob-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 36px;
  flex-shrink: 0;
}

.ob-dot {
  height: 6px;
  width: 6px;
  border-radius: 3px;
  background: #EAE0F0;
  transition: all 0.25s ease;
}

.ob-dot.active { width: 22px; background: #E8728C; }
.ob-dot.done   { background: #5EC4A0; }

/* Content area */
#ob-content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Shared step elements */
.ob-big-emoji {
  font-size: 56px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1;
}

.ob-title {
  font-size: 26px;
  font-weight: 800;
  color: #1C1C1E;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.ob-sub {
  font-size: 15px;
  color: #A090AC;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 28px;
}

.ob-field { margin-bottom: 20px; }

.ob-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #A090AC;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.ob-input {
  width: 100%;
  background: #fff;
  border: 1.5px solid #EAE0F0;
  border-radius: 12px;
  padding: 14px 16px;
  color: #1C1C1E;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.ob-input:focus {
  border-color: #E8728C;
  box-shadow: 0 0 0 3px rgba(232,114,140,0.12);
}

/* Primary CTA button */
.ob-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #F09AB8 0%, #C05882 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.2px;
  margin-top: auto;
  box-shadow: 0 4px 16px rgba(192,88,130,0.3);
}

.ob-btn:active { opacity: 0.9; transform: scale(0.99); }

.ob-skip {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  color: #C0B0CC;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 10px;
}

/* ── Step 2: Race type grid ──────────────────────────────────────────────────── */
.ob-race-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.ob-race-card {
  background: #fff;
  border: 2px solid #EAE0F0;
  border-radius: 16px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.ob-race-card.selected {
  border-color: #E8728C;
  background: rgba(232,114,140,0.05);
  box-shadow: 0 2px 12px rgba(232,114,140,0.2);
}

.ob-race-emoji { font-size: 30px; margin-bottom: 4px; }
.ob-race-label { font-size: 15px; font-weight: 800; color: #1C1C1E; }
.ob-race-dist  { font-size: 12px; color: #A090AC; font-weight: 500; }
.ob-race-weeks { font-size: 11px; color: #C0B0CC; margin-top: 2px; }

/* ── Step 3: Date selectors ──────────────────────────────────────────────────── */
.ob-date-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ob-date-field { flex: 1; }

.ob-select {
  width: 100%;
  background: #fff;
  border: 1.5px solid #EAE0F0;
  border-radius: 12px;
  padding: 14px 12px;
  color: #1C1C1E;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
  cursor: pointer;
}

.ob-select:focus { border-color: #E8728C; }

.ob-date-note {
  background: rgba(94,196,160,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #3A8A70;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  min-height: 42px;
}

/* ── Step 4: Fitness level ───────────────────────────────────────────────────── */
.ob-level-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.ob-level-card {
  background: #fff;
  border: 2px solid #EAE0F0;
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
  width: 100%;
}

.ob-level-card.selected {
  border-color: #E8728C;
  background: rgba(232,114,140,0.05);
  box-shadow: 0 2px 12px rgba(232,114,140,0.2);
}

.ob-level-emoji { font-size: 32px; flex-shrink: 0; }
.ob-level-label { font-size: 16px; font-weight: 800; color: #1C1C1E; margin-bottom: 3px; }
.ob-level-desc  { font-size: 13px; color: #A090AC; line-height: 1.4; }

/* ── Step 5: Notifications ───────────────────────────────────────────────────── */
/* Step 5: Weekly schedule */
.ob-schedule-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ob-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.ob-day-chip {
  min-width: 0;
  min-height: 38px;
  border: 1.5px solid #EAE0F0;
  border-radius: 10px;
  background: #fff;
  color: #A090AC;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.ob-day-chip.selected {
  background: rgba(94,196,160,0.14);
  border-color: #5EC4A0;
  color: #3A8A70;
}

.ob-day-chip.long-day {
  background: rgba(232,114,140,0.12);
  border-color: #E8728C;
  color: #C05882;
}

.ob-long-field { margin-top: 2px; }

.ob-notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.ob-notif-row {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

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

.ob-notif-emoji { font-size: 26px; }
.ob-notif-label { font-size: 15px; font-weight: 700; color: #1C1C1E; }
.ob-notif-desc  { font-size: 12px; color: #A090AC; margin-top: 2px; }

.ob-toggle {
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid #EAE0F0;
  background: #F5EEF9;
  color: #C0B0CC;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ob-toggle.on {
  background: rgba(94,196,160,0.15);
  border-color: #5EC4A0;
  color: #3A8A70;
}

/* ── Step 6: Backup code ─────────────────────────────────────────────────────── */
.ob-time-row {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(180,120,180,0.08);
}

.ob-time-input {
  width: 100%;
  background: #FAF6FD;
  border: 1.5px solid #EAE0F0;
  border-radius: 12px;
  padding: 13px 14px;
  color: #1C1C1E;
  font-size: 17px;
  font-family: inherit;
  outline: none;
}

.ob-code-box {
  background: #fff;
  border: 2px dashed #E8728C;
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(232,114,140,0.12);
}

.ob-code {
  font-size: 32px;
  font-weight: 900;
  color: #E8728C;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}

.ob-code-tip {
  background: rgba(94,196,160,0.12);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: #3A8A70;
  font-weight: 600;
  text-align: center;
  margin-bottom: 28px;
}
