/* conFEsión · identidad tomada de la portada
   muro negro (lo que ocurrió) · oro (lo que permaneció) · horizonte cálido (lo que viene) */
:root {
  --night: #100e0c;
  --smoke: #1b1814;
  --smoke-2: #24201b;
  --line: rgba(242, 233, 218, .14);
  --ivory: #f2e9da;
  --ivory-dim: rgba(242, 233, 218, .64);
  --ivory-faint: rgba(242, 233, 218, .4);
  --gold: #d6a84e;
  --gold-hi: #f3d68a;
  --gold-lo: #8e6420;
  --ember: #e07b33;
  --dusk: #56677a;
  --danger: #e6907a;

  --foil: linear-gradient(100deg, #7d561b 0%, #c9953c 18%, #f6dc93 34%, #b9852f 50%, #ecc56d 66%, #a3752a 82%, #7d561b 100%);

  --display: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Literata", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--night); color: var(--ivory);
  font: 400 1rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* La luz del atardecer entrando por la derecha, como en la portada */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 70% at 100% 38%, rgba(224, 123, 51, .17), rgba(214, 168, 78, .05) 38%, transparent 65%);
}
/* Textura de muro */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
body.reading::before, body.reading::after { display: none; }

a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marca ---------- */
.wordmark {
  font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: .9;
  margin: 0; color: var(--ivory); white-space: nowrap;
  font-size: clamp(3.1rem, 15vw, 6.4rem);
}
.wordmark .fe {
  font-weight: 700; background: var(--foil); background-size: 220% 100%; background-position: 0 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark.sm { font-size: 1.45rem; letter-spacing: -.01em; }
.shimmer .fe { animation: foil 2.6s cubic-bezier(.4, 0, .2, 1) .5s both; }
@keyframes foil { from { background-position: 100% 0; } to { background-position: 0 0; } }

.caps { /* las mayúsculas espaciadas de la portada */
  font-family: var(--display); text-transform: uppercase; letter-spacing: .28em; font-weight: 400;
}
.triad { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .9rem; margin: 1.6rem 0 0; }
.triad span { font-size: .68rem; line-height: 1.55; text-align: center; color: var(--ivory); }
.triad span:nth-of-type(2) { color: var(--gold-hi); }
.triad i { width: 1px; height: 2.2rem; background: var(--ivory-faint); }
.author { font-size: .9rem; letter-spacing: .42em; margin: 0; color: var(--ivory); }
.gold-rule { width: 4.5rem; height: 1px; background: var(--gold); border: 0; margin: 1.6rem auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.25rem; padding: .9rem 1.6rem; border-radius: 2px; border: 1px solid transparent;
  font-family: var(--display); font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: #1a130a; }
.btn-gold:hover { background: var(--gold-hi); }
.btn-line { border-color: var(--line); background: transparent; color: var(--ivory); }
.btn-line:hover { border-color: var(--ivory-dim); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--ivory-dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ivory-faint); cursor: pointer; }
.link:hover { color: var(--ivory); }

/* ---------- Home ---------- */
.home { max-width: 70rem; margin: 0 auto; padding: calc(2.2rem + var(--safe-t)) 1.4rem calc(3rem + var(--safe-b)); }
.home-hero { display: grid; gap: 2.4rem; justify-items: center; text-align: center; }
.cover {
  width: min(66vw, 20rem); aspect-ratio: 2 / 3; border-radius: 2px 4px 4px 2px; overflow: hidden; position: relative;
  box-shadow: 0 2px 0 rgba(255, 255, 255, .04) inset, 0 30px 60px -18px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .05), 18px 24px 70px -30px rgba(224, 123, 51, .45);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::after { /* lomo */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .06) 55%, transparent);
}
.home-copy { max-width: 33rem; }
.home-copy .author { margin-top: 1.9rem; }
.intro { font-size: 1.08rem; line-height: 1.75; color: var(--ivory-dim); margin: 2.1rem 0 0; text-align: left; }
.intro p { margin: 0 0 1.1em; }
.intro p:first-child { color: var(--ivory); font-style: italic; }
.cta { display: grid; gap: .9rem; margin-top: 2.2rem; }
.gift-note { font-size: .86rem; color: var(--ivory-faint); margin: .2rem 0 0; }
.coda { max-width: 30rem; margin: 6rem auto 0; text-align: center; }
.coda blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.35rem; line-height: 1.5; color: var(--ivory); }
.coda blockquote p { margin: 0 0 .6em; }
.coda .wordmark { font-size: 2.4rem; margin-top: 3.2rem; }
.coda dl { margin: 1.2rem 0 2.2rem; display: grid; gap: .45rem; }
.coda dl div { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: baseline; }
.coda dt { text-align: right; font-family: var(--display); font-size: 1.15rem; }
.coda dt.g { color: var(--gold-hi); font-weight: 700; }
.coda dd { margin: 0; text-align: left; color: var(--ivory-dim); font-size: .95rem; }
.legal-foot { margin-top: 4rem; text-align: center; font-size: .78rem; color: var(--ivory-faint); }
.legal-foot a { margin: 0 .5rem; }

