:root {
  color-scheme: light;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --text: #1a1a22;
  --muted: #5c5f6e;
  --border: #d8d6d0;
  --accent: #7a1e3a;
  --accent-hover: #5c152c;
  --accent-rgb: 122, 30, 58;
  --accent2: #8b6914;
  --accent2-hover: #6f5410;
  --accent2-rgb: 139, 105, 20;
  --shadow: 0 18px 50px rgba(26, 26, 34, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121318;
  --surface: #1c1d26;
  --text: #f0f0f4;
  --muted: #a8abb8;
  --border: #3a3b48;
  --accent: #c45c7a;
  --accent-hover: #d97a94;
  --accent-rgb: 196, 92, 122;
  --accent2: #c9a227;
  --accent2-hover: #dbb84a;
  --accent2-rgb: 201, 162, 39;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(var(--accent2-rgb), 0.07), transparent 34%),
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.05), transparent 28%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(23, 25, 38, 0.05);
}

html[data-theme="dark"] .site-header {
  background: rgba(20, 21, 31, 0.96);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.brand-home-icon {
  width: 1.28rem;
  height: 1.28rem;
  display: block;
}

.brand-text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  flex: 1;
  min-width: 0;
}

.header-site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.header-site-nav a:hover,
.header-site-nav a:focus-visible {
  color: var(--text);
  background: rgba(var(--accent2-rgb), 0.08);
}

.header-site-nav a.header-nav-active {
  color: var(--text);
  background: rgba(var(--accent2-rgb), 0.12);
  font-weight: 600;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}

.header-reader-tools,
.header-site-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.header-tool-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
}

.header-tool-button:hover {
  border-color: rgba(var(--accent2-rgb), 0.35);
  background: rgba(var(--accent2-rgb), 0.06);
}

.header-theme-button {
  width: 2.35rem;
  padding-inline: 0;
  display: grid;
  place-items: center;
}

.header-theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.header-popup {
  position: fixed;
  top: 4.35rem;
  right: 1rem;
  z-index: 30;
  width: min(320px, calc(100vw - 2rem));
}

.header-popup-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(20, 22, 40, 0.18);
  padding: 0.85rem;
}

.header-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.header-popup-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.display-control {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.display-control:last-child {
  margin-bottom: 0;
}

.display-control span {
  color: var(--muted);
}

.display-control input[type="range"] {
  width: 100%;
}

.toc-chapter-button {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.92rem;
}

.toc-chapter-list {
  display: grid;
  gap: 0.4rem;
  max-height: 50vh;
  overflow: auto;
}

.toc-chapter-button.active {
  border-color: var(--accent2);
  background: rgba(var(--accent2-rgb), 0.12);
}

.password-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 22, 0.45);
  padding: 1rem;
}

.password-modal-panel {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: 0 18px 50px rgba(20, 22, 40, 0.22);
}

.password-modal-panel label {
  display: block;
  margin-top: 0.6rem;
}

.password-modal-panel input {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  margin-top: 0.35rem;
}

.password-modal-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.password-modal-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.password-modal-actions button:last-child {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.password-modal-actions button:last-child:hover {
  background: var(--accent-hover);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.5rem);
  background:
    radial-gradient(circle at 88% 12%, rgba(var(--accent2-rgb), 0.1), transparent 36%),
    radial-gradient(circle at 10% 88%, rgba(var(--accent-rgb), 0.07), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .landing-hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(var(--accent2-rgb), 0.18), transparent 36%),
    radial-gradient(circle at 10% 88%, rgba(var(--accent-rgb), 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%),
    var(--surface);
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
}

.landing-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--accent2-rgb), 0.22);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  background: rgba(var(--accent2-rgb), 0.08);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-hero-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.landing-hero-title-accent {
  display: block;
  margin-top: 0.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero-lead {
  margin: 1rem auto 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.08rem);
  line-height: 1.65;
}

.landing-hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.1rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: 0.9rem;
}

