/* eLibrary Direct — design system
   Ink navy + warm paper, gold and terracotta accents. Fraunces for display,
   Inter for text; both self-hosted (OFL). */

@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-wght-italic.woff2') format('woff2'); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ink: #10223a;
  --ink-2: #1b3354;
  --ink-3: #2a4670;
  --paper: #fbf8f3;
  --paper-2: #f4eee4;
  --card: #ffffff;
  --gold: #e3a53a;
  --gold-soft: #f4c26b;
  --terra: #d25a24;
  --terra-dark: #b34a19;
  --leaf: #1f7a5f;
  --red: #b42318;
  --text: #1c2536;
  --muted: #5f6b7d;
  --line: #e7dfd2;
  --line-2: #d8cdbb;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16,34,58,.06), 0 2px 8px rgba(16,34,58,.06);
  --shadow: 0 6px 24px rgba(16,34,58,.10);
  --shadow-lg: 0 24px 60px rgba(16,34,58,.18);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.65 var(--sans); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 54px); }
h2 { font-size: clamp(26px, 3.4vw, 38px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 40px); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { display: inline-block; font: 700 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra); margin-bottom: 14px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 650 15.5px/1 var(--sans); padding: 14px 22px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; text-decoration: none !important; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--terra); color: #fff; box-shadow: 0 6px 18px rgba(210,90,36,.28); }
.btn-primary:hover { background: var(--terra-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--terra-dark); cursor: pointer; }