@media (min-width: 900px) {
  .home { padding-top: 5rem; }
  .home-hero { grid-template-columns: minmax(0, 24rem) minmax(0, 30rem); justify-content: center; align-items: center; gap: 5rem; text-align: left; justify-items: start; }
  .cover { width: 100%; }
  .triad span { text-align: left; }
  .wordmark { font-size: 5.6rem; }
}

/* ---------- Formularios / páginas de cuenta ---------- */
.page { max-width: 28rem; margin: 0 auto; padding: calc(1rem + var(--safe-t)) 1.4rem calc(3rem + var(--safe-b)); }
.page-top { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; margin-bottom: 1.5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: inherit; text-decoration: none; }
.icon-btn:hover { background: rgba(127, 127, 127, .12); }
.icon-btn svg { width: 1.35rem; height: 1.35rem; }
.page h1 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.15; margin: 0 0 .7rem; }
.page .lead { color: var(--ivory-dim); margin: 0 0 2rem; line-height: 1.65; }
.form { display: grid; gap: 1.15rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.field label { display: block; font-size: .82rem; color: var(--ivory-dim); margin-bottom: .4rem; }
.field input, .field select {
  width: 100%; height: 3.2rem; padding: 0 1rem; border-radius: 2px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28); color: var(--ivory); font: 400 1rem var(--text); /* 16px: evita el zoom de iOS */
  transition: border-color .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }
