/* =========================================================
   Bacakomix — stylesheet bersama
   Tema gelap, mobile-first.
   ========================================================= */

:root {
  --bg: #0a0b0f;
  --bg-2: #101218;
  --surface: #171a23;
  --surface-2: #20242f;
  --border: #262b38;
  --text: #f2f3f8;
  --text-2: #a8adbf;
  --muted: #6f7489;
  --accent: #ffb020;
  --accent-2: #ff5d73;
  --accent-grad: linear-gradient(135deg, #ffb020, #ff5d73);
  --accent-ink: #1a1203;
  --teal: #36d6b5;
  --violet: #8c7cff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .45);
  --header-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(720px 300px at 15% -80px, rgba(255, 176, 32, .12), transparent 70%),
    radial-gradient(640px 280px at 88% -60px, rgba(255, 93, 115, .10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 14, 18, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "logo nav" "search search";
  align-items: center;
  gap: 10px 12px;
  padding-top: 10px; padding-bottom: 10px;
}

.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 10px; }
.logo-img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 4px 10px rgba(255, 120, 60, .4)); transition: transform .2s; }
.logo:hover .logo-img { transform: rotate(-6deg) scale(1.06); }
.logo-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 900; font-size: 18px;
  transform: rotate(-6deg);
  box-shadow: 0 4px 14px rgba(255, 120, 60, .35);
}
.logo-text { font-size: 22px; font-weight: 800; letter-spacing: -.8px; }
.logo-text b {
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text.small { font-size: 18px; }

.search-form {
  grid-area: search;
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden;
  transition: border-color .15s;
}
.search-form:focus-within { border-color: var(--accent); }
.search-form input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit;
  padding: 9px 4px 9px 16px;
}
.search-form input::placeholder { color: var(--muted); }
.search-form input::-webkit-search-cancel-button { filter: invert(.7); }
.search-form button {
  border: 0; background: transparent; cursor: pointer;
  padding: 0 14px; height: 40px; display: grid; place-items: center;
  color: var(--text-2); font-size: 18px;
}
.search-form button:hover { color: var(--accent); }

.main-nav { grid-area: nav; display: flex; justify-content: flex-end; gap: 4px; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  color: var(--text-2); font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s;
}
.main-nav a svg { font-size: 17px; }
.main-nav a:hover { color: var(--text); background: var(--surface); }
.main-nav a.active { color: var(--accent-ink); background: var(--accent-grad); box-shadow: 0 4px 14px rgba(255, 120, 60, .35); }
@media (max-width: 559px) {
  .main-nav a span { display: none; }
  .main-nav a { padding: 8px 10px; }
}

@media (min-width: 760px) {
  .header-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "logo search nav"; gap: 20px; }
  .search-form { max-width: 460px; width: 100%; justify-self: center; }
  .main-nav a { padding: 8px 14px; }
}

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

.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: linear-gradient(180deg, var(--bg-2), #0c0d12); }
.footer-inner { padding-top: 32px; padding-bottom: 20px; color: var(--text-2); font-size: 14px; }
.footer-inner p { margin: 6px 0 0; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.footer-brand .logo { margin-bottom: 4px; }
.footer-brand p { max-width: 420px; }
.footer-col h3 { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--text-2); font-weight: 600; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between;
  color: var(--muted); font-size: 13px;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1.4fr; gap: 32px; }
}

/* ---------------- Tombol ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { font-size: 18px; }
.btn-primary { background: var(--accent-grad); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(255, 110, 60, .35); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: rgba(255, 255, 255, .06); border-color: var(--border); color: var(--text); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--text-2); background: rgba(255, 255, 255, .1); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------------- Section ---------------- */

