/* ============================================================
   SMARTLIB — discover.css  v17
   - Animated hero bg blending smoothly into black page (dark)
   - Animated hero bg blending smoothly into white page (light)
   - 6 columns, well-sized cards
============================================================ */

.disc-wrap {
  padding-top: calc(var(--nav-h) + 2rem);
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

/* ── Hero section ── */
.disc-header {
  position: relative;
  padding: 8rem 4vw 5rem;
  text-align: center;
  overflow: hidden;
  background: #000;
}

/* Animated gradient — darker teal blobs, stay away from edges */
.disc-header::before {
  content: '';
  position: absolute;
  inset: -60% -40%;
  background:
    radial-gradient(ellipse 50% 45% at 32% 48%, #1e4d48 0%, transparent 45%),
    radial-gradient(ellipse 40% 50% at 70% 38%, #122e3a 0%, transparent 40%),
    radial-gradient(ellipse 30% 35% at 52% 68%, #0c2530 0%, transparent 38%),
    #000;
  animation: heroShift 12s ease-in-out infinite alternate;
  z-index: 0;
}

/* Second slower layer */
.disc-header::after {
  content: '';
  position: absolute;
  inset: -40% -30%;
  background:
    radial-gradient(ellipse 38% 44% at 62% 52%, #174840 0%, transparent 40%),
    radial-gradient(ellipse 28% 32% at 22% 32%, #102c38 0%, transparent 36%);
  animation: heroShift2 16s ease-in-out infinite alternate;
  z-index: 0;
  opacity: .40;
}

@keyframes heroShift {
  0%   { transform: translate(0%,   0%)  scale(1);    }
  25%  { transform: translate(4%,  -3%)  scale(1.04); }
  50%  { transform: translate(-3%,  5%)  scale(1.02); }
  75%  { transform: translate(6%,   2%)  scale(1.05); }
  100% { transform: translate(-4%, -4%)  scale(1.03); }
}
@keyframes heroShift2 {
  0%   { transform: translate(0%,   0%)  scale(1);    }
  33%  { transform: translate(-5%,  4%)  scale(1.06); }
  66%  { transform: translate(4%,  -3%)  scale(1.03); }
  100% { transform: translate(2%,   6%)  scale(1.05); }
}

/* Content sits above both animated layers */
.disc-header > * {
  position: relative;
  z-index: 2;
}

/* Multi-stop fade overlay — black top & bottom blend into page */
.disc-header-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #000                  0%,
    rgba(0,0,0,.92)       8%,
    rgba(0,0,0,.65)      20%,
    rgba(0,0,0,.25)      35%,
    transparent          45%,
    transparent          55%,
    rgba(0,0,0,.25)      65%,
    rgba(0,0,0,.65)      80%,
    rgba(0,0,0,.92)      92%,
    #000                100%
  );
}

/* ══════════════════════════════════════
   LIGHT MODE HERO — blue & teal blobs on white
══════════════════════════════════════ */
body.light-mode .disc-header {
  background: transparent;
}

/* Layer 1 — large blue blobs, base matches page bg */
body.light-mode .disc-header::before {
  background:
    radial-gradient(ellipse 55% 50% at 28% 45%, rgba(168,200,248,.85) 0%, transparent 52%),
    radial-gradient(ellipse 45% 55% at 72% 35%, rgba(125,184,240,.80) 0%, transparent 50%),
    radial-gradient(ellipse 38% 42% at 55% 72%, rgba(157,212,232,.75) 0%, transparent 46%),
    radial-gradient(ellipse 30% 36% at 84% 65%, rgba(184,216,245,.70) 0%, transparent 44%),
    var(--bg, #ebebeb);
  animation: heroShiftLight 9s ease-in-out infinite alternate;
}

/* Layer 2 — deeper blue accents, counter-moving */
body.light-mode .disc-header::after {
  background:
    radial-gradient(ellipse 42% 48% at 60% 50%, rgba(133,180,238,.65) 0%, transparent 46%),
    radial-gradient(ellipse 32% 36% at 18% 30%, rgba(106,173,232,.60) 0%, transparent 40%),
    radial-gradient(ellipse 28% 34% at 78% 20%, rgba(160,202,245,.60) 0%, transparent 38%);
  opacity: 1;
  animation: heroShiftLight2 13s ease-in-out infinite alternate;
}

@keyframes heroShiftLight {
  0%   { transform: translate(0%,    0%)  scale(1);    }
  20%  { transform: translate(5%,   -4%)  scale(1.05); }
  40%  { transform: translate(-4%,   6%)  scale(1.03); }
  60%  { transform: translate(7%,    3%)  scale(1.06); }
  80%  { transform: translate(-6%,  -5%)  scale(1.04); }
  100% { transform: translate(3%,    7%)  scale(1.05); }
}
@keyframes heroShiftLight2 {
  0%   { transform: translate(0%,    0%)  scale(1);    }
  25%  { transform: translate(-7%,   5%)  scale(1.07); }
  50%  { transform: translate(5%,   -6%)  scale(1.04); }
  75%  { transform: translate(-3%,   8%)  scale(1.06); }
  100% { transform: translate(6%,   -3%)  scale(1.05); }
}

/* Fade — dissolves into page bg colour.
   IMPORTANT: if your --bg in light mode is not #ebebeb,
   change both rgba() values to match it. */
body.light-mode .disc-header-fade {
  background: linear-gradient(
    to bottom,
    var(--bg, #ebebeb)      0%,
    rgba(235,235,235,.92)   6%,
    rgba(235,235,235,.50)  16%,
    rgba(235,235,235,.08)  30%,
    transparent            40%,
    transparent            60%,
    rgba(235,235,235,.08)  70%,
    rgba(235,235,235,.50)  84%,
    rgba(235,235,235,.92)  94%,
    var(--bg, #ebebeb)    100%
  );
}

/* ── Eyebrow pill ── */
.disc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: .45rem 1.25rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.light-mode .disc-eyebrow {
  background: rgba(80,120,220,.10);
  border-color: rgba(80,120,220,.22);
  color: #2a5ab8;
}

/* ── Title ── */
.disc-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: .7rem;
  text-shadow: 0 2px 24px rgba(0,0,0,.5);
}
.disc-title span {
  background: linear-gradient(135deg, var(--gold), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.light-mode .disc-title {
  color: #111;
  text-shadow: 0 2px 24px rgba(255,255,255,.5);
}
body.light-mode .disc-title span {
  background: none;
  -webkit-text-fill-color: #e8c96d;
}

/* ── Subtitle ── */
.disc-subtitle {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(255,255,255,.72);
  max-width: 440px;
  margin: 0 auto 5rem;
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
}

body.light-mode .disc-subtitle {
  color: rgba(0,0,0,.55);
  text-shadow: 0 1px 10px rgba(255,255,255,.6);
}

/* ── Genre pills ── */
.disc-genres {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: 0 4vw 1.4rem;
}
.disc-gpill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-family: 'Nunito', sans-serif;
  font-size: .76rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  user-select: none;
}
.disc-gpill:hover {
  border-color: var(--gold);
  color: var(--txt);
  transform: translateY(-1px);
}
.disc-gpill.active {
  background: rgba(232,201,109,.14);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}
body.light-mode .disc-gpill.active {
  background: rgba(0,0,0,.07);
  border-color: #111;
  color: #111;
}

/* ── Toolbar ── */
.disc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 4vw 1.2rem;
  flex-wrap: wrap;
}
.disc-sorts { display: flex; gap: .4rem; flex-wrap: wrap; }
.disc-sort-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-family: 'Nunito', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  padding: .35rem .9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.disc-sort-btn:hover { border-color: var(--gold); color: var(--txt); }
.disc-sort-btn.active {
  background: linear-gradient(135deg, var(--gold), #c9a84c);
  border-color: transparent;
  color: #1a1200;
}
body.light-mode .disc-sort-btn.active { background: #111; color: #fff; }

.disc-count {
  font-size: .76rem;
  color: var(--txt3);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Book grid — 6 columns ── */
.disc-grid-wrap { padding: 0 4vw 3rem; }
.disc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.1rem;
}

/* ── Book card ── */
.disc-card {
  cursor: pointer;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: dcReveal .42s ease forwards;
  transition: transform .26s ease, box-shadow .26s ease, border-color .26s;
}
.disc-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  border-color: var(--border-h);
}
@keyframes dcReveal {
  to { opacity: 1; transform: translateY(0); }
}

.disc-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg2);
}
.disc-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .32s ease;
}
.disc-card:hover .disc-cover img { transform: scale(1.06); }

.disc-cover-fb {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem;
  font-size: 1.8rem;
}
.disc-cover-fb p {
  font-family: 'Playfair Display', serif;
  font-size: .58rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  text-align: center;
  line-height: 1.3;
}
body.light-mode .disc-cover-fb p { color: #333; }

.disc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.62);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  opacity: 0;
  transition: opacity .2s ease;
}
.disc-card:hover .disc-overlay { opacity: 1; }

.disc-ov-btn {
  width: 80%;
  background: linear-gradient(135deg, var(--gold), #c9a84c);
  color: #1a1200;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: .68rem;
  padding: .38rem .7rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform .15s;
}
.disc-ov-btn:hover { transform: scale(1.06); }

.disc-ov-save {
  width: 80%;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .68rem;
  padding: .34rem .7rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50px;
  cursor: pointer;
  transition: background .18s;
}
.disc-ov-save:hover { background: rgba(255,255,255,.2); }

.disc-info { padding: .55rem .6rem .65rem; }
.disc-info-title {
  font-family: 'Playfair Display', serif;
  font-size: .75rem;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.3;
  margin-bottom: .14rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.disc-info-author {
  font-size: .62rem;
  color: var(--txt3);
  margin-bottom: .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disc-info-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .2rem;
}
.disc-star  { color: var(--gold); font-size: .62rem; font-weight: 700; }
.disc-genre-tag {
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-col);
  font-size: .52rem;
  font-weight: 700;
  padding: .08rem .32rem;
  border-radius: 5px;
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Skeleton ── */
.disc-skel {
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}
.disc-skel-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-h) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.disc-skel-line {
  height: 8px;
  border-radius: 4px;
  margin: 7px .6rem 0;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-h) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.disc-skel-line.s { width: 55%; margin-bottom: .6rem; }

/* ── Empty / error ── */
.disc-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--txt3);
}
.disc-empty span { font-size: 3rem; display: block; margin-bottom: .6rem; }
.disc-empty p    { font-size: .92rem; line-height: 1.6; }

/* ── Load more ── */
.disc-more-wrap {
  text-align: center;
  padding: .5rem 4vw 2.5rem;
  display: none;
}
#discMoreBtn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--txt2);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  padding: .68rem 2.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all .22s;
}
#discMoreBtn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 18px var(--glow-gold);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .disc-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .disc-grid { grid-template-columns: repeat(4, 1fr); gap: .9rem; }
  .disc-header { padding-bottom: 3.5rem; }
  .disc-subtitle { margin-bottom: 3rem; }
}
@media (max-width: 680px) {
  .disc-grid { grid-template-columns: repeat(3, 1fr); gap: .75rem; }
  .disc-header { padding-bottom: 2.5rem; }
  .disc-subtitle { margin-bottom: 2rem; }
}
@media (max-width: 420px) {
  .disc-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .disc-header::before,
  .disc-header::after { animation: none; }
}

