/* Mom Fit */

:root {
  --bg: #F6F1E7;
  --surface: #FFFDF8;
  --ink: #2C241D;
  --muted: #8A7E70;
  --line: #E7DECF;
  --day: #2C241D;
  --tint: #EDE6D8;
  --serif: ui-serif, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --round: ui-rounded, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:active { transform: scale(0.97); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--day); outline-offset: 2px; }

.num { font-family: var(--round); font-variant-numeric: tabular-nums; }

#app { max-width: 480px; margin: 0 auto; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 18px) 20px calc(env(safe-area-inset-bottom) + 22px);
  animation: fadeUp 0.28s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 6px;
}
.icon-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}
.topbar .spacer { width: 48px; }

h1.display {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.sub { color: var(--muted); font-size: 17px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(44, 36, 29, 0.05);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tint);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--day); }

/* Lock screen */
.lock { justify-content: center; text-align: center; gap: 10px; }
.lock h1 { font-family: var(--serif); font-size: 38px; }
.dots { display: flex; gap: 18px; justify-content: center; margin: 26px 0 34px; }
.dots .d {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--muted); background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.dots .d.on { background: var(--ink); border-color: var(--ink); }
.dots.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}
.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  justify-items: center;
  max-width: 300px;
  margin: 0 auto;
}
.key {
  width: 82px; height: 82px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 30px;
  font-family: var(--round);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.key.blank { visibility: hidden; }
.lock-note { color: var(--muted); font-size: 16px; margin-top: 20px; }

/* Home */
.greet { margin: 14px 0 2px; }
.today-line { color: var(--muted); font-size: 17px; margin-bottom: 18px; }
.day-btn {
  width: 100%;
  text-align: left;
  border-radius: 22px;
  padding: 20px 22px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.day-btn .k { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.day-btn .n { font-family: var(--serif); font-size: 28px; font-weight: 700; display: block; }
.day-btn .m { color: var(--muted); font-size: 16px; }
.day-btn.big {
  background: var(--day);
  border-color: var(--day);
  color: #FFFDF8;
  padding: 26px 22px;
}
.day-btn.big .k, .day-btn.big .m { color: rgba(255, 253, 248, 0.85); }
.day-btn.big .n { font-size: 36px; }
.home-links { display: flex; gap: 12px; margin-top: auto; padding-top: 20px; }
.home-links .btn-ghost { flex: 1; }

.btn-primary {
  width: 100%;
  min-height: 64px;
  border-radius: 18px;
  background: var(--day);
  color: #FFFDF8;
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(44, 36, 29, 0.18);
}
.btn-ghost {
  min-height: 56px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 600;
  padding: 0 18px;
}
.link-quiet {
  color: var(--muted);
  font-size: 17px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 14px;
  align-self: center;
}

.banner {
  border: 1.5px solid var(--day);
  background: var(--tint);
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.banner .t { font-weight: 700; font-size: 18px; }
.banner .s { color: var(--muted); font-size: 16px; }
.banner .row { display: flex; gap: 10px; margin-top: 12px; }
.banner .btn-primary { min-height: 54px; font-size: 18px; }

/* Preview */
.ex-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.ex-row:last-child { border-bottom: none; }
.ex-row .nm { font-size: 19px; font-weight: 600; }
.ex-row .nt { color: var(--muted); font-size: 15px; display: block; font-weight: 400; }
.ex-row .rp { color: var(--muted); font-size: 16px; white-space: nowrap; }
.nudge {
  background: var(--tint);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 17px;
  margin: 14px 0;
}

/* Lift screen */
.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin: 0 14px;
}
.progress-fill { height: 100%; border-radius: 4px; background: var(--day); transition: width 0.3s; }
.progress-count { color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }

.lift-body { display: flex; flex-direction: column; flex: 1; text-align: center; }
.resume-note { color: var(--muted); font-size: 16px; margin-top: 6px; }
.ex-name {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 26px;
}
.ex-note { color: var(--muted); font-size: 17px; margin-top: 4px; }

.set-dots { display: flex; gap: 10px; justify-content: center; margin: 18px 0 4px; }
.set-dots .sd {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--day); background: transparent;
}
.set-dots .sd.done { background: var(--day); }
.set-label { color: var(--muted); font-size: 17px; font-weight: 600; }

.reps-chip {
  margin: 18px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 26px;
}
.reps-chip .v { font-size: 40px; font-weight: 700; }
.reps-chip .u { color: var(--muted); font-size: 17px; font-weight: 600; }
.reps-chip .chip-hint {
  display: block;
  color: var(--day);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
}
.aim-line { color: var(--muted); font-size: 15px; margin-top: 8px; }
.aim-line b { color: var(--day); }
.next-up { color: var(--muted); font-size: 16px; text-align: center; padding-bottom: 4px; }
.ex-img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  margin: 10px auto 0;
  display: block;
  background: var(--surface);
}
.reps-adjust { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.reps-adjust[hidden] { display: none; }
.reps-adjust .step-btn { width: 54px; height: 54px; font-size: 26px; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 26px 0 6px; }
.step-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--day);
  font-size: 36px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.weight-val { min-width: 130px; text-align: center; }
.weight-val .v { font-size: 50px; font-weight: 700; line-height: 1; }
.weight-val .u { color: var(--muted); font-size: 17px; font-weight: 600; }

.done-btn {
  min-height: 78px;
  border-radius: 22px;
  width: 100%;
  background: var(--day);
  color: #FFFDF8;
  font-size: 24px;
  font-weight: 700;
  margin-top: auto;
  box-shadow: 0 3px 10px rgba(44, 36, 29, 0.2);
}

/* Sheets */
.sheet {
  position: fixed; inset: 0;
  background: rgba(44, 36, 29, 0.45);
  display: flex; align-items: flex-end;
  z-index: 40;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet-card {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 26px 26px 0 0;
  padding: 22px 20px calc(env(safe-area-inset-bottom) + 24px);
  animation: slideUp 0.25s ease-out;
  max-height: 86dvh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.6; } }
.sheet-card h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 14px; }
.sheet-card .btn-ghost { width: 100%; margin-bottom: 10px; min-height: 60px; text-align: left; padding: 0 20px; }

