


.books-page,
.book-detail-page,
.book-read-page,
.admin-books-page {
  padding-top: 6px;
  padding-bottom: 40px;
}


.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;
}

.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;
}


.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;
}

.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;
}


.books-grid-section {
  padding: 0 2px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}


.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);
}

.book-card-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #f1f5f9;
  height: 200px;
}

.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;
}


.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;
}


.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;
}


.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;
}


.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;
}

.book-detail-aside {
  position: sticky;
  top: 80px;
}

@media (max-width: 991.98px) {
  .book-detail-layout { grid-template-columns: 1fr; }
  .book-detail-aside {
    position: static;
    top: auto;
  }
}

.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;
}

.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;
}


.hh-library-page {
  --hh-bg: #f6f8fb;
  --hh-card: #ffffff;
  --hh-card-soft: rgba(255,255,255,.86);
  --hh-text: #111827;
  --hh-muted: #687386;
  --hh-line: rgba(17,24,39,.11);
  --hh-primary: #6c5cff;
  --hh-primary-2: #35bdf7;
  --hh-gold: #f59e0b;
  --hh-shadow: 0 18px 54px rgba(17,24,39,.09);
  --hh-container: 1180px;
  min-height: 100vh;
  padding: clamp(16px, 3vw, 42px) 0 72px;
  color: var(--hh-text);
  background:
    radial-gradient(circle at 8% 0%, rgba(108,92,255,.14), transparent 30%),
    radial-gradient(circle at 92% 4%, rgba(53,189,247,.12), transparent 30%),
    var(--hh-bg);
  overflow: hidden;
}

.hh-library-page * { box-sizing: border-box; }
.hh-library-page a { color: inherit; text-decoration: none; }
.hh-library-page img { width: 100%; display: block; object-fit: cover; }
.hh-library-page button,
.hh-library-page input,
.hh-library-page select { font-family: inherit; }

.hh-library-page .hh-container {
  width: min(var(--hh-container), calc(100% - 28px));
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

main.container:has(.hh-library-page),
main.container .hh-library-page,
main.container .hh-library-page > .hh-container {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.hh-hero {
  position: relative;
  min-height: clamp(420px, 55vw, 660px);
  overflow: hidden;
  border: 1px solid var(--hh-line);
  border-radius: 34px;
  background: #111827;
  box-shadow: var(--hh-shadow);
  isolation: isolate;
  margin-bottom: 18px;
}

.hh-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .8s ease, transform 5s ease;
  z-index: -3;
}

.hh-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hh-slide img {
  height: 100%;
  filter: saturate(1.04) contrast(1.03);
}

.hh-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7,9,20,.88), rgba(7,9,20,.54) 46%, rgba(7,9,20,.18)),
    linear-gradient(180deg, rgba(7,9,20,.08), rgba(7,9,20,.86));
}

.hh-hero-inner {
  min-height: clamp(420px, 55vw, 660px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(20px, 4vw, 44px);
  align-items: end;
  padding: clamp(24px, 5vw, 60px);
  color: #fff;
}

.hh-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 18px;
}

.hh-hero-title {
  max-width: 780px;
  margin: 0 0 20px;
  font-size: clamp(46px, 8vw, 104px);
  line-height: .86;
  letter-spacing: -.095em;
  font-weight: 900;
  text-shadow: 0 24px 70px rgba(0,0,0,.44);
}

.hh-hero-text {
  max-width: 620px;
  margin: 0 0 28px;
  color: rgba(255,255,255,.82);
  font-size: clamp(14px, 1.7vw, 18px);
  line-height: 1.75;
  font-weight: 560;
}

.hh-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hh-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--hh-line);
  border-radius: 999px;
  padding: 0 20px;
  color: var(--hh-text);
  background: var(--hh-card);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: .22s ease;
  white-space: nowrap;
}

.hh-btn:hover { transform: translateY(-2px); }

.hh-btn-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--hh-primary), var(--hh-primary-2));
  box-shadow: 0 14px 34px rgba(108,92,255,.24);
}

.hh-btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}

.hh-feature-book {
  align-self: center;
  justify-self: end;
  width: min(320px, 100%);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 30px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(20px);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
  padding: 18px;
  animation: hhFloat 5s ease-in-out infinite;
}

@keyframes hhFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.hh-feature-cover {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.30);
  margin-bottom: 16px;
}

.hh-feature-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hh-feature-book h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -.055em;
  font-weight: 900;
}

.hh-feature-book p {
  margin: 0;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hh-hero-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.hh-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: .22s ease;
}