/* ── Header ──────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251,248,243,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none !important; }
.brand b { display: block; font: 700 19px/1 var(--serif); letter-spacing: -.01em; }
.brand b em { font-style: italic; color: var(--terra); }
.brand small { display: block; font: 600 11.5px/1 var(--sans); color: var(--muted); letter-spacing: .06em; margin-top: 4px; }
.brand-light { color: #fff; }
.brand-light small { color: rgba(255,255,255,.6); }
.brand-light b em { color: var(--gold-soft); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { color: var(--ink); font-weight: 560; font-size: 15px; padding: 9px 13px; border-radius: 999px; text-decoration: none; }
.nav-links a:hover { background: var(--paper-2); }
.nav-links a.on { background: var(--paper-2); color: var(--terra-dark); }
.nav-links a.btn-primary { color: #fff; margin-left: 6px; }
.nav-links a.btn-primary:hover { background: var(--terra-dark); }
.nav-user { display: inline-flex !important; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--gold-soft); display: inline-grid; place-items: center; font: 700 14px/1 var(--sans); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 70px; left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav-open .nav-links { display: flex; }
  .nav-links a { padding: 13px 14px; font-size: 16px; }
  .nav-links a.btn-primary { margin: 8px 0 0; }
  .nav-user-name { display: inline; }
}

/* ── Flash ───────────────────────────────────────────────── */
.flash { padding: 13px 0; font-weight: 560; font-size: 15px; }
.flash-ok { background: #e7f5ee; color: #155c46; }
.flash-error { background: #fdecea; color: var(--red); }
.flash-info { background: #eef3fb; color: var(--ink-2); }

/* ── Hero ────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, rgba(227,165,58,.22), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(210,90,36,.14), transparent 60%), var(--ink); color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 85%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 84px 0 96px; }
.hero h1 { color: #fff; font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--gold-soft); font-weight: 500; }
.hero .lead { font-size: 19px; color: rgba(255,255,255,.78); max-width: 540px; margin-bottom: 30px; }
.hero .eyebrow { color: var(--gold-soft); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn-ghost:hover { border-color: #fff; }
.hero-trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; color: rgba(255,255,255,.7); font-size: 14px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* 3D book on the hero */
.hero-stage { position: relative; height: 440px; perspective: 1600px; display: grid; place-items: center; }
.book3d { position: relative; width: 250px; height: 360px; transform-style: preserve-3d; transform: rotateY(-28deg) rotateX(6deg); transition: transform .8s cubic-bezier(.2,.8,.2,1); animation: bookfloat 7s ease-in-out infinite; }
.hero-stage:hover .book3d { transform: rotateY(-12deg) rotateX(3deg); }
@keyframes bookfloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.book3d .face { position: absolute; inset: 0; border-radius: 3px 8px 8px 3px; overflow: hidden; background: var(--ink-2); box-shadow: inset 4px 0 10px rgba(0,0,0,.35); transform: translateZ(18px); }
.book3d .face img { width: 100%; height: 100%; object-fit: cover; }
.book3d .face::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(255,255,255,.12) 3%, transparent 8%, transparent 92%, rgba(0,0,0,.1)); }
.book3d .pages { position: absolute; top: 5px; bottom: 5px; right: -1px; width: 36px; transform: rotateY(90deg) translateZ(232px) translateX(-18px); background: repeating-linear-gradient(90deg, #f4efe6 0 2px, #e3dccf 2px 3px); }
.book3d .back { position: absolute; inset: 0; background: #0b1829; border-radius: 3px 8px 8px 3px; transform: translateZ(-18px); box-shadow: 30px 40px 60px rgba(0,0,0,.45); }
.book3d .spine { position: absolute; top: 0; bottom: 0; left: 0; width: 36px; background: linear-gradient(90deg, #0b1829, #1b3354); transform: rotateY(-90deg) translateZ(18px) translateX(-18px); transform-origin: center; }
.book3d-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 30px 24px; background: linear-gradient(160deg, #1b3354, #10223a 60%); color: #fff; }
.book3d-fallback b { font: 600 30px/1.05 var(--serif); }
.book3d-fallback span { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.hero-float { position: absolute; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.hero-float b { display: block; font-size: 15px; }
.hero-float small { color: var(--muted); }
.hero-float .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--paper-2); }
.hero-float.f1 { top: 40px; right: 0; }
.hero-float.f2 { bottom: 46px; left: 0; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; padding: 56px 0 64px; gap: 20px; }
  .hero-stage { height: 380px; }
  .hero-float.f1 { right: 4%; top: 10px; }
  .hero-float.f2 { left: 4%; bottom: 10px; }
}

/* ── Sections ────────────────────────────────────────────── */
.section { padding: 84px 0; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section-head p { color: var(--muted); max-width: 560px; margin: 0; }
.section-head h2 { margin: 0; }

/* ── Book grid & cards ───────────────────────────────────── */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 30px 24px; }
.book-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); text-decoration: none !important; }
.book-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; overflow: hidden; background: var(--paper-2); box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 24px rgba(16,34,58,.16); transition: transform .25s ease, box-shadow .25s ease; }
.book-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.22) 0, rgba(255,255,255,.18) 2.5%, transparent 7%); pointer-events: none; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card:hover .book-cover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 20px 40px rgba(16,34,58,.22); }
.book-title { font: 650 16.5px/1.3 var(--serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { color: var(--muted); font-size: 14px; display: block; }
.book-price { font-weight: 700; font-size: 14.5px; color: var(--terra-dark); display: block; margin-top: 2px; }
.book-meta { display: flex; flex-direction: column; gap: 2px; }

/* ── Steps / features ────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); position: relative; }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); font: 600 44px/1 var(--serif); color: var(--gold); display: block; margin-bottom: 16px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; }
.section-dark .step { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); box-shadow: none; }
.section-dark .step p { color: rgba(255,255,255,.72); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.ticks { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #e7f5ee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' stroke='%231f7a5f' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat; }
.section-dark .ticks li::before { background-color: rgba(255,255,255,.12); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat b { display: block; font: 600 34px/1 var(--serif); color: var(--ink); margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 14px; }

.cta-band { background: linear-gradient(120deg, var(--terra), #e07a33); color: #fff; border-radius: 22px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgba(255,255,255,.88); }
@media (max-width: 760px) { .cta-band { flex-direction: column; align-items: flex-start; padding: 32px 26px; } }

/* ── Mock reader preview (publish page) ──────────────────── */
.device { background: #0b1829; border-radius: 26px; padding: 14px; box-shadow: var(--shadow-lg); }
.device-screen { background: #1a2638; border-radius: 16px; aspect-ratio: 16 / 11; display: grid; place-items: center; overflow: hidden; }
.spread { display: flex; width: 86%; aspect-ratio: 1.42; box-shadow: 0 20px 40px rgba(0,0,0,.4); }
.spread div { flex: 1; background: #fbf8f3; padding: 9% 8%; position: relative; }
.spread div:first-child { background: linear-gradient(90deg, #fbf8f3 80%, #e9e1d3); }
.spread div:last-child { background: linear-gradient(270deg, #fbf8f3 80%, #e9e1d3); }
.spread i { display: block; height: 5px; background: #d8cfbf; border-radius: 3px; margin-bottom: 7px; }
.spread i.h { height: 9px; width: 60%; background: var(--ink-3); margin-bottom: 12px; }
.spread i.s { width: 70%; }

/* ── Forms ───────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 28px; }
.card + .card { margin-top: 22px; }
.card h2 { font-size: 22px; }
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 48px 20px; background: radial-gradient(700px 400px at 100% 0, rgba(227,165,58,.14), transparent 60%), var(--paper); }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 620; font-size: 14.5px; color: var(--ink); margin-bottom: 7px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.input, select.input, textarea.input { width: 100%; font: 16px/1.4 var(--sans); color: var(--text); background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 4px rgba(42,70,112,.12); }
textarea.input { min-height: 140px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--terra); flex: none; }
.errors { background: #fdecea; color: var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 15px; }
.errors ul { margin: 0; padding-left: 18px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Upload drop zones */
.drop { border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fffdf9; padding: 26px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.drop:hover, .drop.over { border-color: var(--terra); background: #fff6ef; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { display: block; color: var(--ink); font-size: 16px; }
.drop span { color: var(--muted); font-size: 14px; }
.drop .icon { font-size: 30px; margin-bottom: 6px; }
.file-state { display: flex; align-items: center; gap: 14px; background: var(--paper-2); border-radius: 12px; padding: 14px 16px; margin-top: 12px; font-size: 14.5px; }
.file-state b { color: var(--ink); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--terra), var(--gold)); transition: width .2s; }
.cover-pick { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; }
.cover-pick .book-cover { width: 150px; }
@media (max-width: 560px) { .cover-pick { grid-template-columns: 1fr; } }
.loc-row { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 10px; margin-bottom: 10px; }
.loc-row .input { padding: 10px 12px; font-size: 15px; }
@media (max-width: 720px) { .loc-row { grid-template-columns: 1fr 1fr; } }

/* ── Book detail page ────────────────────────────────────── */
.book-hero { background: linear-gradient(180deg, var(--paper-2), var(--paper)); padding: 56px 0 30px; }
.book-layout { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.book-layout .book-cover { width: 100%; box-shadow: 0 2px 2px rgba(0,0,0,.08), 0 30px 60px rgba(16,34,58,.25); }
.book-info h1 { font-size: clamp(30px, 4.2vw, 46px); margin-bottom: 8px; }
.book-info .subtitle { font: italic 450 21px/1.4 var(--serif); color: var(--ink-3); margin-bottom: 14px; }
.book-info .by { font-size: 17px; color: var(--muted); margin-bottom: 22px; }
.book-info .by a { color: var(--ink); font-weight: 650; }
.buy-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.buy-box .price { font: 650 30px/1 var(--serif); color: var(--ink); }
.buy-box .price small { display: block; font: 500 13.5px/1.4 var(--sans); color: var(--muted); margin-top: 6px; }
.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; color: var(--muted); }
.fact b { color: var(--ink); font-weight: 650; }
.prose { font-size: 17px; line-height: 1.75; }
.prose p { margin-bottom: 1.1em; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-row a, .share-row button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; text-decoration: none; }
.share-row a:hover, .share-row button:hover { border-color: var(--ink); }
.locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.location { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.location b { display: block; color: var(--ink); }
.location span { display: block; font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
  .book-layout { grid-template-columns: 1fr; gap: 30px; }
  .book-layout .book-cover { width: min(260px, 70%); margin: 0 auto; }
  .book-hero { padding-top: 32px; }
}

/* Printed edition strip on the book page */
.print-box { display: flex; align-items: center; gap: 14px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: -8px 0 22px; flex-wrap: wrap; }
.print-box .print-ic { font-size: 24px; }
.print-box div { flex: 1; min-width: 180px; }
.print-box b { display: block; color: var(--ink); }
.print-box span { font-size: 14px; color: var(--muted); }

/* ── Stars & reviews ─────────────────────────────────────── */
.stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 1px; font-size: 17px; vertical-align: -2px; }
.stars-bg { color: #e2d8c6; }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--gold); }
.stars.sm { font-size: 13px; }
.stars.lg { font-size: 26px; }
.rating-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; margin: -10px 0 20px; text-decoration: none !important; }
.rating-line b { color: var(--ink); }
.book-rating { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.reviews-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .reviews-grid { grid-template-columns: 1fr; gap: 26px; } }
.rev-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.rev-summary .big { font: 650 46px/1 var(--serif); color: var(--ink); margin-bottom: 6px; }
.rev-bars { margin-top: 16px; display: grid; gap: 6px; }
.rev-bar { display: grid; grid-template-columns: 28px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.rev-bar i { display: block; height: 7px; background: var(--line); border-radius: 9px; overflow: hidden; }
.rev-bar i b { display: block; height: 100%; background: var(--gold); }
.review { border-bottom: 1px solid var(--line); padding: 18px 0; }
.review:first-child { padding-top: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.review-head b { color: var(--ink); font-size: 15px; }
.review p { margin: 0; white-space: pre-line; }
.verified { font-size: 12px; font-weight: 650; color: var(--leaf); background: #e7f5ee; padding: 3px 8px; border-radius: 99px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 34px; line-height: 1; color: #e2d8c6; cursor: pointer; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--gold); }
.star-input label:active { transform: scale(.9); }
.star-input input:focus-visible + label { outline: 2px solid var(--ink-3); border-radius: 4px; }

/* ── Publisher dashboard / admin ─────────────────────────── */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 40px 0 24px; }
.dash-head h1 { font-size: 34px; margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs a { padding: 11px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--terra); }
.tabs .count { background: var(--terra); color: #fff; border-radius: 99px; font-size: 12px; padding: 2px 8px; margin-left: 6px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th { text-align: left; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fdfbf7; white-space: nowrap; }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; white-space: nowrap; }
.mini-book { display: flex; align-items: center; gap: 12px; }
.mini-book img { width: 40px; height: 60px; object-fit: cover; border-radius: 2px 5px 5px 2px; box-shadow: var(--shadow-sm); background: var(--paper-2); }
.mini-book b { display: block; color: var(--ink); }
.pill { display: inline-block; font: 650 12.5px/1 var(--sans); padding: 6px 10px; border-radius: 99px; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.pill-live, .pill-paid, .pill-active { background: #e7f5ee; color: #155c46; }
.pill-review, .pill-pending { background: #fff4e0; color: #8a5a00; }
.pill-rejected, .pill-failed, .pill-suspended { background: #fdecea; color: var(--red); }
.pill-draft, .pill-unlisted { background: #eef1f5; color: #4a5568; }
.pill-free { background: #eef3fb; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.kpi span { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.kpi b { font: 650 26px/1.1 var(--serif); color: var(--ink); }
.kpi small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--paper-2); border-radius: 10px; padding: 8px 8px 8px 14px; font-size: 14px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.note { background: #fff8ea; border: 1px solid #f2dfb5; border-radius: 12px; padding: 14px 18px; font-size: 15px; color: #6b4b0d; }
.note-red { background: #fdecea; border-color: #f5c6c0; color: var(--red); }

/* ── Library ─────────────────────────────────────────────── */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 30px 24px; }
.lib-item .book-cover { margin-bottom: 12px; }
.lib-progress { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.lib-progress i { display: block; height: 100%; background: var(--leaf); }

/* ── Empty state, prose pages ────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 18px; }
.empty-art { display: inline-block; margin-bottom: 14px; opacity: .9; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto 20px; }
.doc { padding: 56px 0 80px; }
.doc h1 { font-size: 40px; }
.doc h2 { font-size: 24px; margin-top: 36px; }
.doc p, .doc li { font-size: 16.5px; line-height: 1.75; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ── Search bar ──────────────────────────────────────────── */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.searchbar .input { flex: 1 1 260px; }
.searchbar select.input { flex: 0 1 240px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 560; text-decoration: none !important; }
.chip.on, .chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 60px 0 26px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.foot-grid h4 { color: #fff; font: 650 14px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.foot-grid a:not(.brand) { display: block; color: rgba(255,255,255,.72); margin-bottom: 10px; font-size: 15px; word-break: break-word; }
.foot-grid a:not(.brand):hover { color: #fff; }
.foot-tag { margin-top: 16px; max-width: 280px; }
.foot-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; font-size: 13.5px; color: rgba(255,255,255,.55); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }
