:root {
  --ink: #24172e;
  --muted: #716779;
  --paper: #f7f1e8;
  --paper-deep: #eee4d7;
  --panel: rgba(255, 253, 248, .9);
  --line: rgba(47, 26, 57, .12);
  --plum: #2a103d;
  --plum-soft: #56356a;
  --coral: #f16f5c;
  --yellow: #f6bd28;
  --cyan: #35b8c8;
  --green: #2c9d83;
  --shadow: 0 26px 70px rgba(38, 21, 47, .2), 0 7px 20px rgba(38, 21, 47, .1);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

html { min-width: 320px; background: var(--paper); }
body {
  min-height: 100%;
  height: auto;
  overflow: auto;
  grid-template-rows: 68px auto auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(246, 189, 40, .13), transparent 22rem),
    radial-gradient(circle at 92% 36%, rgba(53, 184, 200, .11), transparent 25rem),
    linear-gradient(180deg, #fbf7f0, var(--paper));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(rgba(42, 16, 61, .22) .55px, transparent .55px);
  background-size: 8px 8px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(53, 184, 200, .45);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  height: 68px;
  padding: 0 clamp(16px, 3vw, 44px);
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid rgba(42, 16, 61, .1);
  background: rgba(250, 246, 239, .9);
  box-shadow: 0 8px 30px rgba(42, 16, 61, .05);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand {
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 42px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

.brand-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.edition {
  display: grid;
  gap: 1px;
  text-align: center;
  letter-spacing: normal;
  text-transform: none;
}

.edition span {
  color: var(--coral);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.edition strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -.01em;
}

.top-actions { gap: 8px; }

.ui-button {
  border-color: rgba(42, 16, 61, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 4px 14px rgba(42, 16, 61, .05);
  font-size: 12px;
  font-weight: 800;
}

.ui-button:hover {
  border-color: rgba(42, 16, 61, .28);
  background: #fffdf8;
  color: var(--plum);
}

.workspace {
  width: min(1540px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 28px clamp(16px, 2.5vw, 38px) 18px;
  display: grid;
  grid-template-columns: minmax(205px, 250px) minmax(620px, 920px) minmax(220px, 270px);
  grid-template-areas: "sponsor viewer media";
  justify-content: center;
  align-items: start;
  gap: clamp(16px, 2vw, 30px);
  background: transparent;
}

.side-panel {
  position: sticky;
  top: 94px;
  width: auto;
  min-width: 0;
  max-height: calc(100dvh - 118px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(42, 16, 61, .1);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(42, 16, 61, .08), inset 0 1px rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
}

.sponsor-panel {
  grid-area: sponsor;
  border-right: 1px solid rgba(42, 16, 61, .1);
}

.media-panel {
  grid-area: media;
  border-left: 1px solid rgba(42, 16, 61, .1);
}

.panel-close { display: none !important; }
.panel-kicker {
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
}

.panel-heading {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.panel-copy {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.viewer-stage {
  grid-area: viewer;
  width: 100%;
  height: clamp(520px, 70dvh, 700px);
  min-height: 520px;
  overflow: visible;
  padding: 60px 58px 82px;
  border: 1px solid rgba(42, 16, 61, .1);
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, .94), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(53, 184, 200, .12), transparent 29%),
    linear-gradient(145deg, rgba(244, 237, 227, .95), rgba(230, 220, 211, .9));
  box-shadow: 0 26px 80px rgba(42, 16, 61, .1), inset 0 1px rgba(255, 255, 255, .9);
  isolation: isolate;
}

.viewer-stage::before {
  opacity: .18;
  border-radius: inherit;
  background-image: radial-gradient(rgba(42, 16, 61, .25) .55px, transparent .55px);
  background-size: 8px 8px;
}

.stage-caption {
  position: absolute;
  z-index: 10;
  top: 21px;
  left: 24px;
  display: grid;
  gap: 1px;
}

.stage-caption span {
  color: var(--coral);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.stage-caption strong {
  font-size: 14px;
  letter-spacing: -.02em;
}

.book-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: visible;
  transition: transform .35s var(--ease), clip-path .35s var(--ease);
}

.book-frame.cover-hidden { visibility: hidden; pointer-events: none; }

.book-area {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: visible;
  transform: none !important;
}

.book-area::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -5px;
  width: 72%;
  height: 22px;
  border-radius: 50%;
  background: rgba(42, 16, 61, .25);
  filter: blur(17px);
}

#book {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 32px rgba(34, 18, 43, .18));
}

#book .stf__wrapper { margin: auto; }
#book .stf__item { background: #fff !important; }
.flip-page { overflow: hidden; background: #fff; }
.flip-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
}

.single-page-overlay,
.spread-page-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: none;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: var(--shadow);
}

.single-page-overlay {
  width: 520px;
  height: 520px;
  object-fit: contain;
}

.single-page-overlay.visible { display: block; }
.spread-page-overlay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spread-page-overlay.visible { display: grid; }
.spread-page-overlay img { display: block; width: 100%; height: 100%; object-fit: contain; }
.spread-page-overlay img + img { border-left: 1px solid rgba(42, 16, 61, .1); }
.spread-page-overlay.portrait { grid-template-columns: 1fr; }
.spread-page-overlay.portrait #rightPageImage { display: none; }

body[data-viewer-layout="spread"][data-cover-page="true"][data-cover-side="front"] .book-frame {
  clip-path: inset(0 0 0 50%);
  transform: translateX(calc(var(--cover-page-size) * -.5));
}

body[data-viewer-layout="spread"][data-cover-page="true"][data-cover-side="back"] .book-frame {
  clip-path: inset(0 50% 0 0);
  transform: translateX(calc(var(--cover-page-size) * .5));
}

body[data-viewer-layout="portrait"][data-cover-page="true"] .book-frame,
body[data-cover-page="flipping"] .book-frame {
  clip-path: none;
  transform: none;
}

.edge-button {
  z-index: 11;
  width: 46px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 17px;
  background: rgba(255, 253, 248, .86);
  box-shadow: 0 12px 30px rgba(42, 16, 61, .14);
  backdrop-filter: blur(14px);
  transition: transform .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}

.edge-button:hover:not(:disabled) {
  color: var(--coral);
  background: #fffdf8;
  transform: translateY(-50%) scale(1.04);
}

.edge-button:disabled { opacity: .2; }
#prev { left: 13px; }
#next { right: 13px; }

.fullscreen-fab {
  position: absolute;
  z-index: 12;
  right: 22px;
  bottom: 20px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--plum), #553165);
  box-shadow: 0 13px 30px rgba(42, 16, 61, .28);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.fullscreen-fab:hover { transform: translateY(-2px); box-shadow: 0 17px 36px rgba(42, 16, 61, .34); }
.fullscreen-fab svg { width: 17px; height: 17px; }

.sponsor-list { display: grid; gap: 12px; }

.sponsor-card {
  --ad-color: #2a103d;
  --ad-color-2: #553165;
  position: relative;
  isolation: isolate;
  min-height: 292px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 21px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background: var(--ad-color);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ad-color) 26%, transparent);
  text-decoration: none;
  animation: sponsorArrive .42s var(--ease) both;
}

.sponsor-card::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -2;
  background-image: var(--ad-image);
  background-size: cover;
  background-position: var(--ad-position, center);
  filter: blur(9px) saturate(.78) contrast(.92);
  transform: scale(1.1);
}

