/* ============================================================
   PHYSIQUE OS — Nordic Edition
   Muted stone · Bone white · Deep forest · Ice blue accents
   Typefaces: Playfair Display + Outfit
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;900&family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Nordic palette */
  --void:       #0e1012;
  --deep:       #141618;
  --surface:    #1a1d20;
  --raised:     #20242a;
  --border:     rgba(255,255,255,0.07);
  --border-hi:  rgba(255,255,255,0.13);

  /* Accent — Nordic ice / glacial teal */
  --ice:        #a8d8d0;
  --ice-dim:    rgba(168,216,208,0.12);
  --ice-glow:   rgba(168,216,208,0.25);
  --ice-deep:   #6bb8ac;

  /* Secondary accents */
  --ember:      #c9724a;   /* warm amber-red */
  --ember-dim:  rgba(201,114,74,0.15);
  --moss:       #7a9e7e;   /* muted forest green */
  --moss-dim:   rgba(122,158,126,0.15);
  --stone:      #8b9199;   /* mid-tone grey */

  /* Text */
  --t1: #e8e4de;           /* warm bone white */
  --t2: rgba(232,228,222,0.55);
  --t3: rgba(232,228,222,0.28);

  /* Fonts */
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Outfit', system-ui, sans-serif;

  /* Radii */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-full: 9999px;

  --nav-h: 72px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--void);
  color: var(--t1);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* Subtle ambient bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(168,216,208,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 100%, rgba(201,114,74,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ── */
#app {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
}

.page {
  display: none;
  flex-direction: column;
  min-height: calc(100dvh - var(--nav-h));
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  padding-top: calc(var(--safe-top) + 12px);
  animation: fadeUp 0.28s ease;
}
.page.active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px;
  -webkit-overflow-scrolling: touch;
}
.scroll-area::-webkit-scrollbar { display: none; }

/* ── TYPOGRAPHY ── */
.serif { font-family: var(--serif); }
.t1 { color: var(--t1); }
.t2 { color: var(--t2); }
.t3 { color: var(--t3); }

.display {
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--t1);
}
.heading { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.label-xs {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t3);
}
.caption { font-size: 0.78rem; color: var(--t2); }
.num {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ── PAGE HEADER ── */
.page-header {
  padding: 12px 16px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.page-header-left { flex: 1; }
.page-eyebrow { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice-deep); margin-bottom: 4px; }
.page-title { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-p { padding: 16px; }
.card + .card { margin-top: 10px; }

.card-ice    { border-top: 1px solid rgba(168,216,208,0.35); }
.card-ember  { border-top: 1px solid rgba(201,114,74,0.35); }
.card-moss   { border-top: 1px solid rgba(122,158,126,0.35); }

/* ── SECTION TITLE ── */
.section-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t1);
  margin: 22px 0 10px;
}
.section-title:first-child { margin-top: 4px; }

/* ── BOTTOM NAV ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(14,16,18,0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--t3);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
  min-width: 54px;
}
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav-item span { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-item.active { color: var(--ice); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer; border-radius: var(--r-full);
  font-family: var(--sans); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.01em;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.95); opacity: 0.85; }

.btn-ice {
  background: var(--ice);
  color: #0e1012;
  padding: 13px 24px;
  box-shadow: 0 2px 16px rgba(168,216,208,0.2);
}
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--t1);
  border: 1px solid var(--border-hi);
  padding: 11px 18px;
}
.btn-outline {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--border);
  padding: 9px 16px;
}
.btn-sm { padding: 8px 14px; font-size: 0.78rem; }
.btn-lg { width: 100%; padding: 15px 24px; font-size: 0.92rem; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--t2);
}
.btn-icon svg { width: 17px; height: 17px; }

/* ── HERO WORKOUT CARD ── */
.hero-card {
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  min-height: 200px;
}
.hero-card-img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%; height: 100%;
  opacity: 0.25;
  filter: grayscale(40%) contrast(1.1);
}
.hero-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(14,16,18,0.5) 0%, rgba(14,16,18,0.85) 60%, rgba(14,16,18,0.97) 100%);
}
.hero-card-content {
  position: relative;
  z-index: 2;
  padding: 22px 18px 20px;
}

/* ── PROGRESS RING ── */
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-svg { transform: rotate(-90deg); }
.ring-track { fill: none; }
.ring-fill  { fill: none; stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(.4,0,.2,1); }
.ring-label { position: absolute; text-align: center; }

