/* ═══════════════════════════════════════════════════════════
   books.css — Kitaplık (Wattpad-tarzı) Sayfa Stilleri
   ═══════════════════════════════════════════════════════════ */

/* ─── Kart / Card Bazlı Panel Stili ─────────────────────── */
.books-page,
.book-detail-page,
.book-read-page,
.admin-books-page {
  padding-top: 6px;
  padding-bottom: 40px;
}

/* ─── Hero Bölümü ────────────────────────────────────────── */
.books-hero {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 36px 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.books-hero::before {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 200px;
  height: 200px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(99,102,241,0.18), transparent 65%);
  pointer-events: none;
}

[data-bs-theme="dark"] .books-hero {
  background: rgba(15,23,42,0.78);
  border-color: rgba(148,163,184,0.14);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}

.books-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.12);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.books-hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.books-hero-text {
  color: var(--bs-secondary-color, #64748b);
  font-size: 1rem;
  margin: 0;
  max-width: 560px;
}

/* ─── Kategori Filtre Barı ──────────────────────────────── */
.books-filter-bar {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 20px;
  margin-bottom: 24px;
}

[data-bs-theme="dark"] .books-filter-bar {
  background: rgba(15,23,42,0.78);
  border-color: rgba(148,163,184,0.14);
}

.books-filter-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.books-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bs-body-color);
  background: rgba(100,116,139,0.08);
  border: 1px solid rgba(100,116,139,0.15);
  text-decoration: none;
  transition: all 0.2s;
}

.books-cat-chip:hover,
.books-cat-chip.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* ─── Kitap Grid ─────────────────────────────────────────── */
.books-grid-section {
  padding: 0 2px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

/* ─── Kitap Kartı ────────────────────────────────────────── */
.book-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(15,23,42,0.09);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15,23,42,0.14);
}

[data-bs-theme="dark"] .book-card {
  background: rgba(20,27,45,0.88);
  border-color: rgba(148,163,184,0.12);
}

.book-card-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #f1f5f9;
  height: 200px;
}

[data-bs-theme="dark"] .book-card-img-wrap {
  background: #1e293b;
}

.book-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.book-card-carousel .carousel-item {
  height: 200px;
}

.book-card-carousel .carousel-item img {
  height: 200px;
  object-fit: cover;
  width: 100%;
}

.book-carousel-indicators {
  bottom: 4px;
}

.book-carousel-indicators button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  padding: 0;
  margin: 0 3px;
}

.book-card-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #94a3b8;
}

/* Badge */
.book-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.book-badge-featured {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #78350f;
}

.book-badge-restricted {
  background: rgba(239,68,68,0.92);
  color: #fff;
}

.book-badge-mixed {
  background: rgba(245,158,11,0.92);
  color: #fff;
}

/* Kart içeriği */
.book-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-card-category {
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 6px;
}

.book-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-author {
  font-size: 0.82rem;
  color: var(--bs-secondary-color, #64748b);
  margin: 0 0 8px;
}

.book-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 8px;
}

.book-star {
  font-size: 0.8rem;
  color: #f59e0b;
}

.book-card-rating-text {
  font-size: 0.78rem;
  color: var(--bs-secondary-color, #64748b);
  margin-left: 4px;
}

.book-card-meta {
  font-size: 0.78rem;
  color: var(--bs-secondary-color, #64748b);
  margin-bottom: 14px;
}

.book-read-btn {
  display: block;
  text-align: center;
  padding: 9px 0;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  color: #fff !important;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: opacity 0.2s;
  margin-top: auto;
}

.book-read-btn:hover {
  opacity: 0.88;
}

/* ─── Boş durum ─────────────────────────────────────────── */
.books-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--bs-secondary-color, #94a3b8);
}

.books-empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}

/* ─── Kitap Detay Sayfası ────────────────────────────────── */
.books-breadcrumb {
  font-size: 0.85rem;
  color: var(--bs-secondary-color, #64748b);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
}

.books-breadcrumb a {
  color: #6366f1;
  text-decoration: none;
}

.books-breadcrumb a:hover { text-decoration: underline; }

.books-breadcrumb-sep { opacity: 0.5; }
.books-breadcrumb-current { font-weight: 600; }

.book-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 767px) {
  .book-detail-layout { grid-template-columns: 1fr; }
}

.book-detail-aside {
  position: sticky;
  top: 80px;
}

.book-detail-carousel {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.book-detail-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin-bottom: 16px;
}