.pw { position: relative; }
.pw input { padding-right: 3.3rem; }
.pw button { position: absolute; right: .25rem; top: .25rem; width: 2.7rem; height: 2.7rem; border: 0; background: none; color: var(--ivory-dim); cursor: pointer; }
.hint { font-size: .78rem; color: var(--ivory-faint); margin-top: .35rem; }
.optional summary { cursor: pointer; color: var(--ivory-dim); font-size: .9rem; list-style: none; padding: .3rem 0; }
.optional summary::-webkit-details-marker { display: none; }
.optional summary::before { content: "+ "; color: var(--gold); }
.optional[open] summary::before { content: "– "; }
.optional .form { margin-top: .9rem; }
.check { display: flex; gap: .75rem; align-items: flex-start; font-size: .9rem; color: var(--ivory-dim); line-height: 1.5; cursor: pointer; }
.check input { appearance: none; flex: none; width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; border: 1px solid var(--ivory-faint); border-radius: 2px; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after { content: ""; width: .32rem; height: .62rem; border: solid #1a130a; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.error { color: var(--danger); font-size: .9rem; margin: 0; min-height: 1.2em; }
.success { color: var(--gold-hi); font-size: .95rem; margin: 0; }
.alt { text-align: center; margin-top: 1.8rem; font-size: .92rem; color: var(--ivory-dim); }

/* ---------- Bienvenida ---------- */
.welcome { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.welcome p { color: var(--ivory-dim); margin: 1rem 0 0; }
.welcome .ok { font-size: .85rem; color: var(--gold-hi); margin: 0 0 1.6rem; }
.welcome h1 { font-family: var(--display); font-weight: 400; font-size: 2.1rem; margin: 0; }
.welcome .bar { width: 9rem; height: 1px; background: var(--line); margin: 2.4rem auto 0; overflow: hidden; }
.welcome .bar i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; animation: fill 2.2s ease forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Continúa leyendo / biblioteca ---------- */
.shelf { max-width: 40rem; margin: 0 auto; padding: calc(.6rem + var(--safe-t)) 1.4rem calc(3rem + var(--safe-b)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 3.6rem; }
.topbar a.wordmark { text-decoration: none; }
.resume { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.4rem; align-items: center; margin: 1.8rem 0 0; }
.resume .cover { width: 100%; }
.resume h1 { font-family: var(--display); font-weight: 400; font-size: 1.95rem; line-height: 1.1; margin: 0 0 .5rem; }
.resume .meta { color: var(--ivory-dim); margin: 0 0 .2rem; font-size: .95rem; }
.resume .meta strong { color: var(--ivory); font-weight: 500; }
.progress { height: 2px; background: var(--line); margin: 1rem 0 .5rem; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .6s ease; }
.progress-label { font-size: .85rem; color: var(--ivory-dim); margin: 0; }
.resume-cta { margin-top: 1.8rem; }
.section-label { font-size: .7rem; color: var(--ivory-faint); margin: 3.4rem 0 .8rem; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toc li button {
  width: 100%; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .6rem; align-items: center; text-align: left;
  min-height: 3.6rem; padding: .7rem .2rem; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.toc .num { font-family: var(--display); color: var(--ivory-faint); font-size: 1.05rem; }
.toc .t { line-height: 1.3; }
.toc .s { font-size: .82rem; color: var(--ivory-faint); display: inline-flex; align-items: center; gap: .4rem; }
.toc .open .num { color: var(--gold); }
.toc .open .s { color: var(--gold-hi); }
.toc .soon .t { color: var(--ivory-dim); }
.toc svg { width: .95rem; height: .95rem; }

/* ---------- Oferta (Etapa 2) ---------- */
.offer { margin-top: 3rem; padding: 1.6rem 1.4rem; border: 1px solid rgba(214, 168, 78, .45); background: rgba(214, 168, 78, .05); }
.offer h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 0 0 .5rem; }
.offer p { color: var(--ivory-dim); margin: 0 0 1rem; line-height: 1.6; }
.offer .price { font-family: var(--display); font-size: 2rem; color: var(--gold-hi); margin: .4rem 0 1.2rem; }
.offer .hint { margin: .8rem 0 0; text-align: center; }

/* ---------- Mi lectura ---------- */
.profile-name { font-family: var(--display); font-size: 2.2rem; font-weight: 400; margin: 1rem 0 .3rem; line-height: 1.1; }
.profile-mail { color: var(--ivory-dim); margin: 0; font-size: .92rem; }
.card { margin-top: 2.2rem; padding: 1.4rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; color: var(--ivory-dim); }
.kv b { color: var(--ivory); font-weight: 400; font-family: var(--display); }
.kv .fe-inline .fe { color: var(--gold-hi); font-weight: 700; }
.stack { display: grid; gap: .8rem; margin-top: 1.6rem; }
.install { margin-top: 2.6rem; color: var(--ivory-dim); font-size: .92rem; line-height: 1.6; }
.install h2 { font-family: var(--display); font-weight: 400; color: var(--ivory); font-size: 1.2rem; margin: 0 0 .4rem; }

/* ---------- Legales ---------- */
.prose { color: var(--ivory-dim); line-height: 1.75; }
.prose h2 { font-family: var(--display); font-weight: 400; color: var(--ivory); font-size: 1.2rem; margin: 2rem 0 .5rem; }

/* ---------- Aviso ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + var(--safe-b)); transform: translate(-50%, 1rem); z-index: 60;
  background: var(--ivory); color: #1d1813; padding: .85rem 1.3rem; border-radius: 2px; font-size: .92rem; max-width: calc(100vw - 2.4rem);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--ivory-faint); }
.loading::after { content: ""; width: 2.5rem; height: 1px; background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; transform: scaleX(.4); } }

/* ===================== LECTOR ===================== */
.reader {
  --r-bg: #f4ecdf; --r-ink: #2b241d; --r-muted: #82735f; --r-line: rgba(43, 36, 29, .14); --r-accent: #9a6d22; --r-bar: rgba(244, 236, 223, .94);
  --r-size: 1.18rem;
  background: var(--r-bg); color: var(--r-ink); min-height: 100vh; min-height: 100dvh; color-scheme: light;
  transition: background-color .3s, color .3s;
}
.reader[data-theme="dark"] {
  --r-bg: #13110f; --r-ink: #e6dccb; --r-muted: #8f8474; --r-line: rgba(230, 220, 203, .13); --r-accent: #d6a84e; --r-bar: rgba(19, 17, 15, .94);
  color-scheme: dark;
}
.r-top, .r-bottom {
  position: fixed; left: 0; right: 0; z-index: 20; background: var(--r-bar);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px); transition: transform .3s ease;
}
.r-top { top: 0; padding-top: var(--safe-t); border-bottom: 1px solid var(--r-line); }
.r-top .in { max-width: 46rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 3.4rem; padding: 0 .4rem; }
.r-top .ttl { font-size: .66rem; color: var(--r-muted); }
.r-top .grp { display: flex; }
.r-bottom { bottom: 0; padding-bottom: var(--safe-b); border-top: 1px solid var(--r-line); }
.r-bottom .bar { height: 2px; background: var(--r-line); }
.r-bottom .bar i { display: block; height: 100%; width: 0; background: var(--r-accent); }
.r-bottom .in { max-width: 46rem; margin: 0 auto; display: flex; justify-content: space-between; padding: .6rem 1.3rem .7rem; font-size: .8rem; color: var(--r-muted); font-variant-numeric: tabular-nums; }
.reader.chrome-hidden .r-top { transform: translateY(-100%); }
.reader.chrome-hidden .r-bottom { transform: translateY(calc(100% - 2px - var(--safe-b))); }

.r-body { max-width: 34em; margin: 0 auto; padding: calc(6.5rem + var(--safe-t)) 1.5rem calc(7rem + var(--safe-b)); font-size: var(--r-size); }
.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.r-open { text-align: center; margin-bottom: 3.4em; }
.r-open .caps { font-size: .62em; color: var(--r-muted); letter-spacing: .34em; }
.r-open h1 { font-family: var(--display); font-weight: 400; font-size: 2.05em; line-height: 1.12; margin: .55em 0 0; text-wrap: balance; }
.r-open .gold-rule { background: var(--r-accent); margin-top: 1.4em; }
.r-open .mins { font-size: .7em; color: var(--r-muted); }
.r-text p { margin: 0; line-height: 1.72; text-align: left; hyphens: auto; -webkit-hyphens: auto; }
.r-text p + p { text-indent: 1.4em; }
.r-text .first::first-letter {
  font-family: var(--display); float: left; font-size: 3.55em; line-height: .82; padding: .07em .1em 0 0; color: var(--r-accent); font-weight: 600;
}
.r-text h2 { font-family: var(--display); font-weight: 400; font-style: italic; font-size: 1.3em; text-align: center; margin: 2.6em 0 1.3em; line-height: 1.3; scroll-margin-top: 5rem; }
.r-text blockquote { margin: 1.8em 0; padding: 0 1.2em; font-style: italic; text-align: center; line-height: 1.7; color: var(--r-ink); }
.r-text blockquote + p { text-indent: 0; }
.r-text .orn { text-align: center; margin: 2.2em 0; color: var(--r-accent); letter-spacing: 1em; font-size: .8em; }
.r-text .orn + p, .r-text h2 + p { text-indent: 0; }
.r-end { margin-top: 4.5em; text-align: center; }
.r-end .caps { font-size: .62em; color: var(--r-muted); letter-spacing: .34em; }

/* Comentarios del lector: una carta al final del capítulo */
.feedback { max-width: 34rem; margin: 0 auto; padding: 1rem 1.5rem 0; }
.feedback h2 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.2; text-align: center; margin: 0 0 1.6rem; text-wrap: balance; }
.fb-intro { font-size: 1.05rem; line-height: 1.75; }
.fb-intro p { margin: 0 0 1.1em; }
.fb-intro .asks { font-style: italic; padding-left: 1.1rem; border-left: 1px solid var(--r-accent); }
.fb-body { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--r-line); }
.reader .field label { color: var(--r-muted); }
.reader .opt-l { opacity: .75; }
.reader .field input, .reader .field textarea {
  width: 100%; border: 1px solid var(--r-line); background: color-mix(in srgb, var(--r-bg) 82%, var(--r-ink) 5%); color: var(--r-ink); border-radius: 2px;
}
.reader .field input { height: 3.2rem; padding: 0 1rem; font: 400 1rem var(--text); }
.reader .field textarea { display: block; padding: .9rem 1rem; font: 400 1rem/1.6 var(--text); resize: vertical; min-height: 10rem; }
.reader .field input:focus, .reader .field textarea:focus { outline: none; border-color: var(--r-accent); }
.reader .check { color: var(--r-ink); font-size: .92rem; }
.reader .check input { border-color: var(--r-muted); }
.reader .check input:checked { background: var(--r-accent); border-color: var(--r-accent); }
.reader .check input:checked::after { border-color: var(--r-bg); }
.reader .hint { color: var(--r-muted); margin-top: -.4rem; }
.reader .error { color: #b4442a; }
.reader[data-theme="dark"] .error { color: var(--danger); }
.reader .btn-gold { background: var(--r-accent); color: var(--r-bg); }
.reader .link { color: var(--r-muted); text-decoration-color: var(--r-line); }
.fb-done { text-align: center; padding: 1rem 0; }
.fb-thanks { font-family: var(--display); font-style: italic; font-size: 1.3rem; line-height: 1.5; margin: 0 0 1.2rem; }
.r-after { max-width: 34rem; margin: 0 auto; padding: 3.5rem 1.5rem calc(7rem + var(--safe-b)); text-align: center; }
.r-after p { color: var(--r-muted); font-size: .95rem; margin: 0 0 1.6rem; }
.r-after .btn-line { border-color: var(--r-line); color: var(--r-ink); }
.r-after .watermark { margin: 3rem 0 0; font-size: .75rem; color: var(--r-muted); opacity: .75; text-align: center; }
.r-body { padding-bottom: 3rem; }

/* Paneles inferiores */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 34rem; margin: 0 auto; max-height: 75vh; overflow: auto;
  background: var(--r-bg); color: var(--r-ink); border-radius: 14px 14px 0 0; padding: 1.1rem 1.4rem calc(1.6rem + var(--safe-b));
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5);
}
.sheet.open { transform: none; }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet .grab { width: 2.4rem; height: 4px; border-radius: 2px; background: var(--r-line); margin: 0 auto 1.1rem; }
.sheet h3 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 0 0 1rem; }
.opt { display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; border-top: 1px solid var(--r-line); }
.opt > span { font-size: .92rem; color: var(--r-muted); }
.seg { display: inline-flex; border: 1px solid var(--r-line); border-radius: 2px; }
.seg button { border: 0; background: none; min-width: 3.2rem; height: 2.6rem; padding: 0 .9rem; cursor: pointer; color: var(--r-ink); font-size: .9rem; }
.seg button + button { border-left: 1px solid var(--r-line); }
.seg button[aria-pressed="true"] { background: var(--r-ink); color: var(--r-bg); }
.seg .a-sm { font-size: .8rem; } .seg .a-lg { font-size: 1.15rem; font-family: var(--display); }
.sizes { display: flex; gap: .35rem; margin: 0 .7rem; }
.sizes i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--r-line); }
.sizes i.on { background: var(--r-accent); }
.sec-list { list-style: none; margin: 0; padding: 0; }
.sec-list button { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--r-line); padding: .95rem 0; cursor: pointer; color: var(--r-ink); font-size: 1rem; display: flex; justify-content: space-between; gap: 1rem; }
.sec-list button.cur { color: var(--r-accent); }
.sec-list small { color: var(--r-muted); font-variant-numeric: tabular-nums; }