.landing-hero-points li {
  position: relative;
  padding-left: 1rem;
}

.landing-hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: var(--accent2);
  transform: translateY(-50%);
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 1.35rem;
}

.landing-hero-cta {
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.45rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.22);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.landing-hero-cta:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.28);
}

.landing-hero-secondary {
  color: var(--accent2);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.landing-hero-secondary:hover {
  text-decoration: underline;
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.landing-stat-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 1rem 0.85rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(23, 25, 38, 0.04);
}

.landing-stat-card strong {
  display: block;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.landing-stat-card span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.landing-featured {
  margin-top: 1.35rem;
}

.landing-section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  letter-spacing: -0.03em;
}

.landing-section-heading p {
  margin: 0.3rem 0 0.85rem;
  color: var(--muted);
}

.featured-books-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}

.featured-books-pagination {
  margin-top: 1rem;
}

.featured-books-error {
  color: var(--accent);
}

.featured-book-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.75rem;
  min-width: 0;
  box-shadow: 0 8px 22px rgba(23, 25, 38, 0.04);
}

.featured-book-cover-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.featured-book-card .novel-cover,
.featured-book-card .novel-cover-fallback {
  width: 100%;
  height: 190px;
}

.featured-book-title {
  display: block;
  width: 100%;
  margin: 0.65rem 0 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.featured-book-title:hover {
  color: var(--accent2);
}

.featured-book-author {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.featured-book-category {
  display: inline-block;
  margin-top: 0.45rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: rgba(var(--accent2-rgb), 0.12);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
}

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
}

.site-footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

.site-footer-column {
  flex: 1 1 0;
  min-width: 0;
}

.site-footer-column:first-child {
  text-align: left;
}

.site-footer-column:nth-child(2) {
  text-align: center;
}

.site-footer-column:last-child {
  text-align: right;
}

.site-footer-column h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.site-footer-column a {
  display: block;
  margin: 0.28rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.site-footer-column a:hover {
  color: var(--accent2);
}

.site-footer-copy {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer-copy a {
  color: inherit;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-link:hover .brand-text {
  color: var(--accent);
}

.info-page {
  padding-bottom: 2rem;
}

.info-hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.info-hero h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  letter-spacing: -0.03em;
}

.info-lead {
  margin: 0.65rem 0 0;
  color: var(--muted);
  max-width: 62ch;
}

.info-hero a {
  color: var(--accent2);
}

.contact-panel,
.recent-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.recent-books-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-book-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.recent-book-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.recent-book-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.recent-book-title:hover {
  color: var(--accent2);
}

.recent-book-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.recent-book-time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.recent-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.contact-panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.contact-panel h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.contact-panel p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.6;
}

.contact-panel a {
  color: var(--accent2);
}

.contact-address,
.contact-hours {
  color: var(--text);
}

.legal-doc {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.legal-doc h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  letter-spacing: -0.03em;
}

.legal-doc h2 {
  margin: 1.15rem 0 0.45rem;
  font-size: 1.05rem;
}

.legal-doc p,
.legal-doc li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-doc ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.2rem;
}

.legal-doc a {
  color: var(--accent2);
}

.legal-updated {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.88rem;
}

.promote-hero {
  display: flex;
  flex-direction: column;
}

.promote-hero .info-lead {
  max-width: none;
}

.info-hero-lead {
  max-width: none;
  white-space: nowrap;
}

.publish-hero-lead {
  max-width: none;
  white-space: normal;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.promote-hero h1 em {
  font-style: normal;
  color: var(--accent2);
}

.promote-search-panel,
.submit-guidelines,
.submit-ebook-form {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.promote-search-panel h2,
.submit-guidelines h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.promote-search-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.promote-search-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.promote-search-input {
  flex: 1 1 220px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.promote-search-results {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.promote-result-button {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  padding: 0.7rem 0.8rem;
  text-align: left;
  cursor: pointer;
}

.promote-result-button:hover {
  border-color: var(--accent2);
}

.promote-result-button span {
  color: var(--muted);
  font-size: 0.86rem;
}

.promote-search-note,
.promote-custom-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-panel .catalog-range {
  margin: 0.85rem 0 0;
}

.search-results-grid {
  margin-top: 0.85rem;
}

.promote-selected-book {
  margin: 0.65rem 0 0;
  font-weight: 600;
}

.promotion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.promotion-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.promotion-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.promotion-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.promotion-price {
  margin: 0.85rem 0 0.55rem !important;
  color: var(--text) !important;
  font-size: 1.5rem !important;
  font-weight: 800;
}

.promotion-cta {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.promotion-cta:hover {
  background: var(--accent-hover);
}

.promotion-combo {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent2-rgb), 0.1));
  text-align: center;
  margin-bottom: 1rem;
}

.promotion-combo-badge {
  margin: 0;
  font-size: 1rem;
}

.promotion-combo-prices {
  margin: 0.45rem 0 0.85rem;
  font-size: 1.35rem;
}

.submit-guidelines ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.submit-field {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.submit-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.84rem;
}

.submit-input,
.submit-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.submit-textarea {
  resize: vertical;
  min-height: 140px;
}

.submit-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.submit-char-count {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.submit-keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.submit-keyword-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(var(--accent2-rgb), 0.1);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.submit-checkbox {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.submit-warning {
  margin: 0.75rem 0 0;
  color: var(--accent);
  font-size: 0.88rem;
}

.submit-upload-button {
  margin-top: 0.85rem;
  width: 100%;
  max-width: 16rem;
  min-height: 44px;
}

.page-ellipsis {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  color: var(--muted);
}

.hero,
.subscription-hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.35rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent2-rgb), 0.12));
  box-shadow: var(--shadow);
}

.hero-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.subscription-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero p,
.subscription-context {
  margin: 0.65rem 0 0;
  color: var(--muted);
  max-width: 62ch;
}

.catalog {
  margin-top: 1rem;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.catalog-toolbar h2 {
  margin: 0;
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.catalog-controls select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.catalog-range {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.catalog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.page-button {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  min-width: 2.1rem;
}

.page-button.active {
  border-color: var(--accent2);
  background: rgba(var(--accent2-rgb), 0.14);
  font-weight: 700;
}

.page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.novel-grid {
  display: grid;
  gap: 0.9rem;
}

.novel-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0.85rem 1rem;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  border-radius: 16px;
  padding: 1rem;
  text-align: left;
  box-shadow: 0 8px 24px rgba(23, 25, 38, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.novel-cover-wrap {
  display: flex;
  min-height: 0;
}

.novel-card-footer {
  grid-column: 1 / -1;
}

.novel-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(23, 25, 38, 0.08);
}

.novel-card .novel-cover,
.novel-card .novel-cover-fallback {
  width: 132px;
  height: 100%;
  min-height: 168px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent2-rgb), 0.18));
}

.novel-card .novel-cover-fallback {
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}

.novel-card-body {
  min-width: 0;
}

.novel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.novel-emoji {
  font-size: 1.4rem;
}

.novel-badge {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
}

.novel-badge.public {
  background: rgba(50, 181, 90, 0.2);
}

.novel-badge.password {
  background: rgba(255, 173, 48, 0.2);
}

.novel-enter-title {
  display: block;
  width: 100%;
  margin: 0 0 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: clamp(1.08rem, 3.2vw, 1.22rem);
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.novel-enter-title:hover {
  color: var(--accent2);
}

a.novel-enter-title {
  text-decoration: none;
}

.novel-unlock-button {
  margin-top: 0;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: clamp(0.84rem, 2.5vw, 0.92rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
  min-height: 44px;
  transition: background 0.15s ease;
}

.novel-unlock-button:hover {
  background: var(--accent-hover);
}

.novel-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.novel-author-line {
  margin: 0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.novel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.novel-description {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.novel-home-view {
  margin-top: 0.5rem;
}

.novel-home-shell {
  max-width: 980px;
  margin: 0 auto;
}

.novel-home-unlocked {
  margin: 0.85rem 0 0;
  border: 1px solid rgba(50, 181, 90, 0.35);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: rgba(50, 181, 90, 0.12);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.novel-home-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.novel-home-cover-wrap {
  min-width: 0;
  display: flex;
  align-self: stretch;
}

.novel-home-cover-wrap > #novel-home-cover-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
}

.novel-home-cover-wrap .novel-home-cover {
  width: 180px;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent2-rgb), 0.18));
}

.novel-home-cover-wrap .novel-home-cover.novel-cover-fallback {
  display: grid;
  place-items: center;
  font-size: 3rem;
}

.novel-home-meta {
  min-width: 0;
}

.novel-home-meta h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.5rem, 5.5vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.novel-home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin: 0 0 1rem;
}

.novel-home-stats dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.novel-home-stats dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.novel-home-read-button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
  transition: background 0.15s ease, transform 0.15s ease;
}

