/* ==========================================================================
   NovelRead — component styles
   Mobile-first. Breakpoints: 768px (tablet), 1024px (desktop).
   ========================================================================== */

/* --- Buttons & form controls ------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }

.btn--outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--ghost { background: transparent; color: var(--accent); }

.btn--sm { padding: 8px 14px; font-size: 0.82rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
}
.icon-btn:hover { background: var(--surface); }

/* --- Layout helpers ------------------------------------------------------ */

.container--narrow { max-width: 760px; }

.section { padding: 28px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section__head h2 { margin: 0; }
.section__more { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.empty-state { color: var(--muted); text-align: center; padding: 40px 16px; }

/* --- Breadcrumbs ----------------------------------------------------------*/

.breadcrumbs { margin: 14px 0; font-size: 0.82rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--border); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* --- Site header ----------------------------------------------------------*/

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.site-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.site-header__actions { display: flex; align-items: center; gap: 2px; }

.header-search { border-top: 1px solid var(--border); background: var(--surface); }
.header-search__form { display: flex; gap: 8px; padding: 10px 16px; }
.header-search__input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

/* --- Hero ------------------------------------------------------------------*/

.hero { padding: 36px 0 18px; text-align: center; }
.hero__badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero__title { margin-bottom: 6px; }
.hero__tagline { color: var(--muted); max-width: 540px; margin: 0 auto 22px; }

.hero__search {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
}
.hero__search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
}
.hero__search-input::placeholder { color: var(--muted); }
.hero__search .btn { padding: 10px 20px; }

/* --- Continue Reading card ------------------------------------------------*/

.continue-reading { padding-top: 16px; }
.continue-reading__card {
  display: flex;
  gap: 14px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  align-items: center;
}
.continue-reading__cover { width: 56px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--surface); }
.continue-reading__cover img { width: 100%; height: 100%; object-fit: cover; }
.continue-reading__body { flex: 1; min-width: 0; }
.continue-reading__eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 800; margin: 0 0 2px; }
.continue-reading__title { font-family: var(--font-display); font-weight: 600; margin: 0; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-reading__chapter { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.continue-reading .btn { flex-shrink: 0; }

/* --- Genre pills ------------------------------------------------------------*/

.genre-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
}
.genre-pills::-webkit-scrollbar { display: none; }
.genre-pill {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
}
.genre-pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- Trending shelf (overlapping book covers) -----------------------------*/

.shelf {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 10px 28px 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf__item {
  flex: 0 0 132px;
  scroll-snap-align: start;
  transition: transform .2s ease;
}
.shelf__item:hover,
.shelf__item:focus-within { transform: translateY(-4px); z-index: 2; }
.shelf .novel-card__body { display: none; } /* shelf shows covers only */
.shelf .novel-card { box-shadow: var(--shadow-md); border-radius: var(--radius-md); }

/* --- Novel grid & cards -----------------------------------------------------*/

.novel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 12px;
}

.novel-card { position: relative; }
.novel-card__cover-link { display: block; }
.novel-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.novel-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.novel-card__cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--accent); background: var(--surface-raised);
}