.section { margin-top: 36px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.section-title::before {
  content: ""; width: 5px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.section-sub { margin: 2px 0 0 15px; color: var(--muted); font-size: 13.5px; }
.section-link { color: var(--accent); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.page-head { margin: 24px 0 18px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* ---------------- Tabs ---------------- */

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab .count {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; text-align: center;
}

/* ---------------- Grid kartu ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid > .state { grid-column: 1 / -1; }

.card { position: relative; min-width: 0; transition: transform .25s ease; }
.card:hover { transform: translateY(-5px); }
.card-link { display: block; }
.card-cover {
  position: relative; aspect-ratio: 3 / 4.2;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  transition: box-shadow .25s ease;
}
.card:hover .card-cover { box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 176, 32, .35); }
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.card-link:hover .card-cover img { transform: scale(1.07); }
.card-cover::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); pointer-events: none;
}
.card-body { padding: 10px 2px 0; }
.card-title {
  font-size: 15px; font-weight: 700; letter-spacing: -.2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.card-link:hover .card-title { color: var(--accent); }
.card-meta { display: flex; gap: 10px; margin-top: 4px; color: var(--text-2); font-size: 12.5px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .rating svg { color: var(--accent); fill: var(--accent); }
.card-sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

.badge {
  position: absolute; z-index: 1;
  padding: 4px 9px; border-radius: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.badge-type { top: 8px; left: 8px; background: var(--violet); color: #fff; }
.badge-type.type-manga { background: var(--accent-2); }
.badge-type.type-manhwa { background: var(--violet); }
.badge-type.type-manhua { background: var(--teal); color: #06231d; }
.badge-status { bottom: 8px; left: 8px; background: rgba(0, 0, 0, .65); color: #fff; z-index: 2; }

.bookmark-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .15s, color .15s, transform .12s;
}
.bookmark-btn:active { transform: scale(.92); }
.bookmark-btn.is-active svg { fill: currentColor; }
.card-bookmark {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(13, 14, 18, .72); border-color: rgba(255, 255, 255, .12);
  font-size: 16px;
}
.card-bookmark:hover { background: rgba(13, 14, 18, .92); }
.card-bookmark.is-active { color: var(--accent); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
.skeleton-card .card-cover { box-shadow: none; }
.skeleton.line { height: 12px; border-radius: 6px; margin-top: 8px; }
.skeleton.line.short { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .spinner { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------- State ---------------- */

.state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.state-icon {
  width: 60px; height: 60px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--text-2); font-size: 28px;
}
.state-error .state-icon { color: var(--accent-2); background: rgba(255, 93, 115, .12); }
.state h3 { font-size: 18px; }
.state p { margin: 6px auto 0; max-width: 440px; color: var(--text-2); }
.state .state-detail { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; }
.state-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.state-actions:empty { display: none; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; gap: 12px; padding: 60px 0; color: var(--text-2); }

/* ---------------- Pagination ---------------- */

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 28px 0 8px; flex-wrap: wrap; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 10px;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700;
}
a.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.page-btn.disabled { opacity: .35; }
.page-btn svg { font-size: 18px; }
.page-gap { color: var(--muted); padding: 0 2px; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 24px; }

/* ---------------- Hero (beranda) ---------------- */

.hero { margin-top: 20px; position: relative; }
.hero-slide {
  position: relative; overflow: hidden;
  border-radius: 24px; border: 1px solid var(--border);
  background: var(--surface); min-height: 300px;
  box-shadow: var(--shadow-lg);
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  filter: blur(24px) brightness(.5) saturate(1.4);
  transform: scale(1.25);
}
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,15,.94) 8%, rgba(10,11,15,.55) 55%, rgba(10,11,15,.15)); }
.hero-content {
  position: relative; z-index: 1;
  display: flex; gap: 18px; align-items: flex-end;
  padding: 24px;
}
.hero-cover {
  width: 120px; flex-shrink: 0;
  aspect-ratio: 3 / 4.2; border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .12); background: var(--surface-2);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { min-width: 0; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 176, 32, .14); border: 1px solid rgba(255, 176, 32, .35);
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  font-size: clamp(24px, 4.5vw, 40px); font-weight: 800; letter-spacing: -.8px; line-height: 1.1; margin-top: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-title a:hover { color: var(--accent); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: var(--text-2); font-size: 13px; }
.hero-meta .pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
  font-weight: 700; font-size: 12.5px; color: var(--text);
}
.hero-meta .pill svg { font-size: 14px; }
.hero-meta .rating svg { color: var(--accent); fill: var(--accent); }
.hero-synopsis {
  display: none; margin: 12px 0 0; color: var(--text-2);
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-actions .btn { padding: 12px 22px; font-size: 15px; }
.hero-arrow {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: none; place-items: center; cursor: pointer;
  background: rgba(10, 11, 15, .55); border: 1px solid rgba(255, 255, 255, .16);
  color: var(--text); font-size: 22px; backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s;
}
.hero-arrow:hover { background: rgba(255, 176, 32, .9); color: var(--accent-ink); border-color: transparent; }
.hero-arrow.prev { left: 14px; }
.hero-arrow.next { right: 14px; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.hero-dots button {
  width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0;
  background: var(--surface-2); cursor: pointer; transition: width .2s, background .2s;
}
.hero-dots button.active { width: 24px; background: var(--accent); }
.hero-skeleton { min-height: 260px; border-radius: 20px; }

@media (min-width: 760px) {
  .hero-slide { min-height: 380px; }
  .hero-content { padding: 40px; gap: 30px; align-items: center; min-height: 380px; }
  .hero-cover { width: 200px; }
  .hero-synopsis { display: -webkit-box; max-width: 640px; }
  .hero-arrow { display: grid; }
}

/* ---------------- Rail horizontal (lanjutkan membaca / bookmark) ---------------- */

.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px;
  gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
@media (min-width: 760px) { .rail { grid-auto-columns: 160px; } }

.history-card .progress-chip {
  position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 2;
  padding: 4px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, .7); color: #fff;
  font-size: 11.5px; font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.remove-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(13, 14, 18, .72); color: var(--text);
  font-size: 14px;
}
.remove-btn:hover { color: var(--accent-2); }

/* ---------------- Detail ---------------- */

.detail-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.detail-hero .hero-bg { filter: blur(30px) brightness(.35) saturate(1.2); }
.detail-hero .hero-bg::after { background: linear-gradient(180deg, rgba(13,14,18,.4), var(--bg)); }
.detail-inner {
  position: relative; z-index: 1;
  display: grid; gap: 18px;
  grid-template-columns: 1fr;
  padding-top: 22px; padding-bottom: 26px;
}
.detail-cover {
  width: 180px; margin: 0 auto;
  aspect-ratio: 3 / 4.2; border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1), 0 0 60px rgba(255, 176, 32, .12);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { min-width: 0; text-align: center; }
.detail-title { font-size: 24px; font-weight: 900; }
.detail-alt { margin-top: 4px; color: var(--text-2); font-size: 13.5px; }
.detail-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin: 16px 0 0;
}
.stat {
  background: rgba(25, 28, 37, .8); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 6px; min-width: 0;
}
.stat dt { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.stat dd { margin: 2px 0 0; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat dd svg { color: var(--accent); fill: var(--accent); }
.genres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; justify-content: center; }
.chip {
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.detail-author { margin-top: 12px; color: var(--text-2); font-size: 14px; }
.detail-author b { color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; justify-content: center; }
.detail-actions .bookmark-btn { padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.detail-actions .bookmark-btn svg { font-size: 18px; }
.detail-actions .bookmark-btn.is-active { color: var(--accent); border-color: var(--accent); }
.continue-note { margin-top: 10px; font-size: 13px; color: var(--text-2); }

.synopsis { color: var(--text-2); white-space: pre-line; margin: 0; }
.synopsis.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 6px; color: var(--accent); font-weight: 700; cursor: pointer; }

@media (min-width: 760px) {
  .detail-inner { grid-template-columns: 220px 1fr; gap: 32px; padding-top: 36px; padding-bottom: 36px; align-items: end; }
  .detail-cover { width: 100%; margin: 0; }
  .detail-info { text-align: left; }
  .detail-title { font-size: 34px; }
  .detail-stats { max-width: 520px; }
  .genres, .detail-actions { justify-content: flex-start; }
}

/* Daftar chapter */
.chapter-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chapter-filter {
  flex: 1; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font: inherit; padding: 8px 14px; outline: 0;
}
.chapter-filter:focus { border-color: var(--accent); }
.chapter-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 8px;
  max-height: 640px; overflow-y: auto; padding-right: 4px;
}
@media (min-width: 760px) { .chapter-list { grid-template-columns: 1fr 1fr; } }
.chapter-item a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .15s, background .15s, transform .15s;
}
.chapter-item a:hover { border-color: var(--accent); background: var(--surface-2); transform: translateX(3px); }
.chapter-item.is-read a { opacity: .6; }
.chapter-item.is-current a { border-color: var(--teal); opacity: 1; }
.chapter-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.chapter-tag { font-size: 11px; font-weight: 800; color: var(--teal); margin-left: 6px; }