.sponsor-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ad-color) 35%, transparent) 0%, rgba(22, 12, 29, .25) 30%, rgba(22, 12, 29, .94) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--ad-color) 70%, transparent), transparent 65%);
}

.sponsor-topline {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.sponsor-label,
.sponsor-page-pill {
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  color: rgba(255, 255, 255, .92);
  background: rgba(23, 12, 29, .45);
  backdrop-filter: blur(9px);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sponsor-content {
  position: relative;
  z-index: 1;
  padding: 54px 16px 17px;
  display: grid;
}

.sponsor-content strong {
  font-size: 22px;
  line-height: 1.02;
  letter-spacing: -.04em;
}

.sponsor-content small {
  margin-top: 7px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  line-height: 1.4;
}

.sponsor-content em {
  width: max-content;
  margin-top: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--ink);
  background: #fffdf8;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.sponsor-card:hover .sponsor-content em { color: var(--plum); transform: translateX(2px); }

.sponsor-cta-slot { margin-top: 12px; }
.sponsor-cta-card {
  padding: 14px;
  border: 1px dashed rgba(42, 16, 61, .23);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 253, 248, .94), rgba(246, 189, 40, .12));
  text-decoration: none;
}
.sponsor-cta-card span { color: #9b6710; font-size: 8px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.sponsor-cta-card strong { font-size: 14px; line-height: 1.15; }
.sponsor-cta-card small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.sponsor-cta-card em { color: var(--plum); font-size: 9px; font-style: normal; font-weight: 900; }

.context-section { margin: 0; padding: 0; border: 0; }
.context-page-title {
  margin: 8px 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.context-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; }
.context-link {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 55px;
  padding: 8px 10px;
  border: 1px solid rgba(42, 16, 61, .09);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 22px rgba(42, 16, 61, .06);
  text-align: left;
  text-decoration: none;
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.context-link:hover { color: inherit; transform: translateY(-2px); border-color: rgba(241, 111, 92, .3); box-shadow: 0 13px 28px rgba(42, 16, 61, .1); }
.link-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(42, 16, 61, .07); }
.link-icon svg { width: 18px; height: 18px; }
.link-copy { min-width: 0; }
.link-copy strong, .link-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-copy strong { font-size: 11px; }
.link-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.link-arrow { color: var(--muted); font-size: 18px; }
.context-link.instagram { color: #fff; background: radial-gradient(circle at 16% 110%, #ffd600 0 17%, transparent 41%), radial-gradient(circle at 92% 3%, #7438f4 0 18%, transparent 37%), linear-gradient(135deg, #c82998, #f15b4a); }
.context-link.instagram .link-icon { background: rgba(255, 255, 255, .2); }
.context-link.instagram .link-copy small { color: rgba(255, 255, 255, .72); }
.context-link.phone { color: #fff; background: linear-gradient(135deg, #087f70, #28a98f); }
.context-link.email { color: #fff; background: linear-gradient(135deg, #4d385c, #725886); }
.context-link.website { color: #fff; background: linear-gradient(135deg, #245b66, #3a8793); }
.context-link.sponsor,
.context-link.custom-color { color: #fff; background: linear-gradient(135deg, var(--link-color, var(--plum)), color-mix(in srgb, var(--link-color-2, var(--plum)) 72%, #000 28%)); }
.context-link.phone .link-icon,
.context-link.email .link-icon,
.context-link.website .link-icon,
.context-link.sponsor .link-icon,
.context-link.custom-color .link-icon { background: rgba(255, 255, 255, .18); }
.context-link.phone .link-copy small,
.context-link.email .link-copy small,
.context-link.website .link-copy small,
.context-link.sponsor .link-copy small,
.context-link.custom-color .link-copy small { color: rgba(255, 255, 255, .72); }
.context-message { padding: 14px; border: 1px solid rgba(241, 111, 92, .18); border-radius: 15px; background: linear-gradient(180deg, #fffdf8, #fff4ec); }
.context-message strong { display: block; color: #9d3f34; font-size: 15px; line-height: 1.15; }
.context-message p { margin: 8px 0 0; color: #5d5363; font-size: 10px; line-height: 1.48; }
.context-empty { margin: 0; padding: 13px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 10px; }
.context-empty[hidden] { display: none; }

.podcast-section { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.podcast-section[hidden] { display: none; }
.podcast-list { max-height: none; overflow: visible; }
.podcast-button.preview-only { min-height: 56px; padding: 7px; grid-template-columns: 47px minmax(0, 1fr); gap: 8px; border-radius: 14px; }
.podcast-button.preview-only .video-thumb { width: 47px; height: 35px; border-radius: 10px; position: relative; isolation: isolate; background: linear-gradient(rgba(42,16,61,.14), rgba(42,16,61,.5)); }
.video-thumb.blurred::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--video-thumb); background-size: cover; background-position: center; filter: blur(2px); transform: scale(1.08); }
.video-thumb span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #d71920; }
.video-thumb svg, .play-dot svg { width: 15px; height: 15px; }
.podcast-copy strong { font-size: 10px; }
.podcast-copy small { font-size: 8px; }
.pending-badge { display: none; }

.email-cta-card {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(42, 16, 61, .1);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(53,184,200,.1));
  box-shadow: 0 12px 28px rgba(42, 16, 61, .07);
}
.email-cta-card > span { color: #9b6710; font-size: 8px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.email-cta-card > strong { display: block; margin-top: 5px; font-size: 14px; line-height: 1.15; }
.email-cta-card form { display: grid; gap: 7px; margin-top: 11px; }
.email-cta-card input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font: inherit; }
.email-cta-card button { min-height: 38px; border: 0; border-radius: 11px; color: #fff; background: var(--plum); font-size: 10px; font-weight: 850; cursor: pointer; }
.sidebar-subscription-message { min-height: 14px; margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.sidebar-subscription-success { margin-top: 11px; display: grid; grid-template-columns: 32px 1fr; gap: 3px 8px; color: #15735f; }
.sidebar-subscription-success[hidden] { display: none; }
.sidebar-subscription-success span { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); }
.sidebar-subscription-success svg { width: 17px; }
.sidebar-subscription-success strong { font-size: 11px; }
.sidebar-subscription-success small { font-size: 8px; }
.form-honeypot, .form-target-frame { position: absolute !important; width: 1px !important; height: 1px !important; left: -10000px !important; opacity: 0 !important; pointer-events: none !important; }

.bottombar {
  width: min(920px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto 28px;
  padding: 9px 16px max(9px, env(safe-area-inset-bottom));
  border: 1px solid rgba(42, 16, 61, .1);
  border-radius: 20px;
  background: rgba(255, 253, 248, .84);
  box-shadow: 0 15px 40px rgba(42, 16, 61, .08);
  backdrop-filter: blur(14px);
}
.page-label { font-size: 11px; }
.page-count { font-size: 9px; }
.progress { width: min(145px, 100%); }
.nav-cluster { border-radius: 999px; }
.nav-button { border-radius: 50%; }
.footer-credit { color: var(--muted); font-size: 9px; }
.footer-credit a { color: var(--plum); font-weight: 850; }

.contents-panel {
  z-index: 100;
  width: min(410px, 94vw);
  border: 0;
  border-radius: 0 26px 26px 0;
  background: rgba(252, 248, 241, .97);
  backdrop-filter: blur(18px);
}
.panel-header { height: 68px; }
.thumb-grid { grid-template-columns: repeat(3, 1fr); }
.thumb img { border-radius: 9px; }
.scrim { z-index: 95; backdrop-filter: blur(4px); }

.zoom-overlay {
  --reader-toolbar-space: 58px;
  --reader-side-space: 150px;
  position: fixed;
  inset: 0;
  z-index: 110;
  overflow: hidden;
  padding: var(--reader-toolbar-space) 0 8px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(92, 60, 108, .34), transparent 35%),
    #151019;
  overscroll-behavior: contain;
}
.zoom-overlay[hidden] { display: none; }
.zoom-toolbar {
  position: fixed;
  z-index: 5;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 38px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(42, 32, 47, .7);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(15px);
}
.zoom-toolbar .ui-button { min-height: 30px; height: 30px; padding: 0 9px; border: 0; color: rgba(255,255,255,.86); background: transparent; box-shadow: none; }
.zoom-toolbar .ui-button.icon { width: 30px; padding: 0; }
.zoom-toolbar .ui-button:hover { color: #fff; background: rgba(255,255,255,.11); transform: none; }
.zoom-toolbar #zoomOut,
.zoom-toolbar #zoomReset,
.zoom-toolbar #zoomIn { display: none; }
.zoom-close {
  position: fixed !important;
  top: 10px;
  left: 12px;
  right: auto !important;
  width: auto !important;
  min-width: 88px;
  padding: 0 13px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.08) !important;
}
.zoom-close::after { content: "Salir"; margin-left: 6px; font-size: 10px; font-weight: 850; }
.zoom-page-status { min-width: 76px; color: rgba(255,255,255,.8); text-align: center; font-size: 10px; font-weight: 800; }
.zoom-pages {
  --zoom-scale: 1;
  --zoom-pan-x: 0px;
  --zoom-pan-y: 0px;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 2px calc(var(--reader-side-space) / 2) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  cursor: grab;
  perspective: 1500px;
  transform-style: preserve-3d;
}
.zoom-pages img {
  width: calc(min(calc((100dvw - var(--reader-side-space)) / 2), calc(100dvh - var(--reader-toolbar-space) - 14px)) * var(--zoom-scale));
  max-width: none;
  height: auto;
  display: block;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,.56);
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(var(--zoom-pan-x), var(--zoom-pan-y));
  transform-origin: center;
  will-change: transform, opacity;
}
.zoom-pages.single img {
  width: calc(min(calc(100dvw - var(--reader-side-space)), calc(100dvh - var(--reader-toolbar-space) - 14px)) * var(--zoom-scale));
}
.zoom-pages.dragging { cursor: grabbing; }
.zoom-pages.dragging.single img,
.zoom-pages.dragging.drag-next:not(.single) img:last-child { transform: translateX(var(--reader-drag-x, 0)) rotateY(-7deg); transform-origin: left center; }
.zoom-pages.dragging.drag-prev:not(.single) img:first-child { transform: translateX(var(--reader-drag-x, 0)) rotateY(7deg); transform-origin: right center; }
.reader-page-flipping-source { opacity: .22; }
.reader-turn-sheet {
  position: absolute;
  z-index: 4;
  object-fit: cover;
  pointer-events: none;
  box-shadow: 0 22px 70px rgba(0,0,0,.54);
  backface-visibility: hidden;
}
.reader-turn-sheet.reader-turn-next { transform-origin: left center; animation: readerTurnNext .46s var(--ease) forwards; }
.reader-turn-sheet.reader-turn-prev { transform-origin: right center; animation: readerTurnPrev .46s var(--ease) forwards; }
.zoom-edge {
  position: fixed;
  z-index: 4;
  top: 50%;
  width: 48px;
  height: 70px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.zoom-edge:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.zoom-edge:disabled { opacity: .16; cursor: default; }
.zoom-edge svg { width: 23px; height: 23px; }
.zoom-edge-prev { left: 18px; }
.zoom-edge-next { right: 18px; }

.subscription-modal { position: fixed; inset: 0; z-index: 130; padding: 20px; display: grid; place-items: center; background: rgba(24, 15, 29, .7); backdrop-filter: blur(12px); }
.subscription-modal[hidden] { display: none; }
.subscription-card { width: min(620px, 96vw); position: relative; overflow: hidden; padding: clamp(27px, 5vw, 46px); border: 1px solid rgba(255,255,255,.65); border-radius: 28px; background: radial-gradient(circle at 100% 0, rgba(53,184,200,.2), transparent 31%), radial-gradient(circle at 0 100%, rgba(246,189,40,.22), transparent 28%), #fffdf8; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.subscription-card::before { content: ""; position: absolute; width: 190px; height: 190px; right: -75px; bottom: -95px; border-radius: 50%; background: linear-gradient(135deg, var(--coral), var(--yellow)); opacity: .86; }
.subscription-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; }
.subscription-close svg { width: 16px; }
.subscription-kicker { color: var(--coral); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.subscription-card h2 { max-width: 460px; margin: 9px 0 10px; font-size: clamp(27px, 5vw, 43px); line-height: 1.03; letter-spacing: -.045em; }
.subscription-card > p { max-width: 480px; margin: 0 0 22px; color: var(--muted); }
.subscription-card form > label:first-child { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 800; }
.subscription-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.subscription-field input { height: 48px; min-width: 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font: inherit; }
.subscription-field button { min-height: 48px; padding: 0 17px; border: 0; border-radius: 13px; background: var(--plum); color: #fff; font-weight: 800; cursor: pointer; }
.subscription-consent { max-width: 510px; margin-top: 13px; display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.subscription-message { min-height: 17px; margin: 8px 0 0; color: #b23c34; font-size: 11px; }
.subscription-card > small { position: relative; display: block; margin-top: 18px; color: var(--muted); font-size: 9px; }
.subscription-success { position: relative; padding: 18px 0; }
.subscription-success[hidden] { display: none; }
.subscription-success > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; }
.subscription-success svg { width: 23px; }
.subscription-success strong { display: block; margin-top: 14px; font-size: 22px; }
.subscription-success p { margin: 4px 0; color: var(--muted); }

.loading {
  z-index: 150;
  background:
    radial-gradient(circle at 50% 30%, rgba(83, 50, 101, .55), transparent 36%),
    var(--plum);
}
.loading.done { display: none; }
.loading-card img { border-radius: 16px; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.loading-track span { background: linear-gradient(90deg, var(--coral), var(--yellow), var(--cyan)); transition: width .2s; }

.consent-banner { z-index: 125; border-color: rgba(255,255,255,.16); background: rgba(35, 24, 42, .94); }

@keyframes sponsorArrive {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@keyframes readerTurnNext {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  55% { filter: brightness(.72); }
  100% { transform: rotateY(-92deg); opacity: 0; filter: brightness(.55); }
}

@keyframes readerTurnPrev {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  55% { filter: brightness(.72); }
  100% { transform: rotateY(92deg); opacity: 0; filter: brightness(.55); }
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "viewer viewer"
      "sponsor media";
    padding-inline: clamp(18px, 5vw, 70px);
  }

  .viewer-stage { width: min(920px, 100%); margin: 0 auto; }
  .side-panel {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: auto;
    max-height: none;
    padding: 20px;
    transform: none !important;
    box-shadow: 0 18px 48px rgba(42,16,61,.07);
  }

  .sponsor-card { min-height: 250px; }
  .sponsor-panel .panel-copy { max-width: 42ch; }
}

@media (max-width: 820px) {
  body { grid-template-rows: 60px auto auto; }
  .topbar { height: 60px; padding: 0 12px; grid-template-columns: 1fr auto; }
  .edition { display: none; }
  .brand img { width: 40px; height: 37px; }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "viewer" "media" "sponsor";
    padding: 14px 10px 12px;
    gap: 14px;
  }
  .viewer-stage {
    height: clamp(510px, 72dvh, 650px);
    min-height: 510px;
    padding: 54px 42px 76px;
    border-radius: 25px;
  }
  .stage-caption { top: 17px; left: 18px; }
  .edge-button { width: 38px; height: 52px; border-radius: 14px; }
  #prev { left: 5px; }
  #next { right: 5px; }
  .fullscreen-fab { right: 14px; bottom: 14px; min-height: 42px; }
  .side-panel { border-radius: 22px; }
  .sponsor-card { min-height: 230px; }
  .bottombar { width: calc(100% - 20px); margin-bottom: 14px; grid-template-columns: 1fr auto; border-radius: 18px; }
  .footer-actions { display: none; }
}

@media (max-width: 600px), (max-width: 950px) and (max-height: 520px) {
  .button-text { display: none; }
  .ui-button { min-height: 36px; padding: 0 10px; }
  .viewer-stage {
    height: min(650px, 72dvh);
    min-height: 480px;
    padding: 50px 24px 70px;
  }
  .stage-caption strong { font-size: 12px; }
  .edge-button { top: auto; bottom: 16px; translate: 0; width: 41px; height: 41px; border-radius: 50%; }
  .edge-button:hover:not(:disabled) { transform: scale(1.04); }
  #prev { left: 14px; }
  #next { right: 14px; }
  .fullscreen-fab { left: 50%; right: auto; bottom: 15px; transform: translateX(-50%); max-width: calc(100% - 118px); padding-inline: 13px; white-space: nowrap; }
  .fullscreen-fab:hover { transform: translateX(-50%) translateY(-2px); }
  .fullscreen-fab span { overflow: hidden; text-overflow: ellipsis; }
  .side-panel { padding: 17px; }
  .sponsor-card { min-height: 210px; }
  .context-actions { grid-template-columns: 1fr; }
  .email-cta-card { display: block; }
  .page-number { display: inline; min-width: 54px; }
  .page-status { min-width: 0; }
  .page-count { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-button:first-child,
  .nav-button:last-child { display: none; }
  .zoom-overlay { --reader-toolbar-space: 48px; --reader-side-space: 14px; padding: var(--reader-toolbar-space) 0 5px; }
  .zoom-toolbar { top: 6px; min-height: 34px; }
  .zoom-toolbar .ui-button { min-height: 28px; height: 28px; }
  .zoom-toolbar .ui-button.icon { width: 28px; }
  .zoom-toolbar #zoomReaderFirst,
  .zoom-toolbar #zoomReaderLast { display: none; }
  .zoom-close { top: 6px; left: 6px; min-width: 64px; height: 32px !important; padding: 0 9px !important; }
  .zoom-close::after { content: "Salir"; font-size: 9px; }
  .zoom-page-status { min-width: 57px; font-size: 9px; }
  .zoom-pages { padding: 0 7px; align-items: flex-start; }
  .zoom-pages img,
  .zoom-pages.single img { width: calc(94dvw * var(--zoom-scale)); max-height: calc(100dvh - var(--reader-toolbar-space) - 8px); object-fit: contain; }
  .zoom-edge { top: 50%; width: 39px; height: 52px; border-radius: 14px; }
  .zoom-edge-prev { left: 4px; }
  .zoom-edge-next { right: 4px; }
  .subscription-field { grid-template-columns: 1fr; }
  .subscription-field button { width: 100%; }
  .consent-banner { grid-template-columns: 1fr; left: 9px; right: 9px; bottom: 9px; }
  .consent-actions { justify-content: flex-end; }
}

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

/* Editorial reading layout ------------------------------------------------- */

body {
  grid-template-rows: 68px auto;
  background: #f6f2eb;
}

body::before { display: none; }

.workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px clamp(20px, 1.55vw, 32px) 26px;
  grid-template-columns: clamp(224px, 13vw, 260px) minmax(680px, 1fr) clamp(246px, 14vw, 282px);
  grid-template-areas: "sponsor viewer media";
  justify-content: stretch;
  align-items: start;
  gap: clamp(16px, 1.25vw, 24px);
}

.reader-column {
  grid-area: viewer;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
}

.side-panel {
  position: sticky;
  top: 88px;
  width: auto;
  max-height: calc(100dvh - 106px);
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.sponsor-panel,
.media-panel { border: 0; }

.panel-heading {
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 1.2vw, 23px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.sponsor-panel > .panel-heading { margin: 1px 0 14px; }

.viewer-stage {
  grid-area: auto;
  width: 100%;
  height: clamp(560px, calc(100dvh - 190px), 1900px);
  min-height: 560px;
  padding: 54px 38px 28px;
  overflow: hidden;
  border: 1px solid rgba(42, 16, 61, .09);
  border-radius: 24px;
  background: linear-gradient(145deg, #eeeae4, #e5e0d9);
  box-shadow: 0 16px 42px rgba(42, 16, 61, .08), inset 0 1px rgba(255, 255, 255, .82);
}

.viewer-stage::before {
  opacity: .09;
  background-image: radial-gradient(rgba(42, 16, 61, .28) .5px, transparent .5px);
  background-size: 9px 9px;
}

.stage-caption {
  top: 17px;
  left: 20px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.stage-caption strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -.02em;
}

.stage-caption span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.book-area::after {
  bottom: -3px;
  width: 76%;
  height: 18px;
  background: rgba(42, 16, 61, .2);
  filter: blur(16px);
}

#book { filter: drop-shadow(0 14px 24px rgba(34, 18, 43, .17)); }

.edge-button {
  width: 42px;
  height: 62px;
  border-radius: 15px;
  border-color: rgba(42, 16, 61, .1);
  color: var(--ink);
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 8px 22px rgba(42, 16, 61, .11);
}

#prev { left: 10px; }
#next { right: 10px; }

.fullscreen-fab {
  top: 10px;
  right: 12px;
  bottom: auto;
  min-height: 38px;
  padding: 0 13px;
  border-color: rgba(42, 16, 61, .12);
  color: var(--ink);
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 7px 20px rgba(42, 16, 61, .09);
  font-size: 10px;
}

.fullscreen-fab:hover {
  color: var(--plum);
  background: #fffdf8;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(42, 16, 61, .13);
}

.sponsor-list { gap: 10px; }

.sponsor-card {
  min-height: clamp(310px, 39dvh, 430px);
  border: 0;
  border-radius: 20px;
  background: #211928;
  box-shadow: 0 16px 34px rgba(42, 16, 61, .16);
}

.sponsor-card::before {
  inset: -3px;
  background-size: cover;
  background-position: var(--ad-position, center);
  filter: blur(1.2px) saturate(.84) contrast(.93);
  transform: scale(1.035);
}

.sponsor-card::after {
  background:
    linear-gradient(180deg, rgba(18, 12, 23, .03) 12%, rgba(18, 12, 23, .18) 42%, rgba(18, 12, 23, .93) 88%, rgba(18, 12, 23, .98) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--ad-color) 24%, transparent), transparent 58%);
}

.sponsor-content {
  padding: 86px 17px 18px;
  gap: 0;
}

.sponsor-category {
  width: max-content;
  max-width: 100%;
  margin-bottom: 7px;
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sponsor-content strong {
  font-size: clamp(19px, 1.35vw, 25px);
  line-height: 1.02;
}

.sponsor-content small {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.4;
}

.sponsor-content em {
  margin-top: 13px;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 9px;
}

.sponsor-card:hover .sponsor-content em { color: #fff; }

.sponsor-cta-slot { margin-top: 12px; }

.sponsor-cta-card {
  padding: 11px 2px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  background: transparent;
}

.sponsor-cta-card strong {
  min-width: 0;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
}

.sponsor-cta-card em {
  flex: none;
  color: var(--plum);
  font-size: 8px;
  white-space: nowrap;
}

.context-page-title {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 9px;
}

.context-actions { gap: 6px; }

.context-link,
.context-link.instagram,
.context-link.phone,
.context-link.email,
.context-link.website,
.context-link.sponsor,
.context-link.custom-color {
  --link-accent: var(--plum-soft);
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid rgba(42, 16, 61, .1);
  border-radius: 12px;
  grid-template-columns: 31px minmax(0, 1fr) 13px;
  gap: 8px;
  color: var(--ink);
  background: rgba(255, 253, 248, .72);
  box-shadow: none;
}

.context-link.instagram { --link-accent: #b74b77; }
.context-link.phone { --link-accent: #2c846f; }
.context-link.email { --link-accent: #70527d; }
.context-link.website { --link-accent: #337482; }
.context-link.sponsor,
.context-link.custom-color { --link-accent: var(--link-color, var(--plum-soft)); }

.context-link:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--link-accent) 35%, transparent);
  background: #fffdf8;
  box-shadow: 0 8px 18px rgba(42, 16, 61, .07);
  transform: translateX(2px);
}

.context-link .link-icon,
.context-link.instagram .link-icon,
.context-link.phone .link-icon,
.context-link.email .link-icon,
.context-link.website .link-icon,
.context-link.sponsor .link-icon,
.context-link.custom-color .link-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: var(--link-accent);
  background: color-mix(in srgb, var(--link-accent) 10%, transparent);
}

.link-icon svg { width: 16px; height: 16px; }

.context-link .link-copy strong { font-size: 10.5px; }

.context-link .link-copy small,
.context-link.instagram .link-copy small,
.context-link.phone .link-copy small,
.context-link.email .link-copy small,
.context-link.website .link-copy small,
.context-link.sponsor .link-copy small,
.context-link.custom-color .link-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

.link-arrow { color: var(--link-accent); font-size: 15px; }

.email-cta-card {
  margin-top: 17px;
  padding: 15px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.email-cta-card > span { color: var(--coral); }
.email-cta-card > strong { font-size: 12px; line-height: 1.25; }
.email-cta-card form { gap: 6px; margin-top: 9px; }
.email-cta-card input { height: 36px; border-radius: 9px; background: rgba(255, 253, 248, .75); font-size: 11px; }
.email-cta-card button { min-height: 36px; border-radius: 9px; font-size: 9px; }

.bottombar {
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 7px 4px max(7px, env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid rgba(42, 16, 61, .1);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.nav-cluster {
  padding: 3px;
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 5px 16px rgba(42, 16, 61, .06);
}

.nav-button { width: 35px; height: 35px; }
.page-label { font-size: 10px; }
.page-count { font-size: 8px; }
.progress { margin-top: 4px; }

@media (max-width: 1500px) {
  .workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "viewer viewer"
      "sponsor media";
    padding-inline: clamp(18px, 3vw, 42px);
  }

  .reader-column,
  .viewer-stage { width: 100%; margin: 0; }

  .side-panel {
    position: relative;
    top: auto;
    max-height: none;
    padding-top: 10px;
    overflow: visible;
  }

  .sponsor-card { min-height: 330px; }
}

@media (max-width: 820px) {
  body { grid-template-rows: 60px auto; }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "viewer" "sponsor" "media";
    padding: 12px 10px 20px;
    gap: 18px;
  }

  .reader-column { gap: 7px; }

  .viewer-stage {
    height: clamp(470px, calc(100vw + 90px), 560px);
    min-height: 470px;
    padding: 50px 34px 65px;
    border-radius: 20px;
  }

  .stage-caption { top: 15px; left: 16px; }
  .stage-caption span { display: none; }

  .fullscreen-fab {
    top: auto;
    left: 50%;
    right: auto;
    bottom: 14px;
    transform: translateX(-50%);
  }

  .fullscreen-fab:hover { transform: translateX(-50%) translateY(-1px); }
  .side-panel { padding: 0 7px; }
  .sponsor-card { min-height: 310px; }
  .bottombar { grid-template-columns: 1fr auto; }
  .footer-actions { display: none; }
}

@media (max-width: 600px), (max-width: 950px) and (max-height: 520px) {
  .viewer-stage {
    height: clamp(470px, calc(100vw + 90px), 540px);
    min-height: 470px;
    padding: 48px 20px 64px;
  }

  .edge-button { top: auto; bottom: 14px; width: 39px; height: 39px; }
  #prev { left: 12px; }
  #next { right: 12px; }
  .sponsor-card { min-height: 285px; }
}

