/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #18181f;
  --surface:   #1e1e28;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --accent:    #c8a96e;
  --accent2:   #e8c98e;
  --red:       #d14444;
  --text:      #e8e6df;
  --muted:     #888880;
  --faint:     #444440;
  --radius:    6px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (max-width: 640px) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}

.nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.nav-links {
  display: flex; gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 65% 50%, rgba(200,169,110,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(209,68,68,0.06) 0%, transparent 60%),
    linear-gradient(160deg, #0a0a0f 0%, #12121a 100%);
}

.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 70% 50%, black 0%, transparent 70%);
  opacity: 0.4;
}

.hero-inner {
  position: relative;
  display: flex; align-items: center; gap: 5vw;
  width: 100%; max-width: 1200px;
  margin: 0 auto;
  padding: clamp(3rem,8vh,6rem) clamp(1rem,4vw,3rem);
}

.hero-cover {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 300px);
  aspect-ratio: 2/3;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px var(--border2);
}

.hero-cover-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(145deg, #1a1a24 0%, #0f0f16 100%);
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cover-art-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  color: var(--border2);
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1;
  padding: 0 1rem;
}

.hero-content { flex: 1 1 0; min-width: 0; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.25);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  letter-spacing: 0.03em;
  line-height: 0.92;
  color: #fff;
  margin-bottom: 0.5rem;
}

.hero-title span { color: var(--accent); }

.hero-subtitle {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-bottom: 2rem;
}

.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.meta-value { font-size: 0.92rem; font-weight: 500; color: var(--text); }

.status-ongoing {
  color: #4caf7d;
  display: flex; align-items: center; gap: 5px;
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #4caf7d; animation: pulse 2s infinite; }

.hero-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 2rem;
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all .2s;
  border: none;
  min-width: 140px;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── BREADCRUMBS ────────────────────────────────────────── */
.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem clamp(1rem,4vw,3rem) 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 0.4rem; opacity: 0.4; }

/* ─── CHAPTER LIST ────────────────────────────────────────── */
.section {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(2rem,5vw,4rem) clamp(1rem,4vw,3rem);
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.section-title span { color: var(--accent); }

.chapter-search {
  display: flex; align-items: center; gap: 10px;
}

.search-input {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  width: 180px;
  transition: border-color .2s;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--accent); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Optional: custom scrollbar for dark theme */
.chapter-grid::-webkit-scrollbar {
  width: 6px;
}
.chapter-grid::-webkit-scrollbar-track {
  background: var(--bg2);
  border-radius: 4px;
}
.chapter-grid::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}
.chapter-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.chapter-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  color: inherit;
}

.chapter-item:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateX(3px);
}

.chapter-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 52px;
}

.chapter-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-date {
  font-size: 0.72rem;
  color: var(--faint);
  white-space: nowrap;
  margin-left: 8px;
}

.new-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  flex-shrink: 0;
}

.chapter-dropdown {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  min-width: 120px;
  transition: border-color .2s;
}

.chapter-dropdown:focus {
  border-color: var(--accent);
}

.chapter-dropdown option {
  background: var(--bg2);
  color: var(--text);
}

.show-more-row {
  grid-column: 1 / -1;
  display: flex; justify-content: center;
  padding-top: 0.5rem;
}

/* ─── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1rem,4vw,3rem);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
  color: var(--faint);
  font-size: 0.78rem;
  max-width: 1200px;
  margin: 0 auto;
}

footer a { color: var(--accent); }

/* ─── CHAPTER READER PAGE ─────────────────────────────────── */
.reader-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem clamp(0.5rem, 2vw, 1rem) 5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}

.reader-page img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--bg3);
}

.reader-chapter-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem,4vw,3rem) 1rem;
  text-align: center;
}
.reader-chapter-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 0.3rem;
}
.reader-chapter-header .sub {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.chapter-nav {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(1rem,4vw,3rem) 2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
}
.chapter-nav a, .chapter-nav span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all .2s;
}

