html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background-color: #1c1e24;
  color: #c9ccd3;
}

/* ============================================
   Light theme — applied when <html data-theme="light">.
   Overrides the darkest surfaces + inverts text.
   ============================================ */
html[data-theme="light"] {
  color-scheme: light;
}
html[data-theme="light"] body {
  background-color: #f5f6f8;
  color: #1f2328;
}
html[data-theme="light"] .nr-navbar,
html[data-theme="light"] .nr-footer {
  background-color: #ffffff;
  border-color: #e5e7eb;
}
html[data-theme="light"] .nr-navbar .nav-link,
html[data-theme="light"] .nr-navbar .navbar-brand,
html[data-theme="light"] .nr-footer .text-secondary {
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-navbar .nav-link:hover,
html[data-theme="light"] .nr-navbar .navbar-brand:hover {
  color: #b78900 !important;
}
html[data-theme="light"] .novel-card,
html[data-theme="light"] .nr-author-sidebar,
html[data-theme="light"] .nr-chapter-editor,
html[data-theme="light"] .card.bg-dark,
html[data-theme="light"] .nr-ad-type-group,
html[data-theme="light"] .nr-ad-slot-card {
  background-color: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-author-sidebar {
  border-right: 1px solid #e5e7eb;
}
html[data-theme="light"] .nr-author-nav-item {
  color: #1f2328;
}
html[data-theme="light"] .nr-author-nav-item:hover,
html[data-theme="light"] .nr-author-nav-item.active {
  background: #eef1f4;
  color: #b78900;
}
html[data-theme="light"] .nr-author-nav-item.active {
  border-left-color: #ffc107;
}
html[data-theme="light"] .nr-author-sidebar-label {
  color: #6c7383;
}
html[data-theme="light"] .text-secondary {
  color: #4a5461 !important;
}
html[data-theme="light"] .text-light {
  color: #1f2328 !important;
}
html[data-theme="light"] .table-dark {
  --bs-table-bg: #ffffff;
  --bs-table-color: #1f2328;
  --bs-table-striped-bg: #eef1f4;
  --bs-table-striped-color: #1f2328;
  --bs-table-hover-bg: #eef1f5;
  --bs-table-hover-color: #1f2328;   /* keep text dark on hover — was inheriting the dark-table's near-white */
  --bs-table-active-bg: #e5e9ee;
  --bs-table-active-color: #1f2328;
  --bs-table-border-color: #e5e7eb;
  color: #1f2328;
}
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] textarea.form-control {
  background-color: #ffffff !important;
  color: #1f2328 !important;
  border-color: #d1d5db !important;
}
html[data-theme="light"] .form-control::placeholder {
  color: #8a919d !important;
}
html[data-theme="light"] .nr-rte {
  border-color: #d1d5db;
}
html[data-theme="light"] .nr-rte-toolbar {
  background: #eef1f4;
  border-bottom-color: #e5e7eb;
}
html[data-theme="light"] .nr-rte-btn,
html[data-theme="light"] .nr-rte-toolbar button {
  color: #1f2328;
}
html[data-theme="light"] .nr-rte-btn:hover,
html[data-theme="light"] .nr-rte-toolbar button:hover {
  background: #e6e8ec;
  color: #8a5a00;
}
html[data-theme="light"] .nr-rte-dd-menu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
html[data-theme="light"] .nr-rte-dd-item {
  color: #1f2328;
}
html[data-theme="light"] .nr-rte-dd-item:hover {
  background: #eef1f4;
  color: #8a5a00;
}
html[data-theme="light"] .list-group-item.bg-dark,
html[data-theme="light"] .bg-dark {
  background-color: #ffffff !important;
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-chapter-editor-header {
  background: #eef1f4;
  color: #1f2328;
}
html[data-theme="light"] .nr-stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
html[data-theme="light"] .nr-ad-type-header {
  background: #eef1f4;
  border-color: #e5e7eb;
}
html[data-theme="light"] .nr-ad-textarea {
  background: #f8f9fa !important;
  color: #1f2328 !important;
  border-color: #d1d5db !important;
}
html[data-theme="light"] .nr-sticky-ad,
html[data-theme="light"] .nr-popup-ad,
html[data-theme="light"] .nr-interstitial-box {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2328;
}
html[data-theme="light"] .breadcrumb {
  background: transparent;
}

/* Public novel cards + placeholders in light theme */
html[data-theme="light"] .novel-card {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
html[data-theme="light"] .novel-card:hover {
  border-color: #b78900 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
html[data-theme="light"] .novel-cover {
  background: linear-gradient(135deg, #e5e7eb, #f1f3f6);
  color: #9ca3af;
}
html[data-theme="light"] .novel-card .text-secondary {
  color: #6b7280 !important;
}

/* Latest release rows + genre panel need light versions of their dark surfaces. */
html[data-theme="light"] .nr-latest-list,
html[data-theme="light"] .nr-genre-panel,
html[data-theme="light"] .nr-latest-row {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-latest-row {
  border-bottom: 1px solid #e5e7eb;
}
html[data-theme="light"] .nr-latest-row a,
html[data-theme="light"] .nr-genre-link {
  color: #ad7f00 !important;
}
html[data-theme="light"] .nr-latest-row a:hover,
html[data-theme="light"] .nr-genre-link:hover {
  color: #b78900 !important;
}
html[data-theme="light"] .nr-genre-link {
  background: #eef1f4 !important;
  border-color: #e5e7eb !important;
}
html[data-theme="light"] .rank-list .rank-num {
  color: #9ca3af;
}

/* Home spotlight + featured hero areas */
html[data-theme="light"] .nr-spotlight,
html[data-theme="light"] .nr-hot-panel,
html[data-theme="light"] .nr-featured-panel {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328 !important;
}

/* Bootstrap muted classes we lean on */
html[data-theme="light"] .btn-outline-light {
  color: #1f2328;
  border-color: #d1d5db;
}
html[data-theme="light"] .btn-outline-light:hover {
  background: #eef1f4;
  color: #1f2328;
}
html[data-theme="light"] .btn-outline-secondary {
  color: #4a5461;
  border-color: #d1d5db;
}
html[data-theme="light"] .btn-outline-secondary:hover {
  background: #eef1f4;
  color: #1f2328;
}
html[data-theme="light"] .btn-outline-warning {
  color: #ad7f00;
  border-color: #ffc107;
}
html[data-theme="light"] .btn-outline-warning:hover {
  background: #ffc107;
  color: #000;
}
html[data-theme="light"] a { color: #ad7f00; }
html[data-theme="light"] a:hover { color: #b78900; }
html[data-theme="light"] .text-warning { color: #b78900 !important; }

/* Home-page featured cards + release list — must invert in light theme */
html[data-theme="light"] .nr-featured-card,
html[data-theme="light"] .nr-release-list {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-featured-card .text-secondary,
html[data-theme="light"] .nr-release-list .text-secondary {
  color: #6b7280 !important;
}
html[data-theme="light"] .nr-featured-card a,
html[data-theme="light"] .nr-release-list a {
  color: #1f2328;
}
html[data-theme="light"] .nr-featured-card:hover {
  border-color: #b78900 !important;
}
html[data-theme="light"] .nr-release-list .list-group-item,
html[data-theme="light"] .nr-release-row {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328 !important;
}
html[data-theme="light"] .nr-spotlight-cover,
html[data-theme="light"] .nr-spotlight-overlay {
  background: linear-gradient(135deg, #e5e7eb, #f1f3f6) !important;
  color: #9ca3af !important;
}
html[data-theme="light"] .nr-spotlight-overlay {
  background: linear-gradient(180deg, transparent, rgba(58,56,48,.75)) !important;
  color: #ffffff !important;
}

/* Bootstrap tables — the fallback rules */
html[data-theme="light"] table.table,
html[data-theme="light"] table.table-hover {
  --bs-table-bg: transparent;
  color: #1f2328;
}
html[data-theme="light"] table.table thead th {
  color: #6b7280;
  border-bottom-color: #e5e7eb;
}
html[data-theme="light"] table.table td,
html[data-theme="light"] table.table th {
  border-color: #e5e7eb;
}

/* Admin Dashboard */
.nr-dash-header .nr-section-title {
  margin: 0;
  border-left: 4px solid #ffc107;
  padding-left: .6rem;
  font-size: 1.35rem;
  text-transform: none;
  letter-spacing: 0;
}
.nr-kpi-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: .9rem 1rem;
  height: 100%;
  transition: border-color .15s ease;
}
.nr-kpi-card:hover {
  border-color: #ffc107;
}
.nr-kpi-mini {
  padding: .65rem .85rem;
}
.nr-kpi-alert {
  border-color: #dc3545 !important;
}
.nr-kpi-label {
  color: #8a919d;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.nr-kpi-label i {
  color: #ffc107;
}
.nr-kpi-value {
  color: #ffc107;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: .25rem;
}
.nr-kpi-value-sm {
  font-size: 1.35rem;
  margin-bottom: 0;
}
.nr-trend-pill {
  display: inline-block;
  font-size: .72rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-weight: 600;
}
.nr-trend-up   { background: rgba(34,197,94,.15); color: #22c55e; }
.nr-trend-down { background: rgba(239,68,68,.15); color: #ef4444; }
.nr-chart-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  overflow: hidden;
}
.nr-chart-header {
  padding: .8rem 1rem;
  background: #22252d;
  border-bottom: 1px solid #2b2f3a;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e6e8eb;
}
.nr-chart-header i {
  color: #ffc107;
}
.nr-chart-body {
  padding: 1rem;
}
.nr-chart-body table.table {
  color: #cfd2d8;
}
.nr-chart-body table.table thead th {
  background: transparent;
  color: #6c7383;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid #2b2f3a;
}
.nr-chart-body table.table td,
.nr-chart-body table.table th {
  border-color: #2b2f3a;
}

html[data-theme="light"] .nr-kpi-card,
html[data-theme="light"] .nr-chart-card {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2328;
}
html[data-theme="light"] .nr-chart-header {
  background: #eef1f4;
  border-bottom-color: #e5e7eb;
  color: #1f2328;
}
html[data-theme="light"] .nr-kpi-value {
  color: #b78900;
}
html[data-theme="light"] .nr-chart-body table.table {
  color: #1f2328;
}
html[data-theme="light"] .nr-chart-body table.table thead th {
  color: #4a5461;
  border-bottom-color: #e5e7eb;
}
html[data-theme="light"] .nr-chart-body table.table td,
html[data-theme="light"] .nr-chart-body table.table th {
  border-color: #e5e7eb;
}

/* Info / legal pages (About, Contact, FAQ, Privacy, Terms, DMCA) */
.nr-info-page {
  max-width: 780px;
  padding: 2rem 0 1rem;
}
.nr-info-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: #ffc107;
}
.nr-info-body {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  line-height: 1.7;
}
.nr-info-body h2 {
  font-size: 1.5rem;
  margin: 1.5rem 0 .5rem;
  color: #ffc107;
}
.nr-info-body h2:first-child { margin-top: 0; }
.nr-info-body h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 .35rem;
}
.nr-info-body a {
  color: #ffc107;
  text-decoration: underline;
}
.nr-form-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-top: 1.5rem;
}
.nr-related-info {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
html[data-theme="light"] .nr-info-body,
html[data-theme="light"] .nr-form-card,
html[data-theme="light"] .nr-related-info {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2328;
}
html[data-theme="light"] .nr-info-title,
html[data-theme="light"] .nr-info-body h2 {
  color: #b78900;
}

/* OAuth login buttons + divider */
.nr-oauth-btn {
  background: #22252d;
  border-color: #3a3f4b;
  color: #e6e8eb;
  font-weight: 500;
}
.nr-oauth-btn:hover {
  background: #2b2f3a;
  border-color: #ffc107;
  color: #ffc107;
}
html[data-theme="light"] .nr-oauth-btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1f2328;
}
html[data-theme="light"] .nr-oauth-btn:hover {
  background: #eef1f4;
  border-color: #ffc107;
  color: #8a5a00;
}
.nr-divider {
  position: relative;
  overflow: hidden;
}
.nr-divider::before,
.nr-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  border-top: 1px solid #2b2f3a;
}
.nr-divider::before { left: 0; }
.nr-divider::after  { right: 0; }
html[data-theme="light"] .nr-divider::before,
html[data-theme="light"] .nr-divider::after {
  border-top-color: #e5e7eb;
}

/* Theme toggle button in navbar */
.nr-theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: .25rem .5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  margin-right: .5rem;
  line-height: 1;
}
.nr-theme-toggle:hover {
  background: rgba(255,193,7,.15);
  color: #ffc107;
}

.nr-navbar {
  background-color: #1e2129;
  border-bottom: 1px solid #2b2f3a;
}

.nr-footer {
  background-color: #1e2129;
  border-top: 1px solid #2b2f3a;
}
.nr-footer-info-nav {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
}
.nr-footer-info-nav a,
.nr-footer-legal-nav a {
  color: #aeb3bd;
  text-decoration: none;
  font-size: .95rem;
}
.nr-footer-info-nav a:hover,
.nr-footer-legal-nav a:hover {
  color: #ffc107;
}
.nr-footer-legal-nav {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.nr-footer-legal-nav .nr-footer-dot {
  color: #4a4f5a;
}
.nr-footer-divider {
  border-color: #2b2f3a;
  opacity: 1;
}
.nr-scroll-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #22252d;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  color: #ffc107;
  font-size: 1.4rem;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease;
}
.nr-scroll-top:hover {
  background: #2b2f3a;
  transform: translateY(-2px);
  color: #ffc107;
}
html[data-theme="light"] .nr-scroll-top {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #b78900;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
html[data-theme="light"] .nr-footer-info-nav a,
html[data-theme="light"] .nr-footer-legal-nav a {
  color: #4a5461;
}
html[data-theme="light"] .nr-footer-info-nav a:hover,
html[data-theme="light"] .nr-footer-legal-nav a:hover {
  color: #b78900;
}
html[data-theme="light"] .nr-footer-divider {
  border-color: #e5e7eb;
}

.nr-section-title {
  border-left: 4px solid #ffc107;
  padding-left: .6rem;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Novel cards */
.novel-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
  height: 100%;
  transition: transform .15s ease, border-color .15s ease;
}

.novel-card:hover {
  transform: translateY(-3px);
  border-color: #ffc107;
}

.novel-card a {
  text-decoration: none;
  color: inherit;
}

.novel-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: linear-gradient(135deg, #2b2f3a, #1e2129);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c7383;
  font-size: 2rem;
  font-weight: 700;
}

.novel-card .card-body {
  padding: .6rem .7rem;
}

.novel-card .novel-title {
  font-size: .9rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* Ranked list (most viewed) */
.rank-list .rank-num {
  width: 2rem;
  font-weight: 700;
  color: #6c7383;
}

.rank-list li:nth-child(-n+3) .rank-num {
  color: #ffc107;
}

/* Chapter reading page — inherits body color so light theme flips to dark text. */
.chapter-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.9;
  color: inherit;
}
html[data-theme="light"] .chapter-content {
  color: #1f2328;
}

.chapter-content p {
  margin-bottom: 1.2em;
}

.chapter-nav .btn {
  min-width: 9rem;
}

/* ===== Mobile responsiveness ===== */
@media (max-width: 767.98px) {
  /* Spotlight: don't let the cover fill the whole screen */
  .nr-spotlight {
    max-width: 320px;
    margin: 0 auto;
  }

  /* Novel detail cover: centered, phone-sized */
  .nr-detail-cover {
    max-width: 200px;
    margin: 0 auto;
    display: block;
  }

  /* Latest releases: title + time on line 1, chapter link on line 2 */
  .nr-release-row {
    flex-wrap: wrap;
  }

  .nr-release-title {
    flex: 1 1 0;
  }

  .nr-release-chapter {
    flex: 1 1 100%;
    order: 5;
    padding-left: 42px; /* align under title, past the thumb */
  }

  .nr-section-title {
    font-size: 1rem;
  }

  .chapter-content {
    font-size: 1.05rem;
  }
}

@media (max-width: 575.98px) {
  /* Chapter prev/next bar: dropdown on its own line, buttons share a row */
  .chapter-nav {
    flex-wrap: wrap;
  }

  .chapter-nav .form-select {
    order: -1;
    width: 100% !important;
    max-width: 100%;
  }

  .chapter-nav .btn {
    min-width: 0;
    flex: 1 1 40%;
  }

  /* Navbar: breathing room when the menu is collapsed open */
  .nr-navbar form[role="search"] {
    margin: .5rem 0;
  }
}

/* Admin novel-manager card grid */
.nr-admin-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #2b2f3a, #1e2129);
  overflow: hidden;
}

.nr-admin-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nr-admin-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #6c7383;
}

/* Rich text editor */
.nr-rte {
  border: 1px solid #495057;
  border-radius: .375rem;
  overflow: hidden;
}

.nr-rte-toolbar {
  background: #2b2f3a;
  padding: .35rem .5rem;
  border-bottom: 1px solid #495057;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  align-items: center;
}

.nr-rte-btn,
.nr-rte-toolbar button {
  background: transparent;
  color: #c9ccd3;
  border: 1px solid transparent;
  border-radius: .25rem;
  padding: .2rem .55rem;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.2;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.nr-rte-btn:hover,
.nr-rte-toolbar button:hover {
  background: #3a3f4b;
  border-color: #6c7383;
  color: #ffc107;
}

.nr-rte-btn i.bi {
  font-size: 1rem;
  line-height: 1;
}

.nr-rte-hl {
  background: #ffc107;
  color: #000;
  padding: 0 .15rem;
  border-radius: 2px;
}

.nr-rte-caret {
  font-size: .7rem;
  opacity: .7;
}

.nr-rte-dd {
  position: relative;
}

.nr-rte-dd-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #1e2129;
  border: 1px solid #3a3f4b;
  border-radius: 4px;
  padding: .3rem;
  min-width: 140px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  margin-top: 2px;
}

.nr-rte-dd-menu.open {
  display: block;
}

.nr-rte-dd-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .3rem .5rem;
  border-radius: 3px;
  background: transparent;
  color: #c9ccd3;
  border: 0;
  cursor: pointer;
  font-size: .85rem;
}

.nr-rte-dd-item:hover {
  background: #2b2f3a;
  color: #ffc107;
}

.nr-color-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #6c7383;
  vertical-align: middle;
  margin-right: .3rem;
}

/* Rendered chapter content — tables, headings, etc. */
.nr-rte-editor h1, .nr-chapter-body h1 { font-size: 1.75rem; margin: 1rem 0 .5rem; }
.nr-rte-editor h2, .nr-chapter-body h2 { font-size: 1.5rem;  margin: 1rem 0 .5rem; }
.nr-rte-editor h3, .nr-chapter-body h3 { font-size: 1.25rem; margin: 1rem 0 .5rem; }
.nr-rte-editor blockquote,
.nr-chapter-body blockquote {
  border-left: 3px solid #ffc107;
  margin: .75rem 0;
  padding: .25rem .75rem;
  color: #aeb3bd;
  background: rgba(255,193,7,.05);
}
.nr-rte-editor pre,
.nr-chapter-body pre {
  background: #0d0f13;
  border: 1px solid #2b2f3a;
  border-radius: 4px;
  padding: .75rem 1rem;
  overflow-x: auto;
  font-family: 'Consolas', monospace;
  font-size: .9rem;
}
.nr-rte-editor table,
.nr-chapter-body table {
  border-collapse: collapse;
  margin: .75rem 0;
  max-width: 100%;
}
.nr-rte-editor th,
.nr-rte-editor td,
.nr-chapter-body th,
.nr-chapter-body td {
  border: 1px solid #495057;
  padding: .4rem .6rem;
}
.nr-rte-editor th,
.nr-chapter-body th {
  background: #2b2f3a;
  font-weight: 600;
}
.nr-rte-editor img,
.nr-chapter-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Keep long story titles, URLs and authored tables inside narrow screens. */
.nr-novel-desc, .nr-chapter-body, main h1 { overflow-wrap: anywhere; }
.nr-chapter-body table { display: block; overflow-x: auto; }
.nr-navbar form, .nr-navbar input[type="search"] { min-width: 0; }
.nr-skip-link:focus {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 10000;
  padding: .75rem 1rem;
  color: #111;
  background: #ffc107;
}
.nr-rte-editor a,
.nr-chapter-body a {
  color: #ffc107;
  text-decoration: underline;
}
.nr-rte-editor hr,
.nr-chapter-body hr {
  border: 0;
  border-top: 1px solid #495057;
  margin: 1rem 0;
}

.nr-rte-editor {
  min-height: 6rem;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
}

.nr-rte-editor:focus {
  box-shadow: none !important;
}

.nr-rte-tall {
  min-height: 22rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Novel description shown on details page */
.nr-novel-desc {
  white-space: normal;
}

.nr-novel-desc p {
  margin-bottom: .5rem;
}

/* Tag chips (selectable) */
.nr-chip {
  display: inline-block;
  background: #2b2f3a;
  color: #aeb3bd;
  border: 1px solid transparent;
  border-radius: 1rem;
  padding: .3rem .8rem;
  font-size: .85rem;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}

.nr-chip:hover {
  border-color: #6c7383;
}

.nr-chip-on {
  background: #ffc107;
  color: #1c1e24;
  font-weight: 600;
  border-color: #ffc107;
}

/* Hot ranking badge on novel cards */
.nr-hot-rank {
  position: absolute;
  top: -6px;
  left: 6px;
  background: linear-gradient(135deg, #ff6b35, #ffc107);
  color: #1c1e24;
  padding: 2px 8px;
  border-radius: .3rem;
  font-weight: 800;
  font-size: .8rem;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(255, 107, 53, .4);
}

/* Announcement banner */
.nr-announcement {
  background: linear-gradient(90deg, #3d3115, #574718, #3d3115);
  color: #ffd75e;
  border-bottom: 1px solid #6b5a1f;
  font-size: .95rem;
}

/* Reading themes (chapter page) */
body.nr-theme-sepia {
  background-color: #f4ecd8;
  color: #4a3f2f;
}

body.nr-theme-sepia .chapter-content {
  color: #4a3f2f;
}

body.nr-theme-light {
  background-color: #f7f7f9;
  color: #24262b;
}

body.nr-theme-light .chapter-content {
  color: #24262b;
}

.nr-reader-settings {
  max-width: 800px;
  margin: 0 auto;
}

/* Featured block (freewebnovel-style) */
.nr-spotlight {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
  position: relative;
}

.nr-spotlight-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: linear-gradient(135deg, #2b2f3a, #1e2129);
}

.nr-spotlight-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.6rem;
  padding: .8rem;
  background: linear-gradient(transparent, rgba(10, 12, 16, .92) 40%);
}

.nr-featured-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
  transition: border-color .15s ease;
}

.nr-featured-card:hover {
  border-color: #ffc107;
}

.nr-featured-cover {
  width: 88px;
  height: auto;
  min-width: 88px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: linear-gradient(135deg, #2b2f3a, #1e2129);
}

.nr-2lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .95rem;
}

.nr-1line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nr-star-half {
  opacity: .45;
}

/* Latest releases list */
.nr-release-list {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  padding: .3rem 1rem;
}

.nr-release-row + .nr-release-row {
  border-top: 1px solid #262a34;
}

.nr-release-thumb {
  width: 34px;
  height: 44px;
  object-fit: cover;
  border-radius: .25rem;
  background: #2b2f3a;
  text-align: center;
  flex-shrink: 0;
}

.nr-release-title {
  flex: 0 1 34%;
  font-weight: 600;
  font-size: .92rem;
}

.nr-release-title:hover {
  color: #ffc107 !important;
}

.nr-release-genres {
  flex: 0 1 18%;
}

.nr-release-chapter {
  flex: 0 1 34%;
  color: #6ea8fe;
}

/* Genre panel */
.nr-genre-panel {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
}

.nr-genre-link {
  display: block;
  padding: .55rem .9rem;
  color: #aeb3bd;
  text-decoration: none;
  border-bottom: 1px solid #262a34;
  font-size: .9rem;
}

.nr-genre-link:hover {
  background: #2b2f3a;
  color: #ffc107;
}

/* Tag chips */
.nr-tag {
  display: inline-block;
  background: #2b2f3a;
  color: #aeb3bd;
  border-radius: 1rem;
  padding: .15rem .7rem;
  font-size: .8rem;
  text-decoration: none;
  margin: 0 .25rem .25rem 0;
}

.nr-tag:hover {
  background: #ffc107;
  color: #1c1e24;
}

/* Comments */
.nr-comment {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  padding: .8rem 1rem;
}
html[data-theme="light"] .nr-comment {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2328;   /* was inheriting the light-theme dark body colour on a dark card → invisible */
}
html[data-theme="light"] .nr-comment p { color: #1f2328; }

/* Ad slots */
.nr-ad-slot:empty {
  display: none;
}

/* Chapter list on novel page */
.chapter-list a {
  color: #aeb3bd;
  text-decoration: none;
  display: block;
  padding: .45rem .6rem;
  border-radius: .3rem;
}

.chapter-list a:hover {
  background: #2b2f3a;
  color: #ffc107;
}

/* Light theme: the dark base + near-black hover above are unreadable on white. */
html[data-theme="light"] .chapter-list a {
  color: #1f2328;
}
html[data-theme="light"] .chapter-list a:hover {
  background: #eef1f4;
  color: #ad7f00;
}

/* Chapter-list pagination (Bootstrap defaults are white/blue — theme them). */
.pagination .page-link {
  background: #1e2129;
  border-color: #2b2f3a;
  color: #c9ccd3;
}
.pagination .page-link:hover {
  background: #2b2f3a;
  color: #ffc107;
}
.pagination .page-item.active .page-link {
  background: #ffc107;
  border-color: #ffc107;
  color: #16181d;
}
.pagination .page-item.disabled .page-link {
  background: #1a1c22;
  border-color: #2b2f3a;
  color: #5c6270;
}
html[data-theme="light"] .pagination .page-link {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2328;
}
html[data-theme="light"] .pagination .page-link:hover {
  background: #eef1f4;
  color: #ad7f00;
}
html[data-theme="light"] .pagination .page-item.active .page-link {
  background: #ffc107;
  border-color: #ffc107;
  color: #1f2328;
}
html[data-theme="light"] .pagination .page-item.disabled .page-link {
  background: #f5f6f8;
  border-color: #e5e7eb;
  color: #9ca3af;
}

/* ===== Author Dashboard (Royal Road style) ===== */
.nr-author-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.nr-author-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1f2328;
  border-right: 1px solid #2b2f3a;
  padding: 1rem 0;
}

.nr-author-nav {
  display: flex;
  flex-direction: column;
}

.nr-author-nav-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.2rem;
  color: #aeb3bd;
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all .12s ease;
}

.nr-author-nav-item:hover {
  background: #22252d;
  color: #ffc107;
}

.nr-author-nav-item.active {
  background: #22252d;
  color: #ffc107;
  border-left-color: #ffc107;
  font-weight: 600;
}

.nr-author-sidebar-section {
  margin-top: 1rem;
  border-top: 1px solid #2b2f3a;
  padding-top: .5rem;
}

.nr-author-sidebar-label {
  padding: .4rem 1.2rem .2rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6c7383;
  font-weight: 700;
}

.nr-author-main {
  flex: 1;
  padding: 1rem 1.5rem 2rem;
  min-width: 0;
}

/* Stat cards row */
.nr-author-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.nr-stat-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  padding: .7rem 1rem;
  flex: 1 1 130px;
  min-width: 130px;
}

.nr-stat-icon {
  font-size: 1.4rem;
  color: #ffc107;
  opacity: .8;
}

.nr-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #c9ccd3;
  line-height: 1.2;
}

.nr-stat-label {
  font-size: .72rem;
  color: #6c7383;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Novel cards (horizontal, cover left + info right) */
.nr-author-novels {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nr-author-novel-card {
  display: flex;
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
  width: calc(50% - .5rem);
  transition: border-color .15s ease;
}

.nr-author-novel-card:hover {
  border-color: #ffc107;
}

.nr-author-novel-cover {
  position: relative;
  width: 160px;
  flex-shrink: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.nr-author-novel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nr-badge-tl {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
}

.nr-badge-tr {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
}

/* Overlay stats at bottom of cover (like Royal Road) */
.nr-novel-overlay-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(10, 12, 16, .85);
  backdrop-filter: blur(4px);
}

.nr-ov-stat {
  flex: 1;
  text-align: center;
  padding: .35rem .2rem;
  border-right: 1px solid rgba(255,255,255,.08);
}

.nr-ov-stat:last-child {
  border-right: 0;
}

.nr-ov-label {
  display: block;
  font-size: .6rem;
  color: #8b8f99;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.nr-ov-value {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: #c9ccd3;
}

.nr-author-novel-info {
  padding: .8rem 1rem;
  flex: 1;
  min-width: 0;
}

/* Mobile: collapse sidebar to top bar */
@media (max-width: 991.98px) {
  .nr-author-layout {
    flex-direction: column;
  }

  .nr-author-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #2b2f3a;
    padding: .5rem 0;
  }

  .nr-author-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
  }

  .nr-author-nav-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: .5rem .8rem;
  }

  .nr-author-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: #ffc107;
  }

  .nr-author-sidebar-section {
    display: none;
  }

  .nr-author-novel-card {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .nr-author-novel-cover {
    width: 110px;
  }

  .nr-stat-card {
    flex: 1 1 45%;
    min-width: 45%;
  }

  .nr-ov-label {
    font-size: .5rem;
  }

  .nr-ov-value {
    font-size: .7rem;
  }
}