.hh-dot.is-active {
  width: 28px;
  background: #fff;
}

.hh-toolbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 190px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--hh-line);
  border-radius: 24px;
  background: var(--hh-card-soft);
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 40px rgba(17,24,39,.08);
  padding: 12px;
  margin: 22px 0;
}

.hh-input,
.hh-select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--hh-line);
  border-radius: 16px;
  background: var(--hh-card);
  color: var(--hh-text);
  outline: none;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 760;
  transition: .22s ease;
}

.hh-input::placeholder { color: var(--hh-muted); }

.hh-input:focus,
.hh-select:focus {
  border-color: rgba(108,92,255,.46);
  box-shadow: 0 0 0 4px rgba(108,92,255,.10);
}

.hh-select option {
  color: var(--hh-text);
  background: var(--hh-card);
}

.hh-category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 22px;
  scrollbar-width: none;
}

.hh-category-strip::-webkit-scrollbar { display: none; }

.hh-cat-btn {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--hh-line);
  border-radius: 999px;
  padding: 0 17px;
  color: var(--hh-muted);
  background: var(--hh-card-soft);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: .22s ease;
}

.hh-cat-btn:hover,
.hh-cat-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--hh-primary), var(--hh-primary-2));
  box-shadow: 0 14px 30px rgba(108,92,255,.18);
}

.hh-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 8px 0 22px;
}

.hh-section-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--hh-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hh-section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hh-section-more {
  min-height: 40px;
  border: 1px solid var(--hh-line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--hh-card-soft);
  color: var(--hh-text);
  font-size: 12px;
  font-weight: 900;
  transition: .22s ease;
}

.hh-section-more:hover {
  transform: translateY(-2px);
  border-color: rgba(108,92,255,.24);
}

.hh-book-section--saved {
  margin-bottom: 14px;
}

.hh-section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: .95;
  letter-spacing: -.075em;
  font-weight: 900;
}

.hh-section-head p {
  margin: 0;
  color: var(--hh-muted);
  font-weight: 650;
}

.hh-count {
  color: var(--hh-muted);
  font-size: 14px;
  font-weight: 850;
}

.hh-book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.hh-book-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hh-line);
  border-radius: 28px;
  background: var(--hh-card);
  box-shadow: 0 16px 44px rgba(17,24,39,.08);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  animation: hhFadeUp .55s ease both;
}

@keyframes hhFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hh-book-card:hover {
  transform: translateY(-8px);
  border-color: rgba(108,92,255,.24);
  box-shadow: 0 26px 70px rgba(17,24,39,.15);
}

.hh-book-cover-wrap {
  position: relative;
  padding: 18px 18px 0;
  background:
    radial-gradient(circle at 24% 0%, rgba(108,92,255,.16), transparent 34%),
    radial-gradient(circle at 84% 20%, rgba(53,189,247,.12), transparent 34%);
}

.hh-book-cover {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 22px;
  background: #dfe5ef;
  box-shadow: 0 18px 42px rgba(17,24,39,.16);
}

.hh-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.hh-book-cover-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--hh-muted);
  font-size: 44px;
}

.hh-book-card:hover .hh-book-cover img { transform: scale(1.055); }

.hh-book-badge {
  position: absolute;
  left: 30px;
  top: 30px;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  color: #fff;
  background: rgba(17,24,39,.72);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 900;
}

.hh-book-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.hh-book-category {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--hh-primary);
  background: rgba(108,92,255,.10);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 12px;
}

.hh-book-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.16;
  letter-spacing: -.055em;
  font-weight: 900;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hh-book-author {
  margin: 0 0 12px;
  color: var(--hh-muted);
  font-size: 13px;
  font-weight: 760;
}

.hh-book-desc {
  margin: 0 0 16px;
  color: var(--hh-muted);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hh-book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hh-line);
  color: var(--hh-muted);
  font-size: 12px;
  font-weight: 800;
}

.hh-rating {
  color: var(--hh-gold);
  white-space: nowrap;
}

.hh-book-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 0 18px 18px;
}

.hh-book-actions.is-dual {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.hh-read-btn {
  display: block;
  min-height: 42px;
  padding: 9px 12px;
  text-align: center;
  border: 0;
  border-radius: 10px;
  color: #fff !important;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s ease, transform .22s ease;
}

.hh-icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--hh-line);
  border-radius: 999px;
  background: var(--hh-card-soft);
  color: var(--hh-text);
  font-size: 16px;
  cursor: pointer;
  transition: .22s ease;
}

