:root {
  --bg: #f5f4ef; --card: #ffffff; --ink: #1d2a21; --muted: #6c766e; --line: #e7e6df;
  --sage: #5c7d61; --sage-d: #3f5c45; --sage-2: #9db59f; --sage-l: #e5ede2; --sand: #d9b58c;
  --red: #d8574e; --orange: #eea35a; --body: #e9e6de; --body-m: #dcd8cd;
  --fig: #2f4a35; --fig-far: #9fb5a2; --fig-top: #5c7d61;
  --r: 22px; --shadow: 0 10px 30px -12px rgba(40, 60, 45, .25);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: #e8e7e0; }
body { background: var(--bg); max-width: 440px; margin: 0 auto; min-height: 100dvh; }
@media (min-width: 600px) { body { box-shadow: 0 0 60px rgba(0,0,0,.08); } }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1 { font-size: 27px; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 20px; letter-spacing: -.01em; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.ic { width: 22px; height: 22px; flex: none; }
.link { color: var(--sage); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.link .ic { width: 16px; height: 16px; }

/* botones */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--sage); color: #fff; font-weight: 700; padding: 14px 20px; border-radius: 16px; transition: transform .15s, background .2s; box-shadow: 0 8px 20px -10px var(--sage-d); }
.btn:active { transform: scale(.97); }
.btn:disabled { background: #b9c4ba; box-shadow: none; }
.btn-lg { padding: 17px 22px; font-size: 16.5px; width: 100%; }
.btn .ic { width: 20px; height: 20px; }
.btn-ghost { background: transparent; color: var(--sage-d); box-shadow: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.icon-btn.fav { color: var(--red); }
.icon-btn.lg { width: 54px; height: 54px; border-radius: 18px; }
.chip { padding: 9px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip .ic { width: 16px; height: 16px; }
.chip.on { background: var(--sage); color: #fff; border-color: var(--sage); }
.chip.big { padding: 13px 18px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.seg { display: flex; background: var(--sage-l); border-radius: 16px; padding: 4px; gap: 4px; }
.seg .chip { flex: 1; justify-content: center; border: 0; background: transparent; padding: 10px 6px; color: var(--sage-d); }
.seg .chip.on { background: var(--sage); color: #fff; box-shadow: 0 4px 12px -6px var(--sage-d); }
.tag { display: inline-block; background: var(--sage-l); color: var(--sage-d); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; letter-spacing: .02em; }
.tag.soft { background: #f3ece2; color: #8a6a43; }
.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card.soft { background: var(--sage-l); box-shadow: none; }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-h { display: flex; align-items: center; gap: 12px; }
.input { width: 100%; padding: 15px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 16px; }
.input:focus { outline: 2px solid var(--sage-2); }

/* figuras (renders y 3D de Blender) */
.fig-wrap { display: block; }
.fig-wrap > * { display: block; width: 100%; height: 100%; object-fit: contain; }
model-viewer { --poster-color: transparent; --progress-bar-color: var(--sage); background: transparent; }

/* página */
.page { padding: 20px 20px 110px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.top .muted { margin-top: 3px; }
.sec { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: -6px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sage-2), var(--sage)); color: #fff; font-weight: 800; font-size: 18px; box-shadow: var(--shadow); }
.avatar.lg { width: 70px; height: 70px; font-size: 28px; }

/* bienvenida */
.welcome { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; }
.welcome-art { position: relative; background: linear-gradient(170deg, #dfe9db 0%, #c9d9c6 60%, #b7cbb4 100%); border-radius: 0 0 40px 40px; overflow: hidden; display: grid; place-items: center; padding: 50px 30px 10px; }
.welcome-art .fig-wrap { width: min(300px, 80%); aspect-ratio: 1; position: relative; z-index: 1; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.b1 { width: 260px; height: 260px; background: rgba(255,255,255,.45); top: 18%; left: 50%; transform: translateX(-50%); }
.b2 { width: 90px; height: 90px; background: rgba(217,181,140,.45); top: 12%; right: 12%; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(16px); } }
.welcome-txt { padding: 28px 24px 34px; display: grid; gap: 14px; }
.welcome-txt h1 { font-size: 34px; }
.brand { font-weight: 800; color: var(--sage); letter-spacing: .25em; text-transform: uppercase; font-size: 13px; }

/* onboarding */
.onb { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: 16px 20px 24px; gap: 18px; }
.onb-head { display: flex; align-items: center; gap: 14px; }
.steps { flex: 1; height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; }
.steps i { display: block; height: 100%; background: var(--sage); border-radius: 9px; transition: width .4s; }
.onb-body { display: grid; gap: 14px; align-content: start; }
.onb-body h2 { font-size: 17px; margin-top: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.opt { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 8px; display: grid; justify-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-align: center; transition: .2s; }
.opt .ic { width: 28px; height: 28px; color: var(--sage); }
.opt.on { border-color: var(--sage); background: var(--sage-l); box-shadow: 0 0 0 3px rgba(92,125,97,.15); }
.opt.row { justify-items: start; text-align: left; padding: 18px; font-size: 15px; gap: 4px; }
.opt.row span { font-weight: 500; font-size: 13.5px; }

/* listo / fin */
.listo { min-height: 100dvh; padding: 50px 22px 30px; display: grid; gap: 16px; align-content: center; text-align: center; position: relative; overflow: hidden; }
.check-big { width: 76px; height: 76px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; margin: 0 auto 4px; box-shadow: 0 0 0 10px var(--sage-l); animation: pop .5s cubic-bezier(.3,1.6,.6,1); }
.check-big .ic { width: 38px; height: 38px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.hero-mini { display: flex; align-items: center; gap: 14px; text-align: left; margin: 8px 0; }
.hero-mini .fig-wrap { width: 92px; height: 92px; background: var(--sage-l); border-radius: 18px; flex: none; padding: 6px; }
.hero-mini h3 { margin: 6px 0 2px; }
.kpis { display: flex; gap: 12px; }
.kpis > div { flex: 1; background: var(--card); border-radius: 16px; padding: 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; box-shadow: var(--shadow); }
.kpis .ic { color: var(--sage); }
.kpis.three > div { flex-direction: column; gap: 2px; padding: 16px 8px; }
.kpis.three b { font-size: 26px; }
.kpis.three span { font-size: 12px; color: var(--muted); }
.confetti i { position: absolute; top: -20px; left: calc(var(--k) * 5.5%); width: 8px; height: 14px; border-radius: 3px; background: var(--sage-2); animation: fall 2.8s calc(var(--k) * -.17s) ease-in forwards; opacity: .8; }
.confetti i:nth-child(3n) { background: var(--sand); }
.confetti i:nth-child(4n) { background: var(--orange); }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: 0; } }

/* inicio */
.streak { display: flex; align-items: center; gap: 6px; background: #fbf1e4; color: #8a5a22; padding: 10px 14px; border-radius: 14px; font-size: 14px; margin-top: -6px; }
.streak .ic { color: #e07b2c; width: 20px; height: 20px; }
.streak span { font-weight: 600; }
.streak.zero { background: var(--sage-l); color: var(--sage-d); }
.streak.zero .ic { color: var(--sage); }
.hero { padding: 0; overflow: hidden; position: relative; display: block; }
.hero-art { overflow: hidden; background: linear-gradient(160deg, #e4ece0, #c8d8c4); height: 210px; display: grid; place-items: center; }
.hero-art .fig-wrap { width: 230px; height: 200px; }
.hero-txt { padding: 16px 18px 20px; display: grid; gap: 6px; padding-right: 76px; }
.hero-txt h2 { font-size: 21px; }
.hero-txt p { font-size: 14px; }
.fab { position: absolute; right: 18px; top: 182px; width: 56px; height: 56px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 20px -8px var(--sage-d); }
.cats4, .time4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat-sm { display: grid; gap: 6px; justify-items: center; font-size: 12px; font-weight: 600; }
.cat-sm .fig-wrap { width: 100%; aspect-ratio: 1; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); }
.time { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 0; display: grid; justify-items: center; transition: .2s; }
.time b { font-size: 22px; }
.time span { font-size: 12px; color: var(--muted); }
.time.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.time.on span { color: #dfe9dc; }
.cta-lib { display: flex; align-items: center; gap: 14px; }
.cta-lib > .ic:first-child { color: var(--sage); width: 28px; height: 28px; }
.cta-lib div { flex: 1; }

/* filas */
.row-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 18px; padding: 10px 14px 10px 10px; box-shadow: 0 4px 14px -10px rgba(40,60,45,.35); }
.row-card .fig-wrap { width: 62px; height: 62px; border-radius: 14px; background: var(--sage-l); padding: 4px; flex: none; }
.row-card > div:not(.fig-wrap) { flex: 1; min-width: 0; }
.row-card > .ic { color: var(--muted); }
.row-card.rest { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); padding: 16px; }
.done { width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; flex: none; }
.done .ic { width: 17px; height: 17px; stroke-width: 2.6; }
.mini-play { width: 34px; height: 34px; border-radius: 50%; background: var(--sage-l); color: var(--sage); display: grid; place-items: center; }
.mini-play .ic { width: 16px; height: 16px; }

/* biblioteca */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 0 14px; border: 1px solid var(--line); }
.search .ic { color: var(--muted); width: 20px; }
.search input { flex: 1; border: 0; padding: 14px 0; font: inherit; font-size: 15px; background: none; outline: none; min-width: 0; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat { display: grid; gap: 4px; justify-items: center; font-size: 11.5px; font-weight: 600; }
.cat .fig-wrap { width: 100%; aspect-ratio: 1; background: var(--card); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--sage); color: #fff; padding: 6px 8px 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; justify-self: start; }
.filter-pill button { color: #fff; display: grid; }
.filter-pill .ic { width: 16px; height: 16px; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ex-card { background: var(--card); border-radius: 20px; padding: 10px 10px 14px; display: grid; gap: 4px; box-shadow: 0 4px 14px -10px rgba(40,60,45,.35); align-content: start; }
.ex-card .fig-wrap { aspect-ratio: 1.15; background: linear-gradient(160deg, #eef3ec, #dde8da); border-radius: 14px; margin-bottom: 6px; padding: 6px; }
.ex-card b { font-size: 14.5px; line-height: 1.25; }
.mtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mtags i { font-style: normal; font-size: 11px; font-weight: 600; background: #fbe9e7; color: #b8443c; padding: 3px 8px; border-radius: 999px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 10px; }

/* detalle */
.detail { padding-top: 12px; padding-bottom: 120px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stage { background: linear-gradient(165deg, #eaf0e7, #d3e1cf); border-radius: 28px; aspect-ratio: 1.2; display: grid; place-items: center; padding: 14px; }
.stage .fig-wrap, .stage > .fig { width: 100%; height: 100%; }
.detail h1 { margin-bottom: -10px; }
.pasos { padding: 0; list-style: none; counter-reset: p; display: grid; gap: 12px; }
.pasos li { counter-increment: p; display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.pasos li::before { content: counter(p); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sage-l); color: var(--sage-d); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.tip { background: var(--sage); color: #fff; margin-top: 16px; box-shadow: none; }
.tip p { margin-top: 4px; opacity: .92; line-height: 1.45; }
.errs, .bens { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 12px; }
.errs li, .bens li { display: flex; gap: 10px; align-items: center; line-height: 1.35; }
.errs .ic { color: var(--red); width: 18px; height: 18px; background: #fbe9e7; border-radius: 50%; padding: 3px; }
.bens .ic { color: #fff; width: 20px; height: 20px; background: var(--sage); border-radius: 50%; padding: 3px; stroke-width: 2.6; }
[data-pane] { display: grid; gap: 4px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.map { display: grid; gap: 12px; justify-items: center; }
.bodymap { width: 100%; max-width: 330px; }
.silueta * { fill: var(--body); }
.m-0 * { fill: var(--body-m); }
.m-p * { fill: var(--red); }
.m-s * { fill: var(--orange); }
.bm-label { font-size: 11px; fill: var(--muted); font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lg { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.lg.p { background: #fbe4e2; color: #b03a32; }
.lg.s { background: #fdf0e0; color: #a5631d; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dot.p { background: var(--red); } .dot.s { background: var(--orange); }
.adapt { display: grid; gap: 8px; justify-items: start; margin-bottom: 10px; }
.disclaimer { line-height: 1.5; padding: 0 4px; }
.sticky-cta { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 440px); padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }

/* reproductor */
.player { min-height: 100dvh; padding: 14px 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; background: linear-gradient(180deg, #edf2ea, var(--bg) 60%); }
.player .bar .center { flex: 1; }
.segbar { display: flex; gap: 4px; }
.segbar i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.segbar i b { display: block; height: 100%; width: 0; background: var(--sage); }
.segbar i.full b { width: 100% !important; }
.stage.big { aspect-ratio: 1.2; padding-bottom: 64px; background: #fff; box-shadow: var(--shadow); }
.ring-wrap { position: relative; width: 124px; height: 124px; margin: -60px auto 0; background: var(--bg); border-radius: 50%; padding: 6px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: #fff; stroke: var(--sage-l); stroke-width: 8; }
.ring #arc { fill: none; stroke: var(--sage); stroke-linecap: round; stroke-dasharray: 326.7; transition: stroke-dashoffset .2s linear; }
.ring #arc.prep { stroke: var(--sand); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 28px; font-variant-numeric: tabular-nums; }
.player h2 { font-size: 23px; }
.player #ptip { font-size: 14.5px; line-height: 1.45; margin-top: -8px; min-height: 42px; }
.controls { display: flex; justify-content: center; align-items: center; gap: 26px; }
.btn-round { width: 76px; height: 76px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 24px -10px var(--sage-d); }
.btn-round .ic { width: 30px; height: 30px; }
.next-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 10px 14px 10px 10px; box-shadow: var(--shadow); }
.next-card .fig-wrap { width: 56px; height: 56px; background: var(--sage-l); border-radius: 14px; padding: 4px; }
.next-card div:last-child { display: grid; }

/* plan */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: grid; justify-items: center; gap: 2px; padding: 10px 0 8px; border-radius: 16px; background: var(--card); font-size: 12px; color: var(--muted); }
.wd b { font-size: 17px; color: var(--ink); }
.wd i { width: 6px; height: 6px; border-radius: 50%; }
.wd.hecho i { background: var(--sage); }
.wd.today { background: var(--sage); color: #dfe9dc; }
.wd.today b { color: #fff; }
.wd.today.hecho i { background: #fff; }
.meta { display: grid; gap: 10px; }
.bar-p { height: 8px; border-radius: 9px; background: #fff; overflow: hidden; }
.bar-p i { display: block; height: 100%; background: var(--sage); border-radius: 9px; }
.plan-row { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 8px; }
.pd { font-size: 13px; font-weight: 700; color: var(--muted); }
.plan-row.today .pd { color: var(--sage); }
.plan-row.today .row-card { outline: 2px solid var(--sage); }

/* progreso */
.stat { display: grid; gap: 4px; align-content: start; }
.stat > .ic { color: var(--sage); }
.stat.warm > .ic { color: #e07b2c; }
.big { font-size: 30px; letter-spacing: -.02em; }
.big small { font-size: 15px; color: var(--muted); font-weight: 600; }
.up { color: var(--sage); font-weight: 700; }
.down { color: var(--red); font-weight: 700; }
.donut-mini { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(var(--card) 55%, transparent 56%), conic-gradient(var(--sage) var(--p), var(--sage-l) 0); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 120px; align-items: end; margin-top: 14px; }
.bars .b { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; justify-items: center; }
.bars .b i { width: 100%; max-width: 26px; align-self: end; background: var(--sage-2); border-radius: 8px; min-height: 4px; }
.bars .b.today i { background: var(--sage); }
.bars span { font-size: 11px; color: var(--muted); font-weight: 600; }
.dist .row-h { margin-top: 12px; gap: 20px; }
.donut { width: 110px; height: 110px; border-radius: 50%; flex: none; -webkit-mask: radial-gradient(transparent 52%, #000 53%); mask: radial-gradient(transparent 52%, #000 53%); }
.dist ul { list-style: none; padding: 0; display: grid; gap: 10px; flex: 1; }
.dist li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dist li i { width: 10px; height: 10px; border-radius: 3px; }
.dist li b { margin-left: auto; }
.hist { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.empty-big { display: grid; gap: 14px; text-align: center; justify-items: center; padding: 26px 20px; }
.empty-big .fig-wrap { width: 160px; height: 160px; background: var(--sage-l); border-radius: 50%; padding: 14px; }

/* perfil */
.me { display: flex; align-items: center; gap: 16px; }
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 15px 16px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.list > *:last-child { border: 0; }
.list .ic:first-child { color: var(--sage); }
.list span { flex: 1; }
.list b { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.list > * > .ic:last-child { color: #b7bdb6; width: 18px; }
#borrar { color: var(--red); }
#borrar .ic { color: var(--red) !important; }

/* barra de pestañas */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 440px); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar a { display: grid; justify-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: #9aa39b; padding: 4px 0; }
.tabbar a.on { color: var(--sage); }
.tabbar a.on .ic { background: var(--sage-l); border-radius: 12px; padding: 3px 14px; box-sizing: content-box; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