/* ── Modal Read Online button ── */
.modal-read-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: linear-gradient(135deg, var(--teal), #3a9e96);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  padding: .65rem 1.4rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
}
.modal-read-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ══════════════════════════════════════
   READ CONFIRMATION POPUP
══════════════════════════════════════ */
.read-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.read-confirm-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.read-confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem 2rem 1.6rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  text-align: center;
  transform: translateY(24px) scale(.97);
  transition: transform .25s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.read-confirm-overlay.open .read-confirm-box {
  transform: translateY(0) scale(1);
}

.read-confirm-icon {
  font-size: 2.4rem;
  margin-bottom: .7rem;
  display: block;
}

.read-confirm-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: .5rem;
}

.read-confirm-book {
  font-family: 'Playfair Display', serif;
  font-size: .88rem;
  font-style: italic;
  color: var(--gold);
  margin-bottom: .5rem;
  display: block;
}

.read-confirm-msg {
  font-size: .82rem;
  color: var(--txt2);
  line-height: 1.55;
  margin-bottom: 1.4rem;
}

.read-confirm-msg strong {
  color: var(--teal);
}

.read-confirm-note {
  font-size: .72rem;
  color: var(--txt3);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .8rem;
  margin-bottom: 1.4rem;
  line-height: 1.5;
  text-align: left;
}

