/* KomikHub — responsive dark theme (mobile-first) */
:root {
  --bg: #0b0d12;
  --panel: #13161d;
  --panel-2: #1a1e27;
  --ink: #e8ecf1;
  --muted: #9aa3b2;
  --line: #242834;
  --accent: #ff7a3d;
  --radius: 14px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: #7cc4ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.nav-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-link:hover {
  color: var(--ink);
  border-color: #313848;
}
.nav-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-icons .nav-link { font-size: 13px; }
.nav-txt { display: inline; }
.nav-ico { width: 16px; height: 16px; flex: 0 0 16px; display: block; }
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.nav-burger:hover { border-color: #313848; }
/* Slide-out drawer (mobile) */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 260px;
  max-width: 85vw;
  background: rgba(13,15,21,0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
  z-index: 100;
  transform: translateX(105%);
  transition: transform .25s ease;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer .logo { margin-bottom: 16px; }
.drawer-burger {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-menu { display: flex; flex-direction: column; gap: 4px; }
.drawer-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.drawer-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 10px;
  border-radius: 8px;
  font-size: 15px;
  border: 1px solid transparent;
}
.drawer-item:hover { background: rgba(255,255,255,0.06); border-color: var(--line); }
body.no-scroll { overflow: hidden; }

.time {
  color: var(--muted);
  font-size: 11px;
  margin-left: 6px;
  white-space: nowrap;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,13,18,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink);
  font-size: 18px;
  white-space: nowrap;
}
.search {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 460px;
  margin-left: auto;
}
.search input {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
  font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.search button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}

/* ── Wrap ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px 60px;
  /* clip BUKAN hidden: hidden bikin .wrap jadi scroll-container
     dan mematikan position:sticky anaknya (preview kanan gak nempel) */
  overflow-x: clip;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
  flex-wrap: wrap;
  padding: 0 4px;
}
.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}
.clear-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.clear-link:hover { color: var(--ink); }

