/* tucuento.kids — Layout: limpio y luminoso. Cada sección tiene su color e ícono; botones gigantes tipo "botón físico";
   Lumi (la mascota) acompaña la navegación. Look único y claro a propósito: todos los colores definidos explícitamente. */
:root {
  color-scheme: light;
  --bg: #F5F9FF;
  --surface: #FFFFFF;
  --ink: #1F2240;
  --muted: #5B6080;
  --line: #E3E8F5;
  --sun: #FFC93C;   --sun-d: #E0A400;   --sun-soft: #FFF5D6;
  --coral: #FF6B6B; --coral-d: #D94848; --coral-soft: #FFE8E8;
  --sky: #4DA8FF;   --sky-d: #2580E0;   --sky-soft: #E3F1FF;
  --mint: #22C79A;  --mint-d: #12A07A;  --mint-soft: #DDF8EF;
  --grape: #8B5CF6; --grape-d: #6A3BD6; --grape-soft: #EEE7FF;
  --shadow: 0 14px 34px rgba(31, 34, 64, .10);
  --shadow-lg: 0 24px 60px rgba(31, 34, 64, .16);

  --f-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --f-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --r: 28px;
  /* Color activo de la sección (se cambia por sección) */
  --c: var(--sky); --c-d: var(--sky-d); --c-soft: var(--sky-soft);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 1.125rem; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--surface); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 4px solid var(--grape); outline-offset: 3px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
section { padding-block: clamp(64px, 9vw, 110px); scroll-margin-top: 80px; }

/* Colores por sección */
.c-sun   { --c: var(--sun);   --c-d: var(--sun-d);   --c-soft: var(--sun-soft); }
.c-coral { --c: var(--coral); --c-d: var(--coral-d); --c-soft: var(--coral-soft); }
.c-sky   { --c: var(--sky);   --c-d: var(--sky-d);   --c-soft: var(--sky-soft); }
.c-mint  { --c: var(--mint);  --c-d: var(--mint-d);  --c-soft: var(--mint-soft); }
.c-grape { --c: var(--grape); --c-d: var(--grape-d); --c-soft: var(--grape-soft); }
.tint { background: var(--c-soft); }

/* Encabezado de sección: ícono grande + título corto */
.sec-head { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.sec-icon { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--c); color: var(--surface); box-shadow: 0 8px 0 var(--c-d); flex: none; transform: rotate(-6deg); }
.sec-icon .ic { width: 40px; height: 40px; stroke-width: 2.4; }
.sec-head h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.sec-head p { color: var(--muted); font-size: 1.15rem; margin-top: 4px; }