.hh-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hh-save-btn.is-active {
  border-color: rgba(16,185,129,.18);
  background: rgba(16,185,129,.12);
  color: #047857;
}

.hh-save-btn:disabled {
  opacity: .7;
  cursor: wait;
}

.hh-read-btn:hover,
.hh-icon-btn:hover,
.hh-save-btn:hover { transform: translateY(-2px); }

.hh-empty {
  display: none;
  border: 1px dashed var(--hh-line);
  border-radius: 28px;
  background: var(--hh-card-soft);
  padding: 48px 22px;
  text-align: center;
  color: var(--hh-muted);
  font-weight: 850;
}

.hh-library-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 36px));
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}

.hh-library-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hh-shelf-showcase {
  margin-top: 48px;
  overflow: hidden;
  border: 1px solid var(--hh-line);
  border-radius: 30px;
  background: var(--hh-card-soft);
  box-shadow: var(--hh-shadow);
  padding: 24px 0;
}

.hh-shelf-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: hhShelf 28s linear infinite;
}

.hh-shelf-showcase:hover .hh-shelf-track { animation-play-state: paused; }

@keyframes hhShelf {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hh-shelf-item {
  width: 140px;
  flex: 0 0 auto;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(17,24,39,.14);
}

.hh-shelf-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hh-parallax {
  --library-parallax-image: url('https://images.unsplash.com/photo-1521587760476-6c12a4b040da?auto=format&fit=crop&w=1800&q=90');
  position: relative;
  margin-top: 48px;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--hh-line);
  border-radius: 34px;
  box-shadow: var(--hh-shadow);
  background: #0c1320;
}

.hh-parallax::before {
  content: "";
  position: absolute;
  inset: -12% 0;
  z-index: 0;
  background: var(--library-parallax-image) center/cover no-repeat;
  transform: translate3d(0, var(--parallax-y, 0), 0) scale(1.08);
  transition: transform .12s linear;
  will-change: transform;
}

.hh-parallax::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7,9,20,.88), rgba(7,9,20,.38));
}

.hh-parallax-inner {
  position: relative;
  z-index: 2;
  min-height: 390px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
}

.hh-parallax h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(36px, 6vw, 78px);
  line-height: .9;
  letter-spacing: -.085em;
  font-weight: 900;
}

.hh-parallax p {
  max-width: 430px;
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.7;
  font-weight: 650;
}

@media (max-width: 1060px) {
  .hh-hero-inner { grid-template-columns: 1fr; }
  .hh-feature-book { display: none; }
  .hh-book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .hh-toolbar { grid-template-columns: 1fr 1fr; }
  .hh-toolbar .hh-input { grid-column: 1 / -1; }
  .hh-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 620px) {
  .hh-library-page { padding-top: 14px; }
  .hh-library-page .hh-container { width: min(100% - 24px, var(--hh-container)); }
  .hh-hero { min-height: 470px; border-radius: 24px; }
  .hh-hero-inner { min-height: 470px; padding: 22px; }
  .hh-hero-title { font-size: clamp(42px, 16vw, 64px); }
  .hh-hero-text { font-size: 13px; }
  .hh-hero-actions .hh-btn { width: 100%; }
  .hh-toolbar { position: static; grid-template-columns: 1fr; border-radius: 20px; padding: 10px; }
  .hh-input,
  .hh-select { height: 44px; border-radius: 14px; font-size: 13px; }
  .hh-section-head { align-items: flex-start; flex-direction: column; }
  .hh-book-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .hh-book-card { border-radius: 20px; }
  .hh-book-cover-wrap { padding: 10px 10px 0; }
  .hh-book-cover { border-radius: 16px; }
  .hh-book-badge { left: 18px; top: 18px; min-height: 24px; font-size: 9px; }
  .hh-book-body { padding: 12px; }
  .hh-book-category { min-height: 22px; padding: 0 8px; font-size: 9px; margin-bottom: 8px; }
  .hh-book-title { font-size: 13px; margin-bottom: 6px; }
  .hh-book-author { font-size: 10px; margin-bottom: 8px; }
  .hh-book-desc { font-size: 10px; line-height: 1.45; margin-bottom: 10px; }
  .hh-book-meta { font-size: 9px; gap: 6px; padding-top: 10px; }
  .hh-section-actions { width: 100%; justify-content: space-between; }
  .hh-book-actions { padding: 0 12px 12px; grid-template-columns: 1fr; }
  .hh-book-actions.is-dual { grid-template-columns: minmax(0, 1fr) 36px; }
  .hh-icon-btn { display: inline-flex; }
  .hh-read-btn,
  .hh-save-btn { min-height: 36px; font-size: 11px; }
  .hh-shelf-showcase { border-radius: 22px; margin-top: 32px; padding: 18px 0; }
  .hh-shelf-item { width: 96px; border-radius: 14px; aspect-ratio: 9 / 16; }
  .hh-shelf-item img { width: 100%; height: 100%; object-fit: cover; }
  .hh-parallax { min-height: 300px; border-radius: 24px; }
  .hh-parallax::before { inset: -10% 0; transform: translate3d(0, var(--parallax-y, 0), 0) scale(1.05); }
  .hh-parallax-inner { min-height: 300px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 24px; }
  .hh-parallax h2 { font-size: 36px; }
  .hh-parallax p { font-size: 13px; }
}


