/* ============================================================
   RPV BOOKS — COMPLETE DESIGN SYSTEM v3
   ============================================================ */
:root {
  --bg: #f2f2f7;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text: #1c1c1e;
  --text-2: #3a3a3c;
  --text-muted: #636366;
  --text-light: #8e8e93;
  --accent: #0071e3;
  --accent-dark: #004fc4;
  --accent-light: #e8f2fd;
  --green: #30d158;
  --green-dark: #248a3d;
  --red: #ff453a;
  --orange: #ff9f0a;
  --purple: #bf5af2;
  --border: #c6c6c8;
  --border-light: #e5e5ea;
  --shadow-xs: 0 1px 3px rgba(0,0,0,.07);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.09);
  --shadow-md: 0 6px 24px rgba(0,0,0,.11);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.15);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --ease: cubic-bezier(.4,0,.2,1);
  --dur: .22s;
  --hh: 58px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); outline: none; }

/* Utilities */
.container { max-width: 1260px; margin: 0 auto; padding: 0 24px; }
.section { padding: 60px 0; }
.section-alt { background: var(--bg-white); }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* Section Headers */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.section-sub { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.see-all { font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px; border-radius: 980px; font-size: 15px; font-weight: 600;
  transition: all var(--dur) var(--ease); white-space: nowrap; cursor: pointer;
  border: 1.5px solid transparent; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,113,227,.35); }
.btn-secondary { background: var(--bg-white); color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-light); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .1px; }
.form-control {
  width: 100%; padding: 11px 15px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text);
  background: var(--bg-white); transition: border-color var(--dur), box-shadow var(--dur);
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.form-control::placeholder { color: var(--text-light); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e8e93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea.form-control { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.form-error { font-size: 13px; color: var(--red); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 900; height: var(--hh);
  background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px); border-bottom: 1px solid var(--border-light);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 100%; max-width: 1260px; margin: 0 auto; padding: 0 24px; }
.site-logo { font-size: 20px; font-weight: 900; color: var(--text); letter-spacing: -.7px; flex-shrink: 0; }
.site-logo em { color: var(--accent); font-style: normal; }
.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search input { width: 100%; padding: 8px 14px 8px 38px; border: 1.5px solid var(--border-light); border-radius: 980px; font-size: 14px; background: var(--bg); transition: all var(--dur); }
.header-search input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0,113,227,.1); }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; }
.search-drop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 200; display: none; max-height: 340px; overflow-y: auto; }
.search-drop.open { display: block; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; transition: background var(--dur); }
.search-item:hover { background: var(--bg); }
.search-item-cover { width: 34px; height: 50px; border-radius: 4px; object-fit: cover; background: var(--border-light); flex-shrink: 0; }
.search-item-title { font-size: 13px; font-weight: 600; }
.search-item-meta { font-size: 12px; color: var(--text-muted); }
.header-nav { display: flex; align-items: center; gap: 2px; }
.header-nav a { font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 6px 12px; border-radius: 980px; transition: all var(--dur); }
.header-nav a:hover, .header-nav a.active { color: var(--accent); background: var(--accent-light); }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.hdr-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border-light); background: var(--bg-white); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--dur); position: relative; cursor: pointer; }
.hdr-btn:hover { border-color: var(--accent); color: var(--accent); }
.hdr-badge { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.user-wrap { position: relative; }
.user-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid var(--border-light); overflow: hidden; transition: border-color var(--dur); }
.user-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-btn:hover { border-color: var(--accent); }
.user-drop { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all var(--dur); z-index: 300; }
.user-drop.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.drop-user { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 6px; }
.drop-name { font-size: 14px; font-weight: 700; }
.drop-role { font-size: 11px; color: var(--text-muted); }
.user-drop a, .user-drop button { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text); transition: background var(--dur); width: 100%; text-align: left; }
.user-drop a:hover, .user-drop button:hover { background: var(--bg); color: var(--text); }
.drop-div { height: 1px; background: var(--border-light); margin: 6px 0; }