/* ---------- Botones gigantes con reacción ---------- */
.big {
  --bc: var(--c); --bd: var(--c-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 72px; padding: 0 34px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  font: 600 1.35rem/1 var(--f-display); color: var(--surface); background: var(--bc);
  box-shadow: 0 8px 0 var(--bd), 0 16px 26px rgba(31, 34, 64, .14);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.big .ic { width: 30px; height: 30px; stroke-width: 2.6; }
.big:hover { transform: translateY(-4px) scale(1.04); animation: wiggle .5s ease; }
.big:active { transform: translateY(7px) scale(.97, .93); box-shadow: 0 1px 0 var(--bd), 0 4px 10px rgba(31, 34, 64, .12); animation: none; }
.big.light { background: var(--surface); color: var(--ink); --bd: var(--line); }
.big.ink { --bc: var(--ink); --bd: #0D0F22; }
.big.wa { --bc: #25C063; --bd: #149447; }
.big.md { min-height: 60px; font-size: 1.15rem; padding: 0 26px; }
.big[disabled] { opacity: .45; cursor: not-allowed; transform: none; animation: none; box-shadow: 0 4px 0 var(--bd); }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -3deg; } 60% { rotate: 3deg; } }
.pop-in { animation: popIn .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes popIn { 0% { transform: scale(.6); } 100% { transform: scale(1); } }

/* Confeti */
.confetti { position: fixed; z-index: 100; width: 12px; height: 12px; border-radius: 3px; pointer-events: none; animation: burst .8s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); box-shadow: 0 2px 0 var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 10px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 700 1.6rem/1 var(--f-display); color: var(--ink); }
.logo .mark { width: 44px; height: 44px; }
.logo b { color: var(--coral); font-weight: 700; }
.logo small { font-size: .62em; color: var(--sky-d); }
.topnav { display: flex; gap: 6px; align-items: center; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; text-decoration: none; font: 600 1.02rem/1 var(--f-display); transition: background .15s, transform .15s; }
.topnav a .dot { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: var(--surface); }
.topnav a .dot .ic { width: 20px; height: 20px; }
.topnav a:hover { background: var(--c-soft); transform: translateY(-2px) rotate(-2deg); }
.sound-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--grape-soft); color: var(--grape-d); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.sound-btn .ic { width: 26px; height: 26px; }
.sound-btn:hover { transform: scale(1.1) rotate(-8deg); }
.sound-btn:active { transform: scale(.9); }
@media (max-width: 1020px) { .topnav a span.t { display: none; } .topnav a { padding: 6px; } }
@media (max-width: 760px) { .topnav { display: none; } }

/* Barra inferior en móvil */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); box-shadow: 0 -2px 0 var(--line), 0 -10px 30px rgba(31, 34, 64, .08);
    padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .tabbar a { display: grid; justify-items: center; gap: 4px; text-decoration: none; font: 600 .78rem/1 var(--f-display); color: var(--muted); padding: 4px 0; }
  .tabbar a .dot { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-d); transition: transform .15s; }
  .tabbar a .dot .ic { width: 26px; height: 26px; }
  .tabbar a:active .dot { transform: scale(.88); }
  .tabbar a.on .dot { background: var(--c); color: var(--surface); }
}

/* ---------- Lumi, la mascota ---------- */
.lumi { overflow: visible; }
.lumi .float { animation: float 3s ease-in-out infinite; }
.lumi .eyes-open ellipse { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
.lumi .wing-l { transform-box: fill-box; transform-origin: 100% 50%; animation: flapL 1.1s ease-in-out infinite; }
.lumi .wing-r { transform-box: fill-box; transform-origin: 0% 50%; animation: flapR 1.1s ease-in-out infinite; }
.lumi .arm-r { transform-box: fill-box; transform-origin: 0% 100%; animation: wave 1.6s ease-in-out infinite; }
.lumi .eyes-happy { display: none; }
.lumi.happy .eyes-open { display: none; }
.lumi.happy .eyes-happy { display: inline; }
.lumi.jump .float { animation: jump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes flapL { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(16deg); } }
@keyframes flapR { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-16deg); } }
@keyframes wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-24deg); } }
@keyframes jump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-28px) scale(1.08, .95); } 100% { transform: translateY(0) scale(1); } }

.bubble {
  position: relative; background: var(--surface); border-radius: 26px; padding: 16px 20px; box-shadow: var(--shadow);
  font: 500 1.15rem/1.3 var(--f-display); color: var(--ink); max-width: 300px;
}
.bubble::after { content: ""; position: absolute; width: 22px; height: 22px; background: var(--surface); transform: rotate(45deg); border-radius: 4px; }
.bubble.tail-left::after { left: -8px; top: 50%; margin-top: -11px; }
.bubble.tail-down::after { bottom: -8px; right: 46px; }

.buddy { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: flex; align-items: flex-end; gap: 6px; flex-direction: column; transition: opacity .25s, transform .25s; }
.buddy .bubble { font-size: 1.02rem; max-width: 240px; transition: opacity .3s, transform .3s; transform-origin: 80% 100%; }
.buddy .bubble.quiet { opacity: 0; transform: scale(.7); }
.buddy button { background: none; border: 0; padding: 0; cursor: pointer; width: 96px; }
.buddy.away { opacity: 0; transform: translateY(30px); pointer-events: none; }
@media (max-width: 760px) { .buddy { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } .buddy button { width: 72px; } .buddy .bubble { max-width: 200px; font-size: .95rem; padding: 12px 14px; } }

/* ---------- Portada (hero) ---------- */
.hero { padding-block: clamp(36px, 6vw, 72px) clamp(56px, 8vw, 96px); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 60px); align-items: center; }
.hero-copy { display: grid; gap: 24px; justify-items: start; min-width: 0; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--coral); }
.name-field { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 520px; background: var(--surface); border-radius: 999px; padding: 10px 10px 10px 22px; box-shadow: var(--shadow); border: 3px solid var(--sun); }
.name-field .ic { width: 32px; height: 32px; color: var(--sun-d); }
.name-field input[type="text"] { flex: 1; min-height: 0; border-radius: 0; box-shadow: none; min-width: 0; border: 0; outline: none; background: transparent; font: 600 1.7rem/1.2 var(--f-display); color: var(--ink); padding: 8px 0; }
.name-field:focus-within { border-color: var(--coral); box-shadow: 0 0 0 6px var(--coral-soft), var(--shadow); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-weight: 700; font-size: 1rem; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust .ic { color: var(--mint-d); }
.hero-art { position: relative; justify-self: center; width: min(460px, 100%); }
.hero-art .cover { transform: rotate(3deg); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.hero-art:hover .cover { transform: rotate(-1deg) scale(1.02); }
.hero-lumi { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 22px 0 0 -10px; }
.hero-lumi .lumi { width: 116px; flex: none; }

.blob { position: absolute; border-radius: 50%; z-index: 0; }
.blob.a { width: 64%; aspect-ratio: 1; background: var(--sun); top: -8%; right: -10%; opacity: .55; }
.blob.b { width: 40%; aspect-ratio: 1; background: var(--sky); bottom: 12%; left: -6%; opacity: .35; }
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { width: min(380px, 92%); }
  .hero-lumi .lumi { width: 92px; }
  .hero-lumi .bubble { font-size: 1rem; }
}

/* Portada del libro */
.cover {
  position: relative; z-index: 1; aspect-ratio: 1; width: 100%; max-width: 100%; overflow: hidden; container-type: inline-size;
  border-radius: 10px 30px 30px 10px; box-shadow: var(--shadow-lg); background: var(--cv, var(--sky));
}
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 5%; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.22) 70%, transparent); }
.cover svg, .cover img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cover img, .style-card .art img, .tile .mini img { object-fit: cover; }
.cover-brand { position: absolute; top: 4.5%; right: 5%; z-index: 1; font: 700 3.6cqi/1 var(--f-display); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 1.6cqi 3cqi; }
.cover-title { position: absolute; left: 7%; right: 7%; bottom: 5%; z-index: 1; padding: 3.4cqi 4cqi; text-align: center; background: var(--surface); color: var(--ink); border-radius: 5cqi; box-shadow: 0 1.4cqi 0 rgba(31, 34, 64, .18); font: 700 clamp(.9rem, 6.6cqi, 2.1rem)/1.05 var(--f-display); text-wrap: balance; }

/* Galería del primer libro */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.gallery figure { margin: 0; padding: 10px 10px 14px; display: grid; align-content: start; gap: 10px; grid-column: span 2; }
.gallery figure:nth-child(-n+2) { grid-column: span 3; }
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; display: block; }
.gallery figcaption { font: 600 1.1rem/1.2 var(--f-display); text-align: center; }
@media (max-width: 880px) {
  .gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 6px 18px; }
  .gallery figure, .gallery figure:nth-child(-n+2) { grid-column: auto; scroll-snap-align: start; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.tap { cursor: pointer; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; }
.tap:hover { transform: translateY(-8px) rotate(-1.2deg); box-shadow: var(--shadow-lg); }
.tap:active { transform: scale(.96); }

/* Aventuras */
.adventures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.adv { display: grid; overflow: hidden; text-align: left; border: 0; padding: 0; font: inherit; color: inherit; }
.adv .art { aspect-ratio: 1; position: relative; }
.adv .art svg { width: 100%; height: 100%; display: block; }
.adv .badge { position: absolute; top: 14px; left: 14px; width: 58px; height: 58px; border-radius: 20px; background: var(--c); color: var(--surface); display: grid; place-items: center; box-shadow: 0 6px 0 var(--c-d); }
.adv .badge .ic { width: 32px; height: 32px; }
.adv .body { padding: 18px 20px 22px; display: grid; gap: 6px; }
.adv h3 { font-size: 1.45rem; }
.adv .age { font-weight: 800; color: var(--c-d); }
.adv[aria-pressed="true"] { box-shadow: 0 0 0 5px var(--c), var(--shadow-lg); }
@media (max-width: 1040px) { .adventures { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .adventures { grid-template-columns: 1fr 1fr; gap: 14px; } .adv h3 { font-size: 1.1rem; } .adv .body { padding: 12px 14px 16px; } .adv .badge { width: 44px; height: 44px; border-radius: 15px; } .adv .badge .ic { width: 24px; height: 24px; } }

/* Estilos */
.styles-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.style-card { display: grid; gap: 12px; padding: 12px 12px 18px; border: 0; font: inherit; color: inherit; text-align: center; }
.style-card .art { aspect-ratio: 300 / 360; border-radius: 20px; overflow: hidden; }
.style-card .art svg, .style-card .art img { width: 100%; height: 100%; display: block; }
.style-card h3 { font-size: 1.25rem; }
.style-card .ref { font-size: .9rem; color: var(--muted); font-weight: 700; }
.style-card[aria-pressed="true"] { box-shadow: 0 0 0 5px var(--c), var(--shadow-lg); }
.style-card[aria-pressed="true"] h3::before { content: "✓ "; color: var(--c-d); }
.fine { font-size: .85rem; color: var(--muted); margin-top: 30px; max-width: 80ch; }
@media (max-width: 1040px) {
  .styles-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(210px, 40%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 6px 22px; }
  .style-card { scroll-snap-align: start; }
}
@media (max-width: 520px) { .styles-row { grid-auto-columns: 66%; } }

/* Cómo funciona */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.how-step { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 34px 22px; }
.how-step .circle { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--c-soft); color: var(--c-d); position: relative; }
.how-step .circle .ic { width: 60px; height: 60px; stroke-width: 2; }
.how-step .n { position: absolute; top: -4px; right: -4px; width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: var(--surface); display: grid; place-items: center; font: 700 1.3rem/1 var(--f-display); box-shadow: 0 4px 0 var(--c-d); }
.how-step h3 { font-size: 1.6rem; }
.how-step p { color: var(--muted); }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } .how-step { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; padding: 20px; } .how-step .circle { width: 84px; height: 84px; grid-row: span 2; } .how-step .circle .ic { width: 42px; height: 42px; } }