@media print {
  body * { display: none !important; }
  body::before { content: "Este contenido solo puede leerse en la plataforma conFEsión."; display: block; padding: 2rem; font: 14pt Georgia, serif; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ===================== ADMIN ===================== */
.admin { max-width: 72rem; margin: 0 auto; padding: calc(.6rem + var(--safe-t)) 1.2rem 4rem; }
.admin h1 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; margin: 1rem 0 1.4rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.8rem; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: .8rem 1rem; color: var(--ivory-dim); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ivory); border-color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1px; }
.stat { background: var(--night); padding: 1.1rem 1rem; outline: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 400; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--ivory-dim); }
.charts { display: grid; gap: 2rem; margin-top: 2.4rem; }
@media (min-width: 800px) { .charts { grid-template-columns: 2fr 1fr 1fr; } }
.chart h3 { font-family: var(--display); font-weight: 400; font-size: 1rem; margin: 0 0 1rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 7.5rem; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; max-width: 2.6rem; background: var(--gold); opacity: .85; min-height: 2px; position: relative; }
.bars div:hover { opacity: 1; }
.bars-x { display: flex; justify-content: space-between; font-size: .7rem; color: var(--ivory-faint); margin-top: .4rem; }
.devices { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.devices li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--line); color: var(--ivory-dim); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 400; color: var(--ivory-faint); font-size: .78rem; background: var(--smoke); position: sticky; top: 0; }
td .mini { display: inline-block; width: 4rem; height: 2px; background: var(--line); vertical-align: middle; margin-right: .5rem; }
td .mini i { display: block; height: 100%; background: var(--gold); }
.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input { flex: 1; min-width: 12rem; height: 2.8rem; padding: 0 1rem; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); color: var(--ivory); border-radius: 2px; font: inherit; }
.toolbar .btn { min-height: 2.8rem; padding: .6rem 1.1rem; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .74rem; border: 1px solid var(--line); color: var(--ivory-dim); }
.pill.free { border-color: var(--gold); color: var(--gold-hi); }
.pill.premium { border-color: var(--dusk); color: #a9b8c8; }
.editor { display: grid; gap: 1rem; }
.editor textarea { width: 100%; min-height: 55vh; padding: 1rem; background: rgba(0, 0, 0, .3); color: var(--ivory); border: 1px solid var(--line); border-radius: 2px; font: .95rem/1.6 var(--text); resize: vertical; }
.editor .row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; }
.editor .row .field { flex: 1; min-width: 12rem; }
.note { font-size: .84rem; color: var(--ivory-faint); line-height: 1.6; }
.note code { color: var(--gold-hi); }

