/* ============================================================
   Base + componentes. Estilo por classe; as telas ficam limpas.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
p { margin: 0; }
a { color: var(--honey); text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- app frame --- */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100%; position: relative; }
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.screen__body { flex: 1; padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.screen__body--scroll { overflow-y: auto; }

/* --- text helpers --- */
.h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; margin: 0; }
.h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; margin: 0; }
.h4 { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 600; line-height: 1.25; margin: 0; }
.label { font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--ls-label); color: var(--ink-mute); text-transform: uppercase; }
.body { color: var(--ink-body); }
.soft { color: var(--ink-soft); }
.mute { color: var(--ink-mute); font-size: var(--fs-xs); }
.num { font-family: var(--font-display); font-weight: 600; }

/* --- top bar --- */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4);
  background: var(--bg); box-shadow: 0 1px 0 var(--chip-bg); flex-shrink: 0; }
.topbar__brand { flex: 1; line-height: 1.1; }
.topbar__brand small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 2.4px; color: var(--ink-mute); }
.topbar__brand span { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 600; }
.topbar__mark { width: 34px; height: 34px; border-radius: 11px; background: var(--surface); color: var(--honey);
  display: grid; place-items: center; flex-shrink: 0; }

/* --- back header (detalhe) --- */
.header { height: 56px; background: var(--bg); box-shadow: 0 1px 0 var(--chip-bg);
  display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.header__back { position: absolute; left: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink); cursor: pointer; }
.header__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }

/* --- bottom nav --- */
.nav { height: var(--nav-h); background: var(--bg); box-shadow: 0 -1px 0 var(--chip-bg);
  display: flex; padding: 12px 8px 18px; flex-shrink: 0; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: var(--fs-label); font-weight: 500; color: var(--ink-mute); }
.nav a.is-active { color: var(--honey); font-weight: 600; }

/* --- card / row --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.card--feature { border-radius: var(--r-feature); box-shadow: var(--sh-2); }
.card--flat { padding: var(--s4); }
.card--active { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.card--dark { background: #2A2119; border-color: #2A2119; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-row);
  padding: 13px 15px; display: flex; align-items: center; gap: var(--s3); }
.row--muted { background: var(--surface-2); border-color: var(--chip-bg); opacity: .6; }
.row__grow { flex: 1; min-width: 0; }
.row__grow .h4 { font-size: 15px; }
.row__sub { font-size: var(--fs-xs); color: var(--ink-mute); }

/* --- icon chip --- */
.chip-i { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--chip-bg); color: var(--honey); }
.chip-i--sm { width: 38px; height: 38px; border-radius: 11px; }
.chip-i--cover { background: var(--cover); }
.chip-i--cover-w { background: var(--cover-warm); }
.chip-i--green { background: var(--green-tint); color: #2ED88F; }

/* --- chip / pill --- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; background: var(--honey-tint); color: var(--honey-text); }
.pill--surface { background: var(--surface); color: var(--honey-text); }
.pill--xp { padding: 4px 9px; font-size: var(--fs-label); }

/* --- buttons --- */
.btn { height: 52px; border: 0; border-radius: 15px; font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn--primary { background: var(--grad-honey); color: var(--on-honey); box-shadow: 0 16px 30px -14px rgba(228,171,76,.45); }
.btn--secondary { background: var(--chip-bg); color: var(--honey); font-weight: 600; height: 48px; }
.btn--wa { background: var(--whatsapp); color: var(--wa-ink); height: 56px; font-size: var(--fs-h4); }
.btn--text { background: none; color: var(--honey); font-weight: 600; height: auto; width: auto; }
.btn-group { display: flex; gap: 10px; }
.btn-group .btn { flex: 1; }

/* --- progress --- */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-inset); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--honey-deep), var(--honey)); }
.segbar { display: flex; gap: 5px; }
.segbar > i { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--chip-bg); }
.segbar > i.is-done { background: var(--honey-deep); }
.segbar > i.is-now  { background: linear-gradient(90deg, var(--honey-deep), var(--honey)); }

/* --- ring --- */
.ring { position: relative; display: grid; place-items: center; }
.ring__track { fill: none; stroke: var(--line); }
.ring__fill  { fill: none; stroke: var(--honey); stroke-linecap: round; }
.ring__label { position: absolute; text-align: center; }