.novel-home-read-button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
}

.novel-home-description {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.novel-home-description h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.novel-home-description p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.book-detail-breadcrumb {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.book-detail-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.book-detail-breadcrumb a:hover {
  text-decoration: underline;
}

.book-detail-preview {
  display: block;
  width: 100%;
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.book-detail-preview:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.book-detail-stats-inline {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

.book-detail-stats-inline div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.book-detail-stats-inline dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.book-detail-stats-inline dd {
  margin: 0;
  font-weight: 600;
}

.book-detail-rating {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text);
}

.book-detail-rating-stars,
.book-detail-star-rate {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.book-star {
  display: inline-block;
  line-height: 1;
  font-size: 1rem;
}

.book-star-full {
  color: var(--accent2);
}

.book-star-empty {
  color: var(--muted);
}

.book-star-half {
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
}

.book-star-half-filled {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: var(--accent2);
}

.book-star-half-empty {
  color: var(--muted);
}

.book-detail-reviews {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.book-detail-reviews h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

.book-detail-reviews-list {
  display: grid;
  gap: 0.85rem;
}

.book-detail-reviews-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-detail-review-card {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.book-detail-review-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.book-detail-review-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.book-detail-review-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent2-rgb), 0.15);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.book-detail-review-meta strong {
  display: block;
  font-size: 0.95rem;
}

.book-detail-review-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.book-detail-review-body {
  margin: 0.55rem 0 0 3.15rem;
  line-height: 1.55;
  font-size: 0.92rem;
}

.book-detail-more-reviews {
  margin: 0.85rem 0 1rem;
}

.book-detail-review-form {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.book-detail-review-form h3 {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
}

.book-detail-review-form label,
.book-detail-review-label {
  display: block;
  margin: 0.65rem 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.book-detail-review-form input,
.book-detail-review-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: var(--bg);
  color: inherit;
}

.book-detail-star-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.15rem 0 0.35rem;
}

.book-detail-star-input {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.1rem;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.book-detail-star-input:hover,
.book-detail-star-input.is-active {
  color: var(--accent2);
}

.book-detail-star-input:hover {
  transform: scale(1.08);
}

.book-detail-review-form .novel-home-read-button {
  margin-top: 0.85rem;
}

.novel-home-external-link-wrap {
  margin-top: 1rem;
}

.novel-home-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent2);
  font-weight: 700;
  text-decoration: none;
}

.novel-home-source-link:hover {
  color: var(--accent2-hover);
  text-decoration: underline;
}

.unlock-view,
.subscription-view,
.builtin-unlock-view {
  margin-top: 0.5rem;
}

.unlock-shell,
.subscription-shell {
  max-width: 980px;
  margin: 0 auto;
}

.unlock-hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent2-rgb), 0.1));
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.unlock-hero h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.unlock-sections {
  display: grid;
  gap: 1rem;
}