.read-confirm-actions {
  display: flex;
  gap: .7rem;
  justify-content: center;
}

.read-confirm-yes {
  flex: 1;
  background: linear-gradient(135deg, var(--teal), #3a9e96);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  padding: .62rem 1.2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
}
.read-confirm-yes:hover { opacity: .88; transform: translateY(-1px); }

.read-confirm-no {
  flex: 1;
  background: transparent;
  color: var(--txt2);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  padding: .62rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: border-color .18s, color .18s;
}
.read-confirm-no:hover { border-color: var(--rose, #e05); color: var(--txt); }

/* ══════════════════════════════════════
   MODAL DESC EXPANDABLE
══════════════════════════════════════ */
.modal-desc {
  font-size: .85rem;
  color: var(--txt2);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-height: 4.8rem;
  overflow: hidden;
  transition: max-height .35s ease;
  position: relative;
}
.modal-desc.expanded {
  max-height: 300px;
}
.modal-desc-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2rem;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
  transition: opacity .3s;
}
.modal-desc.expanded .modal-desc-fade { opacity: 0; }

.modal-desc-toggle {
  background: none;
  border: none;
  color: var(--teal);
  font-family: 'Nunito', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  display: block;
  transition: opacity .18s;
}
.modal-desc-toggle:hover { opacity: .75; }

/* ══════════════════════════════════════
   MODAL SUMMARY ACCORDION
══════════════════════════════════════ */
.modal-summary-wrap {
  margin-bottom: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.modal-summary-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.04);
  border: none;
  padding: .7rem 1rem;
  cursor: pointer;
  transition: background .18s;
}
.modal-summary-toggle:hover { background: rgba(255,255,255,.08); }

.modal-summary-toggle-label {
  font-family: 'Nunito', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: var(--txt);
}

.modal-summary-chevron {
  width: 16px;
  height: 16px;
  color: var(--txt3);
  transition: transform .28s ease;
  flex-shrink: 0;
}
.modal-summary-toggle[aria-expanded="true"] .modal-summary-chevron {
  transform: rotate(180deg);
}
.modal-summary-toggle[aria-expanded="true"] .modal-summary-toggle-label {
  color: var(--teal);
}

.modal-summary-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding: 0 1rem;
  background: rgba(255,255,255,.02);
}
.modal-summary-body.open {
  max-height: 320px;
  padding: .85rem 1rem 1rem;
  overflow-y: auto;
}