.books-home-settings-grid {
  display: grid;
  gap: 16px;
}

.books-home-featured-card {
  display: grid;
}

.books-home-slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.books-home-settings-card {
  border: 1px solid var(--border, rgba(15,23,42,0.08));
  border-radius: 22px;
  background: var(--card-bg, rgba(255,255,255,0.82));
  color: var(--text);
  padding: 16px;
  box-shadow: var(--shadow, 0 10px 30px rgba(15,23,42,0.06));
}

.books-home-settings-card h6 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.books-home-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(56,189,248,0.08));
  margin-bottom: 12px;
}

.books-home-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.books-home-preview-empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  color: var(--bs-secondary-color, #64748b);
  font-weight: 700;
  padding: 16px;
}

.books-home-preview-empty i {
  font-size: 28px;
  color: #6366f1;
}

.books-home-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.books-home-preview-actions .btn {
  flex: 1 1 0;
}

.books-home-parallax-card {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 16px;
}

.books-home-settings-help {
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.87rem;
  line-height: 1.5;
}

.books-home-settings-msg { margin-top: 14px; }

@media (max-width: 991.98px) {
  .books-home-slider-grid { grid-template-columns: 1fr; }
  .books-home-parallax-card { grid-template-columns: 1fr; }
}


.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 {
  white-space: pre-line;
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--bs-secondary-color, #64748b);
  margin: 0;
  white-space: pre-line;
}


.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: var(--card-bg, rgba(255,255,255,0.7));
  border: 1px solid var(--border, rgba(15,23,42,0.07));
  color: var(--text);
  transition: background 0.15s;
}

.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;
}


.book-review-section {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  padding: 24px;
}

.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;
}


.book-read-page {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 88px);
  padding: 18px clamp(10px, 2vw, 24px) 28px;
  isolation: isolate;
}

.book-read-page.has-library-background::before,
.book-read-page.has-library-background::after,
.books-chapter-reader-preview.has-library-background::before,
.books-chapter-reader-preview.has-library-background::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
}

.book-read-page.has-library-background::before,
.book-read-page.has-library-background::after {
  position: fixed;
  border-radius: 0;
}

.book-read-page.has-library-background::before,
.books-chapter-reader-preview.has-library-background::before {
  z-index: -3;
  background-image: var(--reading-bg-active-image, var(--reading-bg-image));
  background-position: var(--reading-bg-position, center center);
  background-size: var(--reading-bg-size, cover);
  background-repeat: var(--reading-bg-repeat, no-repeat);
}

@media (max-width: 767.98px) {
  .book-read-page.has-responsive-backgrounds::before,
  .books-chapter-reader-preview.has-responsive-backgrounds::before {
    background-image: var(--reading-bg-active-mobile-image, var(--reading-bg-mobile-image, var(--reading-bg-active-image, var(--reading-bg-image))));
  }
}

@media (max-width: 767.98px) {
}

.book-read-page.has-library-background::after,
.books-chapter-reader-preview.has-library-background::after {
  z-index: -2;
  background:
    linear-gradient(rgba(15, 23, 42, var(--reading-bg-overlay, 0.35)), rgba(15, 23, 42, var(--reading-bg-overlay, 0.35))),
    linear-gradient(180deg, rgba(248,250,252,0.72), rgba(255,255,255,0.88));
  backdrop-filter: blur(1px);
}

.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);
}


#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;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 14px 18px;
  background: rgba(255,255,255,0.76);
  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);
}

.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);
}

.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;
}

.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);
}

.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);
}

.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 {
  position: relative;
  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);
  overflow: hidden;
}

