/* Monedin — sistema visual
   Tinta azul para la estructura, moneda para el valor, brote para el progreso. */
:root {
  --ink: #12355B;
  --ink-2: #2B5179;
  --ink-soft: #5A6F87;
  --coin: #F4B400;
  --coin-deep: #B78400;
  --coin-wash: #FFF4D1;
  --sprout: #2E9E6B;
  --sprout-wash: #E2F5EB;
  --coral: #E4572E;
  --coral-wash: #FDE8E1;
  --sky: #EAF2FA;
  --line: #D4E1EE;
  --paper: #FFFFFF;
  --text: #13253A;

  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --shadow: 0 1px 0 var(--line), 0 6px 18px -10px rgba(18, 53, 91, .35);
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--body);
  color: var(--text);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 48px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--ink-2); text-underline-offset: 3px; }
img { max-width: 100%; }
code { background: var(--sky); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--ink-soft); }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; }
.fine { font-size: .875rem; color: var(--ink-soft); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 700 1rem/1 var(--body);
  padding: .8em 1.25em;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: var(--bg); color: var(--fg);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 rgba(18, 53, 91, .25);
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(18, 53, 91, .25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--sky); }
.btn.sm { font-size: .9rem; padding: .6em 1em; }
.btn.lg { font-size: 1.1rem; padding: .95em 1.6em; }
.btn.block { width: 100%; }
.btn.danger { --fg: var(--coral); border-color: var(--coral-wash); }
.link { display: inline-block; margin-top: .5em; font-weight: 700; color: var(--ink-2); }
.link.center { display: block; text-align: center; margin-top: 1em; }
.link-btn { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; padding: 0; margin-top: .5em; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.35rem/1 var(--display); color: var(--ink); }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; }
.topnav a:hover { background: var(--sky); }
.topnav a[aria-current] { background: var(--ink); color: #fff; }
.topbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip-profile { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--sky); line-height: 1; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 1.1rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.7rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 2.8rem; }
.avatar.add { font: 700 2.4rem/1 var(--display); color: var(--ink-soft); background: transparent; border: 2px dashed var(--line); }

.tabbar { display: none; }
.flash { margin: 16px 0; padding: 12px 16px; background: var(--sprout-wash); border-left: 4px solid var(--sprout); border-radius: var(--r-sm); }

.footer { border-top: 1px solid var(--line); padding: 24px var(--gutter) 32px; color: var(--ink-soft); font-size: .9rem; text-align: center; }
.footer p { max-width: 70ch; margin: 0 auto .5em; }
.footer a { margin: 0 8px; }

/* ---------- Portada ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(32px, 6vw, 72px) 0 40px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); max-width: 14ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

.grow { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: 0 20px 40px -24px rgba(18, 53, 91, .8); }
.grow-controls { display: grid; gap: 14px; margin-bottom: 18px; font-size: 1.05rem; }
.grow-controls label { display: grid; gap: 6px; }
.grow output { font: 800 1.35rem/1 var(--display); color: var(--coin); }
.grow input[type=range] { width: 100%; accent-color: var(--coin); }
.grow select { font: inherit; padding: 6px 10px; border-radius: var(--r-sm); border: 0; background: var(--ink-2); color: #fff; width: max-content; }
.grow svg { width: 100%; height: auto; display: block; overflow: visible; }
.bar-ink { fill: #6E8FB3; }
.bar-coin { fill: var(--coin); }
.axis { stroke: rgba(255, 255, 255, .35); }
.grow-total { font-size: 1.1rem; margin: 14px 0 6px; }
.grow-total strong { color: var(--coin); font-family: var(--display); font-size: 1.4rem; }
.grow-legend { font-size: .9rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.key.ink { background: #6E8FB3; } .key.coin { background: var(--coin); }
.grow .fine { color: rgba(255, 255, 255, .7); margin: 0; }

.section { padding: 48px 0 8px; }
.section-lead { color: var(--ink-soft); max-width: 60ch; }

/* colores por itinerario */
.c-coin { --tc: var(--coin); --tw: var(--coin-wash); --td: var(--coin-deep); }
.c-sprout { --tc: var(--sprout); --tw: var(--sprout-wash); --td: #1F7A51; }
.c-ink { --tc: var(--ink-2); --tw: var(--sky); --td: var(--ink); }
.c-coral { --tc: var(--coral); --tw: var(--coral-wash); --td: #B33E1C; }

.tracks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 24px; }
.track-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r-md); background: var(--tw); border-top: 6px solid var(--tc); text-decoration: none; color: var(--text); }
.track-card h3 { font-size: 1.5rem; margin: 0; }
.track-card p { margin: 0; flex: 1; }
.track-ages { font-weight: 700; color: var(--td); }
.track-count { font-size: .9rem; color: var(--ink-soft); margin-top: 8px; }
.track-card:hover { outline: 2px solid var(--tc); }