/* ── EXERCISE CARD (Nordic) ── */
.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
.exercise-img-wrap {
  position: relative;
  height: 130px;
  overflow: hidden;
  background: var(--deep);
}
.exercise-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(25%) contrast(1.05);
  opacity: 0.75;
  transition: opacity 0.3s, transform 0.3s;
}
.exercise-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(26,29,32,0.95) 100%);
}
.exercise-img-label {
  position: absolute;
  bottom: 10px; left: 12px;
  z-index: 2;
  display: flex; align-items: center; gap: 8px;
}
.exercise-header {
  padding: 12px 14px 10px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.exercise-name { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.exercise-meta { font-size: 0.72rem; color: var(--t3); margin-top: 3px; }
.exercise-body { padding: 0 14px 12px; }
.exercise-body.collapsed { display: none; }

/* ── SET ROWS ── */
.sets-header {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 36px;
  gap: 6px;
  padding: 4px 0 6px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
}
.set-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 36px;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
}
.set-num { text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--t3); font-family: var(--serif); }
.set-input {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  padding: 9px 6px;
  text-align: center;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, background 0.15s;
}
.set-input:focus { border-color: var(--ice-deep); background: rgba(168,216,208,0.05); }
.set-check {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hi);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.set-check.done { background: var(--ice); border-color: var(--ice); }
.set-check svg { width: 13px; height: 13px; stroke: #0e1012; stroke-width: 2.5; fill: none; display: none; }
.set-check.done svg { display: block; }

/* ── PR BADGE ── */
.pr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(201,114,74,0.15);
  color: var(--ember);
  border: 1px solid rgba(201,114,74,0.3);
  border-radius: var(--r-full);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; text-transform: uppercase;
}

/* ── PROGRESS BARS ── */
.prog-wrap { background: rgba(255,255,255,0.05); border-radius: var(--r-full); overflow: hidden; }
.prog-fill { height: 100%; border-radius: var(--r-full); transition: width 0.7s cubic-bezier(.4,0,.2,1); }
.prog-ice    { background: linear-gradient(90deg, var(--ice-deep), var(--ice)); }
.prog-ember  { background: linear-gradient(90deg, var(--ember), #e8945a); }
.prog-moss   { background: linear-gradient(90deg, var(--moss), #9ec4a2); }

/* ── HABIT GRID ── */
.habit-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.habit-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.22s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.habit-item.done {
  background: rgba(168,216,208,0.08);
  border-color: rgba(168,216,208,0.3);
}
.habit-icon { font-size: 1.35rem; transition: transform 0.2s; }
.habit-item.done .habit-icon { transform: scale(1.15); }
.habit-name { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--t3); }
.habit-item.done .habit-name { color: var(--ice); }

/* ── STAT ROW ── */
.stat-row {
  display: flex; align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.stat-row:last-child { border-bottom: none; }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

/* ── INPUTS ── */
.input-group { margin-bottom: 12px; }
.input-label {
  display: block;
  font-size: 0.63rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--t3); margin-bottom: 7px;
}
input[type="number"], input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 11px 13px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ice-deep);
  background: rgba(168,216,208,0.04);
}
input::placeholder { color: var(--t3); }
select option { background: var(--surface); }

/* ── TIMER ── */
#timer-widget {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  left: 50%; transform: translateX(-50%);
  z-index: 90; display: none; width: calc(100% - 28px); max-width: 402px;
}
#timer-widget.visible { display: block; }
.timer-bar-wrap {
  background: rgba(14,16,18,0.92);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-full);
  backdrop-filter: blur(20px);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,216,208,0.1);
}
.timer-ring-mini { flex-shrink: 0; }
.timer-display {
  font-family: var(--serif);
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ice);
  flex: 1;
}
.timer-label { font-size: 0.65rem; color: var(--t3); letter-spacing: 0.1em; text-transform: uppercase; }
.timer-presets { display: flex; gap: 6px; }
.timer-preset-btn {
  padding: 6px 10px; border-radius: var(--r-full);
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--t2); font-size: 0.7rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.timer-preset-btn:active { background: var(--ice-dim); color: var(--ice); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 18px calc(20px + var(--safe-bottom));
  width: 100%; max-width: 430px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle { width: 32px; height: 3px; background: var(--border-hi); border-radius: 2px; margin: 0 auto 18px; }
.modal-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 18px; }

/* ── TOAST ── */
#toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%; transform: translateX(-50%) translateY(-70px);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-full);
  padding: 10px 18px;
  font-size: 0.82rem; font-weight: 500;
  backdrop-filter: blur(20px);
  z-index: 300;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  white-space: nowrap; max-width: 90vw;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── ONBOARDING ── */
#onboarding {
  position: fixed; inset: 0;
  background: var(--void);
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center;
  animation: fadeUp 0.4s ease;
}
#onboarding.hidden { display: none; }
.onboard-rune {
  width: 72px; height: 72px;
  border: 1.5px solid rgba(168,216,208,0.4);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 28px;
  background: var(--ice-dim);
  box-shadow: 0 0 40px rgba(168,216,208,0.1);
}
.onboard-title { font-family: var(--serif); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 10px; }
.onboard-sub { color: var(--t2); font-size: 0.9rem; line-height: 1.65; margin-bottom: 36px; max-width: 280px; }
.onboard-steps { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin-bottom: 36px; }
.onboard-step {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 13px 14px; text-align: left;
}
.onboard-step strong { display: block; font-size: 0.88rem; font-weight: 600; }
.onboard-step span { font-size: 0.72rem; color: var(--t3); }