/* ===== Chapter Editor (Royal Road style) ===== */
.nr-chapter-editor {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: .5rem;
  overflow: hidden;
}

.nr-chapter-editor-header {
  background: #22252d;
  padding: .8rem 1.2rem;
  font-weight: 600;
  font-size: 1.05rem;
  border-bottom: 1px solid #2b2f3a;
  color: #c9ccd3;
}

.nr-chapter-editor-body {
  padding: 1.5rem;
}

.nr-editor-label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  color: #aeb3bd;
  margin-bottom: .35rem;
}

.nr-rte-divider {
  display: inline-block;
  width: 1px;
  height: 1.2rem;
  background: #495057;
  margin: 0 .5rem;
  vertical-align: middle;
}

.nr-rte-wordcount {
  font-size: .8rem;
  color: #6c7383;
  margin-left: auto;
  align-self: center;
}

/* ===== Admin: Ad slots page ===== */
.nr-ad-type-group {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.nr-ad-type-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.1rem;
  background: #22252d;
  border-bottom: 1px solid #2b2f3a;
  gap: 1rem;
}

.nr-ad-type-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  color: #ffc107;
  font-size: 1.05rem;
}

.nr-ad-type-title i {
  font-size: 1.25rem;
}

.nr-ad-type-body {
  padding: 1rem 1.1rem;
}