.unlock-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.unlock-section-header {
  display: flex;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1rem;
}

.unlock-section-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent2);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.unlock-section-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.unlock-section-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.unlock-password-panel {
  display: grid;
  gap: 0.55rem;
  max-width: 420px;
}

.unlock-password-panel label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.unlock-password-panel input {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0.72rem 0.8rem;
  font: inherit;
}

.unlock-password-button {
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.68rem 1rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.unlock-password-button:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.novel-card-highlight {
  outline: 2px solid var(--accent2);
  box-shadow: 0 0 0 4px rgba(var(--accent2-rgb), 0.14);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.85rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.pricing-card-featured {
  border-color: rgba(var(--accent2-rgb), 0.35);
  background: linear-gradient(180deg, rgba(var(--accent2-rgb), 0.08), rgba(255, 255, 255, 0.98));
}

html[data-theme="dark"] .pricing-card-featured {
  background: linear-gradient(180deg, rgba(var(--accent2-rgb), 0.16), rgba(26, 27, 39, 0.98));
}

.pricing-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(var(--accent2-rgb), 0.14);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.pricing-amount {
  margin-top: 0.35rem;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.pricing-currency {
  font-size: 1.2rem;
  vertical-align: top;
}

.pricing-period,
.pricing-savings {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.pricing-savings {
  color: var(--accent2);
  font-weight: 600;
}

.pricing-features {
  flex: 1;
  margin: 1rem 0 1.1rem;
  padding-left: 1.1rem;
  color: var(--text);
}

.pricing-features li {
  margin-bottom: 0.4rem;
}

.pricing-cta {
  width: 100%;
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pricing-cta-primary,
.pricing-cta:hover {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.pricing-cta-primary:hover {
  background: var(--accent-hover);
}

.subscription-footnote {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.payment-view {
  margin-top: 0.5rem;
}

.payment-shell {
  max-width: 1080px;
  margin: 0 auto;
}

.payment-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(var(--accent2-rgb), 0.06);
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1rem;
  align-items: start;
}

.payment-summary,
.payment-form-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.payment-summary-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-summary h2,
.payment-form-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.payment-summary-card {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(var(--accent2-rgb), 0.04);
}

.payment-form-header h2 {
  margin-bottom: 0.35rem;
}

.payment-form-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .payment-form-section {
  background: rgba(18, 19, 29, 0.55);
}

.payment-form-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.95rem;
}

.payment-novel-line {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.payment-summary-divider {
  height: 1px;
  background: var(--border);
  margin: 0.9rem 0;
}

.payment-summary-total {
  font-size: 1rem;
  font-weight: 700;
}

.payment-billing-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.payment-summary-features {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.payment-security-note {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(var(--accent2-rgb), 0.08);
  color: var(--muted);
  font-size: 0.84rem;
}

.payment-form {
  display: grid;
  gap: 0.45rem;
}

.payment-field {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.payment-field-full {
  margin-top: 0.55rem;
}

.payment-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0.72rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
}

html[data-theme="dark"] .payment-input {
  background: #12131d;
}

.payment-input:focus {
  outline: 2px solid rgba(var(--accent2-rgb), 0.25);
  border-color: var(--accent2);
}

.payment-input-wrap {
  position: relative;
}

.payment-card-brands {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.payment-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.payment-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.payment-error {
  margin: 0.55rem 0 0;
  color: #d14444;
  font-size: 0.9rem;
}

.payment-submit-button {
  width: 100%;
  margin-top: 0.8rem;
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
  transition: background 0.15s ease;
}

.payment-submit-button:hover {
  background: var(--accent-hover);
}

.payment-submit-amount {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

.payment-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  justify-content: center;
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.payment-legal {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.payment-legal a {
  color: var(--accent2);
}

.payment-success {
  text-align: center;
  padding: 2rem 1rem;
}

.payment-success-icon {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(50, 181, 90, 0.16);
  color: #1f8b4c;
  font-size: 1.5rem;
  font-weight: 800;
}

.payment-success h2 {
  margin-bottom: 0.45rem;
}

.payment-success p {
  color: var(--muted);
  max-width: 36ch;
  margin: 0 auto 0.5rem;
}

.reader-view {
  margin-top: 0.5rem;
}

body.is-reading .page {
  max-width: 760px;
}

.status-line {
  margin: 0.55rem 0 0;
  min-height: 1.1rem;
  color: var(--muted);
}

.reader-error {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  border: 1px solid #d14444;
  border-radius: 10px;
  background: rgba(209, 68, 68, 0.08);
  color: #d14444;
}

.chapter-content {
  padding: 1.2rem 0.4rem 2rem;
  font-size: var(--reader-font-size, 18px);
  line-height: var(--reader-line-height, 1.8);
}

.reader-chapter {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0 1.2rem;
  margin-bottom: 1.1rem;
}

.reader-chapter:last-child {
  border-bottom: 0;
}

.reader-chapter h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.1rem, 4.5vw, 1.45rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.reader-chapter p {
  margin: 0 0 0.85rem;
  color: var(--text);
}

.reader-part {
  border-left: 3px solid rgba(var(--accent2-rgb), 0.25);
  padding: 0.55rem 0 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
}

.reader-part-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.reader-part-placeholder {
  color: var(--muted);
  font-style: italic;
}

.hidden {
  display: none;
}

.admin-page {
  background:
    radial-gradient(circle at top right, rgba(var(--accent2-rgb), 0.08), transparent 42%),
    radial-gradient(circle at bottom left, rgba(var(--accent-rgb), 0.06), transparent 38%),
    var(--bg);
}

.admin-main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.admin-gate {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 12rem);
  padding: 1.5rem 0;
}

.admin-gate-card {
  width: min(100%, 440px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(20, 22, 40, 0.08);
  padding: 2rem 1.75rem;
  text-align: center;
}

.admin-gate-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--accent2-rgb), 0.12);
  font-size: 1.35rem;
}

.admin-gate-eyebrow,
.admin-dashboard-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-gate-card h1,
.admin-dashboard h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.admin-gate-lead,
.admin-dashboard-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.55;
}

.admin-gate-form {
  text-align: left;
}

.admin-field {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0.75rem 0.85rem;
  font-size: 1rem;
}

.admin-input:focus {
  outline: 2px solid rgba(var(--accent2-rgb), 0.35);
  outline-offset: 1px;
}

.admin-gate-error {
  margin: 0.65rem 0 0;
  color: #d14444;
  font-size: 0.9rem;
}

.admin-primary-button,
.admin-secondary-button {
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-primary-button {
  width: 100%;
  margin-top: 0.85rem;
  border: none;
  background: var(--accent);
  color: #fff;
}

.admin-primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.admin-secondary-button {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  white-space: nowrap;
}

.admin-gate-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-dashboard:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.admin-dashboard-header h1 {
  margin-bottom: 0.35rem;
}

.admin-status-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-inspector-controls,
.admin-chart-panel,
.admin-results-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 1rem 1.1rem;
}

.admin-empty-state {
  margin: 0;
  color: var(--muted);
}

.helper-text {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.inspector-controls {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.inspector-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.inspector-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.inspector-control span {
  color: var(--muted);
  font-size: 0.82rem;
}

.inspector-control select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0.65rem;
}

.inspector-control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.inspector-multi-actions {
  display: flex;
  gap: 0.35rem;
}

.inspector-multi-action {
  border: 0;
  background: transparent;
  color: var(--accent2);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.inspector-multi-action:hover {
  text-decoration: underline;
}

.inspector-multi-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 9.5rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  background: rgba(var(--accent2-rgb), 0.03);
}

.inspector-multi-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.35;
  cursor: pointer;
}

.inspector-multi-option input {
  margin-top: 0.18rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.inspector-multi-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.inspector-chart-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(var(--accent2-rgb), 0.04);
}

.inspector-chart-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.inspector-chart-header p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.inspector-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.inspector-chart-row {
  display: grid;
  grid-template-columns: minmax(88px, 140px) 1fr minmax(56px, 72px);
  gap: 0.55rem;
  align-items: center;
}

.inspector-chart-label {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-chart-bar-wrap {
  height: 18px;
  border-radius: 999px;
  background: rgba(var(--accent2-rgb), 0.12);
  overflow: hidden;
}

.inspector-chart-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  min-width: 4px;
}

.inspector-chart-value {
  font-size: 0.82rem;
  text-align: right;
  color: var(--muted);
}

.inspector-results {
  margin-top: 0.8rem;
}

.inspector-reader {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.inspector-reader h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.inspector-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.inspector-novel {
  margin: 0.5rem 0 0.35rem;
  font-weight: 600;
}

.inspector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.inspector-table th,
.inspector-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.inspector-table th {
  background: rgba(var(--accent2-rgb), 0.08);
}

@media (max-width: 860px) {
  .page {
    padding: 0.75rem;
  }

  .site-header-inner {
    flex-wrap: wrap;
    padding: 0.7rem 0.85rem;
    gap: 0.65rem;
  }

  .brand-text {
    font-size: clamp(0.98rem, 3.8vw, 1.125rem);
  }

  .header-site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    gap: 0.2rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: thin;
  }

  .header-site-nav a {
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .header-end {
    margin-left: auto;
  }

  .info-hero-lead {
    white-space: normal;
  }

  .header-tool-button {
    min-height: 40px;
    font-size: 0.94rem;
  }

  .header-popup {
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
  }

  .landing-hero {
    padding: 1.35rem 1rem;
    border-radius: 18px;
  }

  .landing-hero-title {
    font-size: clamp(1.75rem, 7vw, 2.45rem);
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }

  .landing-hero-lead {
    font-size: 0.95rem;
  }

  .landing-hero-points {
    flex-direction: column;
    align-items: flex-start;
    max-width: 18rem;
    margin-inline: auto;
    text-align: left;
  }

  .landing-hero-actions {
    flex-direction: column;
  }

  .landing-hero-cta {
    width: 100%;
    max-width: 22rem;
    min-height: 44px;
  }

  .landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .featured-books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .featured-book-card {
    min-width: 0;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .catalog-toolbar h2 {
    font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  }

  .catalog-controls {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-controls select {
    flex: 1;
    min-height: 44px;
    font-size: 1rem;
  }

  .catalog-range {
    font-size: 0.86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .catalog-pagination {
    gap: 0.3rem;
  }

  .page-button {
    min-height: 44px;
    min-width: 44px;
    padding: 0.45rem 0.7rem;
  }

  .novel-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .novel-card .novel-cover,
  .novel-card .novel-cover-fallback {
    width: 96px;
    min-height: 132px;
  }

  .novel-stats {
    gap: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  .novel-home-hero {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .novel-home-cover-wrap > #novel-home-cover-wrap {
    justify-content: center;
  }

  .novel-home-cover-wrap .novel-home-cover,
  .novel-home-cover-wrap .novel-home-cover.novel-cover-fallback {
    width: min(148px, 42vw);
    height: auto;
    aspect-ratio: 2 / 3;
  }


  .novel-home-stats {
    grid-template-columns: 1fr;
  }

  .novel-home-read-button {
    width: 100%;
    min-height: 44px;
  }

  .unlock-hero h1,
  .payment-shell h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }

  .pricing-grid,
  .payment-layout {
    grid-template-columns: 1fr;
  }

  .password-modal-panel {
    width: min(100%, 22rem);
    margin: 0 0.75rem;
  }

  .site-footer-grid {
    flex-direction: column;
    gap: 1.25rem;
  }

  .site-footer-column {
    flex: none;
    text-align: left;
  }

  .contact-panel-grid {
    grid-template-columns: 1fr;
  }

  .promotion-grid {
    grid-template-columns: 1fr;
  }

  .submit-field-row {
    grid-template-columns: 1fr;
  }

  .promote-search-row .landing-hero-cta {
    width: 100%;
  }

  .admin-dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-secondary-button {
    width: 100%;
  }

  body.is-reading .page {
    padding: 0.65rem 0.75rem;
  }

  .chapter-content {
    padding: 0.85rem 0.15rem 1.5rem;
  }
}

@media (max-width: 520px) {
  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-reader-tools {
    width: auto;
  }

  .landing-stats {
    grid-template-columns: 1fr;
  }

  .featured-books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-book-card .novel-cover,
  .featured-book-card .novel-cover-fallback {
    height: 150px;
  }

  .novel-card {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .novel-cover-wrap {
    justify-content: center;
  }

  .novel-card .novel-cover,
  .novel-card .novel-cover-fallback {
    width: min(156px, 52vw);
    height: auto;
    aspect-ratio: 2 / 3;
    min-height: 0;
  }

  .novel-card-body {
    width: 100%;
  }

  .novel-enter-title {
    font-size: clamp(1.05rem, 4.8vw, 1.18rem);
  }
}

.auth-page {
  padding-bottom: 2.5rem;
}

.auth-page-intro {
  max-width: 720px;
  margin: 0 auto 1.25rem;
  text-align: center;
}

.auth-page-intro h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  letter-spacing: -0.03em;
}

.auth-page-tagline {
  margin: 0.65rem auto 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.auth-shell {
  max-width: 980px;
  margin: 0 auto;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-panel {
  padding: 1.5rem 1.55rem 1.4rem;
}

.auth-panel-login {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.03), transparent 42%);
}

.auth-panel-signup {
  background: linear-gradient(180deg, rgba(var(--accent2-rgb), 0.06), transparent 42%);
}

.auth-split-divider {
  display: grid;
  place-items: center;
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.auth-split-divider span {
  padding: 0.45rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.auth-panel-header h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.auth-panel-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-requirements {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.auth-requirements li + li {
  margin-top: 0.2rem;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.35rem;
}

.auth-card-header h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.45rem, 4.5vw, 1.9rem);
  letter-spacing: -0.03em;
}

.auth-lead {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 0.35rem;
}

.auth-field {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(var(--accent2-rgb), 0.15);
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-checkbox-block {
  display: flex;
  margin-top: 0.75rem;
  line-height: 1.45;
}

.auth-checkbox a {
  color: var(--accent2);
}

.auth-text-link {
  color: var(--accent2);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.auth-text-link:hover {
  text-decoration: underline;
}

.auth-status {
  min-height: 1.2rem;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-status.is-error {
  color: #d14444;
}

.auth-submit-button,
.auth-secondary-button {
  width: 100%;
  margin-top: 0.85rem;
  border-radius: 12px;
  padding: 0.82rem 1rem;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.auth-submit-button {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
}

.auth-submit-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.auth-secondary-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.auth-secondary-button:hover {
  background: rgba(var(--accent2-rgb), 0.08);
}

.auth-footnote {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-account-summary {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
}

.auth-account-summary dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.auth-account-summary dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.auth-signed-in-actions {
  display: grid;
  gap: 0.55rem;
}

.subscribe-page .subscribe-hero {
  text-align: center;
}

.subscribe-page .subscribe-hero .info-lead {
  margin-left: auto;
  margin-right: auto;
}

.subscribe-account-line {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

.subscribe-plans-section {
  max-width: 920px;
  margin: 0 auto 1rem;
}

.subscribe-back-link {
  max-width: 920px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.subscribe-back-link a {
  color: var(--accent2);
  font-weight: 600;
  text-decoration: none;
}

.subscribe-back-link a:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-split-divider {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
  }
}