.book-detail-no-img {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #94a3b8;
  background: rgba(100,116,139,0.08);
  border-radius: 16px;
  margin-bottom: 16px;
}

.book-detail-meta-box {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-bs-theme="dark"] .book-detail-meta-box {
  background: rgba(20,27,45,0.88);
  border-color: rgba(148,163,184,0.12);
}

.book-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--bs-body-color);
}

.book-detail-rating-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.book-review-count {
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #64748b);
  margin-left: 4px;
}

/* Sağ main */
.book-detail-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.book-detail-header {}

.book-detail-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.book-detail-summary {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--bs-secondary-color, #64748b);
  margin: 0;
}

/* Bölüm listesi */
.book-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(99,102,241,0.15);
}

.book-chapters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-chapter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.07);
  transition: background 0.15s;
}

[data-bs-theme="dark"] .book-chapter-row {
  background: rgba(20,27,45,0.6);
  border-color: rgba(148,163,184,0.1);
}

.book-chapter-row:hover {
  background: rgba(99,102,241,0.06);
}

.book-chapter-row.book-chapter-locked {
  opacity: 0.65;
}

.book-chapter-row.book-chapter-closed {
  background: rgba(100,116,139,0.08);
  border-style: dashed;
}

.book-chapter-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99,102,241,0.12);
  color: #6366f1;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.book-chapter-info {
  flex: 1;
  min-width: 0;
}

.book-chapter-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.book-chapter-title {
  font-weight: 600;
  font-size: 0.93rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-chapter-view-label {
  font-size: 0.75rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.book-chapter-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
}

.book-chapter-progress-label.is-complete {
  background: rgba(22,163,74,0.12);
  color: #15803d;
}

.book-chapter-lock-label {
  font-size: 0.75rem;
  color: #ef4444;
  display: block;
  margin-top: 2px;
}

.book-chapter-perm-label {
  font-size: 0.75rem;
  color: #f59e0b;
  display: block;
  margin-top: 2px;
}

.book-chapter-read-btn {
  padding: 5px 14px;
  border-radius: 8px;
  background: #6366f1;
  color: #fff !important;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.book-chapter-read-btn:hover { opacity: 0.85; }

.book-chapter-locked-btn {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(100,116,139,0.1);
  color: var(--bs-secondary-color, #94a3b8);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Değerlendirme ─────────────────────────────────────── */
.book-review-section {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  padding: 24px;
}

[data-bs-theme="dark"] .book-review-section {
  background: rgba(20,27,45,0.78);
  border-color: rgba(148,163,184,0.12);
}

.book-review-form-wrap {
  padding: 16px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 14px;
  margin-bottom: 20px;
}

.book-review-form-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.book-star-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.book-star-pick {
  font-size: 1.6rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.book-star-pick:hover,
.book-star-pick.bi-star-fill {
  color: #f59e0b;
  transform: scale(1.15);
}

.book-review-textarea {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid rgba(100,116,139,0.25);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  resize: vertical;
  margin-bottom: 10px;
}

.book-review-submit-btn {
  padding: 8px 20px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.book-review-submit-btn:hover { opacity: 0.87; }
.book-review-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.book-review-msg {
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.book-review-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(15,23,42,0.06);
}

.book-review-item:last-child { border-bottom: none; }

.book-review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.book-review-user {
  font-size: 0.9rem;
}

.book-review-stars {
  display: flex;
  gap: 2px;
}

.book-review-date {
  font-size: 0.78rem;
  color: var(--bs-secondary-color, #94a3b8);
  margin-left: auto;
}

.book-review-comment {
  font-size: 0.88rem;
  color: var(--bs-secondary-color, #64748b);
  margin: 0;
  line-height: 1.55;
}

/* ─── Okuma Sayfası ─────────────────────────────────────── */
.book-read-page {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 88px);
  padding: 0 0 28px;
  isolation: isolate;
}

.book-read-ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(32px);
  opacity: 0.65;
  pointer-events: none;
  z-index: -1;
}

.book-read-ambient--one {
  width: 260px;
  height: 260px;
  top: 24px;
  right: 3%;
  background: rgba(59, 130, 246, 0.14);
}

.book-read-ambient--two {
  width: 220px;
  height: 220px;
  left: 0;
  bottom: 80px;
  background: rgba(249, 115, 22, 0.12);
}

/* Transparent wrapper — lets grid children participate directly in topbar grid */
#bookTopbarCollapsible {
  display: contents;
}

.book-read-topbar {
  position: sticky;
  top: calc(var(--navbar-height, 74px) + 12px);
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

[data-bs-theme="dark"] .book-read-topbar {
  background: rgba(15,23,42,0.84);
  border-color: rgba(148,163,184,0.12);
}

.book-read-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a !important;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15,23,42,0.06);
}

.book-read-back-btn:hover {
  text-decoration: none;
  background: rgba(59, 130, 246, 0.12);
}

[data-bs-theme="dark"] .book-read-back-btn {
  color: #e2e8f0 !important;
  background: rgba(255,255,255,0.06);
  border-color: rgba(148,163,184,0.12);
}

.book-read-progress {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.book-read-progress__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 800;
}

.book-read-progress__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.book-read-progress__summary strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

[data-bs-theme="dark"] .book-read-progress__summary strong {
  color: #f8fafc;
}

.book-read-progress__summary span {
  color: #64748b;
  font-size: 0.84rem;
}

.book-read-progress__track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.book-read-progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #f59e0b);
}

.book-read-toc-dropdown {
  justify-self: end;
}

.book-read-topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.book-read-font-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  border: 1px solid rgba(15,23,42,0.06);
}

[data-bs-theme="dark"] .book-read-font-controls {
  background: rgba(255,255,255,0.06);
  border-color: rgba(148,163,184,0.12);
}

.book-read-font-controls__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: #64748b;
}

.book-read-font-controls__buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.book-read-font-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.86);
  color: #0f172a;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(148,163,184,0.2);
}