/* ---------------- Reader ---------------- */

body.reader-page { background: #08090b; }
.reader-bar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(8, 9, 11, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: transform .25s ease;
}
.reader-bar.hidden { transform: translateY(-100%); }
.reader-bar-inner { display: flex; align-items: center; gap: 10px; height: 56px; }
.icon-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-size: 20px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.disabled, .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.reader-titles { flex: 1; min-width: 0; }
.reader-manga { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.reader-manga:hover { color: var(--accent); }
.reader-chapter { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-select {
  max-width: 150px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px; font: inherit; font-size: 13px;
}
.reader-progress { position: absolute; left: 0; bottom: -1px; height: 3px; background: var(--accent-grad); width: 0; transition: width .1s; }
.reader-select-bottom { max-width: 240px; flex: 1; padding: 10px 12px; border-radius: 999px; }
@media (max-width: 519px) {
  .reader-bar .reader-select { display: none; }
}

.reader-pages { max-width: 820px; margin: 0 auto; padding: 0; }
.reader-page-item { position: relative; background: #0f1014; min-height: 60vh; }
.reader-page-item.loaded { min-height: 0; background: transparent; }
.reader-page-item img { width: 100%; height: auto; margin: 0 auto; opacity: 0; transition: opacity .25s; }
.reader-page-item.loaded img { opacity: 1; }
.page-loader {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px;
  color: var(--muted); font-size: 13px;
}
.reader-page-item.loaded .page-loader { display: none; }
.reader-page-item.failed { min-height: 220px; }
.reader-page-item.failed img { display: none; }
.page-error { display: none; position: absolute; inset: 0; place-items: center; align-content: center; gap: 10px; text-align: center; color: var(--text-2); padding: 20px; }
.reader-page-item.failed .page-error { display: grid; }
.reader-page-item.failed .page-loader { display: none; }

.reader-end { max-width: 820px; margin: 0 auto; padding: 28px 16px 40px; text-align: center; }
.reader-end h2 { font-size: 18px; }
.reader-end p { color: var(--text-2); margin: 6px 0 0; }
.reader-nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.reader-nav .btn { flex: 1; max-width: 240px; }
.reader-state { max-width: 820px; margin: 24px auto; padding: 0 16px; }

.to-top {
  position: fixed; right: 16px; bottom: 20px; z-index: 55;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; font-size: 22px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.img-failed { object-fit: cover; }
