
/* ---------- Tokens de marca (identidad oficial Alento) ---------- */
:root {
  /* Paleta oficial */
  --azul: #1E3FFF;        /* Azul Fôlego · primaria, botones */
  --noite: #0A0F3C;       /* Azul Noite · texto, fondos oscuros */
  --menta: #3EE0B5;       /* Menta · sol, acento positivo */
  --nevoa: #B9C8FF;       /* Névoa · texto sobre azul */
  --ar: #EEF3FF;          /* Ar · fondos de tarjeta */
  --respiracao: #8E9DFF;  /* Curva de la respiración (recomienzos, nunca rojo) */

  /* Alias heredados (mismo nombre, valor oficial) */
  --verde: var(--azul);
  --salvia: var(--respiracao);
  --marfil: #FFFFFF;
  --melocoton: var(--menta);

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: var(--ar);
  --ink: var(--noite);
  --ink-2: #4A5185;
  --muted: #4A5185;
  --line: #D5DCF5;
  --brand: var(--azul);
  --brand-hover: #1530CC;
  --brand-ink: #FFFFFF;
  --accent: var(--menta);
  --accent-ink: var(--noite);
  --chart-1: var(--azul);
  --chart-2: var(--menta);
  --grid: #D5DCF5;
  --danger: #A9402C;
  --ok: var(--azul);
  --focus: var(--azul);
  --shadow: 0 1px 2px rgba(10, 15, 60, .04), 0 8px 24px rgba(10, 15, 60, .06);
  --radius: 22px;
  --radius-sm: 16px;
  --font-title: 'Varela', system-ui, sans-serif;
  --font-text: 'Figtree', system-ui, sans-serif;

  /* Movimiento oficial */
  --motion-fast: 250ms;
  --motion-base: 600ms;
  --motion-slow: 1100ms;
  --ease-out: cubic-bezier(.22,.7,.12,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--noite); --surface: #131A45; --surface-2: #1B2352; --ink: #FFFFFF; --ink-2: var(--nevoa);
    --muted: var(--respiracao); --line: #2A3370; --brand: var(--azul); --brand-hover: #4D63FF; --brand-ink: #FFFFFF;
    --accent-ink: var(--noite); --chart-1: var(--respiracao); --chart-2: var(--menta); --grid: #2A3370; --danger: #E58B76;
    --ok: var(--nevoa); --focus: var(--respiracao); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--noite); --surface: #131A45; --surface-2: #1B2352; --ink: #FFFFFF; --ink-2: var(--nevoa);
  --muted: var(--respiracao); --line: #2A3370; --brand: var(--azul); --brand-hover: #4D63FF; --brand-ink: #FFFFFF;
  --accent-ink: var(--noite); --chart-1: var(--respiracao); --chart-2: var(--menta); --grid: #2A3370; --danger: #E58B76;
  --ok: var(--nevoa); --focus: var(--respiracao); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

