.series-hero { position: relative; margin: calc(var(--pt) * -1) calc(var(--px) * -1) 24px; padding: var(--pt) var(--px); overflow: hidden; }
.series-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(40px) saturate(1.3); opacity: 0.28; transform: scale(1.2);
}
.series-hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,11,18,0.5), var(--bg) 92%); }
.series-top { position: relative; z-index: 1; display: flex; gap: clamp(16px, 3vw, 30px); align-items: flex-start; }
.series-cover {
  width: clamp(130px, 26vw, 220px); flex-shrink: 0; aspect-ratio: 2/3;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--surface-2);
}
.series-cover img { width: 100%; height: 100%; object-fit: cover; }
.series-info { flex: 1; min-width: 0; padding-top: 4px; }
.series-info h1 { margin: 0 0 10px; font-size: clamp(21px, 3.5vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.series-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: #d9c9ff; border-color: transparent; }
.pill.ongoing { color: #6ee7b7; }
.pill.adult { color: #fca5a5; border-color: #7f1d1d; }
.series-author { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.series-author b { color: var(--text); font-weight: 600; }
.series-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.tag { padding: 4px 11px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-soft); transition: 0.15s; }
.tag:hover { color: #fff; border-color: var(--accent); }
.series-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 14.5px;
  transition: all 0.2s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.58; cursor: wait; transform: none; }
.btn svg { width: 18px; height: 18px; }
.rtool:active, .reader-back:active, .modal-close:active { transform: scale(0.92); }
/* Gradient buttons: no border (a transparent border shows dark slivers at the
   rounded edges) + oversized gradient that glides on hover — smooth, no color jump. */
.btn-primary {
  background: linear-gradient(100deg, #7c3aed, #db2777 50%, #7c3aed);
  background-size: 220% 100%;
  background-position: 0% 50%;
  border: none; padding: 13px 23px; color: #fff;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.4);
  backface-visibility: hidden; transform: translateZ(0);
  transition: background-position 0.45s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 10px 26px rgba(219, 39, 119, 0.45); }
.btn-icon { padding: 12px; }
.btn.active-fav { background: var(--accent-soft); border-color: var(--accent); color: #d9c9ff; }
.btn.active-done { background: rgba(16,185,129,0.13); border-color: rgba(16,185,129,0.5); color: #6ee7b7; }

.series-desc { position: relative; z-index: 1; margin: 22px 0; color: #c9cad8; font-size: 15px; line-height: 1.7; max-width: 820px; white-space: pre-wrap; }
.series-desc.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0 0; cursor: pointer; }

/* Clear section labels on the series page */
.series-section { margin: 26px 0; }
.series-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 11px; }
.series-section .series-desc { margin: 0; }

.chapters-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 6px; flex-wrap: wrap; }
.chapters-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch-sort {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.ch-sort:hover { color: var(--text); border-color: var(--accent); }
.ch-sort svg { width: 16px; height: 16px; }
.chapters-count { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.ch-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; height: 38px; }
.ch-search span { display: flex; color: var(--faint); }
.ch-search span svg { width: 16px; height: 16px; }
.ch-search input { background: none; border: 0; outline: none; color: var(--text); font-size: 14px; width: 130px; }
.chapter-list { display: flex; flex-direction: column; gap: 6px; }
.chapter-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px;
  transition: all 0.15s;
}
.chapter-row:hover { background: var(--surface-2); border-color: var(--accent); transform: translateX(3px); }
.chapter-row.read { opacity: 0.55; }
.chapter-row .ch-ic { display: flex; color: var(--accent); flex-shrink: 0; }
.chapter-row .ch-ic svg { width: 18px; height: 18px; }

/* Read toggle circle + list remove button */
.ch-toggle, .row-remove {
  width: 30px; height: 30px; padding: 6px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 50%; background: none; color: var(--faint);
  display: grid; place-items: center; transition: 0.18s;
}
.ch-toggle svg, .row-remove svg { width: 100%; height: 100%; }
.ch-toggle:hover { color: #6ee7b7; border-color: rgba(16,185,129,0.5); }
.ch-toggle.on { color: #6ee7b7; border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.12); }
.ch-toggle.on:hover { color: #fca5a5; border-color: #7f1d1d; background: rgba(220,38,38,0.12); }
.row-remove:hover { color: #fca5a5; border-color: #7f1d1d; background: rgba(220,38,38,0.12); }

/* Corner X on removable library cards */
.card-removable { position: relative; }
.card-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; padding: 8px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,0.62); backdrop-filter: blur(4px); color: #fff;
  display: grid; place-items: center; opacity: 0; transition: opacity 0.2s, background 0.15s;
}
.card-remove svg { width: 100%; height: 100%; }
.card-removable:hover .card-remove { opacity: 1; }
.card-remove:hover { background: #dc2626; }
@media (hover: none) { .card-remove { opacity: 1; } }
.chapter-row .ch-name { font-weight: 600; flex: 1; }
.chapter-row .ch-date { color: var(--faint); font-size: 12.5px; }
.chapter-row .ch-read-mark { display: none; color: var(--accent); font-size: 12px; font-weight: 700; }
.chapter-row.read .ch-read-mark { display: inline; }
.load-more { display: block; margin: 24px auto; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon {
  width: 76px; height: 76px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent);
}
.empty-icon svg { width: 34px; height: 34px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow-lg); z-index: 200; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); opacity: 0; transition: all 0.3s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.bottomnav { display: none; }