[data-bs-theme="dark"] .book-read-font-btn {
  background: rgba(15,23,42,0.86);
  color: #f8fafc;
}

.book-read-font-btn.is-reset {
  font-size: 0.92rem;
}

.book-read-toc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.18);
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.book-read-toc-btn:hover {
  background: rgba(37,99,235,0.16);
  transform: translateY(-1px);
}

.book-toc-menu {
  min-width: 320px;
  max-height: 460px;
  overflow-y: auto;
  border-radius: 20px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(18px);
}

.book-toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 12px;
}

.book-toc-title {
  min-width: 0;
  flex: 1;
}

.book-toc-progress {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1d4ed8;
}

.book-toc-progress.is-complete {
  color: #15803d;
}

.book-toc-item.book-toc-item-locked,
.book-toc-item.book-toc-item-closed {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
}

.book-toc-state {
  margin-left: auto;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 700;
}

.book-toc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.book-read-hero {
  display: grid;
  grid-template-columns: minmax(128px, 150px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(248,250,252,0.94));
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
}

[data-bs-theme="dark"] .book-read-hero {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(15,23,42,0.96), rgba(17,24,39,0.96));
  border-color: rgba(148,163,184,0.12);
}

.book-read-hero__cover {
  aspect-ratio: 3 / 4.2;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a, #1d4ed8 60%, #0ea5e9);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 800;
}

.book-read-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-read-hero__content {
  display: grid;
  align-content: start;
  gap: 14px;
}

.book-read-kicker,
.book-read-content-head__eyebrow,
.book-read-rail-card__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

[data-bs-theme="dark"] .book-read-kicker,
[data-bs-theme="dark"] .book-read-content-head__eyebrow,
[data-bs-theme="dark"] .book-read-rail-card__eyebrow {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
}

.book-read-title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: clamp(2rem, 2vw + 1.3rem, 3.15rem);
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
}

[data-bs-theme="dark"] .book-read-title {
  color: #f8fafc;
}

.book-read-summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #475569;
  max-width: 72ch;
}

[data-bs-theme="dark"] .book-read-summary {
  color: #94a3b8;
}

.book-read-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.book-read-stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(148,163,184,0.18);
}

[data-bs-theme="dark"] .book-read-stat {
  background: rgba(15,23,42,0.82);
  border-color: rgba(148,163,184,0.12);
}

.book-read-stat span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.book-read-stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

[data-bs-theme="dark"] .book-read-stat strong {
  color: #f8fafc;
}

/* İçerik Alanı */
.book-read-body {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.book-read-rail {
  position: sticky;
  top: calc(var(--navbar-height, 74px) + 112px);
  display: grid;
  gap: 14px;
}

.book-read-rail-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 16px 36px rgba(15,23,42,0.08);
}

.book-read-rail-card--soft {
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(241,245,249,0.92));
}

[data-bs-theme="dark"] .book-read-rail-card,
[data-bs-theme="dark"] .book-read-rail-card--soft {
  background: rgba(15,23,42,0.86);
  border-color: rgba(148,163,184,0.12);
}

