/* RedactaIA Lectores · lector web con formato de libro */
html.lw-open, html.lw-open body { overflow: hidden !important; }
@media print { body { display: none !important; } }

.lw-root {
  --lw-bg: #f4f1ea; --lw-fg: #1d1b18; --lw-mute: #7a746b; --lw-paper: #fdfbf7; --lw-desk: #e7e2d8; --lw-ac: #e11d2a;
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
  background: var(--lw-desk); color: var(--lw-fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none; user-select: none; outline: none; overflow: hidden;
  transition: background .3s ease, color .3s ease;
  animation: lwIn .35s ease both;
}
@keyframes lwIn { from { opacity: 0; } }

/* ---------- Barra superior ---------- */
.lw-top {
  position: relative; z-index: 30; display: flex; align-items: center; gap: 10px; height: 58px; flex: none;
  padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--lw-bg); border-bottom: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent);
  transition: transform .3s ease, opacity .3s ease, background .3s ease;
}
.lw-brand { display: inline-flex; align-items: baseline; gap: 2px; text-decoration: none; color: var(--lw-fg); font: 800 19px/1 "Inter", sans-serif; letter-spacing: -.03em; flex: none; padding: 6px 4px; border-radius: 6px; }
.lw-brand i { width: 7px; height: 7px; border-radius: 50%; background: var(--lw-ac); display: inline-block; }
.lw-brand:hover span { opacity: .8; }
.lw-sep { width: 1px; height: 26px; background: color-mix(in srgb, var(--lw-fg) 14%, transparent); flex: none; }
.lw-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.lw-title b { font: 600 14px/1.2 "Fraunces", Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-title span { font-size: 12px; color: var(--lw-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-tacts { display: flex; gap: 2px; align-items: center; flex: none; }
.lw-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--lw-fg);
  font-size: 18px; cursor: pointer; display: grid; place-items: center; flex: none; transition: background .15s;
}
.lw-btn svg { width: 22px; height: 22px; }
.lw-btn.sm { width: 34px; height: 34px; }
.lw-btn.sm svg { width: 18px; height: 18px; }
.lw-btn:hover, .lw-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--lw-fg) 9%, transparent); }
.lw-aa { font: 700 17px/1 "Fraunces", Georgia, serif; }
.lw-lang-code { position: absolute; right: 2px; bottom: 3px; font: 800 8.5px/1 "Inter", sans-serif; background: var(--lw-ac); color: #fff; border-radius: 3px; padding: 2px 3px; }
.lw-lang-code:empty { display: none; }
.lw-btn:focus-visible, .lw-chip:focus-visible, .lw-theme:focus-visible, .lw-cta:focus-visible, .lw-ghost:focus-visible, .lw-toc-i:focus-visible, .lw-brand:focus-visible, .lw-arrow:focus-visible, .lw-lang-i:focus-visible { outline: 2px solid var(--lw-ac); outline-offset: 2px; }

/* ---------- Escenario ---------- */
.lw-stage { position: relative; flex: 1; min-height: 0; }
.lw-host { position: absolute; inset: 0; touch-action: none; cursor: default; }
.lw-arrow {
  position: absolute; top: 50%; z-index: 7; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--lw-paper) 80%, transparent); color: var(--lw-fg); display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.18); opacity: .55; transition: opacity .2s, transform .2s;
}
.lw-arrow svg { width: 22px; height: 22px; }
.lw-arrow.l { left: 12px; } .lw-arrow.r { right: 12px; }
.lw-arrow:hover { opacity: 1; transform: scale(1.06); }
.lw-arrow:disabled { opacity: 0; pointer-events: none; }
.lw-spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--lw-fg) 15%, transparent); border-top-color: var(--lw-ac); animation: lwSpin .8s linear infinite; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .2s .25s; }
.lw-loading .lw-spin { opacity: 1; }
@keyframes lwSpin { to { transform: rotate(360deg); } }

/* ---------- Progreso ---------- */
.lw-bottom { position: relative; z-index: 20; flex: none; padding: 0 18px calc(10px + env(safe-area-inset-bottom)); background: var(--lw-desk); transition: transform .3s ease, opacity .3s ease; }
.lw-bar { height: 4px; background: color-mix(in srgb, var(--lw-fg) 11%, transparent); border-radius: 4px; overflow: hidden; }
.lw-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #b8121d, var(--lw-ac)); border-radius: 4px; transition: width .4s ease; box-shadow: 0 0 10px rgba(225,29,42,.45); }
.lw-prog { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--lw-mute); margin-top: 7px; font-variant-numeric: tabular-nums; min-height: 15px; }
.lw-prog-r { font-weight: 700; color: var(--lw-fg); }
.lw-bottom::before { content: ""; display: block; height: 8px; }