.novel-card__body { padding-top: 8px; }
.novel-card__title { font-size: 0.98rem; margin: 0 0 2px; line-height: 1.3; }
.novel-card__title a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.novel-card__author { font-size: 0.78rem; color: var(--muted); margin: 0 0 4px; }
.novel-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.novel-card__latest { color: var(--muted); }
.novel-card__latest:hover { color: var(--accent); }
.novel-card__genres { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Dog-ear bookmark control (signature element) --------------------------
   A folded-corner that "saves" the novel to the Library (localStorage).
   Sits on the top-right corner of the cover. Gold fill = saved.
   ----------------------------------------------------------------------- */

.dogear {
  position: absolute;
  top: 0; right: 0;
  width: 38px; height: 38px;
  border: none; background: transparent; padding: 0;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.dogear__fold {
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 38px 38px 0;
  border-color: transparent rgba(20, 14, 24, 0.55) transparent transparent;
  transition: border-color .2s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
  transform-origin: top right;
}
.dogear::after {
  content: '';
  position: absolute;
  top: 7px; right: 7px;
  width: 14px; height: 14px;
  background: rgba(255,255,255,0.85);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4.5C5 3.7 5.7 3 6.5 3H17c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H6.5A1.5 1.5 0 015 19.5v-15z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4.5C5 3.7 5.7 3 6.5 3H17c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H6.5A1.5 1.5 0 015 19.5v-15z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .9;
  pointer-events: none;
}
.dogear.is-bookmarked .dogear__fold {
  border-color: transparent var(--gold) transparent transparent;
  transform: scale(1.08) rotate(0deg);
}
.dogear--lg { width: 56px; height: 56px; }
.dogear--lg .dogear__fold { border-width: 0 56px 56px 0; }
.dogear--lg::after { top: 11px; right: 11px; width: 20px; height: 20px; }

/* --- Status badges & star rating -------------------------------------------*/

.badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20,14,24,0.6);
  color: #fff;
  backdrop-filter: blur(2px);
}
.badge--completed { background: var(--accent); }
.badge--hiatus { background: var(--gold); color: #2A1A23; }

.star-rating { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-weight: 700; }
.star-rating__icon { font-size: 0.95em; }
.star-rating__value { color: var(--text); font-weight: 700; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* --- Latest updates list -----------------------------------------------------*/

.update-list { display: flex; flex-direction: column; gap: 4px; }
.update-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
}
.update-row:hover { background: var(--surface); }
.update-row__cover { flex-shrink: 0; width: 42px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--surface-raised); }
.update-row__cover img { width: 100%; height: 100%; object-fit: cover; }
.update-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.update-row__title { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-row__chapter { font-size: 0.8rem; color: var(--accent); }
.update-row__time { font-size: 0.74rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* --- Bottom navigation ----------------------------------------------------------*/

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  height: var(--bottom-nav-h);
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  position: relative;
}
.bottom-nav__item.is-active { color: var(--accent); }
.bottom-nav__badge {
  position: absolute;
  top: 2px; right: 22%;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Hide bottom nav in the reader (the reader toolbar takes its place) */
body.is-reader .bottom-nav { display: none; }
body.is-reader { padding-bottom: 0; }

/* --- Footer ----------------------------------------------------------------------*/

.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 30px; padding: 36px 0 24px; }
.footer-grid { display: flex; flex-direction: column; gap: 22px; margin-bottom: 22px; }
.footer-brand__name { font-size: 1.2rem; }
.footer-brand__tag { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.footer-nav__list { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.88rem; }
.footer-nav__list a:hover { color: var(--accent); }
.widget-title { font-size: 1rem; margin-bottom: 8px; }
.footer-copy { color: var(--muted); font-size: 0.78rem; border-top: 1px solid var(--border); padding-top: 16px; }

/* ==========================================================================
   Single Novel page
   ========================================================================== */

.novel-header { display: flex; gap: 18px; padding: 16px 0 20px; }
.novel-header__cover { position: relative; width: 128px; flex-shrink: 0; }
.novel-header__cover img,
.novel-header__cover-placeholder {
  width: 100%; aspect-ratio: 2/3; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.novel-header__cover-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--accent); background: var(--surface-raised); }
.novel-header__info { flex: 1; min-width: 0; }
.novel-header__info .badge { position: static; display: inline-block; margin-bottom: 8px; }
.novel-header__info h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
.novel-header__author { color: var(--muted); margin-bottom: 8px; }
.novel-header__meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; }
.novel-header__genres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.novel-header__actions .btn { width: 100%; justify-content: center; }

.novel-synopsis { padding: 6px 0 20px; border-bottom: 1px solid var(--border); }
.novel-synopsis h2 { font-size: 1.05rem; }
.novel-synopsis__content { color: var(--muted); }

.chapter-list-block { padding: 20px 0; }
.chapter-list-block__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chapter-search {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  margin-bottom: 10px;
}
.chapter-list { max-height: 480px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.chapter-list__item { border-bottom: 1px solid var(--border); }
.chapter-list__item:last-child { border-bottom: none; }
.chapter-list__item a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
}
.chapter-list__item a:hover { background: var(--surface); }
.chapter-list__num { font-weight: 800; color: var(--accent); font-size: 0.82rem; flex-shrink: 0; }
.chapter-list__title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.chapter-list__date { font-size: 0.74rem; color: var(--muted); flex-shrink: 0; }
.chapter-list__item.is-hidden { display: none; }

/* ==========================================================================
   Chapter Reader
   ========================================================================== */

/* Top reading-progress ribbon */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  z-index: 60;
}
.reading-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .1s linear;
}
.reading-progress__pin {
  position: absolute;
  top: 3px; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: var(--accent) transparent transparent transparent;
  transform: translateX(-50%);
  transition: left .1s linear;
}

.reader-topbar {
  position: sticky; top: 3px;
  z-index: 45;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: transform .25s ease, opacity .25s ease;
}
.reader-topbar__inner { display: flex; align-items: center; gap: 10px; height: 52px; }
.reader-topbar__back { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; }
.reader-topbar__back:hover { background: var(--surface); }
.reader-topbar__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.reader-topbar__novel { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-topbar__chapter { font-weight: 700; font-size: 0.92rem; }

body.immersive .reader-topbar,
body.immersive .reading-progress { transform: translateY(-100%); opacity: 0; }

.reader-content { padding-bottom: 24px; }
.reader-content__inner { max-width: 680px; }

.reader-header { padding: 14px 0 6px; text-align: center; }
.reader-header__eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: 0.74rem; letter-spacing: .08em; margin-bottom: 6px; }
.reader-header h1 { font-size: clamp(1.3rem, 5vw, 1.9rem); }
.reader-header__meta { color: var(--muted); font-size: 0.82rem; }

.reader-body { font-family: var(--font-body); }
.reader-body p { margin: 0 0 1.3em; }

