/* ============================================================
   Pilates na Parede · 21 Dias  —  Design System
   Inspired by BetterMe / warm cream + chocolate palette.
   ============================================================ */

:root {
  /* Neutrals — base clean */
  --bg:           #FBFAFB;
  --bg-elevated:  #FFFFFF;
  --bg-muted:     #F3F3F5;
  --bg-card:      #FFFFFF;
  --border:       #E9E7EA;
  --border-soft:  #F1F0F2;

  /* Text hierarchy — neutral dark for readability */
  --ink:          #18181B;
  --ink-soft:     #52525B;
  --ink-muted:    #71717A;
  --ink-faint:    #A1A1AA;

  /* Brand accent — pink used ONLY for CTAs, icons, highlights */
  --brand:        #cf477e;
  --brand-2:      #b13868;
  --accent:       #cf477e;
  --accent-soft:  #f2a2c1;
  --success:      #10B981;
  --danger:       #EF4444;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Neutral shadows — cleaner, more professional */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 14px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10);

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --nav-h: 76px;

  color-scheme: light;
}

/* ---------- Dark theme (explicit) ---------- */
:root[data-theme="dark"] {
  --bg:           #0E0E11;
  --bg-elevated:  #17171B;
  --bg-muted:     #22222A;
  --bg-card:      #17171B;
  --border:       #2A2A32;
  --border-soft:  #22222A;

  --ink:          #F5F5F7;
  --ink-soft:     #C2C2CB;
  --ink-muted:    #8A8A94;
  --ink-faint:    #5F5F68;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow:    0 4px 14px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);

  color-scheme: dark;
}

/* ---------- Auto (system preference) — unless user picked light explicitly ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0E0E11;
    --bg-elevated:  #17171B;
    --bg-muted:     #22222A;
    --bg-card:      #17171B;
    --border:       #2A2A32;
    --border-soft:  #22222A;

    --ink:          #F5F5F7;
    --ink-soft:     #C2C2CB;
    --ink-muted:    #8A8A94;
    --ink-faint:    #5F5F68;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
    --shadow:    0 4px 14px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55);

    color-scheme: dark;
  }
}

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

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button { border: 0; background: none; cursor: pointer; padding: 0; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

/* Default sizing for inline icons — any explicit CSS rule below overrides this */
button svg, .chip svg, .day-cta svg, .hero-card svg, .ex-item svg,
.day-item .end svg, .setting-row .s-end svg, .stat .ico svg,
.detail-hero .m svg, .ob__opt svg, .ob__list-row svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.btn svg { width: 16px; height: 16px; }
.day-cta svg { width: 16px; height: 16px; }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- App shell ---------- */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bottom) + 24px);
  animation: fadeUp .28s ease;
}

.screen--nav {
  padding-bottom: calc(var(--safe-bottom) + var(--nav-h) + 24px);
}

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

@keyframes heroSwap {
  from { opacity: 0.35; transform: scale(0.985); }
  to   { opacity: 1;    transform: scale(1); }
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 30px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 700; line-height: 1.2; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 600; }
p  { margin: 0; color: var(--ink-soft); }

.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; letter-spacing: 0.03em; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; }
.center { text-align: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 28px;
  min-height: 56px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #FDEDF4;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform .12s ease, background .18s ease, opacity .18s ease;
  width: 100%;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn--ghost {
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--bg-elevated); }

.btn--sm { min-height: 44px; padding: 12px 22px; font-size: 12px; }

.link-btn {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 4px;
}
.link-btn:hover { color: var(--ink); }

/* Secondary text link with subtle chip look */
.secondary-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  margin-top: 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  min-height: 44px;
  transition: background .18s ease, border-color .18s ease;
}
.secondary-link:hover { background: var(--bg-elevated); border-color: var(--ink-muted); color: var(--ink); }
.secondary-link svg { width: 15px; height: 15px; opacity: 0.7; stroke-width: 2.6; }

/* ---------- Cards ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card--flat { box-shadow: none; }
.card--muted { background: var(--bg-muted); border-color: transparent; }
.card--dark { background: var(--brand); color: #FFFFFF; border: 0; }
.card--dark p, .card--dark .text-muted { color: rgba(245,230,206,.75); }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}
.chip svg { width: 14px; height: 14px; }
.chip--dark { background: var(--brand); color: #FFFFFF; border-color: transparent; }
.chip--accent { background: rgba(207,71,126,.12); color: var(--accent); border-color: transparent; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 14px;
  min-height: 44px;
}
.topbar__title { font-size: 15px; font-weight: 700; }
.topbar__side { min-width: 40px; }

.iconbtn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--ink);
}
.iconbtn:hover { background: var(--bg-muted); }

/* ---------- Bottom navigation ---------- */

