/* Cántaro — estilos
   Marca: alfarería. Barro (terracota) para la marca y las acciones, esmalte (turquesa) para el agua
   que llena el cántaro, oro (kintsugi) para las piezas reparadas y los logros, alerta para seguridad.
   Tipos: Young Serif (marca y títulos), Newsreader (lectura), Figtree (interfaz).
   Las formas usan radios irregulares, como piezas hechas a mano. */

@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/young-serif.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/newsreader.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400 600; font-display: swap; src: url(../fonts/newsreader-italic.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/figtree.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f2e9df;
  --bg-2: #e8dacb;
  --surface: #fbf6f0;
  --surface-2: #f5ece2;
  --ink: #2a1c15;
  --ink-2: #5e4a3e;
  --ink-3: #8a7568;
  --line: #e0cebd;
  --barro: #a9522b;
  --barro-ink: #7c3719;
  --barro-soft: #f2dccb;
  --barro-deep: #5c2b17;
  --on-barro: #fff8f1;
  --agua: #2c7a74;
  --agua-ink: #1d5752;
  --agua-soft: #d6e8e3;
  --agua-light: #7fbfb5;
  --oro: #b8872b;
  --oro-ink: #7f5c14;
  --oro-soft: #f3e6c6;
  --alerta: #a3283a;
  --alerta-soft: #f6dcdf;
  --ok: #4e7a34;
  --ok-soft: #e2ecd6;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .2 0 0 0 0 .12 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgb(60 30 15 / 7%), 0 10px 26px -14px rgb(60 30 15 / 28%);
  --hand: 20px 16px 22px 15px / 15px 22px 16px 20px;
  --hand-s: 13px 10px 14px 9px / 10px 14px 9px 13px;
  --hand-btn: 26px 20px 28px 18px / 20px 28px 18px 26px;
  --pebble: 52% 48% 55% 45% / 48% 55% 45% 52%;
  --f-brand: "Young Serif", "Iowan Old Style", Georgia, serif;
  --f-read: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-ui: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --read-size: 19px;
  --tabbar-h: 64px;
  --maxw: 640px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b130f; --bg-2: #241913; --surface: #2a1f18; --surface-2: #32251d;
    --ink: #f3e7da; --ink-2: #cdb9a8; --ink-3: #9c8778; --line: #3f2f25;
    --barro: #d98a5f; --barro-ink: #f2b795; --barro-soft: #45281b; --barro-deep: #3a1d11; --on-barro: #2a130a;
    --agua: #6fc0b4; --agua-ink: #a6ddd3; --agua-soft: #183633; --agua-light: #3f8c82;
    --oro: #ddb35a; --oro-ink: #ecca80; --oro-soft: #3a2e17;
    --alerta: #f08a95; --alerta-soft: #401d23; --ok: #9ccb85; --ok-soft: #1f3019;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 12px 30px -14px rgb(0 0 0 / 65%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b130f; --bg-2: #241913; --surface: #2a1f18; --surface-2: #32251d;
  --ink: #f3e7da; --ink-2: #cdb9a8; --ink-3: #9c8778; --line: #3f2f25;
  --barro: #d98a5f; --barro-ink: #f2b795; --barro-soft: #45281b; --barro-deep: #3a1d11; --on-barro: #2a130a;
  --agua: #6fc0b4; --agua-ink: #a6ddd3; --agua-soft: #183633; --agua-light: #3f8c82;
  --oro: #ddb35a; --oro-ink: #ecca80; --oro-soft: #3a2e17;
  --alerta: #f08a95; --alerta-soft: #401d23; --ok: #9ccb85; --ok-soft: #1f3019;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 12px 30px -14px rgb(0 0 0 / 65%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--grain), var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--barro-ink); }
:focus-visible { outline: 2.5px solid var(--barro); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; font-weight: 400; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───── Marca ───── */
.wordmark { font: 400 25px/1 var(--f-brand); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.wordmark .acc { color: var(--barro); }
.wordmark.xl { font-size: 58px; letter-spacing: -.02em; }

/* ───── Estructura ───── */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar .brand { display: flex; flex-direction: column; gap: 3px; }
.topbar .brand small { font-weight: 600; color: var(--ink-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1 { font: 400 21px/1.2 var(--f-brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; border-radius: var(--pebble); border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn.help { color: var(--alerta); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.s { width: 18px; height: 18px; }
.ico.xs { width: 15px; height: 15px; }

main.view { padding: 4px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px); display: grid; gap: 22px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar nav { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--hand-s); text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 650; }
.tabbar a[aria-current="page"] { color: var(--barro); }
.tabbar a[aria-current="page"] .ico { stroke-width: 2.2; }
body.immersive .tabbar { display: none; }

/* ───── Tipografía ───── */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.title-xl { font: 400 34px/1.08 var(--f-brand); letter-spacing: -.015em; }
.title-l { font: 400 27px/1.15 var(--f-brand); letter-spacing: -.01em; }
.title-m { font: 400 20px/1.25 var(--f-brand); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.narrow { max-width: 30em; }
.mt { margin-top: 10px; }
.num { font-variant-numeric: tabular-nums; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-h h2 { font: 400 21px/1.2 var(--f-brand); }
.section-h a { font-size: 14px; font-weight: 650; text-decoration: none; }
.stack { display: grid; gap: 12px; }
.stack-s { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ───── Botones ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--hand-btn); border: 1px solid transparent;
  font-weight: 750; font-size: 15.5px; cursor: pointer; text-decoration: none;
  background: var(--barro); color: var(--on-barro);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 6px 14px -8px color-mix(in srgb, var(--barro) 70%, transparent);
  transition: transform .12s ease, filter .2s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.soft { background: var(--barro-soft); color: var(--barro-ink); box-shadow: none; }
.btn.oro { background: var(--oro); color: #2a1c0a; }
.btn.light { background: #fff; color: var(--alerta); box-shadow: none; }
.btn.danger { background: var(--alerta); color: #fff; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.danger-text { color: var(--alerta) !important; }
.link-btn { background: none; border: 0; padding: 0; color: var(--barro-ink); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--hand-s); font-size: 12.5px; font-weight: 750; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.chip.barro { background: var(--barro-soft); color: var(--barro-ink); }
.chip.agua { background: var(--agua-soft); color: var(--agua-ink); }
.chip.oro { background: var(--oro-soft); color: var(--oro-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.alerta { background: var(--alerta-soft); color: var(--alerta); }

/* ───── Tarjetas ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); padding: 18px; box-shadow: var(--shadow); }
.card.flat { border: 0; background: var(--surface-2); box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.picked { border-color: var(--agua); box-shadow: 0 0 0 3px var(--agua-soft); }
a.card, button.card { display: block; text-decoration: none; color: inherit; text-align: left; width: 100%; cursor: pointer; }
a.card:hover { border-color: color-mix(in srgb, var(--barro) 45%, var(--line)); }
details.card summary { cursor: pointer; font-weight: 700; }
details.card .prose { margin-top: 10px; }

/* ───── Cántaro (SVG) ───── */
.vessel { width: 100%; height: auto; display: block; overflow: visible; }
.vessel .inner { fill: color-mix(in srgb, var(--surface) 70%, var(--bg-2)); }
.vessel .outline { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linejoin: round; }
.vessel .handle { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.vessel .crack { fill: none; stroke: var(--oro); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.vessel .shine { fill: none; stroke: #fff; stroke-opacity: .35; stroke-width: 4; stroke-linecap: round; }
.vessel .wave { animation: wave 5s linear infinite; }
.vessel .wave.b { animation-duration: 7s; animation-direction: reverse; opacity: .5; }
.vessel .level { transition: transform 1.4s cubic-bezier(.2,.8,.2,1); }
.vessel .spill { fill: var(--agua-light); opacity: 0; }
.vessel.full .spill { animation: spill 3s ease-in-out infinite; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-120px); } }
@keyframes spill { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(46px); } }

/* Mosaico: el cántaro reparado pieza a pieza */
.mosaic { width: 100%; height: auto; display: block; overflow: visible; }
.mosaic .piece.off { fill: color-mix(in srgb, var(--surface-2) 70%, transparent); stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 3 4; }
.mosaic .piece.on.tone0 { fill: var(--barro); }
.mosaic .piece.on.tone1 { fill: color-mix(in srgb, var(--barro) 82%, #000); }
.mosaic .piece.on.tone2 { fill: color-mix(in srgb, var(--barro) 80%, #fff); }
.mosaic .piece.hl.off { fill: var(--barro-soft); stroke: var(--barro); stroke-dasharray: none; stroke-width: 1.6; }
.mosaic .seam { fill: none; stroke: var(--oro); stroke-width: 2.6; stroke-linejoin: round; }
.mosaic .m-outline { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.mosaic .m-handle { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; opacity: .8; }
.mosaic .plabel { font: 800 10px var(--f-ui); fill: var(--ink-3); pointer-events: none; }
.mosaic a .plabel { pointer-events: auto; }
.mosaic .plabel.on { fill: var(--on-barro); }
.mosaic .piece.fresh { animation: settle 1.1s .2s cubic-bezier(.2,.8,.2,1) both; transform-box: fill-box; transform-origin: center; }
.mosaic .seam.fresh { stroke-dasharray: 400; animation: seam 1.4s 1s ease both; }
@keyframes settle { from { transform: translate(18px, 60px) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes seam { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }

/* Tiestos decorativos */
.sherd { position: absolute; width: 90px; height: 90px; pointer-events: none; }
.sherd polygon { fill: var(--barro); opacity: .9; }
.sherd polyline { fill: none; stroke: var(--oro); stroke-width: 3; stroke-linejoin: round; }

/* ───── Inicio ───── */
.hello { display: grid; gap: 4px; padding-top: 4px; }
.verse-line { margin-top: 6px; max-width: 34em; font: italic 16px/1.45 var(--f-read); color: var(--ink-2); padding-left: 12px; border-left: 2px solid var(--oro); }
.verse-line span { font: 700 11.5px var(--f-ui); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--barro-ink); margin-left: 4px; white-space: nowrap; }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 128px 1fr; gap: 18px; align-items: center;
  padding: 20px 20px 22px; border-radius: 30px 22px 34px 20px / 22px 34px 20px 30px;
  background: var(--grain), radial-gradient(120% 90% at 0% 100%, color-mix(in srgb, var(--barro) 16%, transparent), transparent 62%), var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-sherds { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-sherds .sherd { opacity: .16; }
.hero-sherds .h1 { right: -26px; top: -30px; width: 120px; height: 120px; transform: rotate(18deg); }
.hero-sherds .h2 { right: 70px; bottom: -44px; width: 90px; height: 90px; transform: rotate(-24deg); }
.hero .stats { display: grid; gap: 10px; }
.hero .pct { font: 400 46px/1 var(--f-brand); letter-spacing: -.02em; }
.hero .pct small { font: 400 18px var(--f-brand); color: var(--ink-3); }
.hero .rank { display: flex; flex-wrap: wrap; gap: 6px; }
.hero .quiet { font: italic 15px/1.35 var(--f-read); color: var(--ink-2); }

.continue { display: grid; gap: 14px; }
.continue .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.continue h3 { font: 400 23px/1.2 var(--f-brand); }

.story { display: grid; gap: 12px; }
.story-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.story-track::-webkit-scrollbar { display: none; }
.stop { scroll-snap-align: start; flex: none; width: 104px; display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.stop::before { content: ""; position: absolute; top: 21px; left: -50%; width: 100%; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); z-index: 0; }
.stop:first-child::before { display: none; }
.stop.reached::before { background: var(--barro); opacity: .5; }
.stop .dot { width: 44px; height: 44px; border-radius: var(--pebble); display: grid; place-items: center; position: relative; z-index: 1; background: var(--surface); border: 2px solid var(--line); color: var(--ink-3); }
.stop:nth-child(2n) .dot { border-radius: 46% 54% 48% 52% / 55% 45% 55% 45%; }
.stop.reached .dot { border-color: var(--barro); color: var(--barro); }
.stop.here .dot { background: var(--barro); border-color: var(--barro); color: var(--on-barro); box-shadow: 0 0 0 6px var(--barro-soft); }
.stop.here { color: var(--ink); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: grid; gap: 10px; align-content: start; }
.tile .tile-ico { width: 42px; height: 42px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--agua-soft); color: var(--agua-ink); }
.tile.b .tile-ico { background: var(--barro-soft); color: var(--barro-ink); }
.tile h3 { font: 400 18px/1.2 var(--f-brand); }
.tile p { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }

.quote-card { position: relative; padding: 26px 22px 20px; overflow: hidden; border-radius: 26px 18px 30px 16px / 18px 30px 16px 26px; background: var(--grain), linear-gradient(155deg, #8a4121, #3a1b0e 75%); color: #f6e8d8; }
.quote-card::after { content: ""; position: absolute; left: 22px; right: 60%; bottom: 0; height: 3px; background: var(--oro); border-radius: 3px; }
.quote-card .eyebrow { color: rgb(246 232 216 / 65%); }
.quote-card blockquote { margin: 10px 0 0; font: italic 500 24px/1.3 var(--f-read); text-wrap: pretty; }
.quote-card .src { margin-top: 14px; font-size: 13px; opacity: .75; }
.quote-card .actions { display: flex; gap: 8px; margin-top: 16px; padding-bottom: 6px; }
.quote-card .btn { background: rgb(255 255 255 / 14%); color: #fff; min-height: 40px; font-size: 14px; box-shadow: none; }

.help-strip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--hand); background: var(--alerta-soft); color: var(--alerta); font-weight: 750; font-size: 14.5px; border: 0; width: 100%; cursor: pointer; text-align: left; }
.help-strip span { color: var(--ink-2); font-weight: 500; display: block; font-size: 13px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--hand); background: var(--agua-soft); color: var(--agua-ink); }
.banner p { flex: 1; font-size: 14px; font-weight: 650; }

/* ───── Recorrido ───── */
.path { position: relative; display: grid; gap: 14px; }
.path::before { content: ""; position: absolute; left: 27px; top: 30px; bottom: 30px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(var(--barro) 0 10px, transparent 10px 16px); opacity: .35; }
.mod-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; text-decoration: none; color: inherit; }
.mod-node { width: 58px; height: 58px; position: relative; display: grid; place-items: center; z-index: 1; }
.mod-node svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.mod-node svg.ring circle { fill: none; stroke-width: 4; }
.mod-node .track { stroke: var(--line); }
.mod-node .bar { stroke: var(--agua); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.mod-node .face { width: 46px; height: 46px; border-radius: var(--pebble); background: var(--surface); display: grid; place-items: center; font: 800 15px var(--f-ui); color: var(--barro-ink); border: 1px solid var(--line); }
.mod-row:nth-child(2n) .face { border-radius: 45% 55% 50% 50% / 55% 48% 52% 45%; }
.mod-row.done .face { background: var(--agua); color: #fff; border-color: transparent; }
.mod-row.sealed .face { background: var(--barro); color: var(--on-barro); border-color: var(--oro); border-width: 2px; }
.mod-row.locked .face { color: var(--ink-3); background: var(--bg-2); }
.mod-card { padding: 14px 16px; display: grid; gap: 6px; }
.mod-card h3 { font: 400 19px/1.2 var(--f-brand); }
.mod-card .obj { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.mod-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mod-row.locked .mod-card { opacity: .72; }

/* Módulo */
.mod-hero { position: relative; overflow: hidden; display: grid; gap: 12px; padding: 22px 20px; border-radius: 28px 20px 32px 18px / 20px 32px 18px 28px; background: var(--grain), linear-gradient(160deg, var(--barro-deep), #2a130a); color: #f6e8d8; }
.mod-hero > *:not(.mark) { position: relative; z-index: 1; max-width: 78%; }
.mod-hero .eyebrow { color: rgb(246 232 216 / 70%); }
.mod-hero h2 { font: 400 30px/1.1 var(--f-brand); }
.mod-hero .where { font: italic 17px/1.4 var(--f-read); color: rgb(246 232 216 / 88%); }
.mod-hero .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-hero .chip { background: rgb(255 255 255 / 12%); color: #f6e8d8; }
.mod-hero .mark { position: absolute; right: -30px; bottom: -26px; width: 150px; opacity: .55; }
.mod-hero .mark .m-outline, .mod-hero .mark .m-handle { stroke: #f6e8d8; }
.mod-hero .mark .piece.off { fill: rgb(255 255 255 / 6%); stroke: rgb(246 232 216 / 40%); }
.mod-hero .mark .piece.hl.off { fill: rgb(221 179 90 / 30%); stroke: var(--oro); }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { padding: 12px 14px; border-radius: var(--hand-s); background: var(--surface-2); display: grid; gap: 2px; }
.fact.wide { grid-column: 1 / -1; }
.fact b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fact span { font-size: 14.5px; line-height: 1.35; }

.lesson-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); overflow: hidden; box-shadow: var(--shadow); }
.lesson-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; border-top: 1px dashed var(--line); }
.lesson-item:first-child { border-top: 0; }
.lesson-item:hover { background: var(--surface-2); }
.lesson-item .st { width: 32px; height: 32px; border-radius: var(--pebble); display: grid; place-items: center; border: 2px solid var(--line); color: var(--ink-3); font-size: 12.5px; font-weight: 800; }
.lesson-item.done .st { background: var(--agua); border-color: var(--agua); color: #fff; }
.lesson-item.next .st { border-color: var(--barro); color: var(--barro); }
.lesson-item h4 { font: 600 16.5px/1.3 var(--f-read); }
.lesson-item .tag { font: 800 10.5px var(--f-ui); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--oro-ink); vertical-align: 2px; margin-left: 4px; }
.lesson-item .sub { font-size: 12.5px; color: var(--ink-3); }

.piece-banner { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.piece-mini { width: 76px; }

/* ───── Lector ───── */
.reader { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.reader-top { position: sticky; top: 0; z-index: 10; padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 10px; background: var(--grain), var(--bg); }
.reader-top .row { gap: 6px; }
.segs { display: flex; gap: 4px; flex: 1; }
.segs i { flex: 1; height: 5px; border-radius: 5px 2px 5px 2px; background: var(--line); }
.segs i.on { background: var(--barro); }
.segs i.cur { background: linear-gradient(90deg, var(--barro) 50%, var(--line) 50%); }
.reader-body { padding: 8px 20px 24px; display: grid; gap: 18px; align-content: start; animation: rise .35s ease both; }
@keyframes rise { from { opacity: .001; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.step-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--barro); }
.step-label.acompana { color: var(--oro-ink); }
.step-label.seguridad, .step-label.caso { color: var(--alerta); }
.lesson-title { font: 400 31px/1.12 var(--f-brand); letter-spacing: -.01em; }
.prose { font: 400 var(--read-size)/1.62 var(--f-read); color: var(--ink); display: grid; gap: .8em; max-width: 36em; }
.prose strong { font-weight: 650; }
.prose ul { margin: 0; padding-left: 1.1em; display: grid; gap: .45em; }
.prose li::marker { color: var(--barro); }
.tool-prose { font-size: 17px; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--hand-s); background: var(--surface); }
.tbl table { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--f-ui); min-width: 420px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; background: var(--surface-2); }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { font-weight: 700; }
.box { border-radius: var(--hand); padding: 16px 18px; display: grid; gap: 10px; }
.box.acompana { background: var(--oro-soft); }
.box.seguridad, .box.caso { background: var(--alerta-soft); }
.box .prose { font-size: calc(var(--read-size) - 1px); }
.cierre-quote { margin: 0; font: italic 500 29px/1.28 var(--f-read); letter-spacing: -.005em; color: var(--ink); text-wrap: pretty; padding: 6px 0 4px 16px; border-left: 3px solid var(--oro); text-align: left; }
.reader-nav { position: sticky; bottom: 0; padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 10px; }
.reader-nav .btn { flex: 1; }
.reader-nav .btn.ghost { flex: 0 0 auto; }

.practice { display: grid; gap: 10px; padding: 16px; border-radius: var(--hand); background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--barro) 45%, var(--line)); }
.practice .lock { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
textarea, input[type="text"], input[type="date"], input[type="datetime-local"] { width: 100%; border: 1px solid var(--line); border-radius: var(--hand-s); background: var(--surface-2); padding: 12px 14px; font: 16px/1.45 var(--f-ui); resize: vertical; color: var(--ink); }
textarea { min-height: 96px; font-family: var(--f-read); font-size: 17px; }
textarea:focus, input:focus { outline: 2px solid var(--barro); outline-offset: 0; border-color: transparent; background: var(--surface); }
.adj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adj-grid .col { display: grid; gap: 6px; }
.adj-grid .col.wide { grid-column: 1 / -1; }
.adj-grid b { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }

.tool-link { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--hand-s); background: var(--agua-soft); color: var(--agua-ink); text-decoration: none; }
.tool-link .ti { width: 40px; height: 40px; border-radius: var(--pebble); background: var(--surface); display: grid; place-items: center; }
.tool-link b { display: block; font-size: 15px; }
.tool-link span { font-size: 12.5px; opacity: .85; }

/* Final de lección / evaluación */
.finish { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; gap: 20px; padding: 32px 22px; text-align: center; justify-items: center; }
.finish-vessel { width: 150px; }
.finish-mosaic { width: 170px; }
.finish .gain { font: 700 18px var(--f-ui); color: var(--agua); display: flex; align-items: center; gap: 6px; animation: pop .6s .4s both; }
.finish .gain.oro { color: var(--oro-ink); animation-delay: 1.6s; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } 60% { transform: scale(1.1); } to { opacity: 1; transform: none; } }
.finish .actions { display: grid; gap: 10px; width: 100%; max-width: 360px; }
.drops { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.drops i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--agua-light); opacity: .9; animation: fall 1.6s ease-in forwards; }
.drops i.g { background: var(--oro); border-radius: 2px 6px 3px 7px; width: 9px; height: 9px; }
@keyframes fall { to { transform: translateY(110vh) rotate(40deg); opacity: 0; } }

.quiz-q { font: 600 24px/1.25 var(--f-read); }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: var(--hand-s); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1.35; }
.opt .k { width: 28px; height: 28px; border-radius: var(--pebble); border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink-3); }
.opt[aria-pressed="true"] { border-color: var(--barro); background: var(--barro-soft); }
.opt[aria-pressed="true"] .k { background: var(--barro); border-color: var(--barro); color: var(--on-barro); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--alerta); background: var(--alerta-soft); }
.opt.wrong .k { background: var(--alerta); border-color: var(--alerta); color: #fff; }
.sort-item { display: grid; gap: 10px; padding: 14px; border-radius: var(--hand-s); background: var(--surface); border: 1.5px solid var(--line); }
.sort-item p { font: 500 17px/1.35 var(--f-read); }
.sort-item.right { border-color: var(--ok); }
.sort-item.wrong { border-color: var(--alerta); }
.cats, .choices { display: flex; flex-wrap: wrap; gap: 6px; }
.cat { border: 1.5px solid var(--line); background: var(--surface-2); border-radius: var(--hand-s); padding: 7px 12px; font-size: 13.5px; font-weight: 750; cursor: pointer; color: var(--ink-2); }
.cat[aria-pressed="true"] { background: var(--barro); border-color: var(--barro); color: var(--on-barro); }
.cat.ans { box-shadow: 0 0 0 2px var(--ok); }
.order-seq { display: grid; gap: 8px; min-height: 60px; padding: 12px; border-radius: var(--hand-s); background: var(--surface-2); border: 1.5px dashed var(--line); }
.order-seq .ph { color: var(--ink-3); font-size: 14px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.order-chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--hand-s); padding: 10px 14px; font: 600 16px var(--f-read); cursor: pointer; }
.order-seq .order-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.order-seq .order-chip b { font: 800 12px var(--f-ui); color: var(--barro); width: 18px; }
.order-chip.right { border-color: var(--ok); background: var(--ok-soft); }
.order-chip.wrong { border-color: var(--alerta); background: var(--alerta-soft); }
.feedback { border-radius: var(--hand); padding: 16px; display: grid; gap: 6px; animation: rise .3s ease both; }
.feedback.ok { background: var(--ok-soft); }
.feedback.no { background: var(--alerta-soft); }
.feedback b { font-size: 15px; }
.feedback.ok b { color: var(--ok); }
.feedback.no b { color: var(--alerta); }
.feedback p { font: 17px/1.45 var(--f-read); }
.crit-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--alerta); }

/* ───── Herramientas ───── */
.tool-group { display: grid; gap: 10px; }
.tool-group header { display: grid; gap: 2px; }
.tool-group header h2 { font: 400 20px/1.2 var(--f-brand); }
.tool-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); overflow: hidden; box-shadow: var(--shadow); }
.tool-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; text-decoration: none; color: inherit; border-top: 1px dashed var(--line); }
.tool-row:first-child { border-top: 0; }
.tool-row:hover { background: var(--surface-2); }
.tool-row .ti { width: 42px; height: 42px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--agua-soft); color: var(--agua-ink); }
.tool-row:nth-child(2n) .ti { border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%; }
.tool-row.proto .ti { background: var(--alerta-soft); color: var(--alerta); }
.tool-row.acomp .ti { background: var(--oro-soft); color: var(--oro-ink); }
.tool-row h3 { font: 600 16.5px/1.25 var(--f-read); }
.tool-row p { font-size: 13px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-row .code { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--ink-3); }
.done-dot { width: 24px; height: 24px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }

.tool-head { display: grid; gap: 8px; }
.blk { display: grid; gap: 12px; }
.blk > h3 { font: 400 20px/1.2 var(--f-brand); }
.blk .sub { font-size: 14px; color: var(--ink-2); }
.q-read { font: 600 18px/1.4 var(--f-read); }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 14.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.fields.compact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields.compact .field:first-child { grid-column: 1 / -1; }
.fields.compact.two .field:first-child { grid-column: auto; }
.checks { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); overflow: hidden; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 13px 14px; border-top: 1px dashed var(--line); cursor: pointer; font-size: 15.5px; line-height: 1.4; }
.check:first-child { border-top: 0; }
.check.plain { padding: 4px 0; border: 0; }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 8px 6px 9px 5px; border: 2px solid var(--line); margin: 0; display: grid; place-items: center; background: var(--surface); cursor: pointer; }
.check input:checked { background: var(--barro); border-color: var(--barro); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: solid var(--on-barro); border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.check input:checked + span { color: var(--ink-2); }
.note { border-radius: var(--hand-s); padding: 14px 16px; font-size: 15px; line-height: 1.5; display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.note.a { background: var(--oro-soft); }
.note.a .ico { color: var(--oro-ink); }
.note.safe { background: var(--alerta-soft); }
.note.safe .ico { color: var(--alerta); }
.note.info { background: var(--agua-soft); }
.note.info .ico { color: var(--agua-ink); }
.note strong { font-weight: 750; }
.quote-block { margin: 0; padding: 18px 20px; border-radius: var(--hand); background: var(--surface-2); font: italic 18px/1.45 var(--f-read); border-left: 3px solid var(--oro); }
.steps { display: grid; padding: 0; margin: 0; counter-reset: s; }
.steps li { list-style: none; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 0; }
.steps li::before { counter-increment: s; content: counter(s); width: 30px; height: 30px; border-radius: var(--pebble); background: var(--barro-soft); color: var(--barro-ink); display: grid; place-items: center; font-weight: 800; font-size: 13.5px; }
.steps li b { display: block; font-size: 15.5px; }
.steps li span { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.steps li .ink { color: var(--ink); }
.rows-list { display: grid; gap: 10px; }
.row-card { display: grid; gap: 10px; padding: 14px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); position: relative; }
.row-card .del { position: absolute; top: 8px; right: 8px; }
.row-card .n { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; padding-right: 40px; }

.natl { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); overflow: hidden; }
.natl-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px dashed var(--line); }
.natl-row:first-child { border-top: 0; }
.natl-row b { display: block; font-size: 14.5px; }
.natl-row span { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.natl-num { font: 800 15px var(--f-ui); font-variant-numeric: tabular-nums; color: var(--on-barro); background: var(--barro); padding: 8px 12px; border-radius: var(--hand-s); text-decoration: none; white-space: nowrap; }

.flip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flip { perspective: 900px; border: 0; padding: 0; background: none; cursor: pointer; min-height: 132px; text-align: left; }
.flip .in { position: relative; display: block; width: 100%; height: 100%; min-height: 132px; transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip.on .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--hand); padding: 14px; display: grid; align-content: space-between; gap: 8px; }
.flip .f { background: var(--surface); border: 1px solid var(--line); font: 600 16px/1.3 var(--f-read); color: var(--ink); }
.flip .b { background: var(--grain), var(--barro-deep); color: #f6e8d8; transform: rotateY(180deg); font: 500 16px/1.35 var(--f-read); }
.flip small { font: 700 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; opacity: .6; }

.test-item { display: grid; gap: 10px; padding: 16px 0; border-top: 1px dashed var(--line); }
.test-item:first-child { border-top: 0; }
.test-item p { font: 500 18px/1.4 var(--f-read); }
.test-item .n { font: 800 12px var(--f-ui); color: var(--ink-3); letter-spacing: .06em; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scale button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--hand-s); padding: 9px 4px; font-size: 13px; font-weight: 750; color: var(--ink-2); cursor: pointer; line-height: 1.15; }
.scale button[aria-pressed="true"] { background: var(--barro); border-color: var(--barro); color: var(--on-barro); }
.progress-line { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--agua); border-radius: 6px; transition: width .4s ease; }
.sticky-progress { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 62px); z-index: 5; background: var(--grain), var(--bg); padding: 8px 0; display: grid; gap: 6px; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr 44px; gap: 10px; align-items: center; font-size: 14.5px; font-weight: 650; }
.bar-row .track { height: 12px; border-radius: 12px 4px 12px 4px; background: var(--bg-2); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--agua-light); }
.bar-row.top .track i { background: var(--agua); }
.bar-row .v { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.result-card { display: grid; gap: 14px; padding: 20px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.result-card .kv { display: grid; gap: 4px; }
.result-card .kv b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.result-card .kv span { font: 17px/1.45 var(--f-read); }
.bipolar { display: grid; gap: 8px; padding: 16px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); }
.bipolar h4 { font: 400 18px var(--f-brand); }
.bipolar .poles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.bipolar .poles span:last-child { text-align: right; }
.bipolar .dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bipolar .dots button { height: 40px; border-radius: var(--pebble); border: 1.5px solid var(--line); background: var(--surface-2); font-weight: 800; color: var(--ink-3); cursor: pointer; }
.bipolar .dots button[aria-pressed="true"] { background: var(--barro); border-color: var(--barro); color: var(--on-barro); }
.ls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ls div { padding: 10px 12px; border-radius: var(--hand-s); font-size: 14px; line-height: 1.35; }
.ls .l { background: var(--agua-soft); }
.ls .s { background: var(--barro-soft); }
.ls b { display: block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.roles { display: grid; gap: 10px; }
.role { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--hand); border: 1.5px solid var(--line); background: var(--surface); }
.role h4 { font: 400 18px var(--f-brand); }
.role dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 14px; }
.role dt { color: var(--ink-3); font-weight: 700; }
.role dd { margin: 0; }
.role.pick { border-color: var(--barro); box-shadow: 0 0 0 3px var(--barro-soft); }
.strata { display: grid; border-radius: var(--hand); overflow: hidden; }
.stratum { padding: 16px; display: grid; gap: 8px; }
.stratum:nth-child(1) { background: color-mix(in srgb, var(--barro-soft) 55%, var(--surface)); }
.stratum:nth-child(2) { background: var(--barro-soft); }
.stratum:nth-child(3) { background: color-mix(in srgb, var(--barro) 45%, var(--surface)); }
.stratum:nth-child(4) { background: var(--grain), var(--barro-deep); color: #f6e8d8; }
.stratum h4 { font: 400 19px var(--f-brand); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.stratum h4 small { font: 600 13px var(--f-ui); opacity: .8; }
.stratum textarea { background: rgb(255 255 255 / 55%); min-height: 70px; }
.stratum:nth-child(4) textarea { background: rgb(255 255 255 / 10%); color: #fff; border-color: rgb(255 255 255 / 22%); }
.stratum .ej { font: italic 14.5px/1.4 var(--f-read); opacity: .85; }

.paper { position: relative; border-radius: 4px 7px 5px 8px; padding: 26px 20px 30px; background: repeating-linear-gradient(var(--surface) 0 31px, color-mix(in srgb, var(--barro) 18%, transparent) 31px 32px); box-shadow: var(--shadow); border: 1px solid var(--line); transform-origin: 50% 100%; }
.paper textarea { background: transparent; border: 0; font: 19px/32px var(--f-read); min-height: 320px; padding: 0; outline: none; }
.paper textarea:focus { outline: none; background: transparent; }
.paper.tear { animation: tear 1.3s ease-in forwards; }
.paper.burn { animation: burn 2.2s ease-in forwards; }
@keyframes tear { 0% { clip-path: polygon(0 0,100% 0,100% 100%,0 100%); } 20% { clip-path: polygon(0 0,48% 0,55% 30%,46% 60%,54% 100%,0 100%); transform: rotate(-2deg); } 100% { clip-path: polygon(0 0,48% 0,55% 30%,46% 60%,54% 100%,0 100%); transform: translateY(80vh) rotate(-22deg); opacity: 0; } }
@keyframes burn { 0% { filter: none; } 35% { filter: sepia(1) saturate(4) hue-rotate(-20deg) brightness(1.1); box-shadow: 0 0 60px 10px rgb(255 140 50 / 60%); } 70% { filter: grayscale(1) brightness(.4); opacity: .6; } 100% { filter: grayscale(1) brightness(.2); opacity: 0; transform: scale(.94) translateY(-20px); } }
.pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pieces button { display: grid; gap: 6px; justify-items: center; padding: 14px 8px; border-radius: var(--hand); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 750; font-size: 14px; }
.pieces button .ico { width: 26px; height: 26px; color: var(--barro); }
.declaration { padding: 24px 22px; border-radius: 4px 7px 5px 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font: 19px/1.6 var(--f-read); display: grid; gap: 12px; }
.declaration u { text-decoration: none; border-bottom: 1.5px solid var(--barro); padding: 0 2px; }
.declaration .sign { font-style: italic; color: var(--ink-2); font-size: 16px; }
.psalm { padding: 24px 22px; border-radius: var(--hand); background: var(--grain), linear-gradient(160deg, var(--barro-deep), #2a130a); color: #f6e8d8; font: italic 20px/1.55 var(--f-read); display: grid; gap: 10px; }

.tree-step { display: grid; gap: 14px; padding: 20px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); animation: rise .3s ease both; }
.tree-step .qn { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.tree-step h3 { font: 600 23px/1.25 var(--f-read); }
.tree-out { border-radius: var(--hand); padding: 20px; display: grid; gap: 10px; animation: rise .3s ease both; }
.tree-out.urgent { background: var(--alerta); color: #fff; }
.tree-out.urgent .btn.ghost { color: #fff; border-color: rgb(255 255 255 / 50%); }
.tree-out.refer { background: var(--alerta-soft); }
.tree-out.go { background: var(--ok-soft); }
.tree-out p { font: 18px/1.45 var(--f-read); }
.tree-out p.eyebrow { font: 700 12px/1.4 var(--f-ui); letter-spacing: .08em; color: inherit; opacity: .8; }
.tree-trail { display: flex; flex-wrap: wrap; gap: 6px; }

.gate { display: grid; gap: 14px; padding: 20px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gate h3 { font: 400 22px/1.25 var(--f-brand); }
.gate-q { display: grid; gap: 8px; padding: 12px 0; border-top: 1px dashed var(--line); }
.gate-q p { font-size: 15.5px; line-height: 1.4; font-weight: 600; }
.yn { display: flex; gap: 8px; }
.yn button { flex: 1; min-height: 42px; border-radius: var(--hand-s); border: 1.5px solid var(--line); background: var(--surface-2); font-weight: 750; cursor: pointer; padding: 8px; line-height: 1.25; }
.yn button[aria-pressed="true"] { background: var(--agua); border-color: var(--agua); color: #fff; }
.yn button.no[aria-pressed="true"] { background: var(--alerta); border-color: var(--alerta); color: #fff; }

/* ───── Diario ───── */
.privacy { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 14px 16px; border-radius: var(--hand); background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.entry { display: grid; gap: 4px; padding: 14px 16px; text-decoration: none; color: inherit; border-top: 1px dashed var(--line); }
.entry:first-child { border-top: 0; }
a.entry:hover { background: var(--surface-2); }
.entry h3 { font: 600 17px/1.3 var(--f-read); }
.entry p { font: 15px/1.45 var(--f-read); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry p.quote-line { -webkit-line-clamp: unset; color: var(--ink); font-style: italic; }
.entry .when { font-size: 12px; color: var(--ink-3); font-weight: 650; display: flex; gap: 8px; align-items: center; }
.empty { text-align: center; padding: 34px 18px; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); position: relative; }
.empty .sherd { position: relative; width: 70px; height: 70px; opacity: .5; }
.empty .ico { width: 36px; height: 36px; color: var(--barro); }

/* ───── Tu cántaro ───── */
.profile { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 12px 6px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); text-align: center; display: grid; gap: 2px; }
.stat b { font: 400 25px/1 var(--f-brand); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.mosaic-card { padding: 18px; border-radius: var(--hand); background: var(--grain), var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mosaic-wrap { width: min(250px, 72%); margin: 0 auto; }
.ladder { display: grid; }
.rung { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.rung::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: 0; width: 2px; background: repeating-linear-gradient(var(--line) 0 5px, transparent 5px 9px); }
.rung:last-child::before { display: none; }
.rung .badge { width: 40px; height: 40px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); z-index: 1; }
.rung.got .badge { background: var(--oro); color: #2a1c0a; }
.rung.cur .badge { background: var(--barro-soft); color: var(--barro); box-shadow: 0 0 0 4px var(--barro-soft); }
.rung h3 { font: 400 19px/1.2 var(--f-brand); }
.rung ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.rung li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; color: var(--ink-2); }
.rung li.ok { color: var(--ink); }
.rung li .ico { margin-top: 2px; }
.rung li.ok .ico { color: var(--ok); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.bdg { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 12px 6px; border-radius: var(--hand); background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.bdg .b-ico { width: 44px; height: 44px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--oro-soft); color: var(--oro-ink); }
.bdg:nth-child(3n) .b-ico { border-radius: 45% 55% 50% 50% / 56% 46% 54% 44%; }
.bdg.off { opacity: .45; }
.bdg.off .b-ico { background: var(--bg-2); color: var(--ink-3); }
.disclaimer { font-size: 13px; color: var(--ink-2); line-height: 1.5; padding: 14px 16px; border-radius: var(--hand-s); background: var(--surface-2); }

/* Ajustes */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--hand); overflow: hidden; }
.set { display: grid; gap: 8px; padding: 16px; border-top: 1px dashed var(--line); }
.set:first-child { border-top: 0; }
.set > label, .set > .lbl, .set .lbl { font-weight: 750; font-size: 15px; }
.set .hint { font-size: 13px; color: var(--ink-3); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--hand-s); background: var(--bg-2); }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 9px 6px; font-weight: 750; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 14px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 30px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); }
.switch input:checked { background: var(--barro); }
.switch input:checked::after { transform: translateX(20px); }

/* Idioma y país */
.locales { display: grid; gap: 8px; }
.locale { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--hand-s); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.locale b { font-weight: 750; font-size: 15px; }
.locale span { font-size: 13.5px; color: var(--ink-2); }
.locale[aria-pressed="true"] { border-color: var(--barro); background: var(--barro-soft); }
.locale[aria-pressed="true"] span { color: var(--barro-ink); }
.locales.compact .locale { padding: 10px 14px; }

/* ───── Hojas y avisos ───── */
.sheet-back { position: fixed; inset: 0; z-index: 80; background: rgb(30 14 8 / 50%); display: grid; align-items: end; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { background: var(--grain), var(--bg); border-radius: 28px 22px 0 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 22px); width: 100%; max-width: var(--maxw); margin: 0 auto; display: grid; gap: 16px; animation: up .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 4px; }
.sheet h2 { font: 400 24px/1.2 var(--f-brand); }
.share-img { width: 100%; border-radius: 18px; display: block; }
.install-art { width: 78px; margin: 4px auto 0; }
.why { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.why li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.why li .ico { color: var(--barro); margin-top: 1px; }
.selectable { user-select: all; font-size: 17px; }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
body.immersive .toast-wrap { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 60px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--hand-s); font-weight: 650; font-size: 14.5px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; animation: up .3s ease both; max-width: 100%; }
.toast.oro { background: var(--oro); color: #2a1c0a; }

/* ───── Bienvenida ───── */
.onb { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 22px); gap: 20px; position: relative; overflow: hidden; }
.onb .body { display: grid; align-content: center; gap: 16px; animation: rise .45s ease both; position: relative; z-index: 1; }
.onb-hero .body { justify-items: center; text-align: center; }
.onb-vessel { width: 132px; }
.onb h1 { text-align: center; }
.onb .lead { font: 19px/1.5 var(--f-read); color: var(--ink-2); max-width: 30em; }
.onb .verse { font: italic 15px/1.4 var(--f-read); color: var(--barro-ink); }
.onb-hero .locales { width: 100%; max-width: 380px; margin-top: 4px; }
.sherds .sherd { opacity: .22; }
.sherds .s1 { left: -20px; top: 60px; width: 110px; height: 110px; transform: rotate(-20deg); }
.sherds .s2 { right: -28px; top: 32%; width: 130px; height: 130px; transform: rotate(32deg); }
.sherds .s3 { right: 16%; top: 14px; width: 64px; height: 64px; transform: rotate(8deg); }
.onb .dots { display: flex; justify-content: center; gap: 6px; }
.onb-nav { display: flex; gap: 10px; }
.onb-nav .btn.ghost { flex: 0 0 auto; }
.onb .dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--line); }
.onb .dots i.on { width: 24px; background: var(--barro); }
.choice { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 18px; border-radius: var(--hand); border: 2px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; align-items: start; }
.choice .ci { width: 48px; height: 48px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--agua-soft); color: var(--agua-ink); }
.choice.b .ci { background: var(--oro-soft); color: var(--oro-ink); }
.choice h3 { font: 400 20px/1.2 var(--f-brand); }
.choice p { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.choice[aria-pressed="true"] { border-color: var(--barro); box-shadow: 0 0 0 4px var(--barro-soft); }
.promise { display: grid; gap: 12px; }
.promise > div { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.promise .pi { width: 40px; height: 40px; border-radius: var(--pebble); display: grid; place-items: center; background: var(--barro-soft); color: var(--barro-ink); }
.promise b { display: block; font-size: 15.5px; }
.promise span span { font-size: 14px; color: var(--ink-2); line-height: 1.4; }

@media (min-width: 700px) {
  body { background: var(--grain), var(--bg-2); }
  #app { background: var(--grain), var(--bg); box-shadow: 0 0 0 1px var(--line); }
}
@media (max-width: 380px) {
  .hero { grid-template-columns: 100px 1fr; padding: 16px; gap: 14px; }
  .hero .pct { font-size: 38px; }
  .duo, .flip-grid, .adj-grid, .facts-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .wordmark.xl { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