.book-read-rail-card h2 {
  margin: 12px 0 8px;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.book-read-rail-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
  font-size: 0.92rem;
}

.book-read-rail-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.book-read-rail-card__stats div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(15,23,42,0.04);
}

[data-bs-theme="dark"] .book-read-rail-card__stats div {
  background: rgba(255,255,255,0.06);
}

.book-read-rail-card__stats span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.book-read-rail-card__stats strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.book-read-content-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(250,250,249,0.98));
  border: 1px solid rgba(15,23,42,0.07);
  border-radius: 34px;
  padding: clamp(28px, 4vw, 56px);
  box-shadow: 0 26px 64px rgba(15,23,42,0.09);
}

[data-bs-theme="dark"] .book-read-content-wrap {
  background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(17,24,39,0.96));
  border-color: rgba(148,163,184,0.1);
}

.book-read-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}

.book-read-content {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1rem, calc((0.98rem + 0.35vw) * var(--reader-font-scale, 1)), 1.72rem);
  line-height: 2.02;
  letter-spacing: 0.01em;
  color: var(--bs-body-color);
  word-break: break-word;
  white-space: pre-line;
}

.book-read-content-head__meta {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 700;
}

.book-read-content p {
  margin-bottom: 1.28em;
}

.book-read-content p:empty,
.book-read-content p:has(> br:only-child) {
  min-height: 1.28em;
  margin-bottom: 0;
}

.book-read-content p:first-of-type::first-letter {
  float: left;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 4.8rem;
  line-height: 0.9;
  padding-right: 0.14em;
  font-weight: 800;
  color: #1d4ed8;
}

.book-read-content h1,
.book-read-content h2,
.book-read-content h3,
.book-read-content h4 {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.2;
}

.book-read-content blockquote {
  margin: 2em 0;
  padding: 1.2em 1.4em;
  border-left: 4px solid rgba(37,99,235,0.34);
  background: rgba(37,99,235,0.06);
  border-radius: 0 20px 20px 0;
}

.book-read-content img {
  max-width: 100%;
  border-radius: 22px;
  margin: 1.4em auto;
  display: block;
}

.book-read-comments {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(148,163,184,0.18);
}

.book-read-comments__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.book-read-comments__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

[data-bs-theme="dark"] .book-read-comments__eyebrow {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
}

.book-read-comments__head h2 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.book-read-comments__count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  font-weight: 700;
}

[data-bs-theme="dark"] .book-read-comments__count {
  background: rgba(255,255,255,0.07);
}

.book-read-comment-form {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(148,163,184,0.16);
  margin-bottom: 18px;
}

[data-bs-theme="dark"] .book-read-comment-form {
  background: rgba(15,23,42,0.82);
  border-color: rgba(148,163,184,0.12);
}

.book-read-comment-textarea {
  border-radius: 18px;
  min-height: 120px;
}

.book-read-comment-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.book-read-comment-form__actions small,
.book-read-comment-login-note,
.book-read-comment-empty {
  color: #64748b;
}

.book-read-comment-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 700;
}

.book-read-comment-login-note,
.book-read-comment-empty {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15,23,42,0.04);
}

[data-bs-theme="dark"] .book-read-comment-login-note,
[data-bs-theme="dark"] .book-read-comment-empty {
  background: rgba(255,255,255,0.05);
}

.book-read-comment-list {
  display: grid;
  gap: 12px;
}

.book-read-comment-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(15,23,42,0.04);
}

[data-bs-theme="dark"] .book-read-comment-item {
  background: rgba(255,255,255,0.05);
}

.book-read-comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.book-read-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-read-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.book-read-comment-meta strong {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

.book-read-comment-meta span {
  font-size: 0.8rem;
  color: #64748b;
}

.book-read-comment-body p {
  margin: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.8;
}

/* Alt navigasyon */
.book-read-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 8px 0 0;
}

.book-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.09);
  border-radius: 24px;
  text-decoration: none;
  color: var(--bs-body-color) !important;
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
  box-shadow: 0 14px 28px rgba(15,23,42,0.06);
}

[data-bs-theme="dark"] .book-nav-btn {
  background: rgba(20,27,45,0.9);
  border-color: rgba(148,163,184,0.12);
}

.book-nav-btn:hover {
  background: rgba(37,99,235,0.08);
  box-shadow: 0 18px 36px rgba(37,99,235,0.1);
  transform: translateY(-2px);
}

.book-nav-prev i, .book-nav-next i {
  font-size: 1.2rem;
  color: #1d4ed8;
  flex-shrink: 0;
}