.bottomnav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border-soft);
  padding: 10px 8px calc(10px + var(--safe-bottom));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  z-index: 30;
}
:root[data-theme="dark"] .bottomnav { background: rgba(23, 23, 27, 0.88); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottomnav { background: rgba(23, 23, 27, 0.88); }
}
.bottomnav__tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color .18s ease;
}
.bottomnav__tab svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.bottomnav__tab.is-active { color: var(--ink); }
.bottomnav__tab.is-active svg { stroke-width: 2.2; }

/* ---------- Onboarding ---------- */

.ob {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 24px);
}
.ob__dots {
  display: flex; gap: 6px; justify-content: center; margin: 6px 0 32px;
}
.ob__dot {
  height: 4px; width: 28px; border-radius: 4px; background: var(--border);
  transition: background .3s ease;
}
.ob__dot.is-active { background: var(--brand); }
.ob__hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  padding: 20px 0;
}
.ob__illus {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(160deg, #FDECF3 0%, #F8DDE7 60%, #F0C4D5 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -10px 30px rgba(0,0,0,.06);
  position: relative;
}
.ob__illus svg { width: 130px; height: 130px; }
.ob__title { text-align: center; padding: 0 12px; }
.ob__desc { text-align: center; color: var(--ink-muted); max-width: 340px; margin: 0 auto; font-size: 15px; line-height: 1.55; }

.ob__pillars {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%;
  margin-top: 4px;
}
.ob__pillar {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px;
}
.ob__pillar .n {
  font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em;
  line-height: 1;
}
.ob__pillar .l {
  font-size: 12px; color: var(--ink-muted); margin-top: 6px; font-weight: 500;
}
.ob__icon-wrap {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.ob__icon-wrap svg { width: 16px; height: 16px; stroke: var(--ink); }

.ob__list { display: flex; flex-direction: column; gap: 0; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.ob__list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.ob__list-row:last-child { border-bottom: 0; }
.ob__list-row .li-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.ob__list-row .li-icon svg { width: 16px; height: 16px; }
.ob__list-row .li-text { flex: 1; font-size: 14px; font-weight: 500; }
.ob__list-row .li-check { color: var(--ink-muted); }

.ob__options { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.ob__opt {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
  width: 100%;
}
.ob__opt:hover { background: var(--bg-elevated); }
.ob__opt.is-selected { border-color: var(--brand); background: var(--bg-elevated); }
.ob__opt .ob__opt-title { font-weight: 600; font-size: 15px; }
.ob__opt .ob__opt-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.ob__opt .opt-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ob__opt.is-selected .opt-check { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.ob__opt .opt-check svg { width: 14px; height: 14px; opacity: 0; }
.ob__opt.is-selected .opt-check svg { opacity: 1; }
.ob__opt .opt-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
}
.ob__opt .opt-icon svg { width: 20px; height: 20px; }

.ob__input {
  width: 100%;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  transition: border-color .18s ease;
}
.ob__input:focus { outline: 0; border-color: var(--brand); }

.ob__footer { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.skip-btn {
  position: absolute; top: calc(var(--safe-top) + 22px); right: 20px;
  color: var(--ink-muted);
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 12px;
  z-index: 10;
}

/* ---------- Home / desafio ---------- */

.home__greet { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.home__greet .hi { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.home__greet .sub { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #cf477e, #f2a2c1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  border: 2px solid var(--bg);
  box-shadow: var(--shadow-sm);
}

.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 4px 0 20px; }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.stat .l { font-size: 11px; color: var(--ink-muted); font-weight: 500; margin-top: 2px; }
.stat .ico { color: var(--accent); margin-bottom: 4px; display: flex; justify-content: center; }
.stat .ico svg { width: 18px; height: 18px; }

.hero-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(160deg, #1F1F23, #0E0E10);
  color: #FFFFFF;
  padding: 26px 24px 22px;
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: space-between;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 10%, rgba(233,179,132,0.25), transparent 45%),
    radial-gradient(circle at 5% 90%, rgba(0,0,0,0.16), transparent 55%);
  pointer-events: none;
}
.hero-card > * { position: relative; }
.hero-card .kicker { font-size: 11px; letter-spacing: 0.16em; opacity: 0.7; font-weight: 700; text-transform: uppercase; }
.hero-card .day-num { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; margin: 6px 0 2px; }
.hero-card .day-name { font-size: 20px; font-weight: 700; }
.hero-card .day-meta { display: flex; gap: 14px; opacity: 0.75; font-size: 13px; margin-top: 6px; font-weight: 500; }
.hero-card .day-cta {
  margin-top: 18px;
  background: #FFFFFF;
  color: #18181B;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
}
.hero-card.is-done { background: linear-gradient(160deg, #4A6B4E, #2E4530); color: #EAF2E5; }
.hero-card.is-done .day-cta { background: #EAF2E5; color: #2E4530; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 2px 12px;
}
.section-head h3 { font-size: 16px; }
.section-head .note { font-size: 12px; color: var(--ink-muted); font-weight: 500; }

.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: transform .12s ease, background .18s ease;
  text-align: left;
  width: 100%;
}
.day-item:active { transform: scale(.99); }
.day-item .badge {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-muted);
  font-weight: 700; font-size: 15px;
  color: var(--ink);
  flex-shrink: 0;
  position: relative;
}
.day-item .info { flex: 1; min-width: 0; }
.day-item .info .t { font-size: 14px; font-weight: 600; }
.day-item .info .m { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.day-item .end svg { width: 20px; height: 20px; color: var(--ink-faint); }

.day-item.is-locked { opacity: 0.5; }
.day-item.is-locked .badge { background: var(--bg-muted); color: var(--ink-faint); }
.day-item.is-today { border-color: var(--accent); background: linear-gradient(135deg, #FDF3F7, #FCEEF3); }
.day-item.is-today .badge { background: var(--brand); color: #FFFFFF; }
.day-item.is-done .badge { background: #E7EED9; color: #4E6B3E; }
.day-item.is-done .info .t { color: var(--ink-muted); }

/* ---------- Day detail ---------- */

.detail-hero {
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  background: linear-gradient(160deg, #1F1F23, #0E0E10);
  color: #FFFFFF;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.detail-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 20%, rgba(233,179,132,0.25), transparent 45%);
  pointer-events: none;
}
.detail-hero > * { position: relative; }
.detail-hero .k { opacity: 0.7; font-size: 11px; letter-spacing: 0.16em; font-weight: 700; text-transform: uppercase; }
.detail-hero .t { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; line-height: 1.15; }
.detail-hero .m { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; opacity: 0.85; font-weight: 500; }

.block-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; margin: 22px 4px 10px; }

.ex-list { display: flex; flex-direction: column; gap: 10px; }
.ex-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.ex-item .num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.ex-item .info { flex: 1; }
.ex-item .info .name { font-size: 14px; font-weight: 600; }
.ex-item .info .dur { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.floating-cta {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 440px;
  z-index: 20;
}
.floating-cta .btn { box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ---------- Complete overlay ---------- */

.celebrate {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 100;
  padding: calc(var(--safe-top) + 40px) 24px calc(var(--safe-bottom) + 30px);
  display: flex; flex-direction: column;
  animation: fadeUp .4s ease;
}
.celebrate .top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.celebrate .medal {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f2a2c1 0%, #cf477e 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), inset 0 -12px 24px rgba(0,0,0,0.15);
  position: relative;
  animation: pop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.celebrate .medal svg { width: 78px; height: 78px; color: #F7F7F8; }
.celebrate h1 { font-size: 30px; text-align: center; }
.celebrate .sub { text-align: center; color: var(--ink-soft); max-width: 320px; }
.celebrate .rewards { display: flex; gap: 10px; width: 100%; }
.celebrate .reward {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.celebrate .reward .v { font-size: 22px; font-weight: 800; color: var(--accent); }
.celebrate .reward .l { font-size: 11px; color: var(--ink-muted); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Progresso ---------- */

.progress-ring-wrap {
  display: flex; flex-direction: column; align-items: center; margin: 10px 0 24px;
}
.progress-ring { position: relative; width: 200px; height: 200px; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring .rc-bg { stroke: var(--border-soft); }
.progress-ring .rc-fg { stroke: var(--brand); transition: stroke-dashoffset .8s ease; }
.progress-ring .center-txt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.progress-ring .center-txt .n { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.progress-ring .center-txt .l { font-size: 12px; color: var(--ink-muted); margin-top: 6px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }

.achievements-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.ach {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  transition: transform .12s ease;
  min-height: 118px;
}
.ach .ico {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
}
.ach .ico svg { width: 22px; height: 22px; }
.ach .name { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
.ach .desc { font-size: 10px; color: var(--ink-muted); line-height: 1.2; }
.ach .ico { position: relative; }
.ach .ach-check {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #6B9B6F;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.ach .ach-check svg { width: 10px; height: 10px; stroke-width: 3.4; }
.ach.is-unlocked .ico { background: linear-gradient(135deg, #f2a2c1, #cf477e); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.28); }
.ach.is-unlocked .name { color: var(--ink); }
.ach.is-locked { opacity: 0.65; }

/* Confetti */
.confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confettiFall linear forwards;
  transform-origin: center;
}
@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(120vh) rotate(var(--r, 360deg));
    opacity: 0.9;
  }
}
.celebrate { position: fixed; overflow: hidden; }
.celebrate .top { position: relative; z-index: 20; }
.celebrate .btn { position: relative; z-index: 20; }

/* ---------- Perfil ---------- */

.profile-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 24px;
  gap: 14px;
}
.avatar-lg {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, #cf477e, #f2a2c1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  position: relative;
  overflow: hidden;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-hero .avatar-lg .level-badge {
  position: absolute; bottom: -6px; right: -6px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
  border: 3px solid var(--bg);
}
/* When avatar has upload badge, put level badge above the name instead */
.avatar-upload .avatar-lg .level-badge {
  position: static;
  display: inline-block;
  border: 0;
}
.profile-hero .level-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.profile-hero .level-inline .chip {
  padding: 4px 10px;
  font-size: 11px;
}
.profile-hero .name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.profile-hero .level-title { font-size: 13px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }

.xp-card { margin: 6px 0 24px; }
.xp-bar {
  height: 10px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}
.xp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #cf477e, #f2a2c1);
  transition: width .8s ease;
  border-radius: var(--radius-pill);
}
.xp-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); font-weight: 500; margin-top: 8px; }

.setting-list { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.setting-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  width: 100%;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .s-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-muted); display: flex; align-items: center; justify-content: center; }
.setting-row .s-ico svg { width: 16px; height: 16px; }
.setting-row .s-main { flex: 1; }
.setting-row .s-main .t { font-size: 14px; font-weight: 600; }
.setting-row .s-main .m { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.setting-row .s-end svg { width: 18px; height: 18px; color: var(--ink-faint); }
.setting-row.is-danger .s-main .t { color: var(--danger); }

/* ---------- Toggle switch ---------- */
.switch {
  width: 44px; height: 26px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background .2s ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  transition: transform .22s cubic-bezier(.5,0,.2,1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(18px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--brand);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: 22px 22px calc(var(--safe-bottom) + 22px);
  animation: slideUp .32s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp { from { transform: translateY(30px); } to { transform: translateY(0); } }
.modal .grabber { width: 40px; height: 4px; background: var(--border); border-radius: 4px; margin: 0 auto 14px; }
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--ink-muted); font-size: 14px; margin-bottom: 18px; }
.modal .row { display: flex; gap: 10px; }

/* ---------- Utility ---------- */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* ============================================================
   New (v2) components
   ============================================================ */

/* ---------- Home v2: brand header ---------- */
.brand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px 12px;
}
.brand-header .brand {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
}
.brand-header .actions { display: flex; gap: 8px; }

.avatar--sm {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #cf477e, #f2a2c1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  overflow: hidden;
}
.avatar--sm img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Day carousel (horizontal thumbnails) ---------- */
.day-carousel-wrap { margin: 6px -20px 14px; padding: 0 20px 4px; }
.day-carousel {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 0 6px;
}
.day-carousel::-webkit-scrollbar { display: none; }
.day-thumb {
  flex-shrink: 0;
  width: 72px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.day-thumb .th {
  width: 72px; height: 72px;
  border-radius: 16px;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: 30% center;
  background-repeat: no-repeat;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, transform .12s ease;
}
.day-thumb .th::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,253,247,0.05) 0%, rgba(0,0,0,0.15) 100%);
}
.day-thumb .th svg {
  display: none;
}
.day-thumb .lbl {
  font-size: 12px; font-weight: 600; color: var(--ink-muted);
}
/* Today: green ring around the photo */
.day-thumb.is-today .th {
  border-color: #6B9B6F;
  box-shadow: 0 6px 20px rgba(107,155,111,0.28);
}
.day-thumb.is-today .lbl { color: var(--ink); font-weight: 700; }

/* Locked: photo faded + centered dark lock badge */
.day-thumb.is-locked .th { background-color: #F0E3EA; }
.day-thumb.is-locked .th::before {
  background: rgba(250, 243, 231, 0.55);
}
.day-thumb.is-locked .th::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(0,0,0,0.85);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FAF3E7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2'/><path d='M7 11V7a5 5 0 0110 0v4'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

/* Done: photo stays, with translucent green tint + centered check badge */
.day-thumb.is-done .th {
  box-shadow: 0 6px 18px rgba(107,155,111,0.22);
}
.day-thumb.is-done .th::before {
  background: linear-gradient(160deg, rgba(123,179,127,0.55) 0%, rgba(91,143,96,0.55) 100%);
}
.day-thumb.is-done .th::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #6B9B6F;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}
.day-thumb.is-done .lbl { color: var(--ink-muted); }

/* ---------- Objectives row (two-column with divider) ---------- */
.obj-row {
  display: grid; grid-template-columns: 1fr 1px 1fr;
  gap: 16px;
  padding: 14px 4px 14px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin: 0 0 16px;
}
.obj-row .divider { background: var(--border-soft); }
.obj-col .k { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.02em; font-weight: 500; }
.obj-col .v { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.obj-col .v small { font-size: 12px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0; margin-left: 2px; }

/* ---------- Section counter row ---------- */
.counter-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 2px 12px;
}
.counter-row .cnt { font-size: 16px; color: var(--ink-muted); font-weight: 500; }
.counter-row .cnt b { color: var(--ink); font-weight: 800; margin-right: 4px; }
.counter-row .link { font-size: 13px; color: var(--ink-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.counter-row .link svg { width: 14px; height: 14px; }

/* ---------- Big hero workout card (image style) ---------- */
.big-hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #C4B4A0 0%, #A8967F 100%);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .14s ease;
}
.big-hero:active { transform: scale(.99); }
.big-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 70%, rgba(255,255,255,0.28), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(0,0,0,0.14), transparent 50%);
}
.big-hero .illus {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.big-hero .illus svg { width: 60%; height: 60%; color: rgba(255,255,255,0.14); }
.big-hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.55) 100%);
}
.big-hero .caption {
  position: absolute; left: 20px; right: 20px; bottom: 18px;
  color: #FEF9FB;
}
.big-hero .caption .name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.big-hero .caption .meta { display: flex; gap: 12px; font-size: 12px; opacity: 0.85; margin-top: 6px; font-weight: 500; }
.big-hero.is-done .center-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: #FEF9FB;
  gap: 10px;
}
.big-hero.is-done .center-badge .circle {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.big-hero.is-done .center-badge .circle svg { width: 28px; height: 28px; }
.big-hero.is-done .center-badge .lb { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }

/* ---------- Chat drawer (support) ---------- */
.chat-btn { background: var(--bg-card); border: 1px solid var(--border-soft); }
.chat-btn svg { width: 20px; height: 20px; }

/* ---------- Weight chart ---------- */
.chart-card { position: relative; }
.chart-card h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; margin: 0 0 4px; }
.chart-card .month { position: absolute; top: 18px; right: 18px; font-size: 12px; color: var(--ink-muted); text-transform: capitalize; }
.chart-svg { width: 100%; margin: 4px 0 0; display: block; }
.chart-svg .grid-line { stroke: var(--border-soft); stroke-dasharray: 3 4; stroke-width: 1; }
.chart-svg .axis-txt { font-size: 10px; fill: var(--ink-muted); font-family: var(--font); font-weight: 600; }
.chart-svg .line { stroke: var(--brand); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .marker { fill: var(--brand); }
.chart-svg .marker-current { fill: var(--accent); }
.chart-svg .marker-label { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font); }

/* ---------- Weekly tracker card (water/calories) ---------- */
.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}
.week-card .head { display: flex; align-items: center; justify-content: space-between; }
.week-card .head .title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.week-card .head .icon-round {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
}
.week-card .head .icon-round svg { width: 18px; height: 18px; color: var(--brand); }
.week-card .value { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.week-card .value small { font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.week-card .days-row { display: flex; justify-content: space-between; align-items: stretch; height: 68px; margin: 14px 0 2px; }
.week-card .day-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.week-card .day-col .bar {
  width: 8px;
  flex: 1;
  background: var(--bg-muted);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  min-height: 6px;
}
.week-card .day-col .bar-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: height .6s ease;
}
.week-card .day-col .bar-fill--brand {
  background: linear-gradient(to top, var(--brand), #5A4438);
}
.week-card .day-col .lbl { font-size: 10px; color: var(--ink-muted); font-weight: 600; letter-spacing: 0.04em; }
.week-card .day-col.is-today .lbl { color: var(--ink); font-weight: 800; }
.week-card .footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); padding-top: 12px; border-top: 1px solid var(--border-soft); }
.week-card .goal-lbl { position: absolute; right: 18px; text-align: right; font-size: 11px; color: var(--ink-muted); }

/* ---------- Cup grid (water) ---------- */
.cup-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin: 20px 0;
}
.cup {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  transition: all .2s ease;
  position: relative;
}
.cup svg { width: 34px; height: 34px; }
.cup.is-full {
  background: linear-gradient(160deg, #A5C4E9, #7BA9DB);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(123,169,219,0.28);
}

/* ---------- Quick add buttons ---------- */
.quick-adds {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 20px;
}
.quick-add {
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  transition: background .18s ease, border-color .18s ease;
}
.quick-add:hover { background: var(--bg-elevated); border-color: var(--accent-soft); }
.quick-add .qa-val { font-size: 16px; font-weight: 800; }
.quick-add .qa-lbl { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-top: 2px; }

/* ---------- Big value display ---------- */
.big-value {
  text-align: center;
  padding: 24px 0 20px;
}
.big-value .num {
  font-size: 56px; font-weight: 900; letter-spacing: -0.03em; line-height: 1;
  background: linear-gradient(160deg, var(--ink), #5A4438);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.big-value .unit { font-size: 20px; color: var(--ink-muted); font-weight: 600; }
.big-value .meta { font-size: 13px; color: var(--ink-muted); margin-top: 6px; font-weight: 500; }

/* ---------- Meals log (calorias) ---------- */
.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.meal-row .m-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-muted); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.meal-row .m-main { flex: 1; }
.meal-row .m-main .n { font-size: 14px; font-weight: 600; }
.meal-row .m-main .k { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.meal-row .m-val { font-size: 15px; font-weight: 700; color: var(--ink); }
.meal-row.is-empty .m-val { color: var(--ink-faint); font-weight: 500; }

/* ---------- Challenge cards (shop) ---------- */
.challenge-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.challenge-card .banner {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
  position: relative;
}
.challenge-card .banner-1 { background: linear-gradient(160deg, #E0F0E5, #B8DEC6); }
.challenge-card .banner-2 { background: linear-gradient(160deg, #FDE7E1, #F5C4B4); }
.challenge-card .banner-3 { background: linear-gradient(160deg, #E4DEEF, #C4B7D9); }
.challenge-card .banner-4 { background: linear-gradient(160deg, #FCEFCD, #F0D68C); }
.challenge-card .banner-5 { background: linear-gradient(160deg, #DFEDF7, #B3D0E8); }
.challenge-card .body {
  padding: 16px 18px 18px;
}
.challenge-card .subhead {
  font-size: 12px; color: var(--ink-muted); font-weight: 600; letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.challenge-card .subhead b { color: var(--ink); font-weight: 800; margin-right: 4px; }
.challenge-card .name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.challenge-card .stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; font-size: 12px; color: var(--ink-muted); font-weight: 500;
}
.challenge-card .price {
  font-size: 14px; color: var(--ink); font-weight: 700;
}
.challenge-card .actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.challenge-card .actions .btn {
  min-height: 46px; padding: 12px 18px; font-size: 12px;
}
.challenge-card.is-added .add-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.85);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.challenge-card.is-added .add-badge svg { width: 12px; height: 12px; }

/* ---------- Photo positioner (Discord-style crop) ---------- */
.crop-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.crop-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
}
.crop-close:hover { background: var(--bg-elevated); color: var(--ink); }
.crop-close svg { width: 18px; height: 18px; }

.crop-viewport {
  position: relative;
  width: 100%;
  height: 340px;
  border-radius: 14px;
  background: #0E0E10;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.crop-viewport:active { cursor: grabbing; }
.crop-viewport img {
  position: absolute;
  left: 50%; top: 50%;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  max-width: none;
}
.crop-mask {
  position: absolute; inset: 0;
  pointer-events: none;
}
.crop-mask::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: var(--size, 240px);
  height: var(--size, 240px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
}

.crop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 0 4px;
}
.crop-ico {
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crop-ico svg { display: block; }
.crop-ico--sm svg { width: 14px; height: 14px; }
.crop-ico--lg svg { width: 20px; height: 20px; }
.crop-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.crop-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  cursor: pointer;
}
.crop-rotate {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .18s ease;
}
.crop-rotate:hover { background: var(--bg-muted); }
.crop-rotate svg { width: 16px; height: 16px; }

/* ---------- Photo upload avatar ---------- */
.avatar-upload {
  position: relative;
  cursor: pointer;
  display: inline-block;
}
.avatar-upload .upload-badge {
  position: absolute; bottom: 4px; right: 4px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--bg);
}
.avatar-upload .upload-badge svg { width: 14px; height: 14px; }
.avatar-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ---------- Number input row (peso, altura, meta) ---------- */
.stat-input-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.stat-input-row .k { font-size: 14px; font-weight: 600; }
.stat-input-row .val {
  display: flex; align-items: baseline; gap: 4px;
}
.stat-input-row .val .n {
  font-size: 20px; font-weight: 800;
  border: 0; padding: 0; margin: 0;
  background: transparent;
  width: 60px; text-align: right;
  outline: none;
}
.stat-input-row .val .n:focus { color: var(--accent); }
.stat-input-row .val .u { font-size: 13px; color: var(--ink-muted); font-weight: 600; }

/* ============================================================
   Immersive workout mode
   ============================================================ */
.workout {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  animation: fadeUp .28s ease;
}
.workout__media {
  position: relative;
  flex: 1 1 auto;
  min-height: 55vh;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.workout__media::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, transparent 40%, rgba(0,0,0,0.65) 100%);
}
.workout__top {
  position: absolute; top: calc(var(--safe-top) + 14px); left: 20px; right: 20px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 3;
}
.workout__close {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.workout__close svg { width: 20px; height: 20px; }
.workout__caption {
  position: absolute; left: 20px; right: 20px; bottom: 26%;
  z-index: 3;
  color: #fff;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.workout__caption .phase {
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.workout__caption .timer {
  font-size: 54px; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 12px rgba(0,0,0,0.4);
  margin-top: 4px;
}
.workout__caption .exname {
  font-size: 16px; font-weight: 500; letter-spacing: -0.005em;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
  max-width: 260px;
  line-height: 1.3;
}
.workout__caption .skip {
  background: rgba(255,255,255,0.95);
  color: #18181B;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  flex-shrink: 0;
}
.workout__panel {
  background: var(--bg);
  padding: 16px 20px calc(var(--safe-bottom) + 20px);
  flex-shrink: 0;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  margin-top: -24px;
  position: relative;
  z-index: 4;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.08);
}
.progress-dots {
  display: flex; gap: 4px;
  margin-bottom: 14px;
}
.progress-dots .dot {
  flex: 1;
  height: 6px;
  border-radius: 2px;
  background: var(--bg-muted);
  transition: background .2s ease;
}
.progress-dots .dot.is-done { background: var(--brand); }
.progress-dots .dot.is-current {
  background: linear-gradient(to right, var(--brand) 0%, var(--brand) 50%, var(--bg-muted) 50%);
}
.workout__stats {
  display: grid; grid-template-columns: 1fr 1px 1fr;
  gap: 14px;
  padding: 4px 4px 14px;
  align-items: center;
}
.workout__stats .divider { background: var(--border-soft); height: 30px; }
.workout__stats .col { text-align: left; }
.workout__stats .col:last-child { text-align: right; }
.workout__stats .v { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.workout__stats .l { font-size: 10px; color: var(--ink-muted); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; margin-top: 2px; }
.workout__nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.workout__nav .btn-nav {
  min-height: 50px;
  padding: 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
}
.workout__nav .btn-nav.is-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.workout__nav .btn-nav.is-primary:hover { background: var(--brand-2); }
.workout__nav .btn-nav:disabled { opacity: 0.4; }
.workout__nav .btn-nav:active { transform: scale(.98); }
.workout__next-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.workout__next-card .thumb {
  width: 60px; height: 60px;
  border-radius: 12px;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.workout__next-card .info { flex: 1; min-width: 0; }
.workout__next-card .info .k {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 700;
}
.workout__next-card .info .n {
  font-size: 14px; font-weight: 700; line-height: 1.25;
  margin-top: 2px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.workout__next-card .info .meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
}
.workout__next-card .meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-muted);
  padding: 3px 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.workout__next-card .meta-chip svg { width: 11px; height: 11px; }
.workout__next-card .counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: 8px;
  flex-shrink: 0;
}

.workout__pause {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  color: #FEF9FB;
  flex-direction: column;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Loading screen (before workout starts) ---------- */
.workout-loading {
  position: fixed; inset: 0;
  max-width: 480px;
  margin: 0 auto;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: center;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: fadeUp .3s ease;
}
.workout-loading::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.workout-loading .content {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 0 30px;
}
.workout-loading .content h2 {
  font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: #fff;
  text-shadow: 0 3px 14px rgba(0,0,0,0.35);
}
.workout-loading .content .dots {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 24px;
}
.workout-loading .content .dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: pulseDot 1.4s ease-in-out infinite;
}
.workout-loading .content .dots span:nth-child(2) { animation-delay: 0.2s; }
.workout-loading .content .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulseDot {
  0%, 60%, 100% { transform: scale(1); opacity: 0.3; }
  30% { transform: scale(1.3); opacity: 1; }
}

/* ============================================================
   Treinos catalog + list + favorites
   ============================================================ */

/* Category cards */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  text-align: left;
  width: 100%;
  transition: transform .12s ease, background .18s ease;
}
.cat-row:active { transform: scale(.99); }
.cat-thumb {
  width: 72px; height: 72px;
  border-radius: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.cat-thumb-img {
  position: absolute; inset: 0;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: 30% center;
  opacity: 0.9;
}
.cat-body { flex: 1; min-width: 0; }
.cat-body .cat-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.cat-body .cat-count { font-size: 13px; color: var(--ink-muted); margin-top: 2px; font-weight: 500; }
.cat-arrow { color: var(--ink-faint); }
.cat-arrow svg { width: 20px; height: 20px; }

/* Badge dot on iconbtn (e.g. favorites count) */
.iconbtn .badge-dot {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* Workout list rows */
.treino-list {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.treino-row {
  display: flex; align-items: center;
  padding: 12px 14px;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.treino-row:last-child { border-bottom: 0; }
.treino-open {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: none; padding: 0; text-align: left;
  min-width: 0;
}
.treino-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  background-image: url('images/day-bg.png');
  background-size: cover;
  background-position: 30% center;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.treino-thumb-badge {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.treino-thumb-badge svg { width: 12px; height: 12px; }
.treino-thumb-badge--done { background: #6B9B6F; color: #fff; }
.treino-thumb-badge--done svg { stroke-width: 3.4; }
.treino-thumb-badge--lock { background: rgba(0,0,0,0.85); color: #FFFFFF; }

.treino-info { flex: 1; min-width: 0; }
.treino-info .treino-day {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 700;
}
.treino-info .treino-name {
  font-size: 15px; font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.treino-info .treino-meta {
  font-size: 12px; color: var(--ink-muted); margin-top: 3px; font-weight: 500;
}
.treino-info .treino-meta .dot { color: var(--border); margin: 0 4px; }

.treino-fav {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  border-radius: 50%;
  transition: color .2s ease, background .2s ease, transform .12s ease;
  flex-shrink: 0;
}
.treino-fav svg { width: 22px; height: 22px; }
.treino-fav.is-on { color: #B8563D; }
.treino-fav:active { transform: scale(1.15); }

.treino-arrow { color: var(--ink-faint); flex-shrink: 0; }
.treino-arrow svg { width: 16px; height: 16px; }

.treino-row.is-locked .treino-open { opacity: 0.55; }
.treino-row.is-done .treino-name { color: var(--ink-muted); }

/* Empty state (no favorites) */
.empty-state {
  padding: 40px 20px 40px;
  text-align: center;
}
.empty-state .empty-ico {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--ink-faint);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.empty-state .empty-ico svg { width: 34px; height: 34px; }
.empty-state h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Larger viewport frame ---------- */
@media (min-width: 500px) {
  body { background: #E7DAC4; }
  #app { box-shadow: 0 0 60px rgba(0,0,0,0.14); }
  .bottomnav { border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); }
  .workout { box-shadow: 0 0 60px rgba(0,0,0,0.2); }
}

/* ============================================================
   Auth pages (cadastro / login / recuperar / nova-senha)
   ============================================================ */
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 32px);
  max-width: 480px; margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}
.auth-brand .dot {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  letter-spacing: -0.02em;
}
.auth-brand .name {
  font-size: 14px; font-weight: 700; letter-spacing: -0.005em;
}
.auth-brand .name .sub {
  display: block; font-size: 11px; color: var(--ink-muted);
  font-weight: 500; letter-spacing: 0.02em; margin-top: 1px;
}
.auth-hero { margin: 8px 0 22px; }
.auth-hero h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.15; color: var(--ink);
  margin: 0;
}
.auth-hero p {
  font-size: 14px; color: var(--ink-muted);
  margin: 8px 0 0; line-height: 1.5;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.auth-input, .auth-field input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .18s ease, background .18s ease;
  outline: none;
  -webkit-appearance: none;
}
.auth-input:focus, .auth-field input:focus {
  border-color: var(--brand);
  background: var(--bg-elevated);
}
.auth-input::placeholder, .auth-field input::placeholder {
  color: var(--ink-faint);
}
.auth-password {
  position: relative;
  display: flex; align-items: center;
}
.auth-password input {
  padding-right: 46px;
  flex: 1;
}
.auth-password .toggle {
  position: absolute; right: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.auth-password .toggle:hover { background: var(--bg-muted); color: var(--ink); }
.auth-password .toggle svg { width: 18px; height: 18px; }

.auth-help {
  font-size: 13px; color: var(--ink-muted);
  text-align: right;
  margin-top: -4px;
}
.auth-help a { color: var(--brand); font-weight: 600; }
.auth-help a:hover { color: var(--brand-2); }

.auth-submit {
  margin-top: 8px;
  padding: 16px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 54px;
  transition: background .15s ease, transform .12s ease;
  cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: var(--brand-2); }
.auth-submit:active:not(:disabled) { transform: scale(.99); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }

.auth-err {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 4px;
  min-height: 18px;
}
.auth-footer {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.auth-footer a { color: var(--brand); font-weight: 600; }
.auth-footer a:hover { color: var(--brand-2); }

.auth-checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  font-size: 12px; color: var(--ink-muted);
  line-height: 1.45;
}
.auth-checkbox input { accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }
.auth-checkbox a { color: var(--brand); font-weight: 600; }

/* Success screen (post reset password / signup confirmation) */
.auth-success {
  text-align: center;
  padding: 40px 20px;
}
.auth-success .icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(16,185,129,0.12);
  color: var(--success);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.auth-success .icon svg { width: 34px; height: 34px; stroke-width: 2.8; }
.auth-success h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-success p { font-size: 14px; color: var(--ink-muted); line-height: 1.5; }

@media (min-width: 500px) {
  .auth-page {
    box-shadow: 0 0 60px rgba(0,0,0,0.14);
    background: var(--bg-card);
  }
}

/* ---------- Theme toggle icon ---------- */
.theme-toggle svg {
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.theme-toggle:active svg {
  transform: rotate(180deg) scale(0.9);
}

/* ============================================================
   Dark theme overrides for hardcoded values
   ============================================================ */
/* Applied when explicitly dark */
:root[data-theme="dark"] .day-item.is-today {
  background: linear-gradient(135deg, rgba(207,71,126,0.14), rgba(207,71,126,0.06));
}
:root[data-theme="dark"] .day-thumb.is-locked .th::before {
  background: rgba(14,14,17,0.55);
}
@media (min-width: 500px) {
  :root[data-theme="dark"] body { background: #050506; }
}

/* Applied when system is dark AND user hasn't picked light explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .day-item.is-today {
    background: linear-gradient(135deg, rgba(207,71,126,0.14), rgba(207,71,126,0.06));
  }
  :root:not([data-theme="light"]) .day-thumb.is-locked .th::before {
    background: rgba(14,14,17,0.55);
  }
  @media (min-width: 500px) {
    :root:not([data-theme="light"]) body { background: #050506; }
  }
}