/* Lectura inmersiva en móvil (toque en el centro) */
.lw-immersive .lw-top { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.lw-immersive .lw-bottom { opacity: .0; }
.lw-immersive .lw-stage { margin-top: -58px; }

/* ---------- Paneles ---------- */
.lw-panel {
  position: absolute; top: 64px; right: 12px; z-index: 40; width: min(340px, calc(100vw - 24px)); max-height: calc(100% - 80px); overflow-y: auto;
  background: var(--lw-bg); color: var(--lw-fg); border: 1px solid color-mix(in srgb, var(--lw-fg) 12%, transparent);
  border-radius: 16px; padding: 16px 16px 14px; box-shadow: 0 22px 60px rgba(0,0,0,.3);
  animation: lwPop .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes lwPop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.lw-plabel { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lw-mute); margin: 14px 0 8px; }
.lw-plabel:first-child { margin-top: 0; }
.lw-row { display: flex; gap: 8px; align-items: center; }
.lw-row input[type=range] { flex: 1; accent-color: var(--lw-ac); min-width: 0; }
.lw-theme {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 8px; border-radius: 12px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--lw-fg) 12%, transparent); background: transparent; color: var(--lw-fg);
}
.lw-sw { width: 100%; height: 38px; border-radius: 8px; display: grid; place-items: center; font: 600 17px/1 "Fraunces", Georgia, serif; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lw-theme small { font-size: 11.5px; font-weight: 600; }
.lw-theme-claro .lw-sw { background: #fdfbf7; color: #1d1b18; }
.lw-theme-sepia .lw-sw { background: #f4e9d2; color: #3b2f25; }
.lw-theme-oscuro .lw-sw { background: #1c1b1a; color: #ddd7cc; }
.lw-chip {
  flex: 1; height: 38px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 0 8px;
  border: 1.5px solid color-mix(in srgb, var(--lw-fg) 14%, transparent); background: transparent; color: var(--lw-fg);
}
.lw-chip.sq { flex: none; width: 38px; font: 600 13px/1 Georgia, serif; }
.lw-chip.sq.big { font-size: 19px; }
.lw-fonts .lw-chip { font-size: 13.5px; }
.lw-theme.on, .lw-chip.on { border-color: var(--lw-ac); box-shadow: 0 0 0 1px var(--lw-ac) inset; }
.lw-val { width: 46px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--lw-mute); }
.lw-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-top: 10px; cursor: pointer; padding: 4px 0; }
.lw-toggle-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lw-toggle-t small { font-size: 11.5px; color: var(--lw-mute); }
/* Interruptor */
.lw-switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; border: 0; padding: 0; cursor: pointer; background: color-mix(in srgb, var(--lw-fg) 22%, transparent); transition: background .2s ease; }
.lw-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s cubic-bezier(.3,.7,.2,1.2); }
.lw-switch.on { background: var(--lw-ac); }
.lw-switch.on i { transform: translateX(18px); }
.lw-switch:focus-visible { outline: 2px solid var(--lw-ac); outline-offset: 2px; }
.lw-note { font-size: 12px; color: var(--lw-mute); margin: 8px 0 0; }
.lw-langs-aa { flex-wrap: wrap; }
.lw-langs-aa .lw-chip { flex: 0 0 auto; padding: 0 12px; }
@media (max-width: 1023px) { .lw-only-wide { display: none; } }
.lw-langpop { width: 240px; right: 96px; }
.lw-lang-i { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--lw-fg); font-size: 14px; cursor: pointer; text-align: left; }
.lw-lang-i:hover { background: color-mix(in srgb, var(--lw-fg) 7%, transparent); }
.lw-lang-i.on { font-weight: 700; }
.lw-lang-i i { width: 18px; height: 18px; color: var(--lw-ac); display: grid; }