.book-nav-label {
  font-size: 0.72rem;
  color: var(--bs-secondary-color, #94a3b8);
  display: block;
}

.book-nav-chapter {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
  line-height: 1.35;
}

.book-nav-home-btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8 !important;
  text-decoration: none;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.book-nav-home-btn:hover {
  background: rgba(37,99,235,0.2);
  transform: translateY(-2px);
}

.book-nav-placeholder { min-height: 1px; }

@media (max-width: 991.98px) {
  .book-read-topbar {
    grid-template-columns: 1fr;
  }

  .book-read-toc-dropdown {
    justify-self: stretch;
  }

  .book-read-toc-btn {
    width: 100%;
    justify-content: center;
  }

  .book-read-hero {
    grid-template-columns: 1fr;
  }

  .book-read-hero__cover {
    max-width: 180px;
  }

  .book-read-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-read-body {
    grid-template-columns: 1fr;
  }

  .book-read-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .book-read-page {
    gap: 14px;
  }

  .book-read-topbar,
  .book-read-hero,
  .book-read-content-wrap,
  .book-nav-btn {
    border-radius: 22px;
  }

  /* On mobile the topbar uses flex so the collapse toggle + content stack */
  .book-read-topbar {
    display: flex;
    flex-direction: column;
    top: calc(var(--navbar-height, 74px) + 8px);
    padding: 10px 12px;
    gap: 6px;
  }

  .book-read-back-btn,
  .book-read-toc-btn {
    width: 100%;
    justify-content: center;
  }

  .book-read-hero {
    padding: 16px;
  }

  .book-read-summary {
    font-size: 0.92rem;
  }

  .book-read-meta-grid,
  .book-read-rail,
  .book-read-rail-card__stats {
    grid-template-columns: 1fr;
  }

  .book-read-content-wrap {
    padding: 24px 18px;
  }

  .book-read-comments__head,
  .book-read-comment-form__actions,
  .book-chapter-meta-line,
  .book-read-content-head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Font controls + TOC: side by side on mobile */
  .book-read-topbar-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
  }

  .book-read-font-controls {
    flex-direction: row;
    align-items: center;
    flex: 1;
    border-radius: 14px;
  }

  .book-read-font-controls__label {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .book-read-toc-dropdown {
    flex: 0 0 auto;
  }

  /* Collapsible topbar on mobile */
  .book-read-topbar-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0;
  }

  .book-read-topbar-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* Override display:contents on mobile so the wrapper stacks as flex column */
  #bookTopbarCollapsible {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #bookTopbarCollapsible.is-collapsed {
    display: none;
  }

  .book-read-topbar {
    top: calc(var(--navbar-height, 74px) + 8px);
    padding: 10px 12px;
    gap: 8px;
  }

  .book-read-content {
    font-size: 1.02rem;
    line-height: 1.92;
  }

  .book-read-content p:first-of-type::first-letter {
    font-size: 3.8rem;
  }

  .book-read-nav {
    grid-template-columns: 1fr;
  }

  .book-nav-home-btn {
    width: 100%;
    height: 52px;
    border-radius: 18px;
  }
}

.books-access-shell {
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.72);
  border-radius: 22px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

[data-bs-theme="dark"] .books-access-shell {
  background: rgba(15,23,42,0.78);
  border-color: rgba(148,163,184,0.12);
}

.books-access-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.books-access-shell__header h5 {
  margin: 0 0 4px;
  font-weight: 800;
}

.books-access-shell__header p {
  margin: 0;
  color: var(--bs-secondary-color, #64748b);
  max-width: 70ch;
}

.books-access-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.books-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.books-access-panel {
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.72);
}

[data-bs-theme="dark"] .books-access-panel {
  background: rgba(15,23,42,0.86);
  border-color: rgba(148,163,184,0.12);
}

.books-access-panel__head h6 {
  margin: 0 0 4px;
  font-weight: 800;
}

.books-access-panel__head p {
  margin: 0 0 12px;
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.88rem;
  line-height: 1.5;
}

.books-access-checklist {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.books-access-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15,23,42,0.04);
}

[data-bs-theme="dark"] .books-access-check {
  background: rgba(255,255,255,0.05);
}

.books-access-check strong,
.books-access-check small {
  display: block;
}

.books-access-check strong {
  font-size: 0.92rem;
}

.books-access-check small {
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.78rem;
  margin-top: 2px;
}

.books-access-role-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  background: var(--role-dot, #6366f1);
}