/* ─── SHARE WIDGET ───────────────────────────────────────────── */
.share-widget {
  max-width: 820px;
  margin: 3rem auto 1rem;
  text-align: center;
}
.share-widget h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  font-weight: 500;
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #1877F2; }
.share-btn.reddit { background: #FF4500; }

/* ─── SEO TEXT BLOCK (card style) ───────────────────────── */
.chapter-seo {
  max-width: 820px;
  margin: 2rem auto;
  padding: 2rem;
  background: linear-gradient(145deg, var(--bg2) 0%, rgba(200,169,110,0.03) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.chapter-seo h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chapter-seo h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 4px;
}

.seo-content p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.seo-content p strong {
  color: var(--text);
  font-weight: 600;
}

.seo-disclaimer {
  font-size: 0.8rem !important;
  opacity: 0.7;
  margin-top: 1rem;
}

.seo-tags {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── LATEST CHAPTERS WIDGET (card style) ────────────────── */
.latest-widget {
  max-width: 820px;
  margin: 0 auto 4rem auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.latest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.latest-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.view-all-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.view-all-link:hover {
  color: var(--accent2);
}

.latest-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
}

.latest-list li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg3);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-align: center;
  transition: all 0.2s ease;
}

.latest-list li a:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200,169,110,0.15);
}

.ch-prefix {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ch-num {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .chapter-seo,
  .latest-widget {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 1rem;
  }
  .latest-widget ul {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
/* New reader header styles */
.reader-header {
  max-width: 820px;
  margin: 1.5rem auto 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.reader-header-top {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.series-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.chapter-badge {
  background: var(--bg3);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border2);
}

.chapter-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 1rem 0 0.8rem;
}

.chapter-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--bg2);
  padding: 0.2rem 0.8rem;
  border-radius: 16px;
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--border2);
}

.author-credit {
  font-size: 0.7rem;
  color: var(--faint);
  margin-left: 0.5rem;
}

.chapter-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
/* Make dropdown fit nicely inside the new header actions */
.chapter-actions .chapter-dropdown {
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  min-width: 100px;
  text-align: center;
}

.chapter-actions .chapter-dropdown:hover {
  border-color: var(--accent);
}

/* On mobile, adjust spacing */
@media (max-width: 640px) {
  .chapter-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.chapter-nav-btn {
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.chapter-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chapter-nav a:hover { border-color: var(--accent); color: var(--accent); }
.chapter-nav .disabled { opacity: 0.35; pointer-events: none; }


/* latest-chapters widget */
.latest-widget {
  max-width: 820px;
  margin: 2rem auto;
  padding: 1.5rem clamp(1rem,4vw,3rem);
  border-top: 1px solid var(--border);
}
.latest-widget h2 {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--text);
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.latest-widget h2 span { color: var(--accent); }
.latest-widget ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem 1rem; }
.latest-widget li a { color: var(--muted); font-size: 0.85rem; display: block; padding: 0.3rem 0; transition: color .2s; }
.latest-widget li a:hover { color: var(--accent); }

/* ─── PROGRESS BAR ─────────────────────────────────────────── */
.reader-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.15s linear;
  z-index: 200;
}

.reader-progress-text {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ─── READING MODE ─────────────────────────────────────────── */
body.reading-mode nav.nav,
body.reading-mode footer,
body.reading-mode .chapter-nav,
body.reading-mode .chapter-seo,
body.reading-mode .latest-widget,
body.reading-mode .reader-chapter-header {
  display: none !important;
}

body.reading-mode #reader-pages {
  padding-top: 0;
}

body.reading-mode #reader-pages img {
  margin: 0 auto;
  display: block;
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-cover { width: 55vw; }
  .hero-desc { border-left: none; border-top: 2px solid var(--accent); padding: 1rem 0 0; }
  .hero-actions { justify-content: center; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-nav { justify-content: space-between; gap: 0.4rem; }
  .latest-widget ul { grid-template-columns: 1fr 1fr; }
  .chapter-nav a, .chapter-nav span {
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    min-width: auto;
    flex: 1;
  }
  .chapter-dropdown { min-width: 70px; padding: 0.45rem 0.6rem; font-size: 0.75rem; flex: 1; }
}

/* Very small screens - dropdown more compact */
@media (max-width: 372px) {
  .chapter-nav {
    gap: 0.25rem;
  }
  .chapter-nav a, .chapter-nav span {
    padding: 0.35rem 0.5rem;
    font-size: 0.68rem;
  }
  .chapter-dropdown {
    min-width: 60px;
    padding: 0.3rem 0.4rem;
    font-size: 0.65rem;
    flex: 1;
  }
}