.divider { border: none; border-top: 1px solid var(--line, #2a2a35); margin: 8px 0 4px; }
.login-wrap { display:flex; justify-content:center; padding: 60px 16px; }
.login-box { width:100%; max-width:360px; background:var(--card,#17171f); border:1px solid var(--line,#2a2a35); border-radius:12px; padding:24px; }
.login-box h1 { font-size:20px; margin:0 0 4px; }
.login-box input { width:100%; box-sizing:border-box; margin:8px 0; padding:10px 12px; border-radius:8px; border:1px solid var(--line,#2a2a35); background:transparent; color:var(--ink,#eee); font-size:14px; }
.login-box button { width:100%; margin-top:8px; padding:10px; border-radius:8px; border:none; background:var(--accent,#6c5ce7); color:#fff; font-weight:700; cursor:pointer; font-size:14px; }
.login-box .small { font-size:12px; }
.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--ink);
}

/* ── Grid (home + recs) ── */
.grid-container {
  max-width: 1100px;
  margin: 0 auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  height: 100%;
  box-sizing: border-box;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.card:active { transform: translateY(0); }
.cover {
  position: relative;
  aspect-ratio: 2/3;
  background: linear-gradient(180deg,#1a2230,#0d1117);
  overflow: hidden;
  width: 100%;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #aab3c2;
  font-weight: 800;
  font-size: 32px;
}
.meta {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  min-height: 16px;
}
.card-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted, #8b93a7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.card-sub .ch {
  color: var(--muted, #8b93a7);
  font-size: 11px;
  margin: 0;
}
.card-sub .ts {
  color: var(--muted, #8b93a7);
  font-size: 11px;
}
.meta h3 {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 17px;
}
.ch {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}
.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.genres .tag {
  font-size: 10px;
  padding: 3px 8px;
}

/* ── Tags (reusable) ── */
.tag {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  min-height: 32px;
  line-height: 1.2;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tag.g {
  color: #a7f3d0;
  cursor: pointer;
}
.tag.g:hover {
  background: var(--bg);
}
.tag.ch { color: #fde68a; }
.tag.on {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.tag.placeholder {
  color: #6b7280;
  font-style: italic;
}

/* ── Pager ── */
.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
  align-items: center;
}
.pager a, .pager .cur, .pager .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.pager a:hover { background: var(--panel-2); }
.pager .cur {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 800;
}
.pager .dots {
  border: none;
  background: none;
  cursor: default;
  color: var(--muted);
}

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Type (manga/manhwa/manhua) filter */
.mtype-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px 0 4px;
}
.pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #ccc;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  transition: all .15s;
}
.pill:hover { background: rgba(255,255,255,.12); }
.pill.on {
  color: #fff;
  background: #f04a5e;
  border-color: #f04a5e;
}
.tag.type {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  color: #f04a5e;
  background: rgba(240,74,94,.14);
  border: 1px solid rgba(240,74,94,.3);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

/* ── Detail ── */
.detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}
.cover-big {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}
.cover-big img {
  width: 100%;
  height: auto;
  display: block;
}
.info h1 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  max-width: 780px;
}
.info {
  max-width: 780px;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.meta-row .muted {
  font-size: 13px;
}
.desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 18px;
  max-width: 780px;
}
.desc.placeholder {
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}
.genre-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  max-width: 1100px;
}
.genre-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.30);
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.genre-pill:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
}
.genre-pill.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  max-width: 780px;
}
.genre-tag {
  display: inline-block;
  text-decoration: none;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background .15s, color .15s;
}
.genre-tag:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
  border: 0;
}
.primary {
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}
.primary:hover {
  background: #e66b2a;
}

/* ── Chapter list ── */
.chaplist { margin-top: 28px; }
.chaplist-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.chsearch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chsearch input {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 140px;
  width: 100%;
  max-width: 220px;
}
.chsearch input::placeholder { color: var(--muted); }
.chsearch input:focus { outline: none; border-color: var(--accent); }
.ch-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.chaplist h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
}
.chaplist .muted {
  font-size: 13px;
  margin: 0;
}
.chgrid-wrap {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
.chgrid-wrap ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
}
.chap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  min-height: 38px;
  transition: background 0.15s, border-color 0.15s;
}
.chap:hover {
  background: var(--bg);
  text-decoration: none;
  border-color: #313848;
}
/* Bookmark button states */
.btn.bookmark.need-login {
  background: var(--panel-2, rgba(255,255,255,0.05));
  border: 1px dashed var(--line, rgba(255,255,255,0.15));
  color: var(--muted, #9ca3af);
}
.btn.bookmark.need-login:hover {
  background: var(--bg);
  border-color: #313848;
  color: var(--ink);
}
.btn.bookmark.marked {
  background: rgba(56, 132, 255, 0.12);
  border-color: rgba(56, 132, 255, 0.4);
  color: var(--ink);
}
.btn.bookmark.marked .bm-icon { color: #3884ff; }

.chap:active { transform: scale(0.97); }

/* Read chapters: strikethrough mark (mimics ch38/ch39 in the screenshot) */
.chap.read {
  color: var(--muted, #6b7280);
  background: var(--panel-1, rgba(255,255,255,0.02));
  border-color: rgba(255,255,255,0.05);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--muted, #6b7280);
  opacity: 0.7;
}
.chap.read:hover {
  color: var(--ink);
  background: var(--panel-2);
  border-color: #313848;
  text-decoration-color: var(--ink);
  opacity: 0.9;
}
.ch-read { /* wrapper for the li, no visual change needed */ }

.more-btn {
  display: block;
  margin: 12px auto 0;
  padding: 12px 24px;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
  max-width: 400px;
}
.more-btn:hover {
  background: var(--bg);
  border-color: #313848;
}

/* ── Rekomendasi ── */
.recs {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.recs h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--ink);
}
.recs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.rec-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}
.rec-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.rec-card:hover {
  background: var(--panel-2);
  border-color: #313848;
  transform: translateY(-2px);
  text-decoration: none;
}
.rec-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}
.rec-ph {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
}
.rec-title {
  padding: 6px 8px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-ch {
  padding: 0 8px 8px;
  font-size: 10px;
}

/* ── Reader ── */
.reader-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px;
}
.r-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,13,18,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: -14px -14px 14px;
  height: 58px;
}
.r-back {
  font-size: 18px;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.r-info {
  flex: 1;
  min-width: 0;
}
.r-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-ch {
  font-size: 12px;
  color: var(--muted);
  display: block;
}
.r-src {
  font-size: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.08);
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 2px;
}
.action-status {
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 10px;
  min-height: 18px;
}
.ch-select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  max-width: 160px;
}
.ch-select:focus {
  outline: none;
  border-color: var(--accent);
}
.r-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;               /* panel flush — garis hitam antar gambar dulu dari gap ini */
  padding-bottom: 74px;
}
.r-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0;      /* sudut membulat + background gelap = 'garis hitam' di sambungan */
  margin-bottom: -1px;   /* anti hairline: lebar pecahan (791.98px) bikin garis
                            subpixel 1px — overlap nutupin tanpa kehilangan konten */
  background: #0d1117;
  image-rendering: -webkit-optimize-contrast;
}
.r-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}
.r-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(11,13,18,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  height: 56px;
}
.r-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  min-width: 110px;
}
.r-nav-btn:hover {
  background: var(--bg);
  border-color: #313848;
  transform: translateY(-1px);
  text-decoration: none;
}
.r-nav-btn.primary {
  background: var(--accent);
  color: #121418;
  border-color: var(--accent);
}
.r-nav-btn.primary:hover {
  background: #ff8a4d;
}
.r-nav-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
  transform: none;
}