@media (max-width: 991.98px) {
  .books-access-grid {
    grid-template-columns: 1fr;
  }

  .books-access-shell__header {
    flex-direction: column;
  }
}

/* ─── Admin Panel ────────────────────────────────────────── */
.books-admin-hero {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 30px 36px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

[data-bs-theme="dark"] .books-admin-hero {
  background: rgba(15,23,42,0.78);
  border-color: rgba(148,163,184,0.14);
}

.books-admin-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.12);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.books-admin-hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.books-admin-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.books-admin-stat {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  padding: 10px 20px;
  text-align: center;
  min-width: 80px;
}

[data-bs-theme="dark"] .books-admin-stat {
  background: rgba(30,41,59,0.6);
  border-color: rgba(148,163,184,0.12);
}

.books-admin-stat .label {
  font-size: 0.73rem;
  color: var(--bs-secondary-color, #64748b);
  display: block;
  font-weight: 500;
}

.books-admin-stat .value {
  font-size: 1.5rem;
  font-weight: 800;
  display: block;
}

.books-admin-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.books-admin-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
  overflow: hidden;
}

[data-bs-theme="dark"] .books-admin-card {
  background: rgba(15,23,42,0.78);
  border-color: rgba(148,163,184,0.12);
}

.books-admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(15,23,42,0.07);
}

[data-bs-theme="dark"] .books-admin-card-header {
  border-color: rgba(148,163,184,0.1);
}

.books-admin-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.books-admin-card-body {
  padding: 22px 24px;
}

.books-admin-form .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.books-admin-table {
  font-size: 0.88rem;
  margin: 0;
}

.books-admin-table th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
  padding: 10px 12px;
}

.books-admin-table td { padding: 10px 12px; vertical-align: middle; }

.books-admin-book-form {
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
}

/* Görsel listesi */
.books-admin-images-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 32px;
}

.books-admin-img-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.1);
}

.books-admin-img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.books-admin-img-item .img-del-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.85;
}

/* Bölüm Formu */
.books-chapter-form-wrap {
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: 14px;
  padding: 18px 20px;
}

/* Responsive */
@media (max-width: 575px) {
  .books-hero { padding: 22px 20px; }
  .books-hero-title { font-size: 1.4rem; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
  .book-card-img, .book-card-img-wrap { height: 160px; }
  .book-card-carousel .carousel-item, .book-card-carousel .carousel-item img { height: 160px; }
}

/* ─── Admin Studio Refresh ─────────────────────────────── */
.books-admin-hero {
  align-items: stretch;
  gap: 20px 24px;
}

.books-admin-hero-content {
  flex: 1 1 620px;
  min-width: 0;
}

.books-admin-hero-copy {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--bs-secondary-color, #64748b);
  line-height: 1.75;
}

.books-admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.books-admin-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 8px;
}

.books-admin-card-header-rich {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.books-admin-section-copy {
  margin: 8px 0 0;
  color: var(--bs-secondary-color, #64748b);
  max-width: 58ch;
  line-height: 1.7;
}

.books-admin-surface,
.books-admin-table-shell,
.books-admin-panel,
.books-chapter-editor-shell,
.books-chapter-list-shell {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.9));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .books-admin-surface,
[data-bs-theme="dark"] .books-admin-table-shell,
[data-bs-theme="dark"] .books-admin-panel,
[data-bs-theme="dark"] .books-chapter-editor-shell,
[data-bs-theme="dark"] .books-chapter-list-shell {
  background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(17,24,39,0.9));
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

.books-admin-surface {
  border-radius: 22px;
  padding: 18px;
}

.books-admin-table-shell {
  border-radius: 20px;
  overflow: hidden;
}

.books-admin-table-shell .books-admin-table {
  margin-bottom: 0;
}

.books-admin-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

.books-admin-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.books-admin-book-form {
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(239,246,255,0.9), rgba(255,255,255,0.94));
  border: 1px solid rgba(96, 165, 250, 0.22);
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.08);
}

[data-bs-theme="dark"] .books-admin-book-form {
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.92));
  border-color: rgba(96, 165, 250, 0.16);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.28);
}

.books-admin-book-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.books-admin-book-form-head h4 {
  font-size: 1.45rem;
  font-weight: 800;
}

.books-admin-form-copy {
  color: var(--bs-secondary-color, #64748b);
  max-width: 58ch;
  line-height: 1.7;
}

.books-admin-form-state,
.books-admin-soft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.78rem;
}