.nr-ad-slot-card {
  background: #1c1e24;
  border: 1px solid #2b2f3a;
  border-radius: 6px;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
}

.nr-ad-slot-card:last-child {
  margin-bottom: 0;
}

.nr-ad-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}

.nr-ad-slot-name {
  font-weight: 600;
  color: #e6e8eb;
}

.nr-ad-slot-key {
  font-family: monospace;
  font-size: .75rem;
  color: #6c7383;
  background: #22252d;
  padding: .1rem .45rem;
  border-radius: 3px;
}

.nr-ad-slot-desc {
  font-size: .8rem;
  color: #8a919d;
  margin-bottom: .5rem;
}

.nr-ad-preset-btn {
  background: #2b2f3a;
  border: 1px solid #3a3f4b;
  color: #aeb3bd;
  padding: .2rem .55rem;
  font-size: .72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all .12s ease;
}

.nr-ad-preset-btn:hover {
  background: #3a3f4b;
  color: #ffc107;
  border-color: #ffc107;
}

.nr-ad-preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .35rem;
}

.nr-ad-textarea {
  background: #0d0f13;
  color: #cdd0d5;
  border: 1px solid #2b2f3a;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .78rem;
  resize: vertical;
  min-height: 90px;
}

.nr-ad-textarea:focus {
  background: #0d0f13;
  color: #cdd0d5;
  border-color: #ffc107;
  box-shadow: 0 0 0 .15rem rgba(255, 193, 7, .15);
}