/* Cardio / effort */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.pick-btn {
  min-height: 76px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 19px;
  font-weight: 600;
}
.pick-btn.on { border-color: var(--day); background: var(--tint); color: var(--day); }
.effort-btn {
  width: 100%;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  padding: 18px 20px;
  text-align: left;
  margin-bottom: 12px;
}
.effort-btn .t { font-size: 22px; font-weight: 700; display: block; }
.effort-btn .s { color: var(--muted); font-size: 16px; }

/* Cardio machine settings */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 12px;
}
.set-lab { font-size: 18px; font-weight: 600; }
.mini-stepper { display: flex; align-items: center; gap: 12px; }
.step-btn.sm { width: 54px; height: 54px; font-size: 24px; }
.sv { min-width: 96px; text-align: center; font-size: 22px; font-weight: 700; }

/* Done screen */
.done-screen { justify-content: center; text-align: center; gap: 8px; }
.big-check {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--day);
  color: #FFFDF8;
  font-size: 56px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.stat-row { display: flex; justify-content: center; gap: 26px; margin: 16px 0; }
.stat .v { font-size: 34px; font-weight: 700; display: block; }
.stat .l { color: var(--muted); font-size: 15px; }
.pr-line {
  background: var(--tint);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 600;
  margin: 6px auto;
  max-width: 340px;
}
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti span {
  position: absolute; top: -20px;
  width: 10px; height: 15px;
  border-radius: 3px;
  animation: fall 2.8s ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(680deg); opacity: 0.85; }
}

/* Progress */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; }
.cal-head .m { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 0; }
.cal-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border-radius: 14px;
  font-size: 16px;
  color: var(--muted);
  background: none;
  border: none;
  width: 100%;
}
.cal-cell.today { border: 2px solid var(--ink); }
.cal-cell .wd {
  position: absolute; inset: 4px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #FFFDF8;
  font-weight: 700;
}
.legend { display: flex; gap: 16px; margin: 10px 2px 4px; color: var(--muted); font-size: 15px; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.sec-title { font-family: var(--serif); font-size: 24px; font-weight: 700; margin: 26px 0 10px; }
.t-day {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.t-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  text-align: left;
  padding: 14px 16px;
}
.t-card .nm { font-size: 18px; font-weight: 600; }
.t-card .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.t-card .t-right { text-align: right; flex-shrink: 0; }
.t-card .cur { font-size: 18px; font-weight: 700; }
.t-card .up { color: var(--day); font-size: 14px; font-weight: 700; }
.spark { width: 88px; height: 30px; display: block; margin-left: auto; margin-top: 2px; }
.chart-label { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.chart-card .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.chart-card .cur { font-size: 26px; font-weight: 700; }
.chart-card .delta { color: var(--muted); font-size: 16px; }
.chart-note { color: var(--muted); font-size: 16px; padding: 10px 0; }

.wk-list .wk-card { margin-bottom: 12px; width: 100%; text-align: left; }
.wk-card .top { display: flex; justify-content: space-between; align-items: center; }
.wk-card .d { font-weight: 700; font-size: 18px; }
.wk-card .meta { color: var(--muted); font-size: 16px; margin-top: 2px; }
.pill {
  font-size: 14px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  background: var(--tint); color: var(--day);
}

.detail-row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .nm { font-weight: 600; }
.detail-row .info { color: var(--muted); font-size: 16px; }
.detail-row.skipped .nm { color: var(--muted); text-decoration: line-through; }

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  z-index: 60;
  animation: fadeUp 0.25s;
  white-space: nowrap;
}

.interstitial {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50;
  animation: fadeIn 0.2s;
  text-align: center;
  padding: 24px;
}
.interstitial .nice { color: var(--muted); font-size: 20px; }
.interstitial .nxt { font-family: var(--serif); font-size: 34px; font-weight: 700; margin-top: 8px; }

.center-note {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 17px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