@media (max-width: 640px) {
  .chapter-grid {
    max-height: 360px;
  }
}
/* ═══════════════════════════════════════════════════════════════

/* ═══════════════════════════════════════════════════════════════
   PANELVERSE-STYLE READER  (accurate recreation)
   ═══════════════════════════════════════════════════════════════ */

/* Outer wrapper — centres everything, max 820px */
.pv-reader-wrap {
  max-width: 820px;
  margin: 2rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ── H1 title (centered, plain weight like PV) ─────────────── */
.pv-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* ── Info card (bordered box: breadcrumbs + desc + tags) ────── */
.pv-info-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.pv-breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.pv-breadcrumbs a { color: var(--accent); transition: color 0.15s; }
.pv-breadcrumbs a:hover { color: var(--accent2); text-decoration: underline; }
.pv-sep { margin: 0 0.35rem; color: var(--faint); }

.pv-description {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 0.9rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.pv-description strong { color: var(--text); }

.pv-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.pv-tag {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.18rem 0.7rem;
  border-radius: 20px;
}
.pv-tag-status {
  color: #4caf7d;
  border-color: rgba(76,175,125,0.4);
}
.pv-author-line {
  font-size: 0.72rem;
  color: var(--faint);
  margin-top: 0.6rem;
}

/* ── Controls row: ‹Prev  [Chapter ▾]  Next› ───────────────── */
.pv-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.pv-prev-next {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.pv-controls-bottom {
  max-width: 820px;
  margin: 1rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Pill nav buttons */
.pv-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border2);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.pv-pill:hover:not(.pv-pill-disabled) {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}
.pv-pill-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}
.pv-next {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
}
.pv-next:hover:not(.pv-pill-disabled) {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #0a0a0f;
}
.pv-next.pv-pill-disabled {
  background: var(--bg2);
  color: var(--muted);
  border-color: var(--border2);
}

/* ── Dropdown wrapper ───────────────────────────────────────── */
.pv-dropdown-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 140px;
}

/* Trigger button */
.pv-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.pv-dropdown-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.pv-dropdown-btn[aria-expanded="true"] {
  border-color: var(--accent);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.pv-chevron {
  width: 11px;
  height: 8px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
}
.pv-dropdown-btn[aria-expanded="true"] .pv-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.pv-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);

  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.pv-dropdown-panel::-webkit-scrollbar { width: 5px; }
.pv-dropdown-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.pv-dropdown-panel::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.pv-chapter-list { list-style: none; padding: 0; margin: 0; }
.pv-chapter-list li { border-bottom: 1px solid var(--border); }
.pv-chapter-list li:last-child { border-bottom: none; }

.pv-chapter-list li a,
.pv-chapter-list li span {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
}
.pv-chapter-list li a:hover { background: var(--surface); color: var(--text); }
.pv-chapter-list li.pv-current span {
  color: var(--accent);
  font-weight: 600;
  background: rgba(200,169,110,0.07);
}

/* ── Reading mode ───────────────────────────────────────────── */
body.reading-mode .pv-reader-wrap,
body.reading-mode .pv-controls,
body.reading-mode .pv-controls-bottom,
body.reading-mode nav.nav,
body.reading-mode footer,
body.reading-mode .chapter-seo,
body.reading-mode .latest-widget,
body.reading-mode .back-to-top { display: none !important; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pv-info-card { padding: 1rem; text-align: left; }
  .pv-breadcrumbs, .pv-tags { justify-content: flex-start; }
  .pv-description { text-align: left; }
  .pv-pill { padding: 0.45rem 0.8rem; font-size: 0.78rem; }
  .pv-dropdown-btn { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 4rem 1rem 3rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
footer p {
  opacity: 0.8;
}
footer span a { 
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border2);
  border-radius: 999px;
  transition: all 0.2s;
}
footer span a:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent2);
}

/* ─── BACK TO TOP BUTTON ─────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent2);
  transform: translateY(-3px);
}

@media (max-width: 640px) {
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }
}