/* ---------- Creador ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(22px, 4vw, 40px); align-items: start; }
.steps { display: flex; justify-content: space-between; gap: 6px; padding: 22px clamp(14px, 3vw, 30px) 10px; position: relative; }
.steps::before { content: ""; position: absolute; left: 12%; right: 12%; top: 54px; height: 6px; border-radius: 6px; background: var(--line); }
.step-btn { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; font: 600 .9rem/1.1 var(--f-display); color: var(--muted); flex: 1; min-width: 0; }
.step-btn .dot { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 4px solid var(--line); color: var(--muted); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.step-btn .dot .ic { width: 30px; height: 30px; }
.step-btn:hover .dot { transform: scale(1.1) rotate(-6deg); }
.step-btn.done .dot { background: var(--mint); border-color: var(--mint); color: var(--surface); }
.step-btn[aria-selected="true"] { color: var(--ink); }
.step-btn[aria-selected="true"] .dot { background: var(--sky); border-color: var(--sky); color: var(--surface); transform: scale(1.12); box-shadow: 0 6px 0 var(--sky-d); }
@media (max-width: 560px) { .step-btn .t { display: none; } .step-btn .dot { width: 52px; height: 52px; } .steps::before { top: 46px; } }

.guide { display: flex; align-items: center; gap: 10px; padding: 8px clamp(16px, 3vw, 30px) 0; }
.guide .lumi { width: 84px; flex: none; }
.guide .bubble { max-width: none; flex: 1; font-size: 1.2rem; }
.step-body { padding: 18px clamp(16px, 3vw, 30px) 28px; display: grid; gap: 24px; }
.field { display: grid; gap: 10px; min-width: 0; }
.lbl, .field > label { font: 600 1.15rem/1.2 var(--f-display); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lbl .ic, .field > label .ic { color: var(--sky-d); width: 26px; height: 26px; }
.help { font-size: .92rem; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row.three { grid-template-columns: .8fr 1fr 1fr; }
@media (max-width: 600px) { .row, .row.three { grid-template-columns: 1fr; } }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: 600 1.15rem/1.3 var(--f-body); color: var(--ink); background: var(--bg); width: 100%; min-height: 60px;
  border: 3px solid var(--line); border-radius: 18px; padding: 12px 16px; transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 5px var(--sky-soft); background: var(--surface); }
textarea { resize: vertical; min-height: 110px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  font: 600 1.05rem/1 var(--f-display); color: var(--ink); background: var(--bg); border: 3px solid var(--line);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .15s, border-color .15s;
}
.chip .ic { width: 24px; height: 24px; color: var(--sky-d); }
.chip:hover { transform: translateY(-3px) scale(1.04); }
.chip:active { transform: scale(.92); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--sky); border-color: var(--sky); color: var(--surface); }
.chip[aria-pressed="true"] .ic, .chip:has(input:checked) .ic { color: var(--surface); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 4px solid var(--grape); outline-offset: 2px; }
.chip .ord { font-size: .8rem; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--surface); box-shadow: 0 0 0 3px var(--line); cursor: pointer; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--coral); transform: scale(1.08); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 16px 12px; border-radius: 22px; cursor: pointer;
  background: var(--bg); border: 3px solid var(--line); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), border-color .15s, background .15s;
}
.tile:hover { transform: translateY(-4px) scale(1.03); }
.tile:active { transform: scale(.95); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile .ti { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-d); }
.tile .ti .ic { width: 32px; height: 32px; }
.tile strong { font: 600 1.05rem/1.15 var(--f-display); }
.tile span.s { font-size: .85rem; color: var(--muted); font-weight: 700; }
.tile .price { font: 700 1.3rem/1 var(--f-display); color: var(--ink); }
.tile .mini { width: 100%; aspect-ratio: 300 / 360; border-radius: 14px; overflow: hidden; }
.tile .mini svg, .tile .mini img { width: 100%; height: 100%; display: block; }
.tile:has(input:checked) { border-color: var(--c); background: var(--c-soft); }
.tile:has(input:checked) .ti { background: var(--c); color: var(--surface); }
.tile:has(input:focus-visible) { outline: 4px solid var(--grape); outline-offset: 2px; }

.drop { display: grid; place-items: center; text-align: center; gap: 8px; padding: 30px 16px; border-radius: 26px; border: 4px dashed var(--sky); background: var(--sky-soft); cursor: pointer; transition: transform .18s; }
.drop:hover { transform: scale(1.01); }
.drop .ic { width: 56px; height: 56px; color: var(--sky-d); }
.drop strong { font: 600 1.4rem/1.1 var(--f-display); }
.drop span { color: var(--muted); font-weight: 700; }
.drop.over { background: var(--sun-soft); border-color: var(--sun-d); }
.shots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.shot { aspect-ratio: 3 / 4; border-radius: 18px; border: 3px dashed var(--line); display: grid; place-items: end center; padding: 6px; position: relative; overflow: hidden; font-size: .78rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.15; background: var(--surface); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.filled { border: 3px solid var(--mint); }
.shot .rm { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); cursor: pointer; font: 700 1.1rem/1 var(--f-display); z-index: 1; }
.shot .cap { position: relative; background: var(--surface); border-radius: 8px; padding: 3px 6px; }
@media (max-width: 560px) { .shots { grid-template-columns: repeat(3, 1fr); } }

.legal-box { display: grid; gap: 14px; padding: 20px; border-radius: 24px; background: var(--grape-soft); }
.legal-box h4 { font-size: 1.3rem; display: flex; gap: 10px; align-items: center; }
.legal-box h4 .ic { color: var(--grape-d); width: 30px; height: 30px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 1rem; cursor: pointer; }
.check input { width: 28px; height: 28px; margin: 0; accent-color: var(--grape); }
.check .opt-note { display: block; font-size: .85rem; color: var(--muted); }
.check.is-off { opacity: .5; }
.legal-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .92rem; color: var(--muted); font-weight: 700; }
.legal-facts li { display: flex; gap: 8px; align-items: center; }
.legal-facts .ic { color: var(--mint-d); }
.step-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px clamp(16px, 3vw, 30px) 26px; border-top: 2px solid var(--line); }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 18px 22px; border-radius: 22px; background: var(--mint-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .grand { font: 700 1.6rem/1.2 var(--f-display); padding-top: 8px; border-top: 3px dashed var(--mint); }
.missing { font-size: .95rem; color: var(--coral-d); font-weight: 800; }
.notice { font-size: .95rem; color: var(--muted); }
.confirm { padding: 20px; border-radius: 22px; background: var(--mint-soft); display: grid; gap: 6px; border: 3px solid var(--mint); }
.confirm b { font: 700 1.4rem/1.15 var(--f-display); }

.preview { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); display: grid; gap: 16px; min-width: 0; }
.preview details { padding: 16px 20px; }
.preview summary { font: 600 1.1rem/1.2 var(--f-display); cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
.preview summary::-webkit-details-marker { display: none; }
.preview summary .ic { color: var(--sky-d); width: 26px; height: 26px; }
.page1 { margin-top: 12px; font-size: 1.08rem; line-height: 1.65; }
.plan { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 4px; }
.spec { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: 600 .92rem/1 var(--f-display); border-radius: 999px; padding: 9px 14px; background: var(--surface); box-shadow: var(--shadow); }
@media (max-width: 940px) { .studio { grid-template-columns: 1fr; } .preview { position: static; order: -1; max-width: 420px; } }

#open-proof { width: 100%; }

/* Vista previa tipo PDF: páginas de 21 × 21 cm en un visor de solo lectura */
.proof { width: min(1100px, calc(100vw - 24px)); height: min(860px, calc(100dvh - 24px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: var(--r); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.proof[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.proof::backdrop { background: rgba(20, 22, 44, .72); }
.proof-bar { display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 24px; background: var(--surface); border-bottom: 2px solid var(--line); }
.proof-bar > div { flex: 1; min-width: 0; }
.proof-bar h2 { font-size: 1.5rem; }
.proof-meta { display: block; color: var(--muted); font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; }
.proof-count { font: 600 .95rem/1 var(--f-display); background: var(--c-soft); color: var(--c-d); padding: 9px 14px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.proof-x { width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); cursor: pointer; }
.proof-x:hover { background: var(--c-soft); }
.proof-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.proof-viewer { overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 26px; background: #525672; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: contain; }
.proof-viewer:focus-visible { outline: 4px solid var(--grape); outline-offset: -4px; }
.pg { position: relative; flex: none; width: min(100%, 560px); aspect-ratio: 1; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); overflow: hidden; container-type: inline-size; }
.pg > img, .pg > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pg .cover { position: absolute; inset: 0; width: auto; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.pg .cover img { pointer-events: none; }
/* Marca de agua: la vista previa no es el archivo final */
.pg::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='170'%3E%3Ctext x='130' y='92' text-anchor='middle' transform='rotate(-28 130 85)' font-family='sans-serif' font-size='17' font-weight='700' fill='%23ffffff' fill-opacity='.5' stroke='%231F2240' stroke-opacity='.18' stroke-width='.6'%3EVISTA PREVIA · tucuento.kids%3C/text%3E%3C/svg%3E"); }
.pg-n { position: absolute; right: 3cqi; bottom: 2.4cqi; z-index: 3; font: 700 3cqi/1 var(--f-display); color: var(--muted); background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 1cqi 2cqi; }
.pg-text { position: absolute; left: 6%; right: 6%; bottom: 6%; z-index: 1; margin: 0; padding: 4cqi 5cqi; background: rgba(255, 255, 255, .92); border-radius: 4cqi; font: 600 clamp(.8rem, 3.6cqi, 1.15rem)/1.45 var(--f-body); }
.pg-ded, .pg-end { position: absolute; inset: 0; display: grid; place-content: center; gap: 4cqi; padding: 12cqi; text-align: center; background: var(--c-soft); }
.pg-ded span { font: 600 3.6cqi/1 var(--f-display); color: var(--c-d); text-transform: uppercase; letter-spacing: .08em; }
.pg-ded p { margin: 0; font: 600 6cqi/1.35 var(--f-display); text-wrap: balance; }
.pg-end b { font: 700 7cqi/1.1 var(--f-display); }
.pg-end span { font-size: 4cqi; color: var(--muted); font-weight: 700; }
.proof-side { overflow-y: auto; padding: 22px; display: grid; gap: 18px; align-content: start; border-left: 2px solid var(--line); background: var(--surface); }
.proof-side h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.proof-note { padding: 16px 18px; border-radius: 20px; background: var(--sun-soft); border: 3px solid var(--sun); display: grid; gap: 6px; }
.proof-note .ic { color: var(--sun-d); }
.proof-note p { margin: 0; font-weight: 700; }
.proof-form { display: grid; gap: 14px; }
.proof-form textarea { min-height: 90px; }
.proof-actions { display: grid; gap: 14px; }
.proof-actions .big { width: 100%; padding: 0 18px; font-size: 1.05rem; }
@media (max-width: 820px) {
  .proof { width: 100vw; height: 100dvh; border-radius: 0; }
  .proof-body { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .proof-viewer { overflow: visible; padding: 16px; gap: 16px; }
  .proof-side { overflow: visible; border-left: 0; border-top: 2px solid var(--line); }
  .proof-bar { padding: 10px 12px 10px 16px; gap: 10px; }
  .proof-bar h2 { font-size: 1.2rem; }
  .proof-count { display: none; }
}
/* No se imprime: la vista previa no es el archivo final */
@media print { body:has(.proof[open]) { display: none; } }

/* Precios */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price-card { padding: 32px 26px; display: grid; gap: 16px; align-content: start; justify-items: start; position: relative; }
.price-card .ti { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-d); }
.price-card .ti .ic { width: 42px; height: 42px; }
.price-card.star { box-shadow: 0 0 0 5px var(--c), var(--shadow-lg); transform: translateY(-10px); }
.price-card .badge { position: absolute; top: -18px; right: 22px; background: var(--coral); color: var(--surface); font: 600 1rem/1 var(--f-display); padding: 10px 16px; border-radius: 999px; box-shadow: 0 5px 0 var(--coral-d); transform: rotate(4deg); }
.price-card h3 { font-size: 1.7rem; }
.price-card .amt { font: 700 2.6rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.price-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-weight: 700; color: var(--muted); }
.price-card li { display: flex; gap: 8px; align-items: center; }
.price-card li .ic { color: var(--mint-d); }
.price-note { margin-top: 28px; color: var(--muted); font-weight: 700; }
@media (max-width: 880px) { .prices { grid-template-columns: 1fr; } .price-card.star { transform: none; } }

/* Ayuda */
.help-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(22px, 4vw, 44px); align-items: start; }
.help-side { display: grid; gap: 18px; justify-items: start; }
.help-lines { display: grid; gap: 10px; font-weight: 700; }
.help-lines span { display: flex; align-items: center; gap: 10px; }
.help-lines .ic { color: var(--grape-d); width: 26px; height: 26px; }
.help-grid form { padding: clamp(20px, 3vw, 30px); display: grid; gap: 16px; }
.faq { display: grid; gap: 12px; margin-top: 40px; }
.faq details { padding: 18px 22px; }
.faq summary { font: 600 1.15rem/1.3 var(--f-display); cursor: pointer; display: flex; gap: 12px; align-items: center; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--grape-d); width: 28px; height: 28px; }
.faq details p { margin-top: 10px; color: var(--muted); }
@media (max-width: 860px) { .help-grid { grid-template-columns: 1fr; } }

/* Pie */
footer { background: var(--ink); color: var(--surface); padding-block: 48px; }
footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
footer .logo { color: var(--surface); }
footer h4 { margin: 0 0 12px; font-size: 1.15rem; color: var(--sun); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a { color: var(--surface); }
.help-lines a { color: inherit; }
footer .legal-id { font-size: .88rem; color: #C9CCE6; margin-top: 14px; display: grid; gap: 3px; }
.fill { background: var(--sun); color: var(--ink); border-radius: 6px; padding: 0 5px; font-weight: 800; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }

/* Página legal */
.legal-doc { max-width: 820px; }
.legal-doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 10px; }
.legal-doc h2 { font-size: 1.8rem; margin: 46px 0 12px; scroll-margin-top: 90px; }
.legal-doc h3 { font-size: 1.25rem; margin: 22px 0 8px; }
.legal-doc p, .legal-doc li { line-height: 1.7; }
.legal-doc p + p { margin-top: 10px; }
.legal-doc ul, .legal-doc ol { padding-left: 1.3em; display: grid; gap: 6px; }
.legal-toc { padding: 20px 24px; margin: 26px 0; }
.legal-toc ol { margin: 8px 0 0; }
.legal-warn { padding: 16px 20px; border-radius: 18px; background: var(--sun-soft); border: 3px solid var(--sun); font-size: .95rem; margin: 18px 0; }
.legal-quote { padding: 20px 24px; border-left: 6px solid var(--grape); background: var(--grape-soft); border-radius: 0 18px 18px 0; }
.table-wrap { overflow-x: auto; }
.legal-doc table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
.legal-doc th, .legal-doc td { border: 2px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--sun-soft); }
.tag { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: var(--sun); font: 600 .9rem/1 var(--f-display); }
.legal-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.legal-nav a { text-decoration: none; font: 600 1rem/1 var(--f-display); padding: 12px 16px; border-radius: 999px; background: var(--c-soft); }

/* Formulario por tipo de libro */
.types { grid-template-columns: repeat(3, 1fr); }
.types .adv .art { aspect-ratio: 16 / 10; }
@media (max-width: 1040px) { .types { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .types .adv .art { aspect-ratio: 1; } }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.qgrid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .qgrid { grid-template-columns: 1fr; } }
select { appearance: none; padding-right: 48px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232580E0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 22px; }
.counter { justify-self: end; font: 600 .9rem/1 var(--f-display); color: var(--muted); background: var(--bg); padding: 6px 10px; border-radius: 999px; }
.counter.max { color: var(--surface); background: var(--coral); }
.looks { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.photo-txt { font: 600 1.2rem/1.35 var(--f-display); }
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa-item { margin: 0; display: grid; gap: 6px; justify-items: center; }
.qa-item > svg { width: 100%; aspect-ratio: 1; border-radius: 18px; border: 4px solid var(--mint); }
.qa-item.no > svg { border-color: var(--coral); }
.qa-item figcaption { display: inline-flex; align-items: center; gap: 4px; font: 600 .95rem/1 var(--f-display); color: var(--mint-d); }
.qa-item.no figcaption { color: var(--coral-d); }
.consents { display: grid; gap: 14px; }
.brief { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .92rem; }
.brief dt { color: var(--muted); font-weight: 700; }
.brief dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .brief { grid-template-columns: 1fr; } .brief dd { margin-bottom: 6px; } }
