/* ============================================================
   PreHab — Prehabilitation App | Dr. Ted Michelakos
   ============================================================ */

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

:root {
  --navy:    #1c1c1e;
  --green:   #57be46;
  --cream:   #f7f7f8;
  --gold:    #e3a13a;
  --navy-08: rgba(0,0,0,0.055);
  --navy-15: rgba(0,0,0,0.11);
  --navy-40: rgba(0,0,0,0.42);
  --navy-60: rgba(0,0,0,0.6);
  --navy-70: rgba(0,0,0,0.72);
  --blue:    #3b82f6;
  --amber:   #f0ad4e;
  --green-bg: #eaf8ea;
  --amber-bg: #fdf3e3;
  --red-bg:   #fdeae7;
  --blue-bg:  #eaf1fe;
  --gray-bg:  #ededf0;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 2px 10px rgba(0,0,0,0.05);
  --shadow-btn:  0 2px 6px rgba(0,0,0,0.13);
  /* Legacy aliases used throughout app.js */
  --primary:    #1c1c1e;
  --accent:     #2E86C1;
  --success:    #57be46;
  --success-bg: #eaf8ea;
  --warn-bg:    #fffbea;
  --warn-border: #f0ad4e;
  --warn-text:  #7D6608;
  --red:        #e15b4c;
  --bg:         #f7f7f8;
  --card:       #fff;
  --border:     rgba(0,0,0,0.1);
  --text:       #1c1c1e;
  --text-2:     rgba(0,0,0,0.6);
  --text-3:     rgba(0,0,0,0.4);
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bot:   env(safe-area-inset-bottom, 0px);
  --safe-left:  env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--navy);
  min-height: 100dvh;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

/* ── Fixed top nav ─────────────────────────────────────── */
#top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #fff;
  border-bottom: 1.5px solid rgba(0,0,0,0.07);
  padding-top: var(--safe-top);
}
.nav-inner {
  max-width: 500px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem; font-weight: 500;
  color: var(--navy); white-space: nowrap;
}
.nav-logo span { color: var(--green); }
.nav-ctx {
  font-family: 'Nunito', sans-serif;
  font-size: 0.65rem; color: var(--navy-40);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Progress rail ─────────────────────────────────────── */
#prog-rail {
  position: fixed;
  top: calc(var(--safe-top) + 59px);
  left: 0; right: 0; z-index: 99;
  background: var(--navy-15); height: 3px;
}
.prog-fill { height: 3px; background: var(--green); transition: width 0.45s ease; width: 0%; }

/* ── App container ─────────────────────────────────────── */
#app {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100dvh;
}

/* ── Screen ────────────────────────────────────────────── */
.screen {
  animation: fadeUp .22s ease;
  padding-top: calc(var(--safe-top) + 62px);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Scroll content ────────────────────────────────────── */
.content {
  padding: 16px 16px 24px;
}
.content.with-nav { padding-bottom: 84px; }

/* ── Bottom tab nav ────────────────────────────────────── */
.nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px;
  background: #fff;
  border-top: 1.5px solid var(--navy-08);
  display: flex;
  padding-bottom: var(--safe-bot);
  z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 9px 4px;
  background: none; border: none; cursor: pointer;
  color: var(--navy-40);
  font-family: 'Nunito', sans-serif;
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.03em;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn.active { color: var(--green); }
.nav-btn:hover:not(.active) { color: var(--navy); }

/* ── Onboarding ────────────────────────────────────────── */
.onboard-hero {
  text-align: center; padding: 32px 24px 24px;
}
.onboard-hero h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 2.3rem; font-weight: 400; margin-bottom: 10px;
  color: var(--navy);
}
.onboard-hero p {
  font-size: 0.88rem; color: var(--navy-40); line-height: 1.65;
  max-width: 360px; margin: 0 auto;
}
.onboard-form { padding: 0 16px 32px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.7rem; font-weight: 500;
  color: var(--navy-40); letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 6px; font-family: 'Nunito', sans-serif;
}
.form-group input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--navy-15); border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 1rem; color: var(--navy);
  background: #fff; outline: none; transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-group input:focus { border-color: var(--green); }