/* ── HERO ── */
.hero { background: linear-gradient(140deg, #060614 0%, #0d1b3e 50%, #0a2060 100%); color: #fff; padding: 80px 0 72px; overflow: hidden; position: relative; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 900px 600px at 65% 40%, rgba(0,113,227,.18) 0%, transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; position: relative; z-index: 1; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(0,113,227,.18); border: 1px solid rgba(96,165,250,.35); color: #93c5fd; font-size: 11px; font-weight: 600; padding: 5px 14px; border-radius: 980px; margin-bottom: 22px; text-transform: uppercase; letter-spacing: .5px; }
.hero-title { font-size: clamp(34px, 4.5vw, 56px); font-weight: 900; line-height: 1.08; letter-spacing: -2px; margin-bottom: 20px; }
.hero-title em { color: #60a5fa; font-style: normal; }
.hero-sub { font-size: 18px; color: rgba(255,255,255,.7); line-height: 1.65; margin-bottom: 36px; max-width: 460px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 36px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.1); }
.hero-stat strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.hero-stat span { font-size: 12px; color: rgba(255,255,255,.45); }
.hero-books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; transform: perspective(900px) rotateY(-7deg) rotateX(2deg); }
.hero-bk { border-radius: 10px; overflow: hidden; }
.hero-bk-cover { aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center; font-size: 26px; transition: transform var(--dur); }
.hero-bk:hover .hero-bk-cover { transform: scale(1.04) translateY(-3px); }
.hbc1{background:linear-gradient(135deg,#667eea,#764ba2)}.hbc2{background:linear-gradient(135deg,#f093fb,#f5576c)}.hbc3{background:linear-gradient(135deg,#4facfe,#00f2fe)}.hbc4{background:linear-gradient(135deg,#43e97b,#38f9d7)}.hbc5{background:linear-gradient(135deg,#fa709a,#fee140)}.hbc6{background:linear-gradient(135deg,#a18cd1,#fbc2eb)}

/* ── FEATURES BAR ── */
.features-bar { background: var(--bg-white); border-bottom: 1px solid var(--border-light); }
.features-list { display: grid; grid-template-columns: repeat(4, 1fr); }
.feature-item { display: flex; align-items: center; gap: 14px; padding: 20px 28px; border-right: 1px solid var(--border-light); }
.feature-item:last-child { border-right: none; }
.f-ico { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.f-ico.blue { background: #e8f2fd; color: var(--accent); }
.f-ico.green { background: rgba(48,209,88,.12); color: var(--green-dark); }
.f-ico.orange { background: rgba(255,159,10,.12); color: #b45309; }
.f-ico.purple { background: rgba(191,90,242,.12); color: #7c3aed; }
.f-txt strong { font-size: 13px; font-weight: 700; display: block; }
.f-txt span { font-size: 12px; color: var(--text-muted); }

/* ── GENRE PILLS ── */
.genre-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.genre-pill { padding: 7px 18px; border-radius: 980px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--border); background: var(--bg-white); color: var(--text-muted); cursor: pointer; transition: all var(--dur); }
.genre-pill:hover { border-color: var(--accent); color: var(--accent); }
.genre-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── BOOK CARDS ── */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 22px; }
.books-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.book-card { cursor: pointer; transition: transform var(--dur); }
.book-card:hover { transform: translateY(-4px); }
.book-cover-wrap { position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.14); background: var(--border-light); transition: box-shadow var(--dur); }
.book-card:hover .book-cover-wrap { box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.book-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.book-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 980px; color: #fff; text-transform: uppercase; letter-spacing: .4px; }
.badge-new { background: var(--green); }
.badge-hot { background: var(--red); }
.badge-free { background: var(--orange); }
.badge-feat { background: var(--purple); }
.book-wish { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; font-size: 14px; opacity: 0; transition: opacity var(--dur); cursor: pointer; }
.book-card:hover .book-wish { opacity: 1; }
.book-wish.on { opacity: 1; color: var(--red); }
.book-info { padding: 10px 2px 0; }
.book-ttl { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; }
.book-auth { font-size: 12px; color: var(--accent); font-weight: 500; display: block; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-auth:hover { text-decoration: underline; }
.book-meta { display: flex; align-items: center; justify-content: space-between; }
.book-price { font-size: 14px; font-weight: 700; color: var(--text); }
.book-price.free { color: var(--green-dark); }
.book-stars { color: #ff9f0a; font-size: 11px; }

/* ── BOOK DETAIL ── */
.book-detail { padding: 40px 0 80px; }
.book-detail-grid { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
.cover-sticky { position: sticky; top: calc(var(--hh) + 20px); }
.cover-lg { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.22); }
.cover-ph-lg { width: 100%; aspect-ratio: 2/3; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 72px; }
.cover-actions { display: flex; gap: 8px; margin-top: 14px; }
.genre-tag { display: inline-block; background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 980px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px; }
.detail-title { font-size: clamp(24px, 3.5vw, 42px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.12; margin-bottom: 10px; }
.detail-author { font-size: 16px; color: var(--accent); font-weight: 600; margin-bottom: 14px; display: inline-block; }
.detail-author:hover { text-decoration: underline; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.rating-big { font-size: 22px; font-weight: 800; }
.stars-big { color: #ff9f0a; font-size: 18px; letter-spacing: 1px; }
.rating-ct { font-size: 13px; color: var(--text-muted); }
.price-box { background: var(--bg); border: 1.5px solid var(--border-light); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.price-big { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 3px; }
.price-big.free { color: var(--green-dark); }
.price-note { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.paypal-btn { background: #ffc439; color: #003087; border-radius: 980px; padding: 13px 24px; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: all var(--dur); width: 100%; border: none; margin-bottom: 10px; }
.paypal-btn:hover { background: #e6af30; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,196,57,.4); }
.secure-row { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--text-light); margin-top: 8px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.meta-tile { background: var(--bg); border-radius: var(--radius-xs); padding: 10px 13px; }
.meta-lbl { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.meta-val { font-size: 13px; font-weight: 700; margin-top: 2px; }
.owned-banner { background: rgba(48,209,88,.1); border: 1.5px solid rgba(48,209,88,.25); border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; color: var(--green-dark); font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* Tabs */
.tab-bar { display: flex; border-bottom: 2px solid var(--border-light); margin-bottom: 22px; gap: 0; }
.tab-btn { padding: 11px 18px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: all var(--dur); background: none; cursor: pointer; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   READING EXPERIENCE — The crown jewel
   ============================================================ */
.reader-modal { position: fixed; inset: 0; z-index: 2000; background: #111; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.reader-modal.open { opacity: 1; pointer-events: all; }

/* Reader Top Bar */
.reader-bar { height: 50px; background: rgba(20,20,20,.95); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 16px; flex-shrink: 0; }
.reader-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.reader-close { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); cursor: pointer; transition: background var(--dur); flex-shrink: 0; border: none; }
.reader-close:hover { background: rgba(255,255,255,.2); }
.reader-book-title { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-author { font-size: 12px; color: rgba(255,255,255,.45); }
.reader-bar-center { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.reader-page-chips { display: flex; gap: 5px; }
.page-chip { padding: 5px 12px; border-radius: 980px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--dur); border: 1.5px solid rgba(255,255,255,.18); color: rgba(255,255,255,.55); background: transparent; }
.page-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-chip.locked { color: rgba(255,255,255,.25); border-color: rgba(255,255,255,.1); cursor: not-allowed; }
.reader-bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.reader-settings-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); cursor: pointer; transition: background var(--dur); border: none; }
.reader-settings-btn:hover { background: rgba(255,255,255,.2); }

/* Reader Settings Panel */
.reader-settings-panel { position: absolute; top: 58px; right: 16px; width: 260px; background: #1e1e1e; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); padding: 16px; z-index: 10; display: none; }
.reader-settings-panel.open { display: block; }
.rs-label { font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; margin-bottom: 10px; display: block; }
.rs-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.rs-row label { font-size: 13px; color: rgba(255,255,255,.75); }
.font-size-btns { display: flex; gap: 6px; }
.fz-btn { width: 30px; height: 28px; border-radius: 6px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; transition: background var(--dur); }
.fz-btn:hover { background: rgba(255,255,255,.2); }
.theme-btns { display: flex; gap: 6px; }
.theme-btn { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: border-color var(--dur); }
.theme-btn.active { border-color: var(--accent); }
.theme-btn.light { background: #fff; }
.theme-btn.sepia { background: #f4ecd8; }
.theme-btn.dark { background: #1a1a2e; }
.line-height-slider { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* Reader Content Area */
.reader-body { flex: 1; overflow: hidden; display: flex; position: relative; }
.reader-page-area { flex: 1; overflow-y: auto; scroll-snap-type: none; }

/* Reader Page — light theme (default) */
.reader-page { max-width: 680px; margin: 0 auto; padding: 48px 56px 80px; min-height: 100%; }
.reader-page.theme-light { background: #fff; color: #1c1c1e; }
.reader-page.theme-sepia { background: #f8f3e8; color: #3b2f1e; }
.reader-page.theme-dark { background: #1a1a2e; color: #d4d4d8; }
.reader-page-header { text-align: center; margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid currentColor; opacity: .15; }
.reader-chapter-title { font-family: var(--font-serif); font-size: 26px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; opacity: 1; }
.reader-page-num { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: .5; margin-top: 8px; }
.reader-content { font-family: var(--font-serif); font-size: 18px; line-height: 1.95; }
.reader-content p { margin-bottom: 1.4em; }
.reader-content h2 { font-family: var(--font); font-size: 20px; font-weight: 800; margin: 2em 0 .8em; font-style: normal; }
.reader-content h3 { font-family: var(--font); font-size: 17px; font-weight: 700; margin: 1.5em 0 .6em; }
.reader-content blockquote { border-left: 3px solid var(--accent); margin: 1.5em 0; padding: 0 0 0 20px; font-style: italic; opacity: .8; }

/* Locked page overlay */
.reader-locked-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(to bottom, rgba(17,17,17,0) 0%, rgba(17,17,17,.96) 40%); z-index: 5; pointer-events: none; }
.reader-locked-overlay.show { pointer-events: all; }
.reader-lock-card { background: #1c1c1e; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 36px 40px; text-align: center; max-width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.lock-icon { font-size: 44px; margin-bottom: 14px; }
.lock-title { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.5px; margin-bottom: 10px; }
.lock-sub { font-size: 15px; color: rgba(255,255,255,.55); line-height: 1.6; margin-bottom: 24px; }
.lock-price { font-size: 36px; font-weight: 900; color: #fff; letter-spacing: -1.5px; margin-bottom: 20px; }
.lock-price span { font-size: 16px; font-weight: 500; color: rgba(255,255,255,.4); }
.lock-btns { display: flex; flex-direction: column; gap: 10px; }

/* Reader nav arrows */
.reader-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur); z-index: 4; }
.reader-nav:hover { background: rgba(255,255,255,.2); color: #fff; }
.reader-nav-prev { left: 16px; }
.reader-nav-next { right: 16px; }
.reader-nav.hidden { opacity: 0; pointer-events: none; }

/* Reader progress bar */
.reader-progress-bar { height: 2px; background: rgba(255,255,255,.08); flex-shrink: 0; position: relative; }
.reader-progress-fill { height: 100%; background: var(--accent); transition: width .4s var(--ease); }

/* Reader status bar */
.reader-status { height: 36px; background: rgba(20,20,20,.95); border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.reader-status span { font-size: 12px; color: rgba(255,255,255,.35); font-weight: 500; }
.reader-page-indicator { font-size: 12px; color: rgba(255,255,255,.5); font-weight: 600; }

/* ── PREVIEW BADGE ── */
.preview-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(48,209,88,.12); color: var(--green-dark); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 980px; border: 1px solid rgba(48,209,88,.25); }

/* ── AUTH PAGE ── */
.auth-wrap { min-height: calc(100vh - var(--hh)); background: linear-gradient(135deg, #f2f2f7 0%, #e5e5ea 100%); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; padding: 40px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-mark { font-size: 26px; font-weight: 900; letter-spacing: -1px; color: var(--text); }
.auth-logo-mark em { color: var(--accent); font-style: normal; }
.auth-logo-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 26px; }
.auth-tab { flex: 1; padding: 9px; text-align: center; font-size: 14px; font-weight: 600; border-radius: 8px; color: var(--text-muted); cursor: pointer; transition: all var(--dur); }
.auth-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow-xs); }

/* ── DASHBOARD ── */
.dash-wrap { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - var(--hh)); }
.dash-sidebar { background: var(--bg-white); border-right: 1px solid var(--border-light); padding: 22px 0; position: sticky; top: var(--hh); height: calc(100vh - var(--hh)); overflow-y: auto; }
.sidebar-user { padding: 0 14px 18px; border-bottom: 1px solid var(--border-light); margin-bottom: 14px; display: flex; align-items: center; gap: 11px; }
.sidebar-av { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.sidebar-av img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-role { font-size: 11px; color: var(--text-muted); }
.sidebar-section { padding: 0 10px; margin-bottom: 18px; }
.sidebar-sec-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-light); padding: 0 8px; margin-bottom: 5px; display: block; }
.sidebar-link { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-muted); transition: all var(--dur); margin-bottom: 2px; position: relative; }
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.sidebar-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 980px; }
.dash-main { padding: 34px 36px; min-width: 0; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.dash-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.dash-sub { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-xs); }
.stat-ico { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.stat-ico.blue{background:#e8f2fd;color:var(--accent)}.stat-ico.green{background:rgba(48,209,88,.12);color:var(--green-dark)}.stat-ico.orange{background:rgba(255,159,10,.12);color:#b45309}.stat-ico.purple{background:rgba(191,90,242,.12);color:#7c3aed}
.stat-lbl { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-val { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-top: 2px; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 3px; }
.stat-change.up{color:var(--green-dark)}.stat-change.down{color:var(--red)}
.dash-table-wrap { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden; margin-bottom: 24px; }
.dash-table-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.dash-table-head h3 { font-size: 15px; font-weight: 700; }
.rpv-tbl { width: 100%; border-collapse: collapse; }
.rpv-tbl th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); background: var(--bg); border-bottom: 1px solid var(--border-light); }
.rpv-tbl td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.rpv-tbl tr:last-child td { border-bottom: none; }
.rpv-tbl tr:hover td { background: var(--bg); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 980px; font-size: 11px; font-weight: 700; }
.status-pill::before { content: '●'; font-size: 8px; }
.status-pill.published{background:rgba(48,209,88,.12);color:var(--green-dark)}.status-pill.pending{background:rgba(255,159,10,.12);color:#b45309}.status-pill.draft{background:rgba(142,142,147,.12);color:var(--text-muted)}.status-pill.suspended{background:rgba(255,69,58,.1);color:var(--red)}

/* Upload Zone */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: all var(--dur); background: var(--bg); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.upload-zone-ico { font-size: 40px; margin-bottom: 10px; }
.upload-zone-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.upload-zone-hint { font-size: 13px; color: var(--text-muted); }
.cover-preview { width: 100px; height: 150px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.paypal-info { background: #fff8e1; border: 1.5px solid #ffe082; border-radius: 10px; padding: 13px 16px; display: flex; gap: 12px; align-items: flex-start; }

/* ── LIBRARY ── */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }

/* ── REVIEWS ── */
.review-item { background: var(--bg); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.rev-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rev-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rev-name { font-size: 13px; font-weight: 700; }
.rev-date { font-size: 11px; color: var(--text-light); }
.rev-text { font-size: 14px; line-height: 1.65; }
.star-pick { display: flex; gap: 5px; font-size: 26px; cursor: pointer; margin-bottom: 12px; }
.star-pick span { color: var(--border-light); transition: color var(--dur); }
.star-pick span.lit { color: #ff9f0a; }

/* ── REPORT ── */
.issue-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.issue-tag { padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 980px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--dur); background: none; }
.issue-tag.sel { border-color: var(--red); background: #fff0ef; color: var(--red); }

/* ── CHAT WIDGET ── */
.chat-widget { position: fixed; bottom: 22px; right: 22px; z-index: 1500; }
.chat-fab { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 24px rgba(0,113,227,.42); transition: all var(--dur); border: none; }
.chat-fab:hover { transform: scale(1.08); background: var(--accent-dark); }
.chat-unread { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.chat-panel { position: absolute; bottom: 66px; right: 0; width: 350px; height: 510px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(12px) scale(.96); transition: all .25s var(--ease); }
.chat-panel.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }
.chat-head { background: var(--accent); color: #fff; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chat-head h4 { font-size: 14px; font-weight: 700; }
.chat-head span { font-size: 11px; opacity: .75; }
.chat-close { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; color: #fff; transition: background var(--dur); }
.chat-close:hover { background: rgba(255,255,255,.3); }
.chat-tabs { display: flex; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.ctab { flex: 1; padding: 9px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; transition: all var(--dur); }
.ctab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chat-pane { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.chat-pane.active { display: flex; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { display: flex; gap: 7px; align-items: flex-end; }
.chat-msg.mine { flex-direction: row-reverse; }
.msg-av { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-bubble { max-width: 76%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.chat-msg:not(.mine) .msg-bubble { background: var(--bg); border-bottom-left-radius: 4px; }
.chat-msg.mine .msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; color: var(--text-light); margin-bottom: 2px; }
.chat-input-row { border-top: 1px solid var(--border-light); padding: 8px 12px; display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.chat-ta { flex: 1; border: 1.5px solid var(--border); border-radius: 16px; padding: 7px 12px; font-size: 13px; resize: none; max-height: 70px; line-height: 1.4; transition: border-color var(--dur); background: #fff; }
.chat-ta:focus { border-color: var(--accent); outline: none; }
.chat-send { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; flex-shrink: 0; transition: background var(--dur); }
.chat-send:hover { background: var(--accent-dark); }

/* ── ALERTS & TOASTS ── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; }
.alert-success{background:rgba(48,209,88,.1);color:var(--green-dark);border:1px solid rgba(48,209,88,.25)}.alert-error{background:rgba(255,69,58,.08);color:var(--red);border:1px solid rgba(255,69,58,.2)}.alert-info{background:var(--accent-light);color:var(--accent-dark);border:1px solid rgba(0,113,227,.2)}.alert-warn{background:rgba(255,159,10,.1);color:#92400e;border:1px solid rgba(255,159,10,.25)}
.toast-wrap { position: fixed; top: 72px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1c1c1e; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; animation: toastIn .28s var(--ease); pointer-events: all; max-width: 280px; }
.toast.success{border-left:3px solid var(--green)}.toast.error{border-left:3px solid var(--red)}.toast.info{border-left:3px solid var(--accent)}
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── MISC ── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state-ico { font-size: 54px; margin-bottom: 14px; opacity: .4; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border-light); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: var(--text-light); }

/* ── NEWSLETTER ── */
.newsletter { background: linear-gradient(135deg, var(--accent), #0038a8); padding: 56px 0; color: #fff; text-align: center; }
.newsletter h2 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 9px; }
.newsletter p { opacity: .8; margin-bottom: 24px; }
.newsletter-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.newsletter-input { flex: 1; padding: 12px 18px; border-radius: 980px; border: none; font-size: 14px; outline: none; }

/* ── FOOTER ── */
.site-footer { background: #1c1c1e; color: rgba(255,255,255,.6); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 44px; padding-bottom: 44px; }
.footer-brand { font-size: 20px; font-weight: 900; color: #fff; letter-spacing: -.7px; display: block; margin-bottom: 11px; }
.footer-brand em { color: var(--accent); font-style: normal; }
.footer-desc { font-size: 13px; line-height: 1.75; margin-bottom: 18px; }
.footer-socials { display: flex; gap: 9px; }
.soc-ico { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 13px; color: rgba(255,255,255,.6); transition: all var(--dur); }
.soc-ico:hover { background: var(--accent); color: #fff; }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 13px; }
.footer-col li { margin-bottom: 8px; }
.footer-col li a { font-size: 13px; color: rgba(255,255,255,.45); transition: color var(--dur); }
.footer-col li a:hover { color: rgba(255,255,255,.9); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 16px 0; display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,.3); }
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: 12px; color: rgba(255,255,255,.3); transition: color var(--dur); }
.footer-legal a:hover { color: rgba(255,255,255,.7); }

/* Author page */
.author-hero { background: linear-gradient(135deg,#1c1c1e,#2c2c2e); color: #fff; padding: 50px 0; }
.author-hero-inner { display: flex; align-items: flex-start; gap: 30px; }
.author-av-xl { width: 110px; height: 110px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); object-fit: cover; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: #fff; flex-shrink: 0; }
.author-name-xl { font-size: clamp(22px, 4vw, 38px); font-weight: 800; letter-spacing: -1px; margin-bottom: 9px; }
.author-bio-xl { font-size: 14px; color: rgba(255,255,255,.65); max-width: 500px; line-height: 1.65; }
.author-stats-row { display: flex; gap: 26px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.author-stat strong { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.author-stat span { font-size: 11px; color: rgba(255,255,255,.4); }
.author-actions { margin-left: auto; flex-shrink: 0; display: flex; flex-direction: column; gap: 9px; }

/* ── RESPONSIVE ── */
@media(max-width:1100px){.books-grid-5{grid-template-columns:repeat(4,1fr)}.hero-grid{grid-template-columns:1fr}.hero-books{display:none}.stats-grid{grid-template-columns:1fr 1fr}.footer-grid{grid-template-columns:1fr 1fr}}
@media(max-width:768px){.header-nav{display:none}.header-search{max-width:190px}.books-grid-5{grid-template-columns:repeat(3,1fr)}.books-grid{grid-template-columns:repeat(2,1fr)}.book-detail-grid{grid-template-columns:1fr}.cover-sticky{position:static;max-width:190px;margin:0 auto 24px}.dash-wrap{grid-template-columns:1fr}.dash-sidebar{display:none}.form-row{grid-template-columns:1fr}.features-list{grid-template-columns:1fr 1fr}.footer-grid{grid-template-columns:1fr}.newsletter-form{flex-direction:column}.chat-panel{width:calc(100vw - 36px);right:-4px}.author-hero-inner{flex-direction:column}.reader-page{padding:28px 22px 60px}.reader-bar{padding:0 12px}.reader-nav{display:none}}
@media(max-width:480px){.container{padding:0 14px}.books-grid-5{grid-template-columns:repeat(2,1fr)}.auth-card{padding:22px 16px}.dash-main{padding:18px 14px}.stats-grid{grid-template-columns:1fr 1fr}.features-list{grid-template-columns:1fr}}