/* ── Reader: show/hide (hide saat idle / tap) ── */
.r-header,
.r-nav {
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.r-header.hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
.r-nav.hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}
.r-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(19,22,29,0.92);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r-fab.visible {
  opacity: 1;
  pointer-events: auto;
}
.r-fab:hover {
  background: var(--panel-2);
}
.back {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}
.rtitle {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.reader {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.reader a {
  display: block;
  margin: 0 0 8px;
  line-height: 0;
  max-width: 100%;
}
.reader img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  background: #0d1117;
}
.reader .muted {
  text-align: center;
  padding: 20px;
}

/* ── Footer ── */
.foot {
  text-align: center;
  color: var(--muted);
  padding: 20px 16px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  font-size: 12px;
}

/* ── Mobile (up to 720px) ── */
@media (max-width: 720px) {
  .nav-inner { padding: 8px 12px; }
  .logo { font-size: 17px; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
  }
  .search button { padding: 10px 12px; font-size: 13px; }
  .meta { padding: 8px; }
  .meta h3 { font-size: 11px; max-height: 30px; }
  .card-sub { font-size: 10px; gap: 4px; }
  .card-sub .ch, .card-sub .ts { font-size: 10px; }
  .ch { font-size: 10px; }
  .genre-filters { gap: 6px; }
  .genre-pill { font-size: 12px; padding: 4px 10px; }
  .wrap { padding: 20px 12px 60px; }
  .nav-inner { padding: 8px 10px; gap: 8px; }
  .nav-inner .search { min-width: 0; }
  .nav-inner .search input { flex: 1; min-width: 0; }
  .nav-inner .nav-link { font-size: 12px; padding: 6px 9px; }
  /* Mobile: hamburger + drawer, hide desktop icon labels */
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; }
  .nav-icons .nav-txt { display: none; }
  .nav-icons .nav-link { padding: 7px 9px; font-size: 16px; border: none; background: transparent; }
  .nav-icons .nav-ico { width: 20px; height: 20px; flex-basis: 20px; }
  /* Mobile: History/Bookmark/Akun cukup lewat drawer (menu kiri) */
  .nav-icons .m-hide { display: none; }
  .search { max-width: none; margin-left: 0; }
  .detail {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cover-big {
    max-width: 240px;
    margin: 0 auto;
  }
  .info h1 { font-size: 22px; }
  .chgrid-wrap {
    max-height: 400px;
  }
  .chgrid-wrap ul {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
  .chap {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 40px;
  }
  .btn { padding: 10px 16px; font-size: 13px; }
  .recs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .recs { margin-top: 26px; padding-top: 16px; }
  .rec-title { font-size: 12px; }
}

/* ── Small mobile (under 480px) ── */
@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .wrap { padding: 18px 12px 50px; }
  .meta { padding: 7px; }
  .meta h3 { font-size: 10px; line-height: 1.25; -webkit-line-clamp: 2; }
  .card-sub { font-size: 9px; gap: 3px; }
  .card-sub .ch, .card-sub .ts { font-size: 9px; }
  .cover img { object-fit: cover; }
  .ch { font-size: 10px; }
  .chgrid-wrap ul {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .chap {
    font-size: 11px;
    padding: 6px 8px;
    min-height: 36px;
  }
  .info h1 { font-size: 18px; }
  .topbar h1 { font-size: 16px; }
  .btn { width: 100%; }
}

/* ── 404 ── */
.nf-wrap { text-align:center; padding: 80px 16px 60px; }
.nf-code { font-size: 96px; font-weight: 900; line-height: 1; color: var(--accent,#6c5ce7); letter-spacing: -4px; }
.nf-wrap h1 { font-size: 22px; margin: 12px 0 6px; }
.nf-actions { margin-top: 24px; display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }

/* ── login extras ── */
.login-err { background:#3d1f28; color:#ff9aa8; border:1px solid #5e2a3a; padding:8px 12px; border-radius:8px; font-size:13px; margin:8px 0; }
.login-box a { color: var(--accent,#6c5ce7); }

/* ── detail actions & bookmark ── */
.detail-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.detail-actions .btn.primary { flex:1; min-width:140px; }
.btn.bookmark { flex-shrink:0; display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:8px; border:1px solid var(--line,#2a2a35); background:transparent; color:var(--ink,#eee); cursor:pointer; font-size:13px; }
.btn.bookmark .bm-icon { font-size:15px; }
.btn.bookmark.marked { border-color: var(--accent,#6c5ce7); color: var(--accent,#6c5ce7); }

/* ── account ── */
.acc-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.acc-head h1 { font-size:18px; }
.acc-section { margin: 18px 0; }
.acc-recent { display:flex; flex-direction:column; gap:8px; }
.acc-item { display:flex; gap:10px; align-items:center; background:var(--card,#17171f); border:1px solid var(--line,#2a2a35); border-radius:10px; padding:8px 10px; }
.acc-item:hover { border-color: var(--accent,#6c5ce7); }
.acc-item .acc-cover img { width:40px; height:60px; object-fit:cover; border-radius:6px; }
.acc-info { display:flex; flex-direction:column; gap:2px; font-size:13px; min-width:0; }
.acc-info strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.acc-info .muted { font-size:11px; }
.acc-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:10px; }
.acc-card { background:var(--card,#17171f); border:1px solid var(--line,#2a2a35); border-radius:10px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.acc-card .acc-cover img { width:100%; height:150px; object-fit:cover; border-radius:6px; }
.acc-title { font-size:12px; font-weight:600; line-height:1.3; }
.acc-flash { padding:10px 12px; border-radius:8px; font-size:13px; margin-bottom:14px; border:1px solid; }
.acc-flash.ok { color:#7ee2a8; border-color:#2c5c44; background:#14261c; }
.acc-flash.err { color:#ff9d9d; border-color:#5c2c2c; background:#261414; }
.acc-settings { display:flex; flex-direction:column; gap:14px; max-width:420px; }
.acc-form { background:var(--card,#17171f); border:1px solid var(--line,#2a2a35); border-radius:10px; padding:14px; display:flex; flex-direction:column; gap:10px; }
.acc-form label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted,#9aa); }
.acc-form input { background:#0e0e14; border:1px solid var(--line,#2a2a35); border-radius:8px; padding:9px 11px; color:var(--ink,#eee); font-size:13px; width:100%; box-sizing:border-box; }
.acc-form input:focus { outline:none; border-color:var(--accent,#6c5ce7); }
.acc-form .btn { align-self:flex-start; padding:8px 16px; border-radius:8px; font-size:13px; cursor:pointer; border:1px solid var(--accent,#6c5ce7); background:var(--accent,#6c5ce7); color:#fff; }
.ph.sm { width:40px; height:60px; }
.acc-card .ph.sm { width:100%; height:150px; }

/* ── history + bookmarks: toggle / delete buttons ── */
.acc-item.row { flex-wrap: nowrap; position: relative; }
.acc-item.row .acc-info { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.acc-item.row .acc-info a { display: block; min-width: 0; overflow: hidden; }
.acc-item.row .acc-info strong,
.acc-item.row .acc-info .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-card.row { position: relative; }
.bm-toggle {
  background: transparent; border: 1px solid var(--line,#2a2a35); border-radius: 8px;
  color: var(--muted,#9aa); font-size: 15px; line-height: 1; cursor: pointer;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: auto;
}
.bm-toggle:hover { border-color: var(--accent,#6c5ce7); color: var(--ink,#eee); }
.bm-toggle.is-bookmarked { color: var(--accent,#6c5ce7); border-color: var(--accent,#6c5ce7); background: rgba(108,92,231,0.1); }
.bm-del {
  background: transparent; border: 1px solid var(--line,#2a2a35); border-radius: 8px;
  color: var(--muted,#9aa); font-size: 13px; line-height: 1; cursor: pointer;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bm-del:hover { border-color: #ff6b6b; color: #ff6b6b; }
/* history row: toggle + delete side by side */
.acc-item.row .bm-toggle + .bm-del { margin-left: 4px; }
/* bookmarks card: delete button top-right */
.acc-card.row .bm-del { position: absolute; top: 6px; right: 6px; }

/* ── horizontal strips (Baca Terbanyak / genre sama) ── */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 92px;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  /* center the row when it doesn't fill the container; 'safe' keeps the
     start reachable when it overflows (no clipped first card on mobile) */
  justify-content: safe center;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.strip-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.strip-cover {
  position: relative;
  width: 92px;
  height: 138px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg,#1a2230,#0d1117);
  border: 1px solid var(--line);
}
.strip-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-cover .ph, .strip-cover .ph.small {
  width: 100%;
  height: 100%;
  font-size: 28px;
}
.strip-meta { min-width: 0; }
.strip-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-sub { font-size: 10px; margin-top: 2px; }

/* ── admin panel ── */
.admin-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.admin-card { background:var(--card,#17171f); border:1px solid var(--line,#2a2a35); border-radius:12px; padding:16px; }
.admin-card.wide { grid-column:1 / -1; }
.stat-row { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px solid var(--line,#2a2a35); font-size:13px; }
.stat-row:last-child { border:none; }
.stat-row.warn b { color:#ff9aa8; }
.admin-card form { margin:8px 0; }
.admin-card .btn { display:block; width:100%; text-align:left; }
.user-row { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid var(--line,#2a2a35); flex-wrap:wrap; }
.user-row:last-child { border:none; }
.user-name { font-size:13px; }
.tag.admin { background:var(--accent,#6c5ce7); color:#fff; font-size:10px; padding:2px 6px; border-radius:4px; margin-left:6px; }
.user-actions { display:flex; gap:6px; align-items:center; }
.btn.small { padding:5px 10px; font-size:12px; border-radius:6px; }
.btn.danger { color:#ff9aa8; border-color:#5e2a3a; }
form.inline { display:inline; }
.log { background:#0d0d12; border:1px solid var(--line,#2a2a35); border-radius:8px; padding:10px; font-size:11px; max-height:200px; overflow:auto; white-space:pre-wrap; }
.admin-link { color: var(--accent,#6c5ce7); }
@media (max-width:600px) { .admin-grid { grid-template-columns:1fr; } }