/* ---------- Índice lateral ---------- */
.lw-scrim {
  position: absolute; inset: 58px 0 0 0; z-index: 35; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .28s ease;
}
.lw-side {
  position: absolute; top: 58px; left: 0; bottom: 0; z-index: 36; width: min(380px, 92vw); display: flex; flex-direction: column;
  background: var(--lw-bg); color: var(--lw-fg); box-shadow: 24px 0 60px rgba(0,0,0,.25);
  transform: translateX(-104%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s;
}
.lw-side-open .lw-scrim { opacity: 1; pointer-events: auto; }
.lw-side-open .lw-side { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.lw-side-h { display: flex; gap: 14px; align-items: flex-start; padding: 18px 14px 16px 18px; border-bottom: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent); flex: none; }
.lw-side-cover { width: 54px; aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; flex: none; box-shadow: 0 6px 16px rgba(0,0,0,.25); background: color-mix(in srgb, var(--lw-fg) 10%, transparent); }
.lw-side-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-side-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lw-side-t small { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lw-ac); }
.lw-side-t b { font: 600 17px/1.2 "Fraunces", Georgia, serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lw-side-t span { font-size: 12.5px; color: var(--lw-mute); }
.lw-side-t em { font-style: normal; font-size: 11.5px; color: var(--lw-mute); }
.lw-side-prog { height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--lw-fg) 10%, transparent); overflow: hidden; margin-top: 6px; }
.lw-side-prog i { display: block; height: 100%; background: var(--lw-ac); }
.lw-toc { list-style: none; margin: 0; padding: 8px 8px 30px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.lw-toc li { animation: lwItem .35s ease both; }
.lw-toc li:nth-child(2) { animation-delay: .03s; } .lw-toc li:nth-child(3) { animation-delay: .06s; } .lw-toc li:nth-child(4) { animation-delay: .09s; } .lw-toc li:nth-child(5) { animation-delay: .12s; } .lw-toc li:nth-child(n+6) { animation-delay: .15s; }
@keyframes lwItem { from { opacity: 0; transform: translateX(-10px); } }
.lw-toc-i {
  position: relative; width: 100%; display: grid; grid-template-columns: 40px minmax(0,1fr) 22px; gap: 10px; align-items: start; text-align: left;
  padding: 12px 10px 12px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--lw-fg); cursor: pointer; font: inherit;
}
.lw-toc-i:hover { background: color-mix(in srgb, var(--lw-fg) 6%, transparent); }
.lw-toc-i .n { font: 600 22px/1 "Fraunces", Georgia, serif; color: color-mix(in srgb, var(--lw-fg) 35%, transparent); text-align: center; padding-top: 2px; font-variant-numeric: tabular-nums; }
.lw-toc-i .tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lw-toc-i .t { font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.lw-toc-i .s { font-size: 12.5px; line-height: 1.4; color: var(--lw-mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lw-toc-i .p { height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--lw-fg) 10%, transparent); overflow: hidden; margin-top: 3px; }
.lw-toc-i .p i { display: block; height: 100%; background: var(--lw-ac); }
.lw-toc-i .ico { width: 18px; height: 18px; color: var(--lw-mute); padding-top: 3px; }
.lw-toc-i .ico svg { width: 16px; height: 16px; }
.lw-toc-i.done .ico { color: #2f8f5b; }
.lw-toc-i .tag { position: absolute; top: 10px; right: 10px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lw-ac); }
.lw-toc-i.on { background: color-mix(in srgb, var(--lw-ac) 10%, transparent); box-shadow: inset 3px 0 0 var(--lw-ac); }
.lw-toc-i.on .n { color: var(--lw-ac); }
.lw-toc-i.on .ico { display: none; }
.lw-toc-i.locked .t, .lw-toc-i.locked .n { opacity: .55; }
.lw-toc-i.locked .ico { color: var(--lw-ac); }

/* ---------- Muro de pago / código / errores ---------- */
.lw-overlay { position: absolute; inset: 0; z-index: 12; overflow-y: auto; background: var(--lw-desk); animation: lwIn .3s ease; }
.lw-wall { position: relative; min-height: 100%; display: grid; place-items: center; padding: 28px 18px; }
.lw-wall-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(34px) saturate(1.2) brightness(.55); transform: scale(1.1); }
.lw-wall-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.lw-lock {
  position: relative; max-width: 480px; width: 100%; text-align: center; padding: 30px 28px 26px; border-radius: 20px;
  background: color-mix(in srgb, var(--lw-bg) 94%, transparent); box-shadow: 0 30px 80px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: lwRise .45s cubic-bezier(.2,.8,.2,1);
  -webkit-user-select: text; user-select: text;
}
@keyframes lwRise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.lw-wall-cover { width: 96px; aspect-ratio: 2/3; margin: -74px auto 14px; border-radius: 6px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.45); transform: rotate(-3deg); background: #222; }
.lw-wall-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-paywall { margin-top: 60px; }
.lw-kicker { font-size: 11px !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lw-ac) !important; margin: 0 0 6px !important; }
.lw-lock h2 { font: 700 25px/1.2 "Fraunces", Georgia, serif; margin: 0 0 10px; text-wrap: balance; }
.lw-lock p { color: var(--lw-mute); line-height: 1.55; margin: 0 0 16px; font-size: 15px; }
.lw-price { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 16px; }
.lw-price small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--lw-mute); font-weight: 700; }
.lw-price b { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.lw-methods {
  white-space: pre-wrap; text-align: left; font-size: 14px; line-height: 1.55; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--lw-fg) 6%, transparent); margin-bottom: 14px; -webkit-user-select: text; user-select: text;
}
.lw-steps { text-align: left; margin: 0 0 18px; padding: 0 0 0 20px; font-size: 13.5px; color: var(--lw-mute); line-height: 1.7; }
.lw-acts { display: flex; flex-direction: column; gap: 10px; }
.lw-cta { height: 48px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--lw-ac); color: #fff; font-size: 15.5px; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s; }
.lw-cta:hover { background: #c3121e; }
.lw-cta:active { transform: scale(.98); }
.lw-cta:disabled { opacity: .6; cursor: default; }
.lw-ghost { height: 44px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--lw-fg) 18%, transparent); background: transparent; color: var(--lw-fg); font-size: 14px; cursor: pointer; }
.lw-status { padding: 12px; border-radius: 10px; background: rgba(245,196,81,.18); color: #8a6208; font-size: 14px; font-weight: 600; }
[data-theme="oscuro"] .lw-status { color: #f5c451; }
.lw-code { display: flex; gap: 8px; }
.lw-code input {
  flex: 1; min-width: 0; height: 54px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--lw-fg) 20%, transparent); background: var(--lw-paper); color: var(--lw-fg);
  padding: 0 14px; font: 700 20px/1 "Inter", sans-serif; letter-spacing: .18em; text-transform: uppercase; text-align: center; -webkit-user-select: text; user-select: text;
}
.lw-code input:focus { border-color: var(--lw-ac); outline: none; }
.lw-code .lw-cta { height: 54px; }
.lw-msg { font-size: 14px; color: var(--lw-mute); min-height: 20px; margin: 10px 0 0 !important; }
.lw-lock-ilu { width: 110px; margin: 0 auto 6px; }
.lw-lock-ilu svg { width: 100%; height: auto; display: block; }
.lw-shake { animation: lwShake .45s ease; }
@keyframes lwShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lw-unlocked .ilu-arco { transform: translateY(-14px) rotate(-18deg); transform-origin: 84px 58px; transition: transform .4s ease; }

