:root{--bg:#f6efe6;--paper:#fffaf3;--ink:#2d241f;--muted:#74665d;--accent:#6a4b39;--accent-dark:#4a3227;--line:#e7d8c9;--soft:#eee0d3;--ok:#2f6848;--warn:#8b6509;--shadow:0 18px 60px rgba(55,35,24,.16);--reader:20px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:linear-gradient(180deg,#2d2019 0,#4e382c 22%,var(--bg) 22.1%);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}button,input,textarea{font:inherit}.app-shell{max-width:620px;min-height:100vh;margin:auto;background:var(--paper);box-shadow:var(--shadow)}.hero{background:linear-gradient(180deg,#271b15,#50382c);color:#fff;padding:18px 18px 30px;text-align:center}.cover{width:min(78vw,350px);display:block;margin:8px auto 20px;border-radius:18px;box-shadow:0 22px 60px rgba(0,0,0,.4)}.kicker{font-size:12px;letter-spacing:.13em;text-transform:uppercase;opacity:.78}.hero h1,h1,h2,h3{font-family:Georgia,serif}.hero h1{font-size:34px;line-height:1.05;margin:10px 0 6px}.subtitle{font:italic 20px Georgia,serif}.author{font-weight:800;margin-top:14px}.body{padding:22px}.intro{font:21px/1.5 Georgia,serif;text-align:center}.actions{display:grid;gap:12px}.btn{border:0;border-radius:16px;min-height:58px;padding:15px 18px;font-size:18px;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;text-decoration:none}.primary{background:var(--accent);color:#fff}.secondary{background:#eadccf;color:var(--ink)}.ghost{background:#fff;border:1px solid var(--line);color:var(--accent)}.btn:focus-visible,.tool:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #c9a98e;outline-offset:2px}.help{text-align:center;margin-top:17px;font-weight:800;color:var(--accent)}.small{font-size:14px;color:var(--muted);line-height:1.5}.center{text-align:center}.topbar{position:sticky;top:0;z-index:20;background:rgba(255,250,243,.96);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);padding:11px 14px;display:flex;align-items:center;gap:10px}.back{width:42px;height:42px;border:0;border-radius:50%;background:#efe3d8;font-size:26px;cursor:pointer}.topbar h2{font-size:19px;margin:0}.card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:19px;box-shadow:0 9px 30px rgba(72,47,31,.06);margin-bottom:16px}.reader{font:var(--reader)/1.78 Georgia,serif}.reader p{margin:0 0 1.25em}.reader-image{width:100%;border-radius:16px;display:block;margin:18px 0 7px}.reader-tools{position:sticky;top:65px;z-index:15;display:flex;gap:8px;padding:10px 14px;background:rgba(255,250,243,.96);border-bottom:1px solid var(--line)}.tool{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 12px;font-weight:800;cursor:pointer}.qr{width:230px;height:230px;margin:14px auto;border:14px solid #fff;outline:1px solid var(--line);border-radius:14px;background:repeating-linear-gradient(45deg,#2f2925 0 8px,#fff 8px 16px);display:grid;place-items:center}.qr span{background:#fff;padding:10px;border-radius:9px;font-weight:900}.step{display:flex;gap:12px;background:#faf5ef;border-radius:15px;padding:13px;margin:10px 0}.num{width:30px;height:30px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:900;flex:0 0 auto}.form label{display:block;font-weight:800;margin:12px 0 6px}.form input,.form textarea{width:100%;border:1px solid #d6c5b6;border-radius:13px;padding:14px;background:#fff}.form textarea{min-height:92px;resize:vertical}.badge{display:inline-block;padding:6px 9px;border-radius:999px;background:#fff0bd;color:#654d0e;font-size:12px;font-weight:900}.success{text-align:center}.check{width:74px;height:74px;border-radius:50%;background:#deeee4;color:var(--ok);display:grid;place-items:center;font-size:38px;margin:4px auto 14px}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(10px);background:#241b16;color:#fff;padding:12px 16px;border-radius:999px;opacity:0;pointer-events:none;transition:.2s;z-index:99;max-width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.toast.show{opacity:1;transform:translateX(-50%)}.gift{background:linear-gradient(135deg,#493327,#775541);color:#fff;border-radius:22px;padding:24px;text-align:center}.gift h2{font-size:28px}.amount{font-size:30px;font-weight:900;text-align:center;margin:8px 0}.progress{height:5px;background:#eadfd4;position:sticky;top:55px;z-index:16}.progress i{display:block;width:0;height:100%;background:var(--accent)}
@media(min-width:760px){body{padding:26px 0}.app-shell{border-radius:24px;overflow:hidden;min-height:calc(100vh - 52px)}}

.backlink{width:42px;height:42px;border-radius:50%;background:#efe3d8;text-decoration:none;display:grid;place-items:center;font-size:26px;color:var(--ink)}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;font-size:14px}


/* ===== v1.3 — portada más limpia y accesible ===== */
.sr-only{
  position:absolute!important;width:1px!important;height:1px!important;padding:0!important;
  margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;border:0!important
}
.hero-home{
  padding:18px 18px 24px;
  background:
    radial-gradient(circle at 50% 18%,rgba(255,255,255,.055),transparent 32%),
    linear-gradient(180deg,#261a14,#51382b);
}
.hero-home .kicker{
  margin-bottom:10px;
  color:#f3e6db;
  opacity:.82;
  font-weight:700;
}
.hero-home .cover{
  width:min(76vw,348px);
  margin:0 auto 14px;
  border-radius:18px;
  box-shadow:0 20px 50px rgba(0,0,0,.34);
}
.author-signature{
  display:inline-block;
  margin-top:1px;
  padding:8px 18px 9px;
  border-top:1px solid rgba(255,255,255,.19);
  color:#fff8f1;
  font:600 17px/1.2 Georgia,serif;
  letter-spacing:.02em;
}
.body-home{
  padding:28px 22px 24px;
}
.body-home .intro{
  margin:9px auto 4px;
  max-width:470px;
  font-size:22px;
  line-height:1.45;
}
.home-note{
  max-width:430px;
  margin:0 auto 22px;
  text-align:center;
  color:var(--muted);
  font-size:15px;
  line-height:1.5;
}
.home-actions{
  gap:11px;
}
.home-actions .btn{
  min-height:60px;
  transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
}
.home-actions .btn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(64,40,27,.09);
}
.whatsapp-help{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  max-width:380px;
  margin:18px auto 0;
  padding:12px 16px;
  border:1px solid #dfd1c3;
  border-radius:15px;
  background:#fff;
  color:var(--accent-dark);
  text-decoration:none;
  box-shadow:0 5px 16px rgba(70,45,30,.045);
}
.whatsapp-help .wa-icon{
  font-size:22px;
}
.whatsapp-help span:last-child{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  text-align:left;
  line-height:1.2;
}
.whatsapp-help strong{
  font-size:15px;
}
.whatsapp-help small{
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
}
.privacy-note{
  margin:14px 0 0;
  font-size:13px;
}
@media(max-width:430px){
  .hero-home{padding:15px 15px 20px}
  .hero-home .cover{width:min(82vw,342px)}
  .body-home{padding:24px 18px 22px}
  .body-home .intro{font-size:21px}
  .home-note{font-size:14px}
  .home-actions .btn{font-size:17px;min-height:58px}
}


/* ===== v1.4 — sin nombre debajo de portada, con indicador e-book ===== */
.author-signature{display:none!important}
.format-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:2px;
  padding:9px 16px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#fff8f1;
  font:700 14px/1.1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.format-badge::before{content:"📘";font-size:15px;line-height:1}

/* ---- v1.7: lector de varias secciones ---- */
.reader .sub{
  font-size:1.05em; font-weight:700; margin:1.6em 0 .5em;
  color:var(--accent, #8a5a3b); line-height:1.3;
}
.reader .pie{
  font-size:.78em; opacity:.65; font-style:italic;
  text-align:center; margin:.4em 0 1.4em;
}
.indice{
  background:#fffaf5; border-bottom:1px solid #e6d6c6;
  max-height:60vh; overflow:auto; padding:8px 0;
}
.idx-item{
  display:block; padding:12px 18px; text-decoration:none;
  color:#4a3428; font-size:.95rem; border-bottom:1px solid #f0e4d8;
}
.idx-item:last-child{border-bottom:none}
.idx-item.actual{background:#f0e0cf; font-weight:700}
.cap-nav{
  display:flex; flex-direction:column; gap:10px;
  margin:34px 0 10px; padding-top:22px; border-top:1px solid #e6d6c6;
}
.cap-nav .btn{width:100%}
@media(min-width:620px){
  .cap-nav{flex-direction:row-reverse; justify-content:space-between}
  .cap-nav .btn{width:auto; min-width:44%}
}
.qr-real img{box-shadow:0 2px 14px rgba(0,0,0,.12)}

/* ---- v1.8: estado, regalo y soporte ---- */
.estado-item{display:flex;gap:14px;align-items:flex-start;padding:14px 0;border-top:1px solid #efe2d6}
.estado-item:first-of-type{border-top:none}
.estado-ic{font-size:1.5rem;line-height:1;min-width:28px;text-align:center;color:var(--accent,#8a5a3b)}
.dedicatoria{margin:14px 0;padding:12px 16px;border-left:3px solid var(--accent,#8a5a3b);
  background:#faf2e9;font-style:italic;border-radius:0 8px 8px 0}
.legal h2{margin-top:1.8em;font-size:1.1rem}
.legal p,.legal li{font-size:.95rem;line-height:1.65}

/* ---- v1.9: marca del ejemplar ---- */
.marca-ejemplar{
  font-size:.72em; letter-spacing:.04em; text-align:center;
  color:#a08a76; margin:2.2em 0; opacity:.8;
  text-transform:uppercase; user-select:none;
}
.marca-ejemplar::before,.marca-ejemplar::after{content:"·"; margin:0 .6em; opacity:.6}

/* ---- v1.9.3: panel de pedidos en tarjetas, legible en celular ---- */
.resumen{background:#fff;border-radius:12px;padding:12px 16px;margin-bottom:14px;
  box-shadow:0 1px 4px rgba(0,0,0,.06);font-size:.95rem}
.pedido{background:#fff;border-radius:14px;padding:16px;margin-bottom:14px;
  box-shadow:0 1px 6px rgba(0,0,0,.07);border-left:4px solid #ddd}
.pedido.pendiente{border-left-color:#d9a441;background:#fffdf8}
.pedido.aprobado{border-left-color:#5b8f5b}
.pedido.rechazado{border-left-color:#c0625c;opacity:.85}
.pedido header{display:flex;justify-content:space-between;align-items:flex-start;
  gap:10px;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid #f0e4d8}
.codigo{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1.02rem;letter-spacing:.02em}
.pill{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.78rem;
  font-weight:700;white-space:nowrap}
.pill.pendiente{background:#fbeccd;color:#8a5f14}
.pill.aprobado{background:#dcebdc;color:#2f5c2f}
.pill.rechazado{background:#f6dedc;color:#8c3833}
.pill.ok{background:#eef3ee;color:#3c5c3c;font-weight:600}
.pill.alerta{background:#f6dedc;color:#8c3833;font-weight:600}
.dato{display:flex;justify-content:space-between;gap:12px;padding:6px 0;
  border-bottom:1px dashed #f2e7db;font-size:.95rem}
.dato:last-of-type{border-bottom:none}
.dato span{color:#8a7461;flex-shrink:0}
.dato b{text-align:right;word-break:break-word}
.dato b.lleno{color:#a33}
.acciones{margin-top:14px;display:flex;flex-direction:column;gap:10px}
.btn.ancho{width:100%}
.btn.peligro{background:#c0625c;color:#fff}
.rechazo summary{cursor:pointer;font-size:.9rem;color:#8c3833;padding:8px 0;text-align:center}
.rechazo select{width:100%;padding:12px;margin:6px 0 10px;border:1px solid #d8c8b8;
  border-radius:10px;font-size:1rem;background:#fff}
.rechazo label{font-size:.85rem;color:#8a7461}
.motivo{color:#8c3833;margin:0 0 10px}
@media(min-width:760px){
  .acciones{flex-direction:row;flex-wrap:wrap}
  .acciones form{flex:1;min-width:200px}
  .rechazo{flex-basis:100%}
}

/* ---- v2.0: portada, dedicatoria, prólogo y autora ---- */
.portada-libro{text-align:center;padding:10px 0 26px}
.portada-libro img{width:100%;max-width:330px;height:auto;border-radius:10px;
  box-shadow:0 8px 30px rgba(55,39,31,.28);display:block;margin:0 auto 18px}
.portada-pie{font-size:.76rem;letter-spacing:.12em;text-transform:uppercase;
  color:#a08a76;margin:0}
.firma{text-align:right;font-style:italic;color:#7a6250;margin-top:1.6em}
.reader .reader-image[src$="autora.jpg"]{max-width:230px;border-radius:14px;
  margin:0 auto 20px;display:block}

/* ---- v2.1: acceso al panel ---- */
.aviso-error{background:#f6dedc;color:#8c3833;padding:10px 14px;border-radius:10px;
  font-size:.92rem;margin:12px 0}
.resumen .salir{float:right;font-size:.85rem;color:#8a7461;text-decoration:underline}
.form input[type=password]{width:100%;padding:13px;border:1px solid #d8c8b8;
  border-radius:10px;font-size:1.05rem;background:#fff}