.form-hint { font-size: 0.75rem; color: var(--navy-40); margin-top: 5px; display: block; }

.warn-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fffbea; border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 12px 15px; margin-bottom: 16px;
  font-size: 0.92rem; line-height: 1.65; color: var(--navy-70);
}
.warn-box strong { color: var(--navy); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px; border-radius: 14px; border: none;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: all 0.17s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary, .btn-navy { background: var(--navy); color: #fff; }
.btn-primary:hover, .btn-navy:hover { background: #33333a; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #48a838; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy-15); }
.btn-outline:hover { border-color: var(--navy); }

/* ── Home ──────────────────────────────────────────────── */
.home-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px;
}
.home-greeting {
  font-family: 'Nunito', sans-serif; font-size: 1.55rem; font-weight: 400;
  color: var(--navy); line-height: 1.2; margin-bottom: 3px;
}
.home-date { font-size: 0.78rem; color: var(--navy-40); }

.done-circle {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.done-circle.incomplete {
  background: transparent; border: 2px solid var(--navy-15);
  color: var(--navy-40);
}
.done-circle.incomplete span {
  font-family: 'Nunito', sans-serif; font-size: 0.65rem; font-weight: 500;
}

.home-stats-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.home-stat {
  background: #fff; border-radius: 14px;
  padding: 14px 8px 12px; text-align: center;
  border: 1.5px solid var(--navy-08);
}
.home-stat .num {
  font-family: 'Nunito', sans-serif; font-size: 1.75rem;
  display: block; line-height: 1.1; color: var(--navy);
}
.home-stat .lbl {
  font-family: 'Nunito', sans-serif; font-size: 0.55rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--navy-40); display: block; margin-top: 5px;
}

.countdown-card {
  background: var(--navy); border-radius: 16px;
  padding: 16px 20px; margin-bottom: 14px; text-align: center;
}
.countdown-label {
  font-family: 'Nunito', sans-serif; font-size: 0.58rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 6px;
}
.countdown-time {
  font-family: 'Nunito', sans-serif; font-size: 1.9rem; font-weight: 400;
  color: #fff; letter-spacing: 0.04em;
}

.today-progress { margin-bottom: 14px; }
.prog-label { font-size: 0.78rem; color: var(--navy-40); margin-bottom: 6px; }
.prog-bar-bg  { background: var(--navy-08); border-radius: 4px; height: 5px; }
.prog-bar-fill {
  height: 5px; background: var(--green);
  border-radius: 4px; transition: width 0.45s ease;
}

/* ── Section label & info box ───────────────────────────── */
.section-label {
  font-family: 'Nunito', sans-serif; font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy-40); margin: 16px 0 10px;
}
.info-box {
  font-size: 0.92rem; color: var(--navy-70); line-height: 1.65;
  background: #fff; border-radius: 0 10px 10px 0;
  border-left: 3px solid var(--green);
  padding: 12px 15px; margin-bottom: 16px;
}

/* ── Exercise list items ───────────────────────────────── */
.ex-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 12px 14px;
  border: 1.5px solid var(--navy-08);
  margin-bottom: 8px; cursor: pointer;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.ex-item:hover { border-color: var(--navy-15); box-shadow: 0 3px 10px var(--navy-08); }
.ex-item.done  { border-color: var(--green); }
.ex-item.skipped { border-color: #e5a800; }
.ex-thumb {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  background: var(--navy-08); display: flex; align-items: center; justify-content: center;
}
.ex-thumb svg { max-width: 52px; max-height: 52px; }
.ex-info { flex: 1; min-width: 0; }
.ex-name {
  font-family: 'Nunito', sans-serif; font-size: 1.18rem; font-weight: 600;
  color: var(--navy); line-height: 1.25;
}
.ex-muscle {
  font-family: 'Nunito', sans-serif; font-size: 0.59rem; color: var(--green);
  letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px;
}
.ex-reps { font-size: 0.82rem; color: var(--navy-60); margin-top: 3px; }
.check-ring {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--navy-15); background: #fff; color: #fff;
}
.check-ring.done { background: var(--green); border-color: var(--green); }
.check-ring.skipped { background: #e5a800; border-color: #e5a800; }

/* ── Exercise detail nav bar ────────────────────────────── */
.ex-nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px;
}
.ex-num {
  font-family: 'Nunito', sans-serif; font-size: 0.68rem;
  color: var(--navy-40); letter-spacing: 0.06em; text-transform: uppercase;
}
.btn-restart {
  background: none; border: none; font-size: 0.75rem;
  color: var(--navy-40); cursor: pointer;
  font-family: 'Nunito', sans-serif; padding: 4px 0;
  letter-spacing: 0.02em; transition: color 0.15s;
}
.btn-restart:hover { color: var(--navy); }

/* ── Exercise anim-card ────────────────────────────────── */
.anim-card {
  background: #fff; border-radius: 20px; padding: 20px 20px 16px;
  text-align: center; border: 1.5px solid var(--navy-08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  margin-bottom: 14px; position: relative;
  transition: border-color 0.3s;
}
.anim-card.done-state { border-color: var(--green); }
.done-badge {
  display: none; position: absolute; top: 14px; right: 16px;
  background: var(--green); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,166,81,0.3);
}
.anim-card.done-state .done-badge { display: flex; }
.muscle-chip {
  display: inline-flex; align-items: center;
  font-family: 'Nunito', sans-serif; font-size: 0.6rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(0,166,81,0.09); color: var(--green);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
}
.ex-img {
  display: block; margin: 0 auto 12px;
  max-height: 200px; max-width: 100%;
  width: auto; object-fit: contain; border-radius: 8px;
}
.ex-img-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; margin-bottom: 12px;
}
.ex-img-wrap svg { max-width: 100%; max-height: 200px; }
.ex-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.55rem; font-weight: 400; margin-bottom: 8px; line-height: 1.2;
}
.ex-instr {
  font-size: 0.98rem; color: var(--navy-70); line-height: 1.7;
  margin-bottom: 12px; text-align: left;
}
.ex-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ex-tag {
  font-family: 'Nunito', sans-serif; font-size: 0.63rem; letter-spacing: 0.05em;
  background: var(--navy-08); color: var(--navy-40); padding: 4px 10px; border-radius: 20px;
}