.chapter-header__backdrop {
  display: none;
}

.chapter-header.has-chapter-banner,
.chapter-header.chapter-header--default {
  aspect-ratio: 16 / 9;
  width: min(100%, 960px);
  margin: 0 auto;
  min-height: 0;
  max-height: min(560px, calc(100vh - 180px));
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: clamp(22px, 4vw, 56px) clamp(18px, 5vw, 70px);
}

.chapter-header.has-chapter-banner {
  color: #fff;
  background-image: var(--chapter-banner-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
}

@media (max-width: 767.98px) {
  .chapter-header.has-banner-variants.has-chapter-banner {
    background-image: var(--chapter-banner-mobile-image, var(--chapter-banner-image));
  }
}

@media (max-width: 767.98px) {
}

.chapter-header.chapter-header--default {
  background:
    radial-gradient(circle at 18% 20%, rgba(14,165,233,0.22), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(245,158,11,0.16), transparent 32%),
    linear-gradient(135deg, rgba(248,250,252,0.98), rgba(239,246,255,0.94));
}

.chapter-header.has-chapter-banner .chapter-header__backdrop,
.chapter-header.chapter-header--default .chapter-header__backdrop {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chapter-header.has-chapter-banner .chapter-header__backdrop {
  background:
    linear-gradient(180deg, rgba(2,6,23,0.16), rgba(2,6,23,0.72)),
    radial-gradient(circle at center, rgba(15,23,42,0.1), rgba(2,6,23,0.42));
}

.chapter-header.chapter-header--default .chapter-header__backdrop {
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.22));
}

.chapter-header.has-chapter-banner .book-read-hero__cover,
.chapter-header.chapter-header--default .book-read-hero__cover {
  display: none;
}

.chapter-header__content {
  position: relative;
  z-index: 1;
  justify-items: center;
  align-content: center;
  max-width: 820px;
  width: 100%;
  min-height: 0;
}

.chapter-header.has-chapter-banner .book-read-title,
.chapter-header.has-chapter-banner .book-read-summary,
.chapter-header.has-chapter-banner .book-read-stat strong {
  color: #fff;
}

.chapter-header.has-chapter-banner .book-read-summary {
  color: rgba(255,255,255,0.84);
}

.chapter-header.has-chapter-banner .book-read-kicker,
.chapter-header.has-chapter-banner .book-read-stat {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chapter-header.has-chapter-banner .book-read-stat span {
  color: rgba(255,255,255,0.72);
}

.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;
}

.book-read-title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: clamp(1.65rem, 2vw + 1.05rem, 2.85rem);
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
}

.book-read-summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #475569;
  max-width: 72ch;
  white-space: pre-line;
}

.book-read-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 760px;
}

.book-read-stat {
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.book-read-stat span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.book-read-stat strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}


.book-read-body {
  display: grid;
  grid-template-columns: 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));
}

.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);
}

.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);
}

.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 {
  position: relative;
  font-family: 'Source Serif 4', Georgia, serif;
  --reader-base-font-size: 1.08rem;
  font-size: clamp(0.82rem, calc(var(--reader-base-font-size) * var(--reader-font-scale, 1)), 1.62rem);
  line-height: 1.94;
  letter-spacing: 0.01em;
  color: var(--bs-body-color);
  word-break: break-word;
  white-space: pre-line;
}

.book-read-content.is-copy-protected {
  -webkit-user-select: none;
  user-select: none;
}

.book-read-content.is-screen-shielded {
  min-height: 260px;
  border-radius: 24px;
}

.book-read-content.is-screen-shielded,
.book-read-content.is-screen-shielded * {
  color: transparent !important;
  text-shadow: none !important;
  caret-color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  border-color: transparent !important;
  outline-color: transparent !important;
}

.book-read-content.is-screen-shielded :where(img, video, iframe, canvas, svg) {
  visibility: hidden !important;
}

@media print {
  .book-read-content.is-copy-protected {
    color: transparent !important;
    min-height: 70vh;
  }

  .book-read-content.is-copy-protected * {
    color: transparent !important;
    opacity: 0 !important;
  }
}

.book-copy-protection-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.book-copy-protection-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.book-read-content-head__meta {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 700;
}

.book-read-content p {
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 1.28em;
}

.book-read-content :where(li, span) {
  font-size: inherit !important;
  line-height: inherit;
}

.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: calc(4.15rem * var(--reader-font-scale, 1));
  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;
}

.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;
}

.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;
}

.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);
}

.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);
}

.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;
}