.nr-ad-network-badge {
  display: inline-block;
  font-size: .68rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: #3a3f4b;
  color: #aeb3bd;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Runtime ad units — global sticky/popup/interstitial */
.nr-sticky-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: #1c1e24;
  border-top: 1px solid #2b2f3a;
  padding: .5rem 1rem;
  text-align: center;
  max-height: 120px;
  overflow: hidden;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, .3);
}

.nr-sticky-ad-close,
.nr-popup-ad-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(0, 0, 0, .5);
  color: #e6e8eb;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nr-sticky-ad-close:hover,
.nr-popup-ad-close:hover {
  background: #ffc107;
  color: #000;
}

.nr-interstitial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.nr-interstitial-box {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  max-width: 720px;
  width: 100%;
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
  max-height: 90vh;
  overflow: auto;
}

.nr-interstitial-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  color: #aeb3bd;
  border: 1px solid #3a3f4b;
  padding: .3rem .6rem;
  font-size: .8rem;
  border-radius: 4px;
  cursor: pointer;
}

.nr-interstitial-close:hover {
  color: #ffc107;
  border-color: #ffc107;
}

.nr-popup-ad {
  position: fixed;
  z-index: 1050;
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  padding: 1.5rem 1rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  max-width: 380px;
}

.nr-popup-ad.nr-pos-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.nr-popup-ad.nr-pos-bottom-right {
  bottom: 20px;
  right: 20px;
}