.reader-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 18px 0 6px;
}
.reader-nav__prev { justify-self: start; }
.reader-nav__next { justify-self: end; }
.reader-nav__toc { justify-self: center; }

/* Sticky reader toolbar (replaces bottom nav on chapter pages) */
.reader-toolbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform .25s ease;
}
body.immersive .reader-toolbar { transform: translateY(100%); }

.reader-toolbar__btn {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 44px;
  border-radius: var(--radius-md);
  border: none; background: transparent;
  color: var(--text);
}
.reader-toolbar__btn:hover { background: var(--surface); }
.reader-toolbar__btn.is-disabled { color: var(--border); pointer-events: none; }
.reader-toolbar__btn--aa { font-size: 1.1rem; font-weight: 700; }

/* Reader settings bottom sheet */
.reader-settings {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 55;
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform .28s ease;
}
.reader-settings.is-open { transform: translateY(0); }
.reader-settings__handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border); margin: 6px auto 14px; }
.reader-settings__group { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.reader-settings__group:last-child { border-bottom: none; }
.reader-settings__label { font-weight: 700; font-size: 0.9rem; }
.reader-settings__row { display: flex; align-items: center; gap: 14px; }
.reader-settings__step {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 700;
}
.reader-settings__value { min-width: 44px; text-align: center; font-size: 0.85rem; color: var(--muted); }

.reader-settings__swatches { display: flex; gap: 8px; }
.swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-size: 0;
}
.swatch--ink { background: #1B1320; }
.swatch--sepia { background: #F1E6D3; }
.swatch--paper { background: #FAF1E8; }
.swatch--dark { background: #0E0B12; }
.swatch.is-active { border-color: var(--accent); }

/* Reader background themes (applied to .reader-content) */
[data-reader-theme="sepia"] .reader-content,
[data-reader-theme="dark"] .reader-content,
[data-reader-theme="ink"] .reader-content,
[data-reader-theme="light"] .reader-content { padding: 0; }
[data-reader-theme="light"] .reader-content { background: var(--paper); color: var(--text-on-light); }
[data-reader-theme="light"] .reader-topbar,
[data-reader-theme="light"] .reading-progress { background: var(--paper); }

/* ==========================================================================
   Misc pages: blog/post cards, error 404, library page
   ========================================================================== */

.post-card { padding: 22px 0; border-bottom: 1px solid var(--border); }
.post-card__thumb { display: block; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; aspect-ratio: 16/9; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__meta { color: var(--muted); font-size: 0.8rem; }

.error-404__content { text-align: center; padding: 60px 0; }
.error-404__content form { margin: 20px auto; max-width: 420px; }

.library-section { padding: 18px 0; }
.library-section h2 { font-size: 1.1rem; }

/* ==========================================================================
   Tablet / desktop
   ========================================================================== */

@media (min-width: 600px) {
  .novel-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .bottom-nav, .reader-toolbar, .reader-settings { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  body.immersive .reader-toolbar { transform: translate(-50%, 100%); }
  .reader-settings { transform: translate(-50%, 100%); }
  .reader-settings.is-open { transform: translate(-50%, 0); }

  .novel-header { padding: 30px 0; }
  .novel-header__cover { width: 200px; }
  .novel-header__actions .btn { width: auto; }
}

@media (min-width: 1024px) {
  .novel-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 60px 0 28px; }
  .shelf__item { flex: 0 0 170px; }
}


/* --- Section head "see all" link --------------------------------------- */
.section__head-link { font-size: 0.82rem; font-weight: 700; color: var(--ember); white-space: nowrap; }

/* --- Chapter list — stacked rows with optional excerpt ----------------- */
.chapter-list__row { display: flex; align-items: baseline; gap: 10px; }
.chapter-list__excerpt {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chapter-list__item a { display: block; padding: 12px 14px; }

/* --- "You May Also Like" horizontal slider ----------------------------- */
.novel-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.novel-slider::-webkit-scrollbar { height: 6px; }
.novel-slider::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.novel-slider__item {
  flex: 0 0 140px;
  scroll-snap-align: start;
}
.similar-novels { margin-top: 28px; }

/* --- Community channels ------------------------------------------------- */
.community { margin-top: 32px; }
.community__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
}
.community__title { margin: 0 0 6px; font-size: 1.4rem; }
.community__subtext { margin: 0 auto 18px; color: var(--muted); max-width: 460px; font-size: 0.92rem; }
.community__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--channel-color, var(--ember));
  border: 1px solid transparent;
  transition: transform .15s ease, opacity .15s ease;
}
.channel-btn:hover { transform: translateY(-2px); opacity: 0.92; color: #fff; }
.channel-btn:active { transform: scale(0.97); }
.channel-btn__icon { flex: 0 0 auto; }

/* --- Tablet ------------------------------------------------------------- */
@media (min-width: 768px) {
  .novel-slider__item { flex: 0 0 150px; }
  .community__panel { padding: 30px 24px; }
}

/* --- Desktop ------------------------------------------------------------ */
@media (min-width: 1024px) {
  .novel-slider__item { flex: 0 0 165px; }
}