/* Arranque del lector (esqueleto) */
.lw-boot { position: fixed; inset: 0; z-index: 999; background: #e7e2d8; display: flex; flex-direction: column; }
.lw-boot-top { height: 58px; display: flex; align-items: center; gap: 20px; padding: 0 16px; background: #f4f1ea; }
.lw-logo { font: 800 19px/1 "Inter", sans-serif; color: #1d1b18; letter-spacing: -.03em; }
.lw-boot-book { flex: 1; display: flex; justify-content: center; align-items: center; gap: 0; padding: 24px; }
.lw-boot-page { width: min(420px, 44vw); height: min(78vh, 600px); background: #fdfbf7; padding: 50px 40px; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.lw-boot .sk { background: linear-gradient(90deg, #ece7de 0%, #f6f2ea 50%, #ece7de 100%); background-size: 200% 100%; }
.lw-boot .sk-line { height: 12px; margin: 0 0 14px; }
@media (max-width: 900px) { .lw-boot-page.hide-m { display: none; } .lw-boot-page { width: 100%; height: 100%; } .lw-boot-book { padding: 0; } }

@media (max-width: 700px) {
  .lw-top { height: 54px; gap: 6px; padding: 0 6px 0 12px; }
  .lw-brand { font-size: 16px; }
  .lw-sep { display: none; }
  .lw-title b { font-size: 13px; }
  .lw-title span { font-size: 11px; }
  .lw-btn { width: 38px; height: 38px; }
  .lw-btn svg { width: 20px; height: 20px; }
  .lw-scrim, .lw-side { top: 54px; }
  .lw-panel { top: 58px; right: 8px; }
  .lw-langpop { right: 8px; }
  .lw-immersive .lw-stage { margin-top: -54px; }
  .lw-bottom { padding: 0 14px calc(8px + env(safe-area-inset-bottom)); }
  .lw-lock { padding: 24px 18px 20px; }
  .lw-price b { font-size: 32px; }
  .lw-code { flex-direction: column; }
  .lw-code input, .lw-code .lw-cta { flex: none; }
}
@media (max-width: 380px) { .lw-brand span { font-size: 15px; } }
/* ---------- Anotaciones ---------- */
.lw-count { position: absolute; right: 1px; top: 2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--lw-ac); color: #fff; font: 800 9px/15px "Inter", sans-serif; }
.lw-count:empty { display: none; }
.lw-btn.on { background: color-mix(in srgb, var(--lw-ac) 16%, transparent); color: var(--lw-ac); }
.lw-selbar { position: absolute; z-index: 45; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 14px; background: #1f1f1f; color: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.35); animation: lwPop .16s ease; }
.lw-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: var(--c); cursor: pointer; padding: 0; flex: none; transition: transform .12s; }
.lw-dot:hover { transform: scale(1.12); }
.lw-dot.on { box-shadow: 0 0 0 2px #1f1f1f, 0 0 0 4px #fff; }
.lw-dot.sm { width: 22px; height: 22px; border-width: 1.5px; }
.lw-selsep { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin: 0 3px; flex: none; }
.lw-selbtn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.lw-selbtn svg { width: 20px; height: 20px; }
.lw-selbtn:hover { background: rgba(255,255,255,.12); }
.lw-selbtn.danger { color: #ff8a8f; }
.lw-selbtn[hidden] { display: none; }
.lw-notebox { position: absolute; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); background: var(--lw-bg); color: var(--lw-fg); border-radius: 18px; padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); border: 1px solid color-mix(in srgb, var(--lw-fg) 12%, transparent); animation: lwPop .2s ease; -webkit-user-select: text; user-select: text; }
.lw-quote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--lw-ac); font: italic 14px/1.5 "Literata", Georgia, serif; color: var(--lw-mute); background: color-mix(in srgb, var(--lw-fg) 5%, transparent); border-radius: 0 8px 8px 0; }
.lw-note-ta { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--lw-fg) 18%, transparent); background: var(--lw-paper); color: var(--lw-fg); padding: 10px 12px; font: 15px/1.5 "Inter", sans-serif; resize: vertical; min-height: 110px; outline: none; }
.lw-note-ta:focus { border-color: var(--lw-ac); }
.lw-note-colors { display: flex; gap: 8px; margin: 12px 0; }
.lw-note-colors .lw-dot { border-color: color-mix(in srgb, var(--lw-fg) 25%, transparent); }
.lw-note-colors .lw-dot.on { box-shadow: 0 0 0 2px var(--lw-bg), 0 0 0 4px var(--lw-fg); }
.lw-note-acts { display: flex; justify-content: flex-end; gap: 8px; }
.lw-cta.sm, .lw-ghost.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.lw-cta.xs, .lw-ghost.xs { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.lw-drawer { position: absolute; top: 58px; right: 0; bottom: 0; z-index: 38; width: min(400px, 94vw); display: flex; flex-direction: column; background: var(--lw-bg); color: var(--lw-fg); box-shadow: -24px 0 60px rgba(0,0,0,.25); animation: lwDrawer .26s cubic-bezier(.2,.8,.2,1); -webkit-user-select: text; user-select: text; }
@keyframes lwDrawer { from { transform: translateX(40px); opacity: 0; } }
.lw-drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 10px 18px; }
.lw-drawer-h small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lw-ac); }
.lw-drawer-h b { font: 600 19px/1.2 "Fraunces", Georgia, serif; }
.lw-tabs { display: flex; gap: 4px; padding: 0 12px 10px; overflow-x: auto; border-bottom: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent); flex: none; }
.lw-tab { display: inline-flex; gap: 6px; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: transparent; color: var(--lw-mute); font: 600 13px/1 "Inter", sans-serif; cursor: pointer; white-space: nowrap; }
.lw-tab i { font-style: normal; font-size: 11px; opacity: .8; }
.lw-tab.on { background: var(--lw-fg); color: var(--lw-bg); }
.lw-nlist { flex: 1; overflow-y: auto; padding: 8px 12px 20px; overscroll-behavior: contain; }
.lw-nch { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lw-mute); margin: 14px 4px 8px; }
.lw-ncard { position: relative; padding: 12px 12px 8px 16px; border-radius: 12px; background: color-mix(in srgb, var(--lw-fg) 4%, transparent); margin-bottom: 8px; }
.lw-ncard::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.lw-nq { margin: 0; font: 14px/1.5 "Literata", Georgia, serif; }
.lw-nq.ink { display: flex; gap: 8px; align-items: center; font-family: "Inter", sans-serif; font-size: 13.5px; }
.lw-nic svg { width: 18px; height: 18px; display: block; }
.lw-nn { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--lw-paper); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.lw-nfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--lw-mute); }
.lw-nacts { display: flex; gap: 2px; }
.lw-nact { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--lw-fg); cursor: pointer; display: grid; place-items: center; }
.lw-nact svg { width: 17px; height: 17px; }
.lw-nact:hover { background: color-mix(in srgb, var(--lw-fg) 9%, transparent); }
.lw-nact.danger { color: #c0392b; }
.lw-nconfirm { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; font-size: 13px; }
.lw-nempty { text-align: center; padding: 40px 18px; color: var(--lw-mute); }
.lw-nempty-ic { width: 48px; height: 48px; margin: 0 auto 10px; color: var(--lw-ac); }
.lw-nempty-ic svg { width: 100%; height: 100%; }
.lw-nempty b { display: block; color: var(--lw-fg); margin-bottom: 6px; }
.lw-nempty p { font-size: 13.5px; line-height: 1.5; margin: 0; }
.lw-drawer-f { display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent); font-size: 11.5px; color: var(--lw-mute); }
.lw-sync.ok { color: #2f8f5b; } .lw-sync.error { color: #c0392b; }
.lw-inkbar { position: absolute; z-index: 44; left: 50%; bottom: calc(46px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 16px; background: var(--lw-bg); color: var(--lw-fg); box-shadow: 0 14px 40px rgba(0,0,0,.3); border: 1px solid color-mix(in srgb, var(--lw-fg) 12%, transparent); max-width: calc(100vw - 16px); overflow-x: auto; animation: lwPop .2s ease; }
.lw-inkbar .lw-selsep { background: color-mix(in srgb, var(--lw-fg) 15%, transparent); }
.lw-inkbar .lw-dot { border-color: color-mix(in srgb, var(--lw-fg) 20%, transparent); }
.lw-inkbar .lw-dot.on { box-shadow: 0 0 0 2px var(--lw-bg), 0 0 0 4px var(--lw-ac); }
.lw-tool { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--lw-fg); cursor: pointer; display: grid; place-items: center; }
.lw-tool svg { width: 20px; height: 20px; }
.lw-tool.on { background: var(--lw-fg); color: var(--lw-bg); }
.lw-wbtn { width: 30px; height: 36px; flex: none; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.lw-wbtn i { display: block; width: 16px; border-radius: 3px; background: var(--lw-fg); }
.lw-wbtn.on { background: color-mix(in srgb, var(--lw-ac) 18%, transparent); }
.lw-inking .lw-arrow { z-index: 9; }
.lw-inking .lw-host { cursor: crosshair; }

/* ---------- Audiolibro ---------- */
.lw-player { position: relative; z-index: 25; flex: none; padding: 8px max(16px, env(safe-area-inset-left)) 6px; background: var(--lw-bg); border-top: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent); animation: lwPlayer .28s cubic-bezier(.2,.8,.2,1); }
@keyframes lwPlayer { from { transform: translateY(20px); opacity: 0; } }
.lw-pseek { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
.lw-seek { flex: 1; accent-color: var(--lw-ac); min-width: 0; height: 18px; }
.lw-ptime { font-size: 11.5px; color: var(--lw-mute); font-variant-numeric: tabular-nums; min-width: 42px; }
.lw-ptime.r { text-align: right; }
.lw-prow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; max-width: 980px; margin: 2px auto 0; }
.lw-pl, .lw-pr { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lw-pr { justify-content: flex-end; }
.lw-pc { display: flex; align-items: center; gap: 10px; }
.lw-pbtn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--lw-fg); cursor: pointer; display: grid; place-items: center; flex: none; }
.lw-pbtn svg { width: 26px; height: 26px; }
.lw-pbtn:hover { background: color-mix(in srgb, var(--lw-fg) 8%, transparent); }
.lw-pbtn.big { width: 52px; height: 52px; background: var(--lw-ac); color: #fff; box-shadow: 0 6px 18px rgba(225,29,42,.35); }
.lw-pbtn.big svg { width: 24px; height: 24px; }
.lw-pbtn.big:hover { background: #c3121e; }
.lw-pbtn.sm { width: 34px; height: 34px; }
.lw-pbtn.sm svg { width: 18px; height: 18px; }
.lw-player.loading .lw-pbtn.big { opacity: .6; }
.lw-pchip { height: 34px; min-width: 44px; padding: 0 10px; border-radius: 17px; border: 1.5px solid color-mix(in srgb, var(--lw-fg) 16%, transparent); background: transparent; color: var(--lw-fg); font: 700 13px/1 "Inter", sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.lw-pchip.ic span svg { width: 16px; height: 16px; display: block; }
.lw-pchip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.lw-pchip b:empty { display: none; }
.lw-pchip.on { border-color: var(--lw-ac); color: var(--lw-ac); }
.lw-pchip.wide { flex: 0 1 auto; min-width: 0; max-width: 240px; }
.lw-pchip.wide b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lw-psrc { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lw-mute); white-space: nowrap; }
.lw-psrc.audio { color: var(--lw-ac); }
.lw-pmsg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--lw-mute); padding: 4px 0 2px; text-align: center; }
.lw-pmenu { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 20px)); max-height: 50vh; overflow-y: auto; background: var(--lw-bg); border: 1px solid color-mix(in srgb, var(--lw-fg) 12%, transparent); border-radius: 14px; padding: 12px; box-shadow: 0 -18px 50px rgba(0,0,0,.25); animation: lwPop .18s ease; }
.lw-pmenu .lw-lang-i small { color: var(--lw-mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.lw-pmenu .lw-lang-i.locked { opacity: .55; }
.lw-player-open .lw-bottom::before { height: 4px; }

@media (max-width: 700px) {
  .lw-drawer { top: 54px; width: 100vw; }
  .lw-selbar { padding: 6px; gap: 3px; }
  .lw-dot { width: 24px; height: 24px; }
  .lw-selbtn { width: 34px; height: 34px; }
  .lw-inkbar { bottom: calc(40px + env(safe-area-inset-bottom)); left: 8px; right: 8px; transform: none; }
  .lw-inkbar .lw-wbtn, .lw-inkbar .lw-dot.sm:nth-of-type(n+5) { display: none; }
  .lw-inkbar .lw-dot.sm { width: 20px; height: 20px; }
  .lw-inkbar .lw-tool { width: 32px; }
  .lw-prow { grid-template-columns: auto 1fr auto; gap: 4px; }
  .lw-pl { order: 2; justify-content: center; }
  .lw-pc { order: 1; gap: 2px; }
  .lw-pr { order: 3; gap: 4px; }
  .lw-pbtn { width: 38px; height: 38px; }
  .lw-pbtn.big { width: 46px; height: 46px; }
  .lw-psrc { display: none; }
  .lw-pchip { height: 32px; min-width: 38px; padding: 0 8px; }
  .lw-pchip.wide { max-width: 120px; }
  .lw-pchip.wide span { display: none; }
  .lw-brand span { display: none; }
}
@media (max-width: 400px) {
  .lw-tacts .lw-btn { width: 34px; }
  .lw-pchip.wide b { max-width: 70px; }
  .lw-ptime { min-width: 34px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) { .lw-root *, .lw-root { animation: none !important; transition: none !important; } }
.lw-langblock .lw-plabel { margin-top: 14px; }

/* ---------- Tanda Apple Books: selección, marcapáginas, índice, compartir ---------- */
.lw-root, .lw-root * { -webkit-tap-highlight-color: transparent; }
.lw-root, .lw-host, .lw-stage { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lw-root input, .lw-root textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.lw-root ::selection { background: transparent; }
.lw-root input::selection, .lw-root textarea::selection { background: color-mix(in srgb, var(--lw-ac) 28%, transparent); }
.lw-inking, .lw-inking * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
.lw-inking .lw-host { touch-action: none; }

.lw-sublabel { font-size: 12.5px; color: var(--lw-mute); margin: 4px 0 8px; }
.lw-turns .lw-chip { flex: 1; }
.lw-mark-btn.on { color: var(--lw-ac); background: transparent; }

.lw-side-tabs { display: flex; gap: 4px; padding: 8px 10px 0; flex: none; border-bottom: 1px solid color-mix(in srgb, var(--lw-fg) 9%, transparent); }
.lw-side-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 0; background: transparent; color: var(--lw-mute); font: 650 13.5px/1 "Inter", sans-serif; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lw-side-tab i { font-style: normal; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: color-mix(in srgb, var(--lw-fg) 9%, transparent); padding: 0 5px; }
.lw-side-tab.on { color: var(--lw-fg); border-bottom-color: var(--lw-ac); }
.lw-side-tab.on i { background: var(--lw-ac); color: #fff; }
.lw-toc-i .s.full { -webkit-line-clamp: 5; }
.lw-toc-i .pc { font-size: 11px; color: var(--lw-mute); font-variant-numeric: tabular-nums; }
.lw-toc-i.on .pc { color: var(--lw-ac); font-weight: 650; }
.lw-toc-i .bm { position: absolute; right: 12px; bottom: 10px; width: 12px; height: 14px; color: var(--lw-ac); }
.lw-toc-i .bm svg { width: 12px; height: 14px; display: block; }
.lw-toc-i.done .t { color: color-mix(in srgb, var(--lw-fg) 70%, transparent); }

.lw-bmlist { overflow-y: auto; flex: 1; padding: 8px 8px 30px; overscroll-behavior: contain; }
.lw-bm { display: flex; align-items: flex-start; gap: 2px; border-radius: 12px; animation: lwItem .3s ease both; }
.lw-bm:hover { background: color-mix(in srgb, var(--lw-fg) 5%, transparent); }
.lw-bm-go { flex: 1; min-width: 0; display: flex; gap: 12px; text-align: left; border: 0; background: transparent; color: var(--lw-fg); padding: 12px 6px 12px 10px; cursor: pointer; font: inherit; }
.lw-bm-ic { width: 16px; height: 20px; color: var(--lw-ac); flex: none; padding-top: 1px; }
.lw-bm-ic svg { width: 16px; height: 20px; display: block; }
.lw-bm-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lw-bm-tx b { font-size: 14px; font-weight: 650; line-height: 1.3; }
.lw-bm-tx span { font: italic 13px/1.45 "Literata", Georgia, serif; color: var(--lw-mute); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lw-bm-tx span:empty { display: none; }
.lw-bm-tx small { font-size: 11px; color: var(--lw-mute); font-variant-numeric: tabular-nums; }
.lw-bm-del { margin: 10px 6px 0 0; color: var(--lw-mute); }
.lw-bm-del:hover { color: var(--lw-ac); }

.lw-share-wrap { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.lw-share-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.42); animation: lwIn .2s ease both; }
.lw-share { position: relative; width: min(460px, 100%); max-height: calc(100% - 20px); overflow-y: auto; background: var(--lw-bg); color: var(--lw-fg); border-radius: 20px; padding: 16px 18px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); border: 1px solid color-mix(in srgb, var(--lw-fg) 12%, transparent); animation: lwPop .22s ease both; box-sizing: border-box; }
.lw-share-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lw-share-h b { font: 650 18px/1.2 "Fraunces", Georgia, serif; }
.lw-share-opts { display: flex; flex-direction: column; gap: 8px; }
.lw-share-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--lw-fg) 14%, transparent); background: transparent; color: var(--lw-fg); cursor: pointer; font: inherit; }
.lw-share-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lw-share-opt b { font-size: 14.5px; font-weight: 650; }
.lw-share-opt small { font-size: 12.5px; color: var(--lw-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-share-opt.on { border-color: var(--lw-ac); background: color-mix(in srgb, var(--lw-ac) 7%, transparent); }
.lw-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--lw-fg) 30%, transparent); flex: none; box-sizing: border-box; transition: border .15s; }
.lw-share-opt.on .lw-radio { border: 5.5px solid var(--lw-ac); }
.lw-share-prev { display: flex; gap: 12px; margin: 14px 0; padding: 12px; border-radius: 14px; background: var(--lw-paper); border: 1px solid color-mix(in srgb, var(--lw-fg) 8%, transparent); }
.lw-share-cover { width: 58px; aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; flex: none; box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.lw-share-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-share-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lw-share-tx blockquote { margin: 0 0 6px; font: italic 14px/1.5 "Literata", Georgia, serif; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lw-share-tx b { font: 650 14px/1.25 "Fraunces", Georgia, serif; }
.lw-share-tx span { font-size: 12.5px; color: var(--lw-mute); }
.lw-share-tx code { font: 11.5px/1.3 ui-monospace, Menlo, monospace; color: var(--lw-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.lw-share-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.lw-share-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--lw-fg); cursor: pointer; font: inherit; }
.lw-share-act span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--lw-fg) 8%, transparent); }
.lw-share-act span svg { width: 21px; height: 21px; }
.lw-share-act small { font-size: 12px; }
.lw-share-act:hover span { background: color-mix(in srgb, var(--lw-ac) 14%, transparent); color: var(--lw-ac); }
.lw-share-st { min-height: 18px; margin: 6px 0 0; text-align: center; font-size: 13px; color: #2f8f5b; font-weight: 600; }
.lw-share-opt:focus-visible, .lw-share-act:focus-visible, .lw-side-tab:focus-visible, .lw-bm-go:focus-visible { outline: 2px solid var(--lw-ac); outline-offset: 2px; }
@media (max-width: 700px) {
  .lw-share-wrap { place-items: end center; padding: 0; }
  .lw-share { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: lwSheet .26s cubic-bezier(.2,.8,.2,1) both; }
  .lw-tacts { gap: 0; }
}
@keyframes lwSheet { from { transform: translateY(40px); opacity: 0; } }

.lw-root [hidden] { display: none !important; }