/* --- checklist --- */
.check { display: flex; align-items: center; gap: 11px; }
.check__box { width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; box-shadow: inset 0 0 0 2px #5A503E; }
.check.is-done .check__box { background: var(--ok); box-shadow: none; color: #fff; display: grid; place-items: center; }
.check.is-done .check__label { color: var(--ink-mute); text-decoration: line-through; }

/* --- accordion --- */
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-row); overflow: hidden; }
.acc.is-open { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.acc__head { display: flex; align-items: center; gap: var(--s3); padding: 13px 15px; cursor: pointer; }
.acc__body { padding: 0 15px 15px 50px; display: flex; flex-direction: column; gap: 12px; }

/* --- carousel --- */
.carousel { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4);
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; flex-shrink: 0; }

/* --- states --- */
.state { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-soft); }
.skl { background: var(--surface); border-radius: var(--r-card); position: relative; overflow: hidden; }
.skl::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  transform: translateX(-100%); animation: skl 1.4s infinite; }
@keyframes skl { to { transform: translateX(100%); } }

/* --- timeline (jornada) --- */
.tl { position: relative; padding-left: 40px; }
.tl::before { content: ""; position: absolute; left: 17px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl__item { position: relative; padding-bottom: 18px; }
.tl__item:last-child { padding-bottom: 0; }
.tl__dot { position: absolute; left: -40px; top: -2px; width: 36px; height: 36px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; color: var(--ink-mute); }
.tl__item.is-done .tl__dot { background: var(--ok); box-shadow: none; color: #fff; }
.tl__item.is-now .tl__dot { box-shadow: inset 0 0 0 2px var(--honey), 0 0 0 5px rgba(228,171,76,.12); color: var(--honey); }

/* --- heatmap de racha --- */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.heat i { width: 100%; aspect-ratio: 1; border-radius: 4px; background: var(--chip-bg); display: block; }
.heat i.l1 { background: rgba(228,171,76,.28); }
.heat i.l2 { background: rgba(228,171,76,.60); }
.heat i.l3 { background: var(--honey); }
.heat i.is-today { box-shadow: 0 0 0 2px var(--honey); }

/* --- níveis --- */
.levels { display: flex; gap: 6px; }
.levels i { flex: 1; height: 6px; border-radius: 999px; background: var(--chip-bg); }
.levels i.on { background: var(--grad-honey); }
.levels i.now { background: var(--grad-honey); box-shadow: 0 0 0 3px rgba(228,171,76,.14); }

/* --- segmented switch --- */
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; color: var(--ink-mute); font-weight: 600; font-size: 12px;
  padding: 8px 4px; border-radius: 9px; cursor: pointer; }
.seg button.is-on { background: var(--chip-bg); color: var(--ink); }

/* --- mood check-in --- */
.mood { display: flex; gap: 8px; }
.mood button { flex: 1; border: 0; border-radius: 12px; padding: 13px 4px; background: var(--surface-inset);
  color: var(--ink-mute); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; line-height: 1.2; }
.mood button.is-on { background: var(--chip-bg); color: var(--honey); box-shadow: inset 0 0 0 1.5px var(--honey-deep); }

/* --- prep mode (pantalla completa) --- */
.prep { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; padding: 22px; }
.prep__top { display: flex; justify-content: space-between; align-items: center; }
.prep__body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 22px; padding: 20px 8px; }
.prep__n { font-family: var(--font-display); font-size: 60px; font-weight: 500; color: var(--honey); line-height: 1; }
.prep__t { font-family: var(--font-display); font-size: 25px; font-weight: 500; line-height: 1.35; max-width: 18ch; }
.prep__dots { display: flex; gap: 7px; justify-content: center; }
.prep__dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--chip-bg); }
.prep__dots i.on { background: var(--honey); }

/* --- menu / lista --- */
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 16px 4px; color: var(--ink);
  font-weight: 500; font-size: 16px; }
.menu-list a + a { border-top: 1px solid var(--line); }
.menu-list .chip-i { background: var(--chip-bg); color: var(--honey); }

/* --- onboarding --- */
.ob { min-height: 100vh; display: flex; flex-direction: column; padding: 40px 28px 28px; text-align: center; align-items: center; }
.ob__art { width: 88px; height: 88px; border-radius: 26px; background: var(--surface); color: var(--honey);
  display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(228,171,76,.16), 0 24px 50px -16px rgba(228,171,76,.3); }

/* --- misc --- */
.stack { display: flex; flex-direction: column; }
.gap2 { gap: var(--s2); } .gap3 { gap: var(--s3); } .gap4 { gap: var(--s4); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.hr { height: 1px; background: var(--chip-bg); }