.book-read-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: min(100%, 860px);
  margin: 2px auto 0;
  padding: 8px 0 0;
}

.book-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  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);
}

.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 {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(37,99,235,0.1);
  font-size: 1rem;
  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: 48px;
  height: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(37,99,235,0.12);
  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(5, 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;
    padding-inline: 8px;
  }

  .book-read-topbar,
  .book-read-hero,
  .book-read-content-wrap,
  .book-nav-btn {
    border-radius: 22px;
  }


  .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;
  }

  .chapter-header.has-chapter-banner,
  .chapter-header.chapter-header--default {
    aspect-ratio: 16 / 9;
    max-height: 230px;
    padding: 14px 12px;
  }

  .book-read-title {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
    line-height: 1.12;
  }

  .book-read-rail,
  .book-read-rail-card__stats {
    grid-template-columns: 1fr;
  }

  .book-read-meta-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .book-read-stat {
    min-width: 0;
    padding: 5px 4px;
    border-radius: 9px;
  }

  .book-read-stat span {
    font-size: 0.52rem;
    letter-spacing: 0;
    margin-bottom: 2px;
  }

  .book-read-stat strong {
    font-size: 0.64rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .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;
  }


  .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;
  }


  .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;
  }


  #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 {
    --reader-base-font-size: 1.02rem;
    font-size: clamp(0.78rem, calc(var(--reader-base-font-size) * var(--reader-font-scale, 1)), 1.34rem);
    line-height: 1.82;
  }

  .book-read-content p:first-of-type::first-letter {
    font-size: calc(3.2rem * var(--reader-font-scale, 1));
  }

  .book-read-nav {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    gap: 6px;
  }

  .book-nav-home-btn {
    width: 42px;
    min-height: 50px;
    border-radius: 14px;
  }

  .book-nav-btn {
    min-height: 50px;
    padding: 7px 8px;
    border-radius: 14px;
    gap: 6px;
  }

  .book-nav-label {
    font-size: 0.58rem;
  }

  .book-nav-chapter {
    font-size: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.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);
}

.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);
}

.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);
}

.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;
  }
}


.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;
}

.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;
}

.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;
}

.books-admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(15,23,42,0.07);
}

.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-owner-line {
  margin-top: 7px;
}

.books-admin-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 260px);
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.books-admin-owner-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-admin-owner-badge.is-user {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.books-assignment-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.books-assignment-current span {
  color: var(--bs-secondary-color, #64748b);
  font-size: 0.82rem;
  font-weight: 700;
}

.books-assignment-current strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-assignment-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.books-assignment-option {
  display: flex;
  min-width: 0;
  cursor: pointer;
}

.books-assignment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.books-assignment-option > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  width: 100%;
  min-height: 92px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.78);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.books-assignment-option i {
  grid-row: span 2;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.books-assignment-option strong,
.books-assignment-option small {
  min-width: 0;
}

.books-assignment-option small {
  color: var(--bs-secondary-color, #64748b);
  line-height: 1.35;
}

.books-assignment-option input:checked + span {
  border-color: rgba(37, 99, 235, 0.58);
  background: rgba(239, 246, 255, 0.92);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.1);
}

#assignmentUserWrap {
  transition: opacity 0.18s ease;
}

#assignmentUserWrap.is-disabled {
  opacity: 0.52;
}

.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;
}


.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;
}


.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;
}


@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; }
  .books-assignment-mode-grid { grid-template-columns: 1fr; }
  .books-assignment-option > span { min-height: 78px; }
  .books-admin-table td.text-end { min-width: 156px; }
}


.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);
}

.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);
}

.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;
}

.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;
}

.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;
}

.books-background-preview-strip {
  position: relative;
  min-height: 118px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15,23,42,0.05);
}

.books-background-preview-strip img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
}

.books-background-preview-strip .btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
}

.books-reading-background-settings {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 18px;
}

.books-bg-variant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.books-bg-variant-field {
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.62);
}

@media (max-width: 767.98px) {
  .books-bg-variant-grid {
    grid-template-columns: 1fr;
  }
}

.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);
}

.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);
}

.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;
}

.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);
}

.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;
}

.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);
}

.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));
}

.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 {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  isolation: isolate;
  padding: 14px;
  border-radius: 28px;
  overflow: hidden;
}

.books-chapter-preview-hero {
  padding: 18px;
  border-radius: 28px;
  min-height: 280px;
}

.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);
}

.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));
}

.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;
}

.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);
}

.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;
  }
}
