/* ══════════════════════════════════════════════════════════════════
   reader.css v5 — MyTropes e-reader stylesheet
   Dark romance reader with slide-in chat drawer
   Colors: bg #1e191d | sidebar #2d2429 | purple #7c5295 | gold #c8a96e
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.reader-body {
  margin: 0;
  padding: 0;
  background: #1e191d;
  color: #d4c8e0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Light mode override (toggled via JS adding .rd-light to body) */
.reader-body.rd-light {
  background: #f9f5f0;
  color: #2a1f2e;
}

/* ── Font size modifiers ───────────────────────────────────────── */
.reader-body.rd-fs-s { font-size: 0.88rem; }
.reader-body.rd-fs-m { font-size: 1.05rem; }
.reader-body.rd-fs-l { font-size: 1.2rem; }

/* ── TOP BAR ──────────────────────────────────────────────────── */
.rd-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #252023;
  border-bottom: 1px solid #3d3238;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.rd-topbar__back {
  color: #C5A6BB;
  text-decoration: none;
  font-size: 0.82rem;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}
.rd-topbar__back:hover { color: #e0c8ed; }

.rd-topbar__title {
  font-size: 0.88rem;
  font-family: 'Montserrat', sans-serif;
  color: #e8e0d5;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.rd-topbar__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rd-topbar__btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid #3d3238;
  color: #d4c8e0;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.rd-topbar__btn:hover {
  background: rgba(200,168,224,0.12);
  border-color: #7c5295;
  color: #e8d8f0;
}

.rd-topbar__chat-btn {
  background: rgba(124,82,149,0.18);
  border-color: #7c5295;
  color: #e0c8ed;
}
.rd-topbar__chat-btn:hover {
  background: rgba(124,82,149,0.35);
  color: #fff;
}

/* Light mode topbar */
.rd-light .rd-topbar {
  background: #fff;
  border-bottom-color: #e0d8e8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.rd-light .rd-topbar__title { color: #2a1f2e; }
.rd-light .rd-topbar__back { color: #7c5295; }
.rd-light .rd-topbar__btn {
  background: #f4eef8;
  border-color: #d0bfe0;
  color: #3a2a4a;
}
.rd-light .rd-topbar__btn:hover { background: #e8d8f0; border-color: #7c5295; }

/* ── READING PROGRESS LINE ────────────────────────────────────── */
.rd-progress-line {
  position: fixed;
  top: 52px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c5295, #C5A6BB);
  z-index: 1001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.rd-sidebar {
  position: fixed;
  top: 54px;
  left: 0;
  width: 260px;
  height: calc(100vh - 54px);
  background: #2d2429;
  border-right: 1px solid #3d3238;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  z-index: 900;
}
.rd-sidebar.open { transform: translateX(0); }

.rd-sidebar::-webkit-scrollbar { width: 3px; }
.rd-sidebar::-webkit-scrollbar-thumb { background: #4a3a44; border-radius: 3px; }
.rd-sidebar::-webkit-scrollbar-track { background: transparent; }

.rd-sidebar__head {
  padding: 16px 18px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #3d3238;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.rd-chapter-list {
  padding: 6px 0;
}

.rd-chapter-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  color: #b8a8c8;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rd-chapter-item:hover {
  background: rgba(200,168,224,0.08);
  color: #e0c8ed;
}
.rd-chapter-item.current {
  border-left-color: #C5A6BB;
  background: rgba(197,166,187,0.12);
  color: #e8d8f0;
  font-weight: 600;
}

.rd-ch-num {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a6a88;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 2px;
}

.rd-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 899;
}
.rd-sidebar-overlay.visible { display: block; }

/* Light mode sidebar */
.rd-light .rd-sidebar {
  background: #f4eef8;
  border-right-color: #ddd0e8;
}
.rd-light .rd-chapter-item { color: #5a4a6a; }
.rd-light .rd-chapter-item:hover { background: rgba(124,82,149,0.08); color: #2a1f2e; }
.rd-light .rd-chapter-item.current {
  background: rgba(124,82,149,0.12);
  color: #2a1f2e;
}

/* ── SETTINGS PANEL ───────────────────────────────────────────── */
.rd-settings-panel {
  display: none;
  position: fixed;
  top: 60px;
  right: 16px;
  background: #2a2030;
  border: 1px solid #3d3238;
  border-radius: 10px;
  padding: 16px 18px;
  z-index: 950;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  min-width: 180px;
}
.rd-settings-panel.open { display: block; }

.rd-settings-panel label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 8px;
}

.rd-font-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.rd-font-btn {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid #3d3238;
  color: #b8a8c8;
  border-radius: 6px;
  padding: 6px 0;
  font-family: Georgia, serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}
.rd-font-btn:hover { border-color: #7c5295; color: #e0c8ed; }
.rd-font-btn.active {
  background: rgba(124,82,149,0.25);
  border-color: #7c5295;
  color: #e8d8f0;
}

.rd-theme-toggle {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid #3d3238;
  color: #b8a8c8;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.rd-theme-toggle:hover { border-color: #7c5295; color: #e0c8ed; }

/* Light mode settings */
.rd-light .rd-settings-panel {
  background: #fff;
  border-color: #d8cce8;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.rd-light .rd-font-btn { background: #f4eef8; border-color: #d0bfe0; color: #3a2a4a; }
.rd-light .rd-font-btn.active { background: rgba(124,82,149,0.15); }
.rd-light .rd-theme-toggle { background: #f4eef8; border-color: #d0bfe0; color: #3a2a4a; }

/* ── MAIN READING AREA ────────────────────────────────────────── */
.rd-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 28px 120px;
  min-height: 100vh;
}

.rd-chapter-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8d8f0;
  margin-bottom: 8px;
  font-family: Georgia, serif;
  line-height: 1.3;
}

.rd-chapter-meta {
  font-size: 0.8rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rd-content {
  color: #d4c8e0;
  letter-spacing: 0.01em;
}

.rd-content p {
  margin: 0 0 1.4em;
}

.rd-content p:empty,
.rd-content p:has(br:only-child) {
  margin: 0.5em 0;
}

.rd-content em, .rd-content i { color: #e8d8f0; font-style: italic; }

/* Light mode reading area */
.rd-light .rd-chapter-title { color: #2a1f2e; }
.rd-light .rd-chapter-meta { color: #7a6888; }
.rd-light .rd-content { color: #2a1f2e; }
.rd-light .rd-content em { color: #1a0f1e; }

/* ── CHAPTER NAV (bottom) ─────────────────────────────────────── */
.rd-chapnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #252023;
  border-top: 1px solid #3d3238;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 800;
}

.rd-chapnav__btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid #3d3238;
  color: #C5A6BB;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.rd-chapnav__btn:hover {
  background: rgba(197,166,187,0.15);
  border-color: #7c5295;
  color: #e0c8ed;
}
.rd-chapnav__btn:disabled, .rd-chapnav__btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.rd-chapnav__label {
  font-size: 0.78rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
}

/* Light mode chapter nav */
.rd-light .rd-chapnav { background: #fff; border-top-color: #e0d8e8; }
.rd-light .rd-chapnav__btn { background: #f4eef8; border-color: #d0bfe0; color: #5a3a7a; }
.rd-light .rd-chapnav__btn:hover { background: #e8d8f0; }

/* ── FLOATING CHARACTER CARD ──────────────────────────────────── */
.rd-char-float {
  position: fixed;
  right: 20px;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 810;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.rd-char-float.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.rd-char-float__portrait {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #7c5295;
  box-shadow: 0 4px 16px rgba(124,82,149,0.45);
  display: block;
}

.rd-char-float__label {
  font-size: 0.68rem;
  color: #C5A6BB;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  background: rgba(37,32,35,0.9);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ── CHAT DRAWER ──────────────────────────────────────────────── */
.rd-chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: #1e191d;
  border-left: 1px solid #3d3238;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 1100;
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}
.rd-chat-drawer.open { transform: translateX(0); }
.rd-chat-drawer.expanded { width: 640px; }

.rd-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1099;
}
.rd-drawer-backdrop.visible { display: block; }

/* Drawer header */
.rd-drawer__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #252023;
  border-bottom: 1px solid #3d3238;
  flex-shrink: 0;
}

.rd-drawer__title {
  flex: 1;
  font-size: 0.88rem;
  font-family: 'Montserrat', sans-serif;
  color: #e8d8f0;
  font-weight: 600;
}

.rd-drawer__close-btn,
.rd-drawer__back-btn,
.rd-drawer__expand-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.rd-drawer__close-btn:hover,
.rd-drawer__back-btn:hover,
.rd-drawer__expand-btn:hover {
  color: #e8d8f0;
  background: rgba(255,255,255,0.08);
}

/* Character selection screen */
.rd-drawer__selection {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rd-drawer__selection-title {
  font-size: 1rem;
  color: #e8d8f0;
  font-family: Georgia, serif;
  margin-bottom: 4px;
}

.rd-drawer__selection-subtitle {
  font-size: 0.82rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 12px;
  line-height: 1.5;
}

.rd-drawer__selection-note {
  font-size: 0.8rem;
  color: #a88db0;
  text-align: center;
  background: rgba(124,82,149,0.1);
  border: 1px solid #3d3050;
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 320px;
  line-height: 1.5;
}

.rd-drawer__char-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #3d3238;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
  width: 100%;
  color: #d4c8e0;
  font-family: 'Montserrat', sans-serif;
}
.rd-drawer__char-option:hover {
  background: rgba(124,82,149,0.12);
  border-color: #7c5295;
}
.rd-drawer__char-option--explore {
  border-style: dashed;
  border-color: #4a3a54;
  color: #a88db0;
}
.rd-drawer__char-option--explore:hover {
  border-style: solid;
  border-color: #7c5295;
  background: rgba(124,82,149,0.08);
}

.rd-drawer__char-option__portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #2d2429;
  border: 2px solid #4a3a54;
}
.rd-drawer__char-option__portrait--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.rd-drawer__char-option__info { flex: 1; min-width: 0; }
.rd-drawer__char-option__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8d8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-drawer__char-option__sub {
  font-size: 0.73rem;
  color: #888;
  margin-top: 2px;
}
.rd-drawer__char-option__arrow {
  color: #555;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Chat panel inside drawer */
.rd-drawer__chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.rd-drawer__char-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #7c5295;
}

.rd-drawer__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.rd-drawer__messages::-webkit-scrollbar { width: 3px; }
.rd-drawer__messages::-webkit-scrollbar-thumb { background: #4a3a44; border-radius: 3px; }

/* Message bubbles (used by JS) */
.rd-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.rd-msg--user {
  align-self: flex-end;
  background: rgba(124,82,149,0.3);
  border: 1px solid #7c5295;
  color: #e8d8f0;
  border-bottom-right-radius: 4px;
}
.rd-msg--char {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid #3d3238;
  color: #d4c8e0;
  border-bottom-left-radius: 4px;
  font-family: Georgia, serif;
}
.rd-msg--thinking {
  align-self: flex-start;
  color: #888;
  font-style: italic;
  font-size: 0.82rem;
  padding: 6px 10px;
  background: none;
  border: none;
}

.rd-drawer__input-area {
  padding: 12px 14px;
  border-top: 1px solid #3d3238;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #252023;
  flex-shrink: 0;
}

.rd-drawer__input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid #3d3238;
  border-radius: 10px;
  color: #e8d8f0;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: Georgia, serif;
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 100px;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.rd-drawer__input::placeholder { color: #555; }
.rd-drawer__input:focus { border-color: #7c5295; }

.rd-drawer__send-btn {
  background: #7c5295;
  border: none;
  color: #fff;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  transition: background 0.15s, transform 0.1s;
}
.rd-drawer__send-btn:hover { background: #6a4480; }
.rd-drawer__send-btn:active { transform: scale(0.95); }
.rd-drawer__send-btn:disabled { background: #3d2850; cursor: not-allowed; }

/* ── AUDIO PLAYER ─────────────────────────────────────────────── */
.rd-audio-player {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  background: #252023;
  border-top: 1px solid #3d3238;
  z-index: 820;
  display: none;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.rd-audio-player.active { display: block; }

.rd-audio-player__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rd-audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rd-audio-btn {
  background: none;
  border: 1px solid #3d3238;
  color: #C5A6BB;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.rd-audio-btn:hover { border-color: #7c5295; color: #e0c8ed; }

.rd-audio-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7c5295;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.15s;
  flex-shrink: 0;
}
.rd-audio-play:hover { background: #6a4480; }

.rd-audio-seek {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  accent-color: #7c5295;
  cursor: pointer;
}

.rd-audio-time {
  font-size: 0.72rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.rd-audio-speed {
  background: none;
  border: 1px solid #3d3238;
  color: #888;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
.rd-audio-speed-label {
  font-size: 0.72rem;
  color: #888;
}

.rd-audio-info {
  font-size: 0.78rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rd-audio-close {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.rd-audio-close:hover { color: #e0c8ed; }

/* ── END OF BOOK OVERLAY ──────────────────────────────────────── */
.rd-end-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,14,18,0.92);
  z-index: 1200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 20px;
}
.rd-end-overlay.visible { display: flex; }

.rd-end-overlay__portrait {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #7c5295;
  box-shadow: 0 0 32px rgba(124,82,149,0.5);
}

.rd-end-overlay__msg {
  font-size: 1.3rem;
  font-family: Georgia, serif;
  color: #e8d8f0;
  max-width: 420px;
  line-height: 1.6;
}

.rd-end-overlay__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.rd-end-overlay__cta a,
.rd-end-overlay__cta button {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  border: 2px solid transparent;
}
.rd-end-overlay__cta .btn-primary-cta {
  background: #7c5295;
  color: #fff;
  border-color: #7c5295;
}
.rd-end-overlay__cta .btn-primary-cta:hover { background: #6a4480; }
.rd-end-overlay__cta .btn-secondary-cta {
  background: transparent;
  color: #C5A6BB;
  border-color: #7c5295;
}
.rd-end-overlay__cta .btn-secondary-cta:hover {
  background: rgba(124,82,149,0.15);
  color: #e8d8f0;
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rd-topbar__title { display: none; }
  .rd-topbar { gap: 8px; padding: 0 10px; }
  .rd-topbar__btn { padding: 5px 9px; font-size: 0.75rem; }

  .rd-main { padding: 68px 18px 100px; }
  .rd-chapter-title { font-size: 1.25rem; }

  .rd-chat-drawer { width: 100vw; }
  .rd-chat-drawer.expanded { width: 100vw; }

  .rd-char-float { right: 14px; bottom: 66px; }
  .rd-char-float__portrait { width: 44px; height: 44px; }

  .rd-audio-player__inner { padding: 8px 14px; gap: 8px; }
  .rd-audio-speed-label { display: none; }
}

@media (max-width: 480px) {
  .rd-topbar__back { font-size: 0.78rem; }
  .rd-chapnav { padding: 0 12px; }
  .rd-chapnav__label { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   Paywall overlay — Chapter 2+ gate for non-logged-in visitors
   ══════════════════════════════════════════════════════════════════ */

.rd-paywall-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 10, 14, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.rd-paywall-overlay.visible { display: flex; }

.rd-paywall-card {
  background: #28202c;
  border: 1px solid #4a3a54;
  border-radius: 18px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  position: relative;
  animation: paywallSlideUp 0.35s cubic-bezier(.22,1,.36,1) both;
}

@keyframes paywallSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.rd-paywall-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid #7c5295;
  box-shadow: 0 0 24px rgba(124,82,149,0.45);
  margin: 0 auto 16px;
}

.rd-paywall-lock {
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}

.rd-paywall-title {
  font-size: 1.5rem;
  font-family: Georgia, serif;
  color: #e8d8f0;
  margin: 0 0 12px;
  font-weight: 700;
}

.rd-paywall-msg {
  font-size: 0.92rem;
  color: #b0a0c0;
  line-height: 1.65;
  margin: 0 0 24px;
  font-family: Georgia, serif;
}
.rd-paywall-msg em { color: #e0c8ed; font-style: italic; }

.rd-paywall-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rd-paywall-cta {
  display: block;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s;
  letter-spacing: 0.02em;
}
.rd-paywall-cta--primary {
  background: #7c5295;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,82,149,0.4);
}
.rd-paywall-cta--primary:hover {
  background: #6a4480;
  box-shadow: 0 6px 20px rgba(124,82,149,0.55);
  color: #fff;
}
.rd-paywall-cta--secondary {
  background: transparent;
  color: #C5A6BB;
  border: 2px solid #4a3a54;
}
.rd-paywall-cta--secondary:hover {
  border-color: #7c5295;
  color: #e0c8ed;
  background: rgba(124,82,149,0.1);
}

.rd-paywall-fine {
  font-size: 0.72rem;
  color: #666;
  font-family: 'Montserrat', sans-serif;
  margin: 0;
}

/* Blurred last paragraphs — preview effect before the paywall shows */
.rd-content.paywall-blur::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, #1e191d 90%);
  pointer-events: none;
}
.rd-content.paywall-blur {
  position: relative;
  overflow: hidden;
  max-height: 85vh;
}

@media (max-width: 600px) {
  .rd-paywall-card { padding: 28px 20px; }
  .rd-paywall-title { font-size: 1.25rem; }
}