/* Secciones oscuras con el fondo de marca, independientes del tema */
.theme-deep {
  --bg: var(--noite); --surface: rgba(238, 243, 255, .07); --surface-2: rgba(238, 243, 255, .12);
  --ink: #FFFFFF; --ink-2: var(--nevoa); --muted: var(--respiracao); --line: rgba(185, 200, 255, .25);
  --brand: var(--menta); --brand-hover: #6BEBCB; --brand-ink: var(--noite); --focus: var(--nevoa);
  --chart-1: var(--menta); --chart-2: var(--respiracao); --grid: rgba(185, 200, 255, .18);
  color: var(--ink);
  background: linear-gradient(140deg, var(--noite) 0%, var(--azul) 140%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 400 16px/1.55 var(--font-text); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 400; line-height: 1.2; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }
.stack > * + * { margin-top: var(--gap, 16px); }

.eyebrow {
  font: 500 11px/1.3 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.title-xl { font-size: clamp(32px, 6vw, 56px); font-weight: 400; letter-spacing: -.02em; }
.title-lg { font-size: clamp(26px, 4.4vw, 38px); font-weight: 400; }
.title-md { font-size: clamp(21px, 3vw, 26px); }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__mark { width: 30px; height: auto; }
.brand__logo { height: 26px; width: auto; }
.brand__name { font: 400 22px/1 var(--font-title); letter-spacing: .01em; }

.site-header {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.site-header--clear { position: absolute; inset: 0 0 auto; background: transparent; border: 0; backdrop-filter: none; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.site-header nav { display: flex; align-items: center; gap: 6px; }
.site-header nav a:not(.btn) { text-decoration: none; padding: 8px 10px; border-radius: 10px; font-size: 15px; color: var(--ink-2); }
.site-header nav a:not(.btn):hover { color: var(--ink); background: var(--surface-2); }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px; border-radius: 30px; border: 1px solid transparent;
  font: 500 16px/1 var(--font-text); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); transition: background var(--motion-fast) var(--ease-out), transform .1s, box-shadow var(--motion-fast) var(--ease-out);
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; font-size: 17px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn--accent { background: var(--melocoton); color: var(--accent-ink); }
.btn--accent:hover { background: #6BEBCB; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 6px 2px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.link:hover { color: var(--ink); }

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card--flat { box-shadow: none; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 15px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-size: 16px;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--verde); flex: none; }
.form-error { color: var(--danger); font-size: 14px; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 15px;
}
.notice--warn { background: color-mix(in srgb, var(--melocoton) 22%, var(--surface)); border-color: color-mix(in srgb, var(--melocoton) 55%, var(--line)); }
.notice__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked { background: var(--chart-1); }
.toggle input:checked::after { transform: translateX(18px); }

/* ---------- Landing ---------- */
.hero { min-height: min(92vh, 820px); display: flex; align-items: center; padding: 110px 0 72px; position: relative; overflow: hidden; }
.hero__content { max-width: 640px; }
.hero__mark { width: 180px; margin-bottom: 28px; }
.hero__mark img { width: 100%; height: auto; }
.hero .title-xl { margin-bottom: 18px; }
.hero__tag { font: 500 12px/1 var(--font-text); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 34px; }
.hero__meta { font-size: 14px; color: var(--muted); }

.section { padding: clamp(56px, 9vw, 104px) 0; }
.section__head { max-width: 640px; margin-bottom: 40px; }
.section__head > * + * { margin-top: 12px; }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step-card { padding: 28px; }
.step-card__num { font: 400 40px/1 var(--font-title); color: var(--chart-1); margin-bottom: 18px; }
.step-card h3 { font-size: 19px; margin-bottom: 8px; }
.step-card p { color: var(--ink-2); font-size: 15.5px; }
.split { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list svg { flex: none; width: 22px; height: 22px; color: var(--chart-1); margin-top: 1px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 500 17px/1.4 var(--font-text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 300; font-size: 24px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 10px; color: var(--ink-2); }
.cta-band { text-align: center; padding: clamp(64px, 10vw, 120px) 0; }
.cta-band > .container > * + * { margin-top: 16px; }

/* ---------- Cuestionario ---------- */
.quiz { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.quiz__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; }
.quiz__back { justify-self: start; background: none; border: 0; padding: 8px 6px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; font-size: 15px; }
.quiz__back:disabled { visibility: hidden; }
.quiz__count { justify-self: end; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--chart-1); border-radius: inherit; transition: width .4s ease; }
.quiz__main { flex: 1; display: flex; padding: clamp(20px, 4vh, 40px) 0 24px; }
.quiz__screen { width: 100%; animation: rise .35s ease both; }
.quiz__screen h1 { font-size: clamp(22px, 3.6vw, 28px); font-weight: 400; margin-bottom: 8px; }
.quiz__screen .subtitle { color: var(--ink-2); margin-bottom: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.options { display: grid; gap: 10px; margin-top: 20px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 12px 18px;
  text-align: left; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 16.5px; transition: border-color .15s, background .15s;
}
.option:hover { border-color: color-mix(in srgb, var(--azul) 60%, var(--line)); }
.option.is-selected { border: 2px solid var(--azul); background: var(--ar); }
.option__label { flex: 1; }
.option__check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.option.is-selected .option__check { background: var(--chart-1); border-color: var(--chart-1); }
.option__check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.option.is-selected .option__check svg { opacity: 1; }
.option__radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.option.is-selected .option__radio { border: 7px solid var(--chart-1); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0 8px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.stepper button:hover { border-color: var(--chart-1); }
.stepper__value { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.stepper input { width: 3.2ch; border: 0; background: transparent; text-align: center; font: 400 clamp(40px, 7vw, 52px)/1 var(--font-title); font-variant-numeric: tabular-nums; -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; border-bottom: 2px solid var(--focus); }
.stepper__unit { font-size: 16px; color: var(--muted); white-space: nowrap; }
.range { width: 100%; accent-color: var(--chart-1); margin-top: 12px; }

/* En el flujo de la página: nunca tapa el contenido; se queda visible abajo solo si la pantalla no alcanza. */
.sticky-cta { position: sticky; bottom: 0; z-index: 10; margin-top: 32px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.sticky-cta .btn { max-width: 440px; margin: 0 auto; display: flex; width: 100%; }
.theme-deep .sticky-cta { background: none; }

.info-screen { text-align: center; padding-top: 3vh; }
.info-screen .brand__mark { margin: 0 auto 24px; width: 56px; height: auto; }
.info-screen h1 { font-weight: 400 !important; margin-top: 10px; }
.info-screen p { color: var(--ink-2); font-size: 17px; margin-top: 14px; max-width: 480px; margin-left: auto; margin-right: auto; }
.info-screen .eyebrow { font-size: 12px; margin-top: 0; }

.analysis { text-align: center; padding-top: 2vh; }
.ring { --p: 0; width: 140px; height: 140px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--chart-1) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font: 400 34px/1 var(--font-title); font-variant-numeric: tabular-nums; }
.checklist { list-style: none; padding: 0; margin: 28px auto 0; display: grid; gap: 14px; max-width: 360px; text-align: left; }
.checklist li { display: flex; gap: 12px; align-items: center; color: var(--muted); transition: color .3s; }
.checklist li.is-active { color: var(--ink); }
.checklist li.is-done { color: var(--ink-2); }
.checklist__dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.checklist li.is-active .checklist__dot { border-color: var(--chart-1); border-top-color: transparent; animation: spin .9s linear infinite; }
.checklist li.is-done .checklist__dot { background: var(--chart-1); border-color: var(--chart-1); }
.checklist li.is-done .checklist__dot::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }

/* ---------- Resultados ---------- */
.results-hero { padding: 96px 0 56px; text-align: center; }
.results-hero > .container > * + * { margin-top: 14px; }
.r-section { padding: clamp(48px, 8vw, 88px) 0; opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.r-section.is-visible { opacity: 1; transform: none; }
.r-section + .r-section { border-top: 1px solid var(--line); }
.r-section__head { margin-bottom: 32px; max-width: 680px; }
.r-section__head > * + * { margin-top: 10px; }
.r-num { font: 500 12px/1 var(--font-text); letter-spacing: .14em; color: var(--chart-1); }
.estimate-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font: 500 12px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; background: color-mix(in srgb, var(--melocoton) 30%, var(--surface)); color: var(--accent-ink); }
:root[data-theme="dark"] .estimate-tag { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .estimate-tag { color: var(--ink); } }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { padding: 20px; }
.stat__label { font-size: 14px; color: var(--muted); }
.stat__value { font: 400 clamp(28px, 4vw, 36px)/1.1 var(--font-title); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat__sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.cards-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 18px; }
.card h3 { font-size: 18px; margin-bottom: 4px; }
.card__sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-2); }
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.plan-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.plan-item { display: flex; gap: 14px; align-items: flex-start; }
.plan-item + .plan-item { margin-top: 16px; }
.plan-item__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--chart-1); }
.plan-item__icon svg { width: 20px; height: 20px; }
.plan-item h4 { font-size: 16px; font-weight: 400; }
.plan-item p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.week-tag { font: 500 11px/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Gráficos ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font: 12px var(--font-text); fill: var(--muted); }
.chart .axis-line { stroke: var(--grid); stroke-width: 1; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .line-1 { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-2 { fill: none; stroke: var(--chart-2); stroke-width: 2; stroke-dasharray: 5 5; stroke-linecap: round; }
.chart .area-1 { fill: var(--chart-1); opacity: .1; }
.chart .bar-1 { fill: var(--chart-1); }
.chart .bar-muted { fill: var(--line); }
.chart .dot-1 { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.chart .dot-2 { fill: var(--chart-2); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.chart .value-label { fill: var(--ink); font-weight: 600; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.45; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
}
.chart-tooltip strong { font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--chart-1); }
.legend i.key-2 { border-top: 2px dashed var(--chart-2); }
.legend i.key-bar { height: 10px; width: 10px; border: 0; border-radius: 3px; background: var(--chart-1); }
.chart-table { margin-top: 10px; font-size: 13.5px; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }

.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.hbars__row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.hbars__label { font-size: 15px; }
.hbars__value { font: 400 15px/1 var(--font-title); font-variant-numeric: tabular-nums; }
.hbars__track { grid-column: 1 / -1; height: 12px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hbars__fill { display: block; height: 100%; width: 0; background: var(--chart-1); border-radius: 0 4px 4px 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.hbars__row.is-top .hbars__fill { background: var(--chart-2); }

.gauge { display: grid; gap: 10px; }
.gauge__track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.gauge__seg { height: 12px; background: var(--surface-2); }
.gauge__seg:first-child { border-radius: 4px 0 0 4px; }
.gauge__seg:last-child { border-radius: 0 4px 4px 0; }
.gauge__seg.is-on { background: var(--chart-1); }
.gauge__scale { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ---------- Paywall ---------- */
.paywall { padding: clamp(56px, 9vw, 100px) 0; }
.paywall__head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.paywall__head > * + * { margin-top: 12px; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 940px; margin: 0 auto; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 26px 22px 22px;
  border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.plan:hover { border-color: color-mix(in srgb, var(--chart-1) 50%, var(--line)); }
.plan[aria-checked="true"] { border-color: var(--chart-1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chart-1) 22%, transparent), var(--shadow); }
.plan--recommended { border-color: var(--melocoton); }
.plan__badge { position: absolute; top: -13px; left: 22px; padding: 6px 12px; border-radius: 99px; background: var(--melocoton); color: var(--accent-ink); font: 600 11.5px/1 var(--font-text); letter-spacing: .12em; text-transform: uppercase; }
.plan__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plan__name { font: 400 19px/1.2 var(--font-title); }
.plan__radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.plan[aria-checked="true"] .plan__radio { border: 7px solid var(--chart-1); }
.plan__price { font: 400 34px/1.1 var(--font-title); margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.plan__period { font-size: 14.5px; color: var(--ink-2); }
.plan__equiv { font-size: 13.5px; color: var(--muted); }
.plan__unavailable { font-size: 14px; color: var(--muted); margin-top: 10px; }
.paywall__features { max-width: 940px; margin: 32px auto 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.paywall__cta { max-width: 520px; margin: 32px auto 0; text-align: center; }
.paywall__cta > * + * { margin-top: 12px; }
.terms-box { max-width: 940px; margin: 28px auto 0; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.terms-box dl { display: grid; gap: 10px; margin: 0; }
.terms-box dt { font-weight: 600; color: var(--ink); }
.terms-box dd { margin: 2px 0 0; }
.free-note { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }

/* ---------- Acceso ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 0 64px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 99px; background: var(--surface-2); margin-bottom: 24px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 99px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.summary-plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-bottom: 24px; font-size: 15px; }

/* ---------- Bienvenida / configuración ---------- */
.fullscreen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.fullscreen main { flex: 1; display: grid; place-items: center; padding: 40px 0 64px; }
.welcome { text-align: center; }
.welcome .hero__mark { margin: 0 auto 28px; }
.welcome > * + * { margin-top: 16px; }
.steps-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.steps-dots span { width: 28px; height: 4px; border-radius: 99px; background: var(--line); }
.steps-dots span.is-on { background: var(--chart-1); }
.choice-list { display: grid; gap: 10px; }

/* ---------- Panel ---------- */
.dash { padding: 32px 0 80px; }
.dash__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.dash__grid { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; }
@media (max-width: 860px) { .span-8, .span-6, .span-4 { grid-column: span 12; } }
.counter { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 18px 0 8px; }
.counter button { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-size: 26px; cursor: pointer; }
.counter button:hover { border-color: var(--chart-1); }
.counter__value { font: 400 64px/1 var(--font-title); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.target-line { text-align: center; font-size: 14.5px; color: var(--ink-2); }
.badge-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ok); }
.goal { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.goal:last-child { border-bottom: 0; }
.goal input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--verde); flex: none; }
.goal.is-done .goal__title { text-decoration: line-through; color: var(--muted); }
.goal__title { font-weight: 500; }
.goal__detail { font-size: 14px; color: var(--muted); margin-top: 2px; }
.sos { background: var(--azul); color: #FFFFFF; border: 0; }
.sos h3 { color: #FFFFFF; }
.sos p { color: var(--nevoa); }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(10, 15, 60, .6); backdrop-filter: blur(4px); }
.modal__card { width: 100%; max-width: 440px; max-height: calc(100dvh - 40px); overflow: auto; }
.breath { text-align: center; padding: 8px 0; }
.breath__circle { width: 200px; height: 200px; margin: 24px auto; border-radius: 50%; display: grid; place-items: center; position: relative; }
.breath__circle::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--salvia) 55%, transparent), color-mix(in srgb, var(--chart-1) 25%, transparent)); transform: scale(var(--s, .6)); transition: transform var(--d, 4s) ease-in-out; }
.breath__circle span { position: relative; font: 400 20px/1.3 var(--font-title); }
.breath__circle small { display: block; font: 400 30px/1 var(--font-title); margin-top: 4px; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.legal-page { padding: 48px 0 80px; }
.legal-page h1 { margin-bottom: 8px; }
.legal-page h2 { font-size: 20px; margin: 32px 0 8px; }
.legal-page p, .legal-page li { color: var(--ink-2); }
.legal-page p + p { margin-top: 10px; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.skeleton { width: 40px; height: 40px; border: 3px solid var(--line); border-top-color: var(--chart-1); border-radius: 50%; animation: spin .9s linear infinite; }

@media (max-width: 560px) {
  .card { padding: 20px; }
  .site-header nav .hide-sm { display: none; }
  .btn { padding: 14px 20px; }
}

/* ---------- Utilidades (la CSP no permite atributos style en el HTML) ---------- */
.u-center-block { margin-left: auto; margin-right: auto; }
.u-text-center { text-align: center; }
.u-my-12 { margin-top: 12px; margin-bottom: 12px; }
.u-mb-24 { margin-bottom: 24px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-16 { margin-top: 16px; }
.notice--wide { max-width: 940px; margin: 0 auto 24px; }
.section--surface { background: var(--surface); }
.progress span { width: 0; }
.hero__mark .brand__mark { width: 100%; height: 100%; }

/* ---------- Lista de planes (paywall e identificación) ---------- */
.paywall__choose { max-width: 620px; margin: 0 auto; }
.paywall__choose .paywall__cta { margin-top: 24px; }
.paywall__choose .terms-box { margin-top: 20px; }
.plan-list { display: grid; gap: 14px; }
.plan-row {
  position: relative; display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 18px 18px 18px 20px; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.plan-row:hover { border-color: color-mix(in srgb, var(--chart-1) 50%, var(--line)); }
.plan-row[aria-checked="true"] { border-color: var(--chart-1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chart-1) 20%, transparent); }
.plan-row--recommended { border-color: var(--melocoton); padding-top: 26px; padding-bottom: 22px; }
.plan-row--recommended[aria-checked="true"] { border-color: var(--melocoton); box-shadow: 0 0 0 4px color-mix(in srgb, var(--melocoton) 35%, transparent); }
.plan-row:disabled { opacity: .55; cursor: not-allowed; }
.plan-row__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 5px 14px; border-radius: 99px; background: var(--melocoton); color: var(--accent-ink);
  font: 600 12px/1 var(--font-text); letter-spacing: .04em;
}
.plan-row__radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; transition: border .15s; }
.plan-row[aria-checked="true"] .plan-row__radio { border: 8px solid var(--chart-1); }
.plan-row__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.plan-row__name { font: 400 clamp(17px, 2.4vw, 20px)/1.25 var(--font-title); }
.plan-row__total { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plan-row__day {
  flex: none; display: grid; justify-items: center; gap: 2px; min-width: 92px; padding: 10px 12px 10px 20px;
  background: var(--surface-2); clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
  border-radius: 0 10px 10px 0;
}
.plan-row__day strong { font: 400 20px/1.1 var(--font-title); font-variant-numeric: tabular-nums; }
.plan-row__day span { font-size: 13px; color: var(--ink-2); }
.plan-row--compact { padding: 14px 14px 14px 16px; gap: 12px; }
.plan-row--compact.plan-row--recommended { padding-top: 22px; padding-bottom: 16px; }
.plan-row--compact .plan-row__name { font-size: 16px; }
.plan-row--compact .plan-row__day { min-width: 78px; padding: 8px 10px 8px 18px; }
.plan-row--compact .plan-row__day strong { font-size: 17px; }
@media (max-width: 420px) {
  .plan-row { gap: 12px; padding-left: 14px; padding-right: 12px; }
  .plan-row__radio { width: 22px; height: 22px; }
  .plan-row[aria-checked="true"] .plan-row__radio { border-width: 7px; }
  .plan-row__day { min-width: 76px; padding: 8px 8px 8px 18px; }
  .plan-row__day strong { font-size: 17px; }
}
.plan-pick { margin-bottom: 28px; }
.plan-pick__label { font: 500 11px/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }

/* ===================================================================== */
/* Área privada                                                           */
/* ===================================================================== */
.app-header .app-nav { display: flex; gap: 4px; }
.app-header .app-nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 15px; color: var(--ink-2); }
.app-header .app-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.app-header .app-nav a:hover { color: var(--ink); }
.tabbar { display: none; }
@media (max-width: 760px) {
  .app-header .app-nav a:not([href="/admin"]) { display: none; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; font-size: 11.5px; color: var(--muted); border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: var(--chart-1); font-weight: 600; }
  .tabbar__icon svg { width: 24px; height: 24px; }
}
.app-main { padding: 28px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-intro { margin-top: 8px; max-width: 620px; }
.section-title { font: 400 18px/1.3 var(--font-title); margin: 28px 0 12px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3c { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: color-mix(in srgb, var(--chart-1) 50%, var(--line)); }
.kicker { font: 500 11px/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.pill--ok { background: color-mix(in srgb, var(--chart-1) 16%, var(--surface)); color: var(--ok); }
.pill--warn { background: color-mix(in srgb, var(--melocoton) 30%, var(--surface)); color: var(--accent-ink); }
.pill--estimate { background: color-mix(in srgb, var(--melocoton) 26%, var(--surface)); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
:root[data-theme="dark"] .pill--estimate, :root[data-theme="dark"] .pill--warn { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill--estimate, :root:not([data-theme="light"]) .pill--warn { color: var(--ink); } }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.big-number { font: 400 clamp(40px, 7vw, 56px)/1 var(--font-title); font-variant-numeric: tabular-nums; }
.progress-line { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress-line span { display: block; height: 100%; background: var(--chart-1); border-radius: inherit; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list__main { flex: 1; min-width: 0; }
.list__meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--chart-1); color: var(--ink); }
.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty-state__mark { display: inline-block; width: 46px; margin-bottom: 12px; }
.empty-state__mark img { width: 100%; height: auto; }
.empty-state__title { font: 400 17px/1.3 var(--font-title); color: var(--ink); margin-bottom: 6px; }
.segmented { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--surface-2); gap: 2px; }
.segmented button { border: 0; background: none; padding: 8px 14px; border-radius: 99px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.modal__actions { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.range-scale { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.select, textarea.input { width: 100%; }
.select { min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.help { font-size: 13px; color: var(--muted); }

/* Panel */
.dash-hero { display: grid; gap: 18px; grid-template-columns: 1.2fr 1fr; }
@media (max-width: 860px) { .dash-hero { grid-template-columns: 1fr; } }
.today-card .big-number { margin: 10px 0 6px; }
.ganas-card { background: var(--azul); color: #FFFFFF; border: 0; }
.ganas-card .muted, .ganas-card p { color: var(--nevoa); }
.ganas-card h2 { color: #FFFFFF; }

/* Jornada: planta que crece con las lecciones */
.journey-hero { display: grid; gap: 24px; grid-template-columns: 220px 1fr; align-items: center; }
@media (max-width: 640px) { .journey-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.plant { width: 200px; height: 200px; }
.plant .pot { fill: var(--surface-2); stroke: var(--line); }
.plant .stem { stroke: var(--chart-1); stroke-width: 3; fill: none; stroke-linecap: round; }
.plant .leaf { fill: var(--salvia); stroke: var(--chart-1); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: grow .6s ease both; }
.plant .leaf--new { fill: var(--chart-1); }
.plant .bud { fill: var(--melocoton); }
@keyframes grow { from { transform: scale(0); } to { transform: scale(1); } }
.chapter { margin-top: 14px; }
.chapter > summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: center; }
.chapter > summary::-webkit-details-marker { display: none; }
.chapter__num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 400 15px/1 var(--font-title); background: var(--surface-2); flex: none; }
.chapter[data-status="completed"] .chapter__num { background: var(--chart-1); color: #fff; }
.chapter[data-status="locked"] { opacity: .65; }
.chapter__title { font: 400 17px/1.3 var(--font-title); }
.lesson-row { display: flex; gap: 12px; align-items: center; padding: 12px 0 12px 54px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.lesson-row[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.lesson-row__state { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; }
.lesson-row[data-status="completed"] .lesson-row__state { background: var(--chart-1); border-color: var(--chart-1); color: #fff; }
.lesson-row[data-status="available"] .lesson-row__state, .lesson-row[data-status="in_progress"] .lesson-row__state { border-color: var(--chart-1); border-width: 2px; }
.lesson-row__main { flex: 1; }

/* Lección */
.lesson { max-width: 680px; margin: 0 auto; }
.lesson-block { padding: 22px 0; border-bottom: 1px solid var(--line); animation: rise .35s ease both; }
.lesson-block:last-of-type { border-bottom: 0; }
.lesson-block h2 { font-size: 20px; margin-bottom: 10px; }
.lesson-block p + p { margin-top: 12px; }
.lesson-text { font-size: 17px; line-height: 1.7; color: var(--ink); }
.choice-feedback { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; background: var(--surface-2); }
.choice-feedback--ok { background: color-mix(in srgb, var(--chart-1) 12%, var(--surface)); }
.choice-feedback--no { background: color-mix(in srgb, var(--melocoton) 25%, var(--surface)); }
.option[aria-pressed="true"] { border: 2px solid var(--azul); background: var(--ar); }
.commit { padding: 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--salvia) 22%, var(--surface)); }
.lesson-done { text-align: center; padding: 32px 0 8px; }

/* Respiración */
.breathe { display: grid; justify-items: center; gap: 18px; text-align: center; }
.breathe__circle { width: min(280px, 72vw); aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center; }
.breathe__circle::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--salvia) 70%, transparent), color-mix(in srgb, var(--chart-1) 30%, transparent));
  transform: scale(var(--s, .55)); transition: transform var(--d, 4s) ease-in-out; }
.breathe__circle::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--line); }
.breathe__label { position: relative; font: 400 22px/1.3 var(--font-title); }
.breathe__count { display: block; font: 400 40px/1 var(--font-title); font-variant-numeric: tabular-nums; margin-top: 6px; }
.breathe__time { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Diario */
.mood-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mood-option { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; }
.mood-option[aria-pressed="true"] { border-color: var(--chart-1); background: color-mix(in srgb, var(--chart-1) 9%, var(--surface)); font-weight: 600; }
.mood-dot { width: 22px; height: 22px; border-radius: 50%; }
.mood-5 { background: #1E3FFF; } .mood-4 { background: #8E9DFF; } .mood-3 { background: #B9C8FF; } .mood-2 { background: #3EE0B5; } .mood-1 { background: #FFC857; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar__dow { font-size: 12px; color: var(--muted); text-align: center; }
.calendar__day { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 13px; cursor: pointer; position: relative; }
.calendar__day[disabled] { opacity: .35; cursor: default; }
.calendar__day .mood-dot { width: 10px; height: 10px; position: absolute; bottom: 5px; }
.calendar__day[aria-current="date"] { border-color: var(--chart-1); border-width: 2px; }

/* Logros */
.achievement { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 22px 16px; }
.achievement__badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.achievement__badge svg { width: 30px; height: 30px; }
.achievement.is-unlocked .achievement__badge { background: color-mix(in srgb, var(--chart-1) 18%, var(--surface)); color: var(--chart-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--salvia) 35%, transparent); }
.achievement:not(.is-unlocked) { opacity: .7; }

/* Ayuda */
.chat { display: grid; gap: 12px; }
.bubble { max-width: 85%; padding: 12px 16px; border-radius: 18px; font-size: 15.5px; line-height: 1.55; }
.bubble--user { justify-self: end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble--guide { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Admin */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-weight: 600; color: var(--ink-2); background: var(--surface-2); }
.code-input { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 360px; }

/* Oferta de salida */
.offer-box { margin: 18px 0; padding: 18px; border-radius: var(--radius-sm); text-align: center;
  background: color-mix(in srgb, var(--melocoton) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--melocoton) 55%, var(--line)); }
.offer-box s { color: var(--muted); margin-right: 8px; }
.offer-box strong { font: 400 30px/1.1 var(--font-title); }
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { white-space: nowrap; flex: none; }

/* ---------- App instalable (PWA) ---------- */
.install-steps { list-style: none; padding: 0; margin: 20px 0 12px; display: grid; gap: 12px; }
.install-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; }
.install-step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand); color: var(--brand-ink); font: 400 14px/1 var(--font-title); }
.install-step__text { flex: 1; font-size: 15px; }
.install-step__icon { flex: none; color: var(--azul); display: inline-grid; place-items: center; }
.install-step__icon--inline { display: inline-grid; vertical-align: middle; margin-left: 6px; }
.install-card { text-align: left; margin-top: 20px; }
.install-actions { max-width: 420px; margin-left: auto; margin-right: auto; }
.install-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.offline-bar { position: sticky; top: 0; z-index: 60; padding: 8px 16px; text-align: center; font-size: 14px; background: var(--melocoton); color: var(--accent-ink); }
.offline-page { padding-top: 12vh; }
.offline-page__icon { margin: 0 auto 20px; border-radius: 16px; }
.container { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
@media (display-mode: standalone) {
  .site-header--clear { padding-top: env(safe-area-inset-top); }
}

/* ---------- Splash de entrada ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--azul); transition: opacity var(--motion-fast) var(--ease-out);
}
.splash__logo { width: min(180px, 48vw); height: auto; animation: splash-in var(--motion-base) var(--ease-out) both; }
.splash.is-done { opacity: 0; pointer-events: none; }
@keyframes splash-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
  .splash__logo { animation: none; }
}

/* ---------- Catálogo de programas ---------- */
.catalog-head { padding-top: 24px; }
.program-grid { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 760px) { .program-grid { grid-template-columns: 1fr 1fr; } }
.program-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 8px; opacity: 0; transform: translateY(12px);
  animation: program-in var(--motion-base) var(--ease-out) forwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes program-in { to { opacity: 1; transform: none; } }
.program-card:active { transform: scale(.985); transition: transform var(--motion-fast) var(--ease-out); }
.program-card__head { display: flex; justify-content: space-between; align-items: flex-start; }
.program-card__icon { width: 44px; height: 44px; }
.program-card__name { font: 400 28px/1.15 var(--font-title); letter-spacing: -.01em; }
.program-card__tagline { color: var(--ink-2); font-weight: 500; }
.program-card__desc { color: var(--muted); font-size: 14px; line-height: 1.45; flex: 1; }
.program-card__cta { margin-top: 8px; }
.program-card--night { background: var(--noite); border-color: #2A3370; }
.program-card--night .program-card__name, .program-card--night .program-card__tagline { color: #fff; }
.program-card--night .program-card__desc { color: var(--nevoa); }
.catalog-install, .catalog-account { text-align: center; margin-top: 20px; }
.btn--mint { background: var(--menta); color: var(--noite); }
.btn--mint:hover { background: #6BEBCB; }
.plan-modal { max-width: 420px; width: 100%; }
.plan-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; font: 500 16px var(--font-text); transition: border-color var(--motion-fast) var(--ease-out); }
.plan-row:hover { border-color: var(--azul); }
.plan-row__price { font-family: var(--font-title); }

/* ---------- Dashboard de programa ---------- */
.program-hero { display: flex; gap: 16px; align-items: flex-start; padding: 24px 0 8px; flex-wrap: wrap; }
.program-hero__icon { width: 56px; height: 56px; }
.program-hero__catalog { margin-left: auto; }
.next-lesson { display: block; margin-top: 16px; text-decoration: none; color: inherit;
  border-left: 4px solid var(--program, var(--azul)); }
.mini-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.mini-card { text-decoration: none; color: inherit; }
.catalog-section { margin: 24px 0 10px; }
.welcome-program { font-size: 20px; margin-top: 12px; }

/* ---------- Tema nocturno contextual (programa Sueño) ---------- */
body.program-night { --bg: var(--noite); --surface: #131A45; --surface-2: #1B2352; --ink: #fff; --ink-2: var(--nevoa);
  --muted: var(--nevoa); --line: #2A3370; background: var(--noite); color: var(--ink); }
body.program-night .card { background: var(--surface); border-color: var(--line); }
body.program-night .next-lesson { border-left-color: var(--program, #FFC857); }

@media (prefers-reduced-motion: reduce) {
  .program-card { animation: none; opacity: 1; transform: none; }
  .program-card:active { transform: none; }
}
.admin-program-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-program-row:last-child { border-bottom: 0; }
.admin-program-row select { max-width: 200px; }