.modal-summary-body .modal-desc {
  font-size: .84rem;
  color: var(--txt2);
  line-height: 1.65;
  margin-bottom: .5rem;
  max-height: none;
  overflow: visible;
}
.modal-summary-body .modal-desc-fade { display: none; }
.modal-summary-body .modal-desc-toggle { display: none; }

/* ══════════════════════════════════════
   MODAL FULL OVERRIDES
══════════════════════════════════════ */
.modal-body > .modal-desc,
.modal-body > .modal-desc-toggle {
  display: none !important;
}

.modal-summary-body .modal-desc {
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
  font-size: .85rem;
  color: var(--txt2);
  line-height: 1.65;
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .4rem;
}

.modal-dl-btn,
.modal-save-btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  padding: .65rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
}
.modal-dl-btn {
  background: linear-gradient(135deg, var(--gold), #c9a84c);
  color: #1a1200;
  border: none;
}
.modal-dl-btn:hover  { opacity: .88; transform: translateY(-1px); }
.modal-save-btn {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--border);
}
.modal-save-btn:hover { border-color: var(--gold); color: var(--gold); }

.modal-read-btn {
  flex: 1;
  min-width: 130px;
}

/* ══════════════════════════════════════
   FORCE MODAL SUMMARY VISIBLE
══════════════════════════════════════ */
.book-modal .modal-inner {
  overflow: visible !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 1.5rem !important;
}

.book-modal .modal-body {
  overflow-y: auto !important;
  max-height: 80vh !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: .5rem !important;
}

.book-modal .modal-summary-wrap {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  margin: .3rem 0 .6rem !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: transparent !important;
}

.book-modal .modal-summary-toggle {
  display: flex !important;
  visibility: visible !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255,255,255,.05) !important;
  border: none !important;
  padding: .65rem 1rem !important;
  cursor: pointer !important;
}

.book-modal .modal-summary-toggle-label {
  font-family: 'Nunito', sans-serif !important;
  font-size: .82rem !important;
  font-weight: 700 !important;
  color: var(--txt) !important;
}

.book-modal .modal-summary-chevron {
  width: 16px !important;
  height: 16px !important;
  color: var(--txt3) !important;
  transition: transform .28s ease !important;
  flex-shrink: 0 !important;
}