.nr-popup-ad.nr-pos-bottom-left {
  bottom: 20px;
  left: 20px;
}

.nr-popup-ad.nr-pos-top-right {
  top: 20px;
  right: 20px;
}

.nr-popup-ad.nr-pos-top-left {
  top: 20px;
  left: 20px;
}

.nr-ad-label {
  font-size: .65rem;
  color: #6c7383;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .25rem;
}

.nr-ad-slot {
  background: rgba(255, 255, 255, .02);
  border: 1px dashed #2b2f3a;
  padding: .5rem;
  border-radius: 4px;
}

/* ===== Author public profile ===== */
.nr-author-profile { padding-top: 1rem; }
.nr-author-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.nr-author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffc107, #b78900);
  color: #1c1e24;
  font-weight: 700;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html[data-theme="light"] .nr-author-hero {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2328;
}

/* ===== Content protection =====
   .nr-nx holds decoy sentences. display:none keeps them away from humans,
   screen readers and innerText — but textContent-based scrapers ingest them,
   which is exactly the point. */
.nr-nx {
  display: none !important;
}

/* Discourages casual select/copy. Not a real barrier — anyone can read the
   DOM — so it stays optional and off by default. */
.nr-nocopy {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
.nr-nocopy::selection { background: transparent; }
.nr-nocopy ::selection { background: transparent; }

/* ===== Age gating overlay ===== */
.nr-age-gate {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nr-age-gate-box {
  background: #1e2129;
  border: 1px solid #dc3545;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  max-width: 460px;
  text-align: center;
  color: #c9ccd3;
}
html[data-theme="light"] .nr-age-gate-box {
  background: #ffffff;
  color: #1f2328;
}

.nr-card-mature {
  position: absolute;
  top: .35rem;
  left: .35rem;
  background: #dc3545;
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: .1rem .35rem;
  border-radius: 3px;
  z-index: 2;
}

/* ===== Chapter Reader preferences ===== */
.nr-reader-bar {
  position: sticky;
  top: 8px;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 0 .5rem;
}
.nr-reader-toggle {
  background: #22252d;
  color: #ffc107;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  padding: .35rem .7rem;
  cursor: pointer;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nr-reader-toggle:hover { border-color: #ffc107; }
.nr-reader-panel {
  position: absolute;
  top: 100%;
  right: .5rem;
  margin-top: .5rem;
  min-width: 300px;
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.nr-reader-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
}
.nr-reader-row:last-child { margin-bottom: 0; }
.nr-reader-row label {
  min-width: 90px;
  color: #c9ccd3;
  font-size: .85rem;
}
.nr-reader-row input[type=range] {
  flex: 1;
  accent-color: #ffc107;
}
.nr-reader-btn {
  background: #2b2f3a;
  color: #c9ccd3;
  border: 1px solid #3a3f4b;
  border-radius: 4px;
  padding: .15rem .5rem;
  cursor: pointer;
  font-size: .8rem;
}
.nr-reader-btn:hover { background: #3a3f4b; color: #ffc107; }
.nr-reader-val {
  font-family: monospace;
  color: #8a919d;
  font-size: .8rem;
  min-width: 60px;
  text-align: center;
}
.nr-reader-theme-picker {
  display: flex;
  gap: .35rem;
}
.nr-theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.nr-theme-swatch:hover { transform: scale(1.1); }
.nr-theme-swatch.active { border-color: #ffc107; box-shadow: 0 0 0 2px rgba(255,193,7,.2); }
.nr-theme-swatch-dark     { background: #1c1e24; }
.nr-theme-swatch-sepia    { background: #f4ecd8; }
.nr-theme-swatch-cream    { background: #ffffff; }
.nr-theme-swatch-light    { background: #ffffff; border: 2px solid #d1d5db; }
.nr-theme-swatch-midnight { background: #0a0a10; }

/* Reader theme overrides scoped to body class so the toggle only affects the reader page. */
body.nr-rt-sepia    { background-color: #f4ecd8 !important; color: #4a3a24 !important; }
body.nr-rt-cream    { background-color: #ffffff !important; color: #1f2328 !important; }
body.nr-rt-light    { background-color: #ffffff !important; color: #222 !important; }
body.nr-rt-midnight { background-color: #0a0a10 !important; color: #c9ccd3 !important; }
body.nr-rt-dark     { /* uses site default dark */ }

body.nr-rt-sepia .chapter-content,
body.nr-rt-cream .chapter-content,
body.nr-rt-light .chapter-content { color: inherit; }
body.nr-rt-sepia .nr-reader-panel,
body.nr-rt-cream .nr-reader-panel,
body.nr-rt-light .nr-reader-panel {
  background: rgba(255,255,255,.95);
  color: #1f2328;
  border-color: #d1d5db;
}
body.nr-rt-sepia .nr-reader-row label,
body.nr-rt-cream .nr-reader-row label,
body.nr-rt-light .nr-reader-row label { color: #1f2328; }

.chapter-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.75;
  padding: 1rem 0 2rem;
}
.chapter-content p { margin-bottom: 1.1em; }

/* ===== Key economy (locked chapters, wallet, rewards) ===== */

/* Preview above the lock panel fades out so the cut doesn't feel abrupt. */
.nr-lock-preview {
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  pointer-events: none;
}

.nr-lock-panel {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  margin-top: -0.5rem;
}
html[data-theme="light"] .nr-lock-panel {
  background: #ffffff;
  border-color: #e5e7eb;
}

.nr-lock-key {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffc107, #b78900);
  color: #1c1e24;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nr-lock-eyebrow {
  margin-top: 1rem;
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #8b90a0;
}

/* Navbar wallet chip */
.nr-key-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  margin-right: .5rem;
  border-radius: 999px;
  background: rgba(255, 193, 7, .12);
  border: 1px solid rgba(255, 193, 7, .45);
  color: #ffc107;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
}
.nr-key-chip:hover { background: rgba(255, 193, 7, .22); color: #ffd75e; }
.nr-key-chip .nr-key-claim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

/* Chapter-list lock badge */
.nr-chapter-lock {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: rgba(255, 193, 7, .12);
  border: 1px solid rgba(255, 193, 7, .4);
  color: #d9a406;
  white-space: nowrap;
}
.nr-chapter-lock.nr-unlocked {
  background: rgba(46, 204, 113, .1);
  border-color: rgba(46, 204, 113, .4);
  color: #2ecc71;
}

/* Rewards page */
.nr-reward-card {
  background: #1e2129;
  border: 1px solid #2b2f3a;
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
}
html[data-theme="light"] .nr-reward-card {
  background: #ffffff;
  border-color: #e5e7eb;
}
.nr-reward-balance {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffc107;
}
.nr-xp-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
html[data-theme="light"] .nr-xp-bar { background: rgba(0, 0, 0, .08); }
.nr-xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc107, #ff9800);
}
.nr-streak-day {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .06);
  border: 1px solid #2b2f3a;
  color: #8b90a0;
}
html[data-theme="light"] .nr-streak-day { background: rgba(0,0,0,.04); border-color: #e5e7eb; }
.nr-streak-day.nr-active {
  background: linear-gradient(135deg, #ffc107, #b78900);
  border-color: #ffc107;
  color: #1c1e24;
}

/* ===== Continue-reading cards (home) ===== */
.nr-continue-card,
.nr-continue-card:hover { display: block; text-decoration: none; color: inherit; }
.nr-continue-btn {
  margin-top: .45rem;
  background: #ffc107;
  color: #1c1e24;
  font-weight: 700;
  font-size: .76rem;
  text-align: center;
  padding: .35rem .4rem;
  border-radius: .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nr-continue-card:hover .nr-continue-btn { background: #ffcd39; }