/* ── Timer panel ───────────────────────────────────────── */
.timer-panel {
  background: #fff; border-radius: 16px; padding: 20px 16px 16px;
  margin-bottom: 14px; border: 1.5px solid var(--navy-08); text-align: center;
}
.timer-lbl {
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--navy-40); margin-bottom: 16px;
}
.timer-ring-wrap {
  position: relative; width: 120px; height: 120px; margin: 0 auto 16px;
}
.timer-ring-wrap svg { transform: rotate(-90deg); display: block; }
.timer-track { fill: none; stroke: var(--navy-08); stroke-width: 6; }
.timer-arc {
  fill: none; stroke: var(--green); stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
}
.timer-arc.urgent { stroke: #e05a2b; }
.timer-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-size: 2.4rem; font-weight: 400;
  color: var(--navy); line-height: 1; pointer-events: none;
}
.timer-num.urgent { color: #e05a2b; }
.timer-num.done   { color: var(--green); }
.timer-controls { display: flex; gap: 10px; justify-content: center; }
.btn-timer {
  padding: 9px 22px; border-radius: 10px; border: none;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-timer-start { background: var(--green); color: #fff; }
.btn-timer-start:hover { background: #48a838; }
.btn-timer-reset {
  background: var(--navy-08); color: var(--navy-40);
  border: 1.5px solid var(--navy-15);
}
.btn-timer-reset:hover { background: var(--navy-15); color: var(--navy); }
.hint {
  font-size: 0.77rem; color: var(--navy-40);
  background: var(--navy-08); border-radius: 8px;
  padding: 7px 12px; font-style: italic; margin-top: 12px;
}

/* ── Exercise action row (← / Complete / →) ────────────── */
.ex-action-row {
  display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px;
  align-items: stretch; margin-bottom: 8px;
}
.btn-nav {
  height: 52px; border-radius: 14px; border: 1.5px solid var(--navy-15);
  background: #fff; color: var(--navy-40); font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.btn-nav:hover:not([disabled]) { border-color: var(--navy); color: var(--navy); }
.btn-nav[disabled] { opacity: 0.25; cursor: not-allowed; }
.btn-complete {
  height: 52px; border-radius: 14px; border: none;
  background: var(--green); color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 0.92rem; font-weight: 500;
  cursor: pointer; transition: all 0.17s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-complete:hover { filter: brightness(1.08); }
.btn-complete.marked       { background: var(--navy); }
.btn-complete.skipped-state { background: #e5a800; }

/* ── Fixed bottom actions area ─────────────────────────── */
.ex-actions-fixed {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px;
  background: var(--cream);
  border-top: 1.5px solid var(--navy-08);
  padding: 10px 16px calc(var(--safe-bot) + 10px);
  z-index: 50;
}

/* ── Skip panel ────────────────────────────────────────── */
.skip-panel {
  background: #fff; border-radius: 14px;
  padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--navy-08);
}
.skip-panel-title {
  font-family: 'Nunito', sans-serif; font-size: 0.65rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--navy-40); margin-bottom: 10px;
}
.skip-opts { display: flex; flex-direction: column; gap: 6px; }
.skip-opt {
  padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--navy-15); background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 0.84rem; color: var(--navy);
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.skip-opt:hover { border-color: var(--navy); }
.skip-opt.selected { border-color: var(--gold); background: #fffbea; }
.skip-other-input {
  width: 100%; margin-top: 8px; padding: 9px 12px;
  border: 1.5px solid var(--navy-15); border-radius: 10px;
  font-family: 'Nunito', sans-serif; font-size: 0.88rem; color: var(--navy);
  background: #fff; outline: none; transition: border-color 0.15s;
}
.skip-other-input:focus { border-color: var(--green); }
.skip-confirm-btn {
  margin-top: 10px; width: 100%; padding: 10px; border-radius: 10px;
  border: none; background: var(--gold); color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.skip-confirm-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.skip-toggle {
  display: block; background: none; border: none; padding: 6px 0 2px;
  font-family: 'Nunito', sans-serif; font-size: 0.8rem;
  color: var(--navy-40); cursor: pointer; width: 100%;
  text-align: center; transition: color 0.15s;
}
.skip-toggle:hover { color: var(--navy); }

/* ── Page header (list / calendar / recordings / notes) ── */
.page-header {
  padding: 18px 16px 12px;
  display: flex; align-items: center; gap: 10px;
}
.page-header h2 {
  font-family: 'Nunito', sans-serif; font-size: 1.65rem; font-weight: 400; flex: 1;
}
.page-header p { font-size: 0.82rem; color: var(--navy-40); }
.back-btn {
  background: none; border: none; color: var(--navy);
  font-size: 1.6rem; cursor: pointer; padding: 4px 10px 4px 0;
  line-height: 1; display: flex; align-items: center; flex-shrink: 0;
}

/* ── Completion screen ─────────────────────────────────── */
.completion-wrap { text-align: center; padding: 32px 16px; }
.complete-icon {
  width: 72px; height: 72px; background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 1.9rem; color: #fff;
  box-shadow: 0 8px 28px rgba(0,166,81,0.3);
}
.completion-title {
  font-family: 'Nunito', sans-serif; font-size: 2.2rem; font-weight: 400; margin-bottom: 10px;
}
.completion-sub {
  font-size: 0.88rem; color: var(--navy-40); line-height: 1.65;
  max-width: 360px; margin: 0 auto 24px;
}
.streak-badge {
  display: inline-block; background: #fff; border: 1.5px solid var(--navy-08);
  border-radius: 20px; padding: 8px 20px; margin-bottom: 24px;
  font-family: 'Nunito', sans-serif; font-size: 1.1rem; color: var(--navy);
}
.c-stats { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.c-stat { background: #fff; border-radius: 14px; padding: 14px 20px; border: 1px solid var(--navy-08); }
.c-stat-n { font-family: 'Nunito', sans-serif; font-size: 2rem; display: block; }
.c-stat-l {
  font-family: 'Nunito', sans-serif; font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--navy-40);
}

/* ── Calendar ──────────────────────────────────────────── */
.cal-stats-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 18px;
}
.cal-stat-box {
  background: #fff; border-radius: 14px; padding: 14px 8px 12px;
  text-align: center; border: 1px solid var(--navy-08);
}
.cal-stat-box .n {
  font-family: 'Nunito', sans-serif; font-size: 1.85rem;
  display: block; line-height: 1; color: var(--navy);
}
.cal-stat-box .l {
  font-family: 'Nunito', sans-serif; font-size: 0.6rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--navy-40); display: block; margin-top: 3px;
}
.cal-card {
  background: #fff; border-radius: 16px; padding: 16px; border: 1px solid var(--navy-08);
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-family: 'Nunito', sans-serif; font-size: 1.15rem; font-weight: 400; }
.cal-nav-btn {
  background: none; border: none; cursor: pointer; font-size: 1.3rem;
  color: var(--navy-40); padding: 4px 8px; border-radius: 8px; transition: color 0.15s;
}
.cal-nav-btn:hover { color: var(--navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow {
  font-family: 'Nunito', sans-serif; font-size: 0.6rem;
  color: var(--navy-40); text-align: center; padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; cursor: default;
}
.cal-day.done      { background: var(--green); color: #fff; }
.cal-day.today     { background: #e8f4fc; border: 2px solid var(--navy); color: var(--navy); font-weight: 600; }
.cal-day.today-done { background: var(--green); border: 2px solid #48a838; color: #fff; font-weight: 600; }
.cal-day.missed    { background: #fdecea; color: #d24a3c; }
.cal-day.future, .cal-day.empty { color: var(--navy-15); }
.cal-legend { display: flex; gap: 14px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--navy-40); }
.cal-swatch { width: 12px; height: 12px; border-radius: 50%; }

/* ── Recordings ────────────────────────────────────────── */
.rec-controls { text-align: center; padding: 24px 0 16px; }
.record-btn {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--navy); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; color: #fff; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.record-btn svg { width: 28px; height: 28px; }
.record-btn.recording { background: var(--red); animation: recPulse 1.5s infinite; }
@keyframes recPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
  50%     { box-shadow: 0 0 0 12px rgba(192,57,43,0); }
}
.rec-timer { font-family: 'Nunito', sans-serif; font-size: 1.1rem; color: var(--red); min-height: 26px; }
.rec-card {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 12px; padding: 12px 14px;
  border: 1px solid var(--navy-08); margin-bottom: 8px;
}
.rec-card-info { flex: 1; min-width: 0; }
.rec-card-label { font-size: 0.85rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-play-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--green); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rec-play-btn svg { width: 14px; height: 14px; }
.rec-del-btn {
  background: none; border: none; color: var(--navy-40); cursor: pointer;
  font-size: 0.85rem; padding: 4px; flex-shrink: 0; transition: color 0.15s;
}
.rec-del-btn:hover { color: var(--red); }

/* ── Notes ─────────────────────────────────────────────── */
.note-card {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  border: 1px solid var(--navy-08); margin-bottom: 12px;
}
.note-ts {
  font-family: 'Nunito', sans-serif; font-size: 0.63rem; letter-spacing: 0.05em;
  color: var(--navy-40); margin-bottom: 10px; text-transform: uppercase;
}
.notes-area, .note-ta {
  width: 100%; min-height: 100px; border: none; outline: none; resize: none;
  font-family: 'Nunito', sans-serif; font-size: 0.9rem; color: var(--navy);
  line-height: 1.65; background: transparent;
}
.note-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--navy-08);
}
.save-status, .note-status { font-size: 0.75rem; color: var(--green); transition: opacity 0.3s; }
.note-del-btn {
  background: none; border: none; font-size: 0.75rem; color: var(--navy-40);
  cursor: pointer; padding: 2px 0; transition: color 0.15s;
}
.note-del-btn:hover { color: var(--red); }

/* ── Note box (gold left border) ────────────────────────── */
.note-box {
  background: #fff; border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 13px 16px;
  font-size: 0.92rem; line-height: 1.65; color: var(--navy-70);
  margin-bottom: 18px;
}
.note-box strong { color: var(--navy); }

/* ── Generic card ─────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 14px; padding: 16px;
  border: 1px solid var(--navy-08); margin-bottom: 12px;
}

/* ── Utility ────────────────────────────────────────────── */
.text-sm  { font-size: 0.84rem; }
.text-mute { color: var(--navy-40); }
.mt-4  { margin-top:  4px; }
.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }


/* ── Nunito weight hierarchy ────────────────────────────── */
/* Single typeface (Nunito) throughout; hierarchy via weight.  */
.nav-logo,
.onboard-hero h1,
.home-greeting,
.ex-title,
.completion-title,
.cal-month,
.page-header h2,
.ex-name,
.streak-badge { font-weight: 800; }

/* Big display numbers — heaviest weight */
.home-stat .num,
.c-stat-n,
.cal-stat-box .n,
.timer-num { font-weight: 900; }

/* ════════════════════════════════════════════════════════════
   Figma polish — clean white surfaces, soft shadows, rounded
   (appended; overrides earlier rules via source order)
   ════════════════════════════════════════════════════════════ */

/* Soft elevated cards */
.home-stat, .ex-item, .timer-panel, .card, .cal-card,
.note-card, .rec-card, .cal-stat-box, .c-stat, .skip-panel {
  box-shadow: var(--shadow-card);
}
.home-stat, .cal-stat-box, .c-stat { border-radius: 18px; }
.ex-item, .note-card, .rec-card    { border-radius: 16px; }
.timer-panel, .card, .cal-card     { border-radius: 20px; }
.anim-card { border-radius: 22px; box-shadow: var(--shadow-card); }
.countdown-card { border-radius: 20px; box-shadow: var(--shadow-card); }

/* Callout boxes → clean rounded cards (drop the left-border bar) */
.info-box, .warn-box, .note-box {
  border-left: none; border-radius: 16px;
}
.info-box { background: #fff; box-shadow: var(--shadow-card); }

/* Buttons — rounded with soft raised shadow, springy press */
.btn { border-radius: 16px; box-shadow: var(--shadow-btn); }
.btn:active { transform: translateY(1px); }
.btn-complete { border-radius: 16px; box-shadow: 0 3px 12px rgba(87,190,70,0.38); }
.btn-complete.marked        { box-shadow: 0 3px 12px rgba(0,0,0,0.18); }
.btn-complete.skipped-state { box-shadow: 0 3px 12px rgba(240,173,78,0.42); }
.btn-complete:active        { transform: translateY(1px); }
.btn-nav   { border-radius: 16px; }
.btn-timer { border-radius: 14px; box-shadow: var(--shadow-btn); }
.btn-timer:active { transform: translateY(1px); }

/* Floating bottom bars — white with a soft top shadow */
.ex-actions-fixed { background: #fff; border-top: none; box-shadow: 0 -2px 14px rgba(0,0,0,0.06); }
.nav              { box-shadow: 0 -2px 14px rgba(0,0,0,0.05); }

/* Circular accent elements — give them a soft colored glow */
.done-circle            { box-shadow: 0 4px 14px rgba(87,190,70,0.34); }
.done-circle.incomplete { box-shadow: none; }
.complete-icon          { box-shadow: 0 8px 24px rgba(87,190,70,0.34); }
.record-btn             { box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
.rec-play-btn           { box-shadow: 0 2px 8px rgba(87,190,70,0.42); }
.check-ring             { transition: all 0.15s; }
.muscle-chip            { background: var(--green-bg); }

/* Pill badge utility (matches Figma status pills) */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Nunito', sans-serif; font-size: 0.72rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill-green { background: var(--green-bg); color: #2f9e3b; }
.pill-amber { background: var(--amber-bg); color: #cf8a2e; }
.pill-red   { background: var(--red-bg);   color: #d24a3c; }
.pill-blue  { background: var(--blue-bg);  color: var(--blue); }
.pill-gray  { background: var(--gray-bg);  color: var(--navy-60); }