.book-modal .modal-summary-toggle[aria-expanded="true"] .modal-summary-chevron {
  transform: rotate(180deg) !important;
}

.book-modal .modal-summary-toggle[aria-expanded="true"] .modal-summary-toggle-label {
  color: var(--teal) !important;
}

.book-modal .modal-summary-body {
  max-height: 0 !important;
  overflow: hidden !important;
  transition: max-height .35s ease, padding .3s ease !important;
  padding: 0 1rem !important;
}

.book-modal .modal-summary-body.open {
  max-height: 220px !important;
  padding: .8rem 1rem !important;
  overflow-y: auto !important;
}

.book-modal .modal-summary-body .modal-desc {
  display: block !important;
  font-size: .84rem !important;
  color: var(--txt2) !important;
  line-height: 1.65 !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
}

.book-modal .modal-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .6rem !important;
  margin-top: auto !important;
  padding-top: .4rem !important;
}

/* ══════════════════════════════════════
   MODAL — clean rewrite v14
══════════════════════════════════════ */

.book-modal .modal-summary-section {
  margin: .6rem 0 .8rem;
}

.book-modal .modal-summary-label {
  font-family: 'Nunito', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .35rem;
}

.book-modal .modal-desc {
  display: block !important;
  visibility: visible !important;
  font-size: .84rem;
  color: var(--txt2);
  line-height: 1.65;
  max-height: 140px;
  overflow-y: auto;
  padding-right: .25rem;
  margin: 0;
}

.book-modal .modal-desc::-webkit-scrollbar { width: 4px; }
.book-modal .modal-desc::-webkit-scrollbar-track { background: transparent; }
.book-modal .modal-desc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.book-modal .modal-inner {
  display: flex !important;
  flex-direction: row !important;
  gap: 1.5rem !important;
  overflow: visible !important;
  max-height: 90vh !important;
}

.book-modal .modal-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  max-height: 80vh !important;
  gap: .1rem !important;
}

.book-modal .modal-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .6rem !important;
  margin-top: .8rem !important;
}

.book-modal .modal-dl-btn,
.book-modal .modal-save-btn,
.book-modal .modal-read-btn {
  flex: 1 !important;
  min-width: 120px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Nunito', sans-serif !important;
  font-weight: 700 !important;
  font-size: .84rem !important;
  padding: .62rem 1rem !important;
  border-radius: 50px !important;
  cursor: pointer !important;
  transition: opacity .18s, transform .18s !important;
}

.book-modal .modal-dl-btn {
  background: linear-gradient(135deg, var(--gold), #c9a84c) !important;
  color: #1a1200 !important;
  border: none !important;
}
.book-modal .modal-dl-btn:hover { opacity: .88 !important; transform: translateY(-1px) !important; }

.book-modal .modal-read-btn {
  background: linear-gradient(135deg, var(--teal), #3a9e96) !important;
  color: #fff !important;
  border: none !important;
}
.book-modal .modal-read-btn:hover { opacity: .88 !important; transform: translateY(-1px) !important; }

.book-modal .modal-save-btn {
  background: transparent !important;
  color: var(--txt) !important;
  border: 1px solid var(--border) !important;
}
.book-modal .modal-save-btn:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

.book-modal .modal-summary-wrap,
.book-modal .modal-summary-toggle,
.book-modal .modal-summary-body,
.book-modal .modal-desc-toggle,
.book-modal .modal-desc-fade {
  display: none !important;
}

/* ══════════════════════════════════════
   CARD OVERLAY — 3 buttons: View / Read / Save
══════════════════════════════════════ */

.disc-ov-btn { display: none !important; }

.disc-ov-view,
.disc-ov-read,
.disc-ov-save {
  width: 82%;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .66rem;
  padding: .32rem .6rem;
  border-radius: 50px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  text-align: center;
}

.disc-ov-view {
  background: linear-gradient(135deg, var(--gold), #c9a84c);
  color: #1a1200;
  border: none;
}
.disc-ov-view:hover { transform: scale(1.05); }

.disc-ov-read {
  background: linear-gradient(135deg, var(--teal), #3a9e96);
  color: #fff;
  border: none;
}
.disc-ov-read:hover { transform: scale(1.05); }

.disc-ov-save {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.disc-ov-save:hover { background: rgba(255,255,255,.2); transform: scale(1.05); }