/* ── CONFETTI ── */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ── BODY METRICS GRID ── */
.body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.body-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
}
.body-val { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.body-unit { font-size: 0.72rem; color: var(--t3); }
.body-lbl { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t3); margin-top: 3px; }
.delta-up   { color: #c9724a; font-size: 0.72rem; }
.delta-down { color: var(--moss); font-size: 0.72rem; }

/* ── BADGE GRID ── */
.badge-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); text-align: center;
}
.badge-item.earned { border-color: rgba(168,216,208,0.28); background: var(--ice-dim); }
.badge-item.locked { opacity: 0.35; filter: grayscale(1); }
.badge-icon { font-size: 1.4rem; }
.badge-name { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3); }
.badge-item.earned .badge-name { color: var(--ice); }

/* ── CHART ── */
.chart-col-wrap { display: flex; gap: 3px; align-items: flex-end; height: 90px; padding: 0 2px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; border-radius: 3px 3px 0 0;
  background: rgba(168,216,208,0.15);
  border: 1px solid rgba(168,216,208,0.2);
  min-height: 3px;
  transition: height 0.6s cubic-bezier(.4,0,.2,1);
}
.chart-bar.today { background: var(--ice-deep); border-color: var(--ice); }
.chart-day { font-size: 0.58rem; color: var(--t3); font-weight: 600; }

/* ── QUICK ACTION ── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 12px;
  cursor: pointer; text-align: left;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.quick-btn:active { background: var(--raised); }
.quick-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.quick-label strong { display: block; font-size: 0.82rem; font-weight: 600; }
.quick-label span { font-size: 0.68rem; color: var(--t3); }

/* ── QUOTE ── */
.quote-card {
  background: linear-gradient(135deg, rgba(168,216,208,0.06) 0%, rgba(168,216,208,0.02) 100%);
  border: 1px solid rgba(168,216,208,0.12);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 0;
}
.quote-body { font-family: var(--serif); font-size: 0.95rem; font-style: italic; line-height: 1.6; color: var(--t1); }
.quote-who  { font-size: 0.68rem; color: var(--t3); margin-top: 7px; letter-spacing: 0.06em; }

/* ── STREAK ── */
.streak-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--ember-dim);
  border: 1px solid rgba(201,114,74,0.25);
  border-radius: var(--r-full);
  padding: 6px 12px;
}
.streak-flame { font-size: 1rem; animation: flicker 2.5s ease-in-out infinite; }
@keyframes flicker { 0%,100%{transform:scale(1) rotate(-2deg);} 50%{transform:scale(1.1) rotate(2deg);} }
.streak-num { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--ember); }
.streak-lbl { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(201,114,74,0.7); }

/* ── STEPPER ── */
.stepper {
  display: flex; align-items: center;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden;
}
.stepper-btn {
  width: 44px; height: 44px; background: transparent; border: none;
  color: var(--t1); font-size: 1.2rem; cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stepper-btn:active { background: rgba(255,255,255,0.07); }
.stepper-val { flex: 1; text-align: center; font-family: var(--serif); font-size: 1rem; font-weight: 700; }

/* ── WEEK PIPS ── */
.week-pips { display: flex; gap: 5px; }
.pip { flex: 1; height: 5px; border-radius: 3px; background: var(--border); transition: background 0.3s; }
.pip.done { background: var(--ice-deep); }
.pip.rest { background: rgba(122,158,126,0.4); }

/* ── WATER VISUAL ── */
.water-drops { display: flex; gap: 3px; align-items: flex-end; }
.water-drop-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.water-segment {
  width: 7px; border-radius: 3px;
  transition: background 0.4s, height 0.4s;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── SCROLL CHIPS ── */
.chip-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; background: var(--raised); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 7px 14px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; color: var(--t2);
  transition: all 0.15s; white-space: nowrap;
}
.chip.active, .chip:active { background: var(--ice-dim); color: var(--ice); border-color: rgba(168,216,208,0.3); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.4; }
.empty-text { font-size: 0.85rem; color: var(--t3); line-height: 1.5; }

/* ── HISTORY ITEMS ── */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--raised); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.history-title { font-family: var(--serif); font-size: 0.88rem; font-weight: 600; }
.history-sub   { font-size: 0.7rem; color: var(--t3); margin-top: 2px; }
.history-stat  { font-family: var(--serif); font-size: 0.9rem; font-weight: 700; color: var(--ice); margin-left: auto; }

/* ── RESPONSIVE ── */
@media (min-width: 430px) {
  #app, #bottom-nav { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ── ANIMATIONS ── */
@keyframes slideUp { from{opacity:0;transform:translateY(16px);}to{opacity:1;transform:translateY(0);} }
@keyframes scaleIn { from{opacity:0;transform:scale(0.9);}to{opacity:1;transform:scale(1);} }

.stagger > * { animation: slideUp 0.3s ease both; }
.stagger > *:nth-child(1){animation-delay:.04s}
.stagger > *:nth-child(2){animation-delay:.09s}
.stagger > *:nth-child(3){animation-delay:.14s}
.stagger > *:nth-child(4){animation-delay:.19s}
.stagger > *:nth-child(5){animation-delay:.24s}
.stagger > *:nth-child(6){animation-delay:.29s}

/* Notch safe */
.safe-top { padding-top: var(--safe-top); }