.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { counter-increment: s; padding-top: 56px; position: relative; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--coin); color: var(--ink); display: grid; place-items: center; font: 800 1.3rem/1 var(--display); }
.steps strong { display: block; color: var(--ink); font-size: 1.1rem; }

.demo-list { display: grid; gap: 10px; max-width: 720px; }
.demo-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--text); }
.demo-item:hover { background: var(--sky); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--tw); color: var(--td); font-weight: 700; font-size: .85rem; }

.closing { text-align: center; padding: 64px 0 24px; }
.closing h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); max-width: 22ch; margin: 0 auto 24px; }

/* ---------- Formularios ---------- */
.auth { max-width: 440px; margin: 48px auto; }
.auth.wide { max-width: 640px; }
.form { display: grid; gap: 18px; margin: 20px 0; }
.form label { display: grid; gap: 6px; font-weight: 700; color: var(--ink); }
.form small { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--text); width: 100%;
}
input:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px var(--sky); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.error { background: var(--coral-wash); color: #8C2B0F; border-radius: var(--r-sm); padding: 12px 16px 12px 32px; }
p.error { padding-left: 16px; }

.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-avatar input, .radio-card input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.radio-avatar .avatar { border: 3px solid transparent; cursor: pointer; }
.radio-avatar input:checked + .avatar { border-color: var(--coin); background: var(--coin-wash); }
.radio-avatar input:focus-visible + .avatar { outline: 3px solid var(--ink-2); }
.track-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-card span { display: block; padding: 12px 14px; border: 2px solid var(--line); border-left: 6px solid var(--tc); border-radius: var(--r-sm); cursor: pointer; font-weight: 400; }
.radio-card input:checked + span { border-color: var(--tc); background: var(--tw); }
.radio-card input:focus-visible + span { outline: 3px solid var(--ink-2); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg span { display: block; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--coin); }
.danger-zone { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- Perfiles ---------- */
.profiles { text-align: center; padding: 48px 0; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-top: 32px; }
.profile-tile { width: 170px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); }
.profile-pick { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border-radius: var(--r-md); width: 100%; box-sizing: border-box; }
.profile-pick:hover, .profile-tile.add:hover { background: var(--sky); }
.profile-pick:focus-visible { outline: 3px solid var(--coin); }
.profile-pick strong, .profile-tile.add strong { font: 700 1.2rem/1.2 var(--display); color: var(--ink); }
.profile-tile.add { padding: 16px; border-radius: var(--r-md); }
.edit-link { font-size: .9rem; }

/* ---------- Panel principal ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.dash { padding-top: 28px; display: grid; gap: 20px; }
.dash-head { display: flex; align-items: center; gap: 16px; }
.dash-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0; }
.dash-head p { margin: 0; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.week { display: flex; gap: 20px; align-items: center; background: var(--sky); border-color: transparent; }
.ring { width: 120px; height: 120px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring-bg { stroke: #fff; }
.ring-fg { stroke: var(--sprout); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.week h2 { margin: 0; font-size: 1.2rem; }
.big { font: 800 2.2rem/1.1 var(--display); color: var(--ink); margin: 4px 0; }
.big span { font-size: 1.1rem; font-weight: 500; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.stats > div { display: grid; gap: 4px; }
.stat { font: 800 1.6rem/1.1 var(--display); color: var(--ink); }
.xpbar { height: 10px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.xpbar span { display: block; height: 100%; background: var(--sprout); border-radius: inherit; }
.xpbar.coin span { background: var(--coin); }
.xpbar.big { height: 16px; }

.plan h2 { margin-bottom: 12px; }
.plan-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.plan-list li > div { display: grid; }
.plan-list .muted { font-size: .85rem; }
.plan-list li.is-next { border: 2px solid var(--coin); background: var(--coin-wash); }
.plan-list strong { color: var(--ink); font-size: 1.05rem; }

.badge-row { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge-row li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; background: var(--coin-wash); border-radius: 999px; font-weight: 700; color: var(--ink); }
.badge-row li span { font-size: 1.2rem; }
.badge-row.big { justify-content: center; margin-top: 16px; }
.badge-row.big li { flex-direction: column; border-radius: var(--r-md); padding: 12px 16px; text-align: center; }
.badge-row.big li span { font-size: 2rem; }
.badge-row.big small { font-weight: 400; color: var(--ink-soft); }
.badge-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.badge-grid li { display: grid; gap: 4px; padding: 18px; border-radius: var(--r-md); border: 1px solid var(--line); }
.badge-grid li.has { background: var(--coin-wash); border-color: transparent; }
.badge-grid li.locked { opacity: .6; }
.badge-icon { font-size: 2.2rem; }

/* ---------- Camino ---------- */
.path-page { padding-top: 24px; }
.track-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 24px; }
.track-tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.track-tabs a[aria-current] { background: var(--tc); border-color: var(--tc); color: #fff; }
.c-coin .track-tabs a[aria-current] { color: var(--ink); }
.path-head { padding: 24px; border-radius: var(--r-lg); background: var(--tw); margin-bottom: 32px; }
.path-head .lead { margin-bottom: .4em; }
.path-head p:last-child { margin: 0; }
.module { margin-bottom: 40px; }
.module h2 { display: flex; flex-direction: column; gap: 2px; }
.module-n { font: 700 .95rem/1 var(--body); color: var(--td); }
.stones { list-style: none; padding: 0; margin: 16px 0 0; position: relative; display: grid; gap: 18px; max-width: 640px; }
.stones::before { content: ''; position: absolute; left: 31px; top: 20px; bottom: 20px; border-left: 4px dotted var(--line); }
.stone > a, .stone > div { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text); position: relative; }
.stone.right > a, .stone.right > div { margin-left: clamp(0px, 6vw, 56px); }
.stone-dot { width: 66px; height: 66px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 1.5rem/1 var(--display); background: #fff; border: 4px solid var(--line); color: var(--ink-soft); position: relative; z-index: 1; }
.stone-text { display: grid; }
.stone-text strong { font-size: 1.1rem; color: var(--ink); }
.stone-text .muted { font-size: .9rem; }
.stone.is-done .stone-dot { background: var(--sprout); border-color: var(--sprout); color: #fff; }
.stone.is-next .stone-dot { background: var(--coin); border-color: var(--coin-deep); color: var(--ink); box-shadow: 0 0 0 6px var(--coin-wash); }
.stone.is-ready .stone-dot { border-color: var(--tc); color: var(--ink); }
.stone.is-soon { opacity: .55; }
.stone > a:hover .stone-dot { transform: scale(1.06); }
.stone-dot { transition: transform .15s ease; }

/* ---------- Reproductor de lecciones ---------- */
.player { max-width: 680px; margin: 0 auto; padding: 16px 0 0; min-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.player-head { display: flex; align-items: center; gap: 14px; }
.close { font-size: 1.3rem; text-decoration: none; color: var(--ink-soft); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.close:hover { background: var(--sky); }
.player-progress { flex: 1; height: 14px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.player-progress span { display: block; height: 100%; width: 0; background: var(--sprout); border-radius: inherit; transition: width .4s ease; }
.player-xp { font: 800 1rem/1 var(--display); color: var(--coin-deep); min-width: 3ch; text-align: right; }
.player-meta { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; font-size: .9rem; }
.stage { flex: 1; padding: 12px 0 24px; }
.card { animation: none; }
.card.enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.card h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); }
.card h1:focus, .card h2:focus { outline: none; }
.card p, .card li { font-size: 1.15rem; max-width: 60ch; }
.big-emoji { font-size: 3.4rem; line-height: 1; margin-bottom: 12px; }
.options { display: grid; gap: 10px; margin-top: 18px; }
.option { font: 400 1.1rem/1.35 var(--body); text-align: left; padding: 14px 18px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: var(--r-md); background: #fff; color: var(--text); cursor: pointer; }
.option:hover { background: var(--sky); }
.option[aria-checked=true], .option[aria-pressed=true] { border-color: var(--ink-2); background: var(--sky); }
.option.right { border-color: var(--sprout); background: var(--sprout-wash); }
.option.wrong { border-color: var(--coral); background: var(--coral-wash); }
.classify { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 16px; }
.classify li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-md); }
.classify li.right { border-color: var(--sprout); background: var(--sprout-wash); }
.classify li.wrong { border-color: var(--coral); background: var(--coral-wash); }
.ci-text { font-size: 1.1rem; }
.ci-buckets { display: flex; gap: 6px; }
.bucket { font: 700 .95rem/1 var(--body); padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.bucket[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.hint { color: var(--ink-soft); font-size: .9rem; }
.mission { background: var(--coin-wash); border-radius: var(--r-lg); padding: 24px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--ink); margin-top: 8px; }
.check input { width: 22px; height: 22px; accent-color: var(--sprout); }
.player-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 24%); padding: 20px 0 16px; display: grid; gap: 10px; }
.player-foot .btn { width: 100%; }
.feedback:empty { display: none; }
.feedback { padding: 14px 16px; border-radius: var(--r-md); }
.feedback p { margin: .3em 0 0; }
.feedback.good { background: var(--sprout-wash); color: #155C3C; }
.feedback.bad { background: var(--coral-wash); color: #8C2B0F; }
.feedback.neutral { background: var(--sky); color: var(--ink); }
.done { text-align: center; padding-top: 24px; }
.done p { margin-left: auto; margin-right: auto; }
.burst { font-size: 4.5rem; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
.xp-gain { font: 800 2rem/1 var(--display); color: var(--coin-deep); }
.levelup { display: inline-block; background: var(--ink); color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 700; }

/* ---------- Herramientas ---------- */
.page { padding-top: 32px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 24px; }
.tool-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.tool { margin-top: 14px; }
.tool-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tf { display: grid; gap: 4px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.tool-out { margin-top: 14px; padding: 14px 16px; background: var(--sky); border-radius: var(--r-md); font-size: 1.05rem; }
.tool-out p { margin: .6em 0 0; font-size: .9rem; }
.tool-out strong { color: var(--ink); }
.split { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.split li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.split small { grid-column: 1 / -1; color: var(--ink-soft); }
.card .tool-out { font-size: 1.1rem; }

/* ---------- Plan de estudios ---------- */
.plan-track { border-top: 6px solid var(--tc); padding-top: 20px; margin-top: 40px; }
.plan-track h2 .muted { font: 400 1rem var(--body); }
.plan-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 28px; }
.plan-modules ul { padding-left: 1.1em; margin: 0; }
.plan-modules li { margin-bottom: 4px; }
.soon { font-size: .8rem; color: var(--ink-soft); background: var(--sky); padding: 1px 8px; border-radius: 999px; }

/* ---------- Familia ---------- */
.family-members { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 36px; }
.family-members li { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.family-members li > div { flex: 1; display: grid; gap: 6px; }
.goal-list { display: grid; gap: 16px; margin-bottom: 20px; }
.goal header { display: flex; justify-content: space-between; align-items: baseline; }
.goal-pct { font: 800 1.5rem/1 var(--display); color: var(--coin-deep); }
.goal.reached { background: var(--sprout-wash); border-color: transparent; }
.goal p { margin: 10px 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input { width: auto; flex: 1 1 140px; }
.new-goal { max-width: 520px; background: var(--sky); border-color: transparent; }
.moves { list-style: none; padding: 0; display: grid; gap: 6px; max-width: 640px; }
.moves li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pos { color: var(--sprout); } .neg { color: var(--coral); }

/* ---------- Móvil ---------- */

/* ---------- Descubre: historias, claves y curiosidades ---------- */
.d-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 32px; }
.d-jump a { padding: 6px 14px; border-radius: 999px; background: var(--sky); font-weight: 700; text-decoration: none; }
.descubre h2 { margin-top: 40px; scroll-margin-top: 80px; }
.d-list { display: grid; gap: 12px; }
.d-card { border: 1px solid var(--line); border-left: 6px solid var(--coin); border-radius: var(--r-md); background: var(--paper); scroll-margin-top: 80px; }
.d-card.key { border-left-color: var(--coral); }
.d-card summary { display: grid; gap: 4px; padding: 16px 20px; cursor: pointer; list-style: none; }
.d-card summary::-webkit-details-marker { display: none; }
.d-card summary strong { font: 700 1.2rem/1.25 var(--display); color: var(--ink); }
.d-card summary::after { content: 'Leer la historia ↓'; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.d-card.key summary::after { content: 'Ver la explicación ↓'; }
.d-card[open] summary::after { content: 'Cerrar ↑'; }
.d-when { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--coin-deep); }
.d-hook { color: var(--ink-2); }
.d-body { padding: 0 20px 18px; max-width: 70ch; }
.d-moral { background: var(--sky); padding: 10px 14px; border-radius: var(--r-sm); }
.d-matiz { border-left: 3px solid var(--coin); padding: 4px 0 4px 12px; color: var(--ink-2); }
.sources cite { font-style: normal; }
.sources { font-size: .85rem; color: var(--ink-soft); }
.sources span { font-weight: 700; }
.d-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.d-fact h3 { font-size: 1.15rem; }
.story-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.story-card { display: grid; gap: 6px; padding: 18px; border-radius: var(--r-md); background: var(--coin-wash); text-decoration: none; color: var(--text); }
.story-card:hover { outline: 2px solid var(--coin); }
.story-card strong { font: 700 1.1rem/1.25 var(--display); color: var(--ink); }
.card.done .teaser { margin-top: 20px; padding: 16px 18px; border-radius: var(--r-md); background: var(--sky); text-align: left; }
.card.done .teaser .teaser-kicker { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.card.done .teaser h2 { display: block; font: 700 1.1rem/1.3 var(--display); color: var(--ink); margin: 2px 0 4px; }
.card.done .teaser p { margin: 0; }
.did-you-know { margin-top: 12px; padding: 14px 18px; border-radius: var(--r-md); background: var(--coin-wash); text-align: left; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .tracks { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .tool-grid, .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topnav { display: none; }
  .is-public .topnav { display: none; }
  .chip-name { display: none; }
  .chip-profile { padding: 2px; }
  .is-app main { padding-bottom: 96px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; 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; text-decoration: none; color: var(--ink-soft); font-size: .75rem; font-weight: 700; padding: 4px; border-radius: var(--r-sm); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--ink); background: var(--sky); }
  .is-app .footer { padding-bottom: 96px; }
  .tracks { grid-template-columns: 1fr; }
  .track-pick { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:last-child { grid-column: 1 / -1; }
  .week { flex-direction: column; text-align: center; }
  .plan-list li { grid-template-columns: 1fr auto; }
  .plan-list .mins { display: none; }
  .demo-item { grid-template-columns: 1fr auto; }
  .demo-item .pill { grid-column: 1 / -1; justify-self: start; }
  .player-foot { padding-bottom: 8px; }
  .classify li { flex-direction: column; align-items: stretch; }
  .ci-buckets .bucket { flex: 1; }
  .profile-tile { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 760px) {
  .d-grid, .story-cards { grid-template-columns: 1fr; }
}
.did-you-know .label { font-weight: 700; }