[data-bs-theme="dark"] .books-admin-form-state,
[data-bs-theme="dark"] .books-admin-soft-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.24);
}

.books-admin-book-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.books-admin-book-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.books-admin-panel,
.books-chapter-editor-shell,
.books-chapter-list-shell {
  border-radius: 24px;
  padding: 20px;
}

.books-admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.books-admin-panel-head--compact {
  margin-bottom: 12px;
}

.books-admin-panel-head h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.books-admin-panel-head p {
  margin: 6px 0 0;
  color: var(--bs-secondary-color, #64748b);
  line-height: 1.65;
}

.books-admin-book-form .form-label,
.books-chapter-modal .form-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bs-secondary-color, #64748b);
}

.books-admin-book-form .form-control,
.books-admin-book-form .form-select,
.books-chapter-modal .form-control,
.books-chapter-modal .form-select {
  min-height: 46px;
  border-radius: 16px;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255,255,255,0.88);
  box-shadow: none;
}

[data-bs-theme="dark"] .books-admin-book-form .form-control,
[data-bs-theme="dark"] .books-admin-book-form .form-select,
[data-bs-theme="dark"] .books-chapter-modal .form-control,
[data-bs-theme="dark"] .books-chapter-modal .form-select {
  background: rgba(30,41,59,0.86);
  border-color: rgba(148, 163, 184, 0.18);
  color: #e5e7eb;
}

.books-admin-media-card {
  min-height: 120px;
  border-radius: 20px;
  border: 1px dashed rgba(59, 130, 246, 0.24);
  background: rgba(239,246,255,0.62);
  padding: 16px;
}

[data-bs-theme="dark"] .books-admin-media-card {
  background: rgba(30,41,59,0.46);
  border-color: rgba(96, 165, 250, 0.22);
}

.books-admin-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248,250,252,0.86);
}

[data-bs-theme="dark"] .books-admin-toggle-chip {
  background: rgba(30,41,59,0.64);
  border-color: rgba(148, 163, 184, 0.16);
}

.books-admin-toggle-chip .form-check-input {
  float: none;
  margin: 0;
}

.books-admin-toggle-chip .form-check-label {
  margin: 0;
  font-weight: 700;
}

.books-admin-media-panel {
  padding-top: 4px;
}

.books-admin-book-preview {
  position: sticky;
  top: calc(var(--navbar-height, 74px) + 18px);
}

.books-admin-preview-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.1);
}

[data-bs-theme="dark"] .books-admin-preview-card {
  background: rgba(15,23,42,0.96);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.28);
}

.books-admin-preview-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(145deg, #dbeafe, #eff6ff 52%, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-bs-theme="dark"] .books-admin-preview-cover {
  background: linear-gradient(145deg, #1d4ed8, #0f172a 54%, #111827);
}

.books-admin-preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.books-admin-preview-cover-fallback {
  width: 100px;
  height: 100px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: #1d4ed8;
  background: rgba(255,255,255,0.66);
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.14);
}

[data-bs-theme="dark"] .books-admin-preview-cover-fallback {
  background: rgba(15,23,42,0.72);
  color: #dbeafe;
  border-color: rgba(191, 219, 254, 0.16);
}

.books-admin-preview-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.books-admin-preview-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.books-admin-preview-body h5 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.3;
}

.books-admin-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.9rem;
}

.books-admin-preview-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.books-admin-preview-body p {
  margin: 0;
  color: var(--bs-secondary-color, #64748b);
  line-height: 1.75;
}

.books-admin-preview-tags,
.books-admin-preview-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.books-admin-preview-chip,
.books-admin-preview-empty-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.9);
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

[data-bs-theme="dark"] .books-admin-preview-chip,
[data-bs-theme="dark"] .books-admin-preview-empty-chip {
  background: rgba(30, 64, 175, 0.28);
  color: #dbeafe;
}

.books-admin-preview-empty-chip {
  background: rgba(148, 163, 184, 0.12);
  color: var(--bs-secondary-color, #64748b);
}

.books-admin-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 12px;
}

.books-admin-img-item {
  width: 100%;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.books-chapter-modal-dialog {
  max-width: min(1320px, calc(100vw - 32px));
}

.books-chapter-modal {
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
  background: rgba(255,255,255,0.96);
}

[data-bs-theme="dark"] .books-chapter-modal {
  background: rgba(15,23,42,0.98);
  border-color: rgba(148, 163, 184, 0.14);
}

.books-chapter-modal-header {
  border-bottom: 0;
  padding: 22px 24px 0;
}

.books-chapter-modal-body {
  padding: 22px 24px 26px;
  background: linear-gradient(180deg, rgba(248,250,252,0.94), rgba(255,255,255,0.98));
}

[data-bs-theme="dark"] .books-chapter-modal-body {
  background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(17,24,39,0.98));
}