/* Admin: embudo, mapa de lectura, comentarios, lanzamiento */
.block-title { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 2.8rem 0 1rem; }
.funnel { display: grid; gap: .55rem; }
.funnel div { display: grid; grid-template-columns: 9.5rem 1fr 4.5rem; gap: .8rem; align-items: center; font-size: .88rem; color: var(--ivory-dim); }
.funnel .track { height: .55rem; background: var(--line); }
.funnel .track i { display: block; height: 100%; background: var(--gold); }
.funnel b { font-weight: 400; color: var(--ivory); text-align: right; font-variant-numeric: tabular-nums; }
.map td.reach { min-width: 12rem; }
.map .track { display: inline-block; width: 8rem; height: .45rem; background: var(--line); vertical-align: middle; margin-right: .6rem; }
.map .track i { display: block; height: 100%; background: var(--gold); }
.passages { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.passages li { border-left: 2px solid var(--gold); padding: .2rem 0 .2rem 1rem; }
.passages q { font-style: italic; color: var(--ivory); line-height: 1.6; }
.passages small { display: block; color: var(--ivory-faint); margin-top: .35rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: none; color: var(--ivory-dim); border-radius: 99px; padding: .4rem .85rem; cursor: pointer; font-size: .85rem; }
.chips button span { color: var(--ivory-faint); margin-left: .2rem; }
.chips button[aria-pressed="true"] { border-color: var(--gold); color: var(--ivory); background: rgba(214, 168, 78, .12); }
.comment-list { display: grid; gap: 1px; margin-top: 1rem; }
.cmt { background: var(--smoke); padding: 1.2rem 1.2rem 1rem; outline: 1px solid var(--line); }
.cmt.is-new { box-shadow: inset 3px 0 0 var(--gold); }
.cmt.is-archived { opacity: .6; }
.cmt header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; }
.cmt .who b { font-weight: 500; }
.cmt .who span, .cmt time { color: var(--ivory-faint); font-size: .82rem; }
.cmt .body { margin: .8rem 0; line-height: 1.7; white-space: pre-wrap; }
.cmt .tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cmt .actions { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .88rem; }
.pill.ok { border-color: var(--gold); color: var(--gold-hi); }
.pill.star { border-color: var(--ember); color: #f0a56b; }
.stage { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1.2rem; border: 1px solid var(--line); }
.stage strong { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.form-inline { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; }
.form-inline .field { flex: 1; min-width: 10rem; }
.form-inline .btn { min-height: 3.2rem; }

/* ===== Lector · formato PDF (páginas protegidas) ===== */
.r-pages { max-width: 50rem; margin: 0 auto; padding: calc(4.2rem + var(--safe-t)) .5rem 2rem; display: grid; gap: .75rem; }
.reader.is-pdf { --r-bg: #e9e2d6; }
.reader.is-pdf[data-theme="dark"] { --r-bg: #0f0d0b; }
.pg { margin: 0; background: #fff; overflow: hidden; border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 10px 30px -12px rgba(0, 0, 0, .35); -webkit-touch-callout: none; }
.pg img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.r-pages .r-end { margin-top: 2.5rem; font-size: 1.1rem; }
.opt-note { font-size: .82rem; color: var(--r-muted); margin: -.3rem 0 .6rem; line-height: 1.5; }
@media (min-width: 700px) { .r-pages { gap: 1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; } }
.pdf-box { border-top: 1px solid var(--line); margin-top: 1rem; }

/* Índice del libro con partes */
.toc li button { grid-template-columns: 2.2rem 1fr 1.4rem; min-height: 3.9rem; }
.toc .t small { display: block; font-size: .78rem; color: var(--ivory-faint); margin-top: .2rem; }
.toc .open .t small { color: var(--gold-hi); }
.toc .soon .t { color: var(--ivory-dim); }
.toc .s { justify-content: flex-end; color: var(--ivory-faint); }
.toc .open .s { color: var(--gold-hi); }
.toc .extra .t { font-style: italic; }
.toc .part-h { padding: 2.2rem .2rem .8rem; border-bottom: 1px solid var(--line); display: grid; gap: .35rem; }
.toc .part-h:first-child { padding-top: .6rem; }
.toc .part-h .caps { font-size: .66rem; color: var(--ivory-faint); letter-spacing: .3em; }
.toc .part-h .part-t { font-family: var(--display); font-size: 1.35rem; line-height: 1.2; color: var(--ivory); }
.toc .part-h .w { font-weight: 600; }
.toc .part-h .w.fe { font-weight: 700; background: var(--foil); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.toc .part-h.end { padding: 1.4rem 0 0; }
.steps { padding-left: 1.2rem; line-height: 1.8; }
.steps code { word-break: break-all; }