.books-chapter-studio {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.books-chapter-compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.books-chapter-editor-pane {
  min-width: 0;
}

.books-chapter-editor {
  min-height: 460px;
  resize: vertical;
  padding: 18px;
  border-radius: 20px !important;
  line-height: 1.7;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
}

.books-chapter-preview-pane {
  min-width: 0;
}

.books-chapter-reader-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.books-chapter-preview-hero {
  padding: 18px;
  border-radius: 28px;
}

.books-chapter-preview-cover {
  min-height: 230px;
}

.books-chapter-preview-cover span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.books-chapter-preview-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.books-chapter-live-read-area {
  width: 100%;
  max-width: none;
  margin: 0;
}

.books-chapter-live-title {
  margin: 0 0 22px;
  font-size: clamp(1.8rem, 1.1rem + 1.8vw, 2.8rem);
}

.books-chapter-preview-frame {
  height: 100%;
  min-height: 100%;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.96);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

[data-bs-theme="dark"] .books-chapter-preview-frame {
  background: rgba(15,23,42,0.96);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.books-chapter-preview-head {
  padding: 20px 22px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(239,246,255,0.86), rgba(255,255,255,0));
}

[data-bs-theme="dark"] .books-chapter-preview-head {
  background: linear-gradient(180deg, rgba(30,64,175,0.18), rgba(15,23,42,0));
}

.books-chapter-preview-head h4 {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

.books-chapter-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.books-chapter-preview-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.8rem;
  font-weight: 700;
}

.books-chapter-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 4px;
}

.books-chapter-preview-content {
  padding-top: 0;
}

.books-chapter-preview-pane .book-read-content-head__meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.books-chapter-preview-pane .book-read-content-head__meta span {
  display: inline;
}

.books-chapter-preview-empty,
.books-chapter-list-empty {
  min-height: 180px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: var(--bs-secondary-color, #64748b);
  background: rgba(248,250,252,0.72);
  line-height: 1.7;
}

[data-bs-theme="dark"] .books-chapter-preview-empty,
[data-bs-theme="dark"] .books-chapter-list-empty {
  background: rgba(30,41,59,0.46);
  border-color: rgba(148, 163, 184, 0.16);
}

.books-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.books-chapter-admin-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .books-chapter-admin-card {
  background: rgba(15,23,42,0.86);
  border-color: rgba(148, 163, 184, 0.14);
}

.books-chapter-admin-card__index {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.books-chapter-admin-card__body {
  min-width: 0;
}

.books-chapter-admin-card__title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.books-chapter-admin-card__title-row strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.45;
}

.books-chapter-admin-card__badges,
.books-chapter-admin-card__actions,
.books-chapter-admin-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.books-chapter-admin-card__meta {
  margin-top: 8px;
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.84rem;
}

.books-chapter-admin-card__actions {
  justify-content: flex-end;
}

@media (max-width: 1199.98px) {
  .books-admin-book-studio,
  .books-chapter-compose-grid {
    grid-template-columns: 1fr;
  }

  .books-admin-book-preview {
    position: static;
  }

  .books-chapter-preview-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .books-admin-hero {
    padding: 24px 20px;
  }

  .books-admin-hero-actions {
    width: 100%;
  }

  .books-admin-hero-actions .btn {
    flex: 1 1 180px;
  }

  .books-admin-card-body,
  .books-admin-book-form,
  .books-chapter-modal-body {
    padding: 18px;
  }

  .books-admin-book-form-head,
  .books-admin-card-header-rich,
  .books-admin-panel-head,
  .books-chapter-admin-card,
  .books-chapter-admin-card__title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .books-admin-panel,
  .books-chapter-editor-shell,
  .books-chapter-list-shell {
    padding: 16px;
    border-radius: 20px;
  }

  .books-chapter-admin-card {
    grid-template-columns: 1fr;
  }

  .books-chapter-admin-card__index {
    width: 40px;
    height: 40px;
  }

  .books-chapter-admin-card__actions {
    width: 100%;
  }

  .books-chapter-admin-card__actions .btn {
    flex: 1 1 0;
  }

  .books-chapter-preview-meta-grid {
    grid-template-columns: 1fr;
  }
}
