/* PojokKomik — tema gelap */
:root {
  --bg: #0d0e12;
  --bg-2: #15171d;
  --bg-3: #1d2027;
  --line: #272b34;
  --text: #e7e8ec;
  --muted: #9aa0ab;
  --accent: #6c8cff;
  --accent-2: #4f6ef0;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
img { display: block; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.page-title { margin: 24px 0 16px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: rgba(13, 14, 18, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.search { flex: 1; max-width: 420px; }
.search input {
  width: 100%; padding: 8px 12px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); }
.nav { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.who { color: var(--muted); font-size: 13px; }
.logout-form { display: inline-flex; margin: 0; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg-3); color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #262a33; text-decoration: none; }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #4a2b2b; color: var(--danger); }
.btn.danger:hover { background: #2a1b1b; }
.btn.block { width: 100%; }

/* ---------- kartu & grid ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 24px 20px 60px; }
main.reader-main { max-width: none; padding: 0; }

.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.comic-card {
  display: block; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text);
  transition: transform .15s, border-color .15s;
}
.comic-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.cover { position: relative; aspect-ratio: 2 / 3; background: var(--bg-3); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; }
.card-body h3 {
  margin: 0 0 4px; font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  position: absolute; right: 8px; bottom: 8px;
  padding: 3px 8px; border-radius: 999px; font-size: 11.5px;
  background: rgba(0, 0, 0, .78); color: #fff;
}

/* ---------- detail komik ---------- */
.comic-head { display: flex; gap: 24px; margin-bottom: 32px; }
.big-cover {
  width: 200px; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); flex-shrink: 0;
}
.comic-meta h1 { margin: 0 0 6px; font-size: 26px; }
.desc { max-width: 68ch; color: #c9ccd4; white-space: pre-wrap; }
.comic-meta .btn { margin-top: 12px; }

.chapter-list ul { list-style: none; margin: 0; padding: 0; }
.chapter-list li {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.chapter-list li > a {
  flex: 1; display: flex; justify-content: space-between; gap: 14px;
  padding: 12px 6px; color: var(--text);
}
.chapter-list li > a:hover { background: var(--bg-2); text-decoration: none; }
.chapter-list li.read .ch-title { color: var(--muted); }
.chapter-list li.started .ch-title { color: var(--accent); }
.ch-title { font-weight: 500; }
.ch-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* --- comic page extra meta --- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 16px;
  margin: 14px 0 12px;
  background: #0f141b;
  border: 1px solid #1a1f28;
  border-radius: 10px;
  padding: 12px 14px;
}
.meta-grid dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.meta-grid dd {
  margin: 4px 0 0;
  color: #e6edf3;
  font-size: 14px;
}
.pill {
  display: inline-block;
  font-size: 12px;
  background: #20262e;
  color: #cfd6e0;
  border-radius: 999px;
  padding: 4px 9px;
  margin: 4px 8px 2px 0;
}

/* --- rating stars --- */
.ratebox {
  margin: 12px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stars {
  display: flex;
  gap: 6px;
}
.star {
  appearance: none;
  border: 1px solid #2a2f35;
  background: #0f141b;
  color: #5b6470;
  font-size: 20px;
  line-height: 1;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
}
.star.on {
  color: var(--accent);
  border-color: #3a3423;
}
.star:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.chapter-list form { margin: 0; }

/* ---------- form ---------- */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.panel { margin-bottom: 24px; }
.panel h2 { margin-top: 0; }
label { display: block; margin-bottom: 12px; font-size: 13.5px; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-grid { display: grid; gap: 4px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-inline input, .form-inline select { width: auto; min-width: 160px; margin: 0; }
.file-label input { padding: 7px; }
.new-comic-fields { border-left: 2px solid var(--accent); padding-left: 14px; margin: 8px 0; }

/* ---------- unggah banyak file ---------- */
.check-label {
  display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px;
}
.check-label input { display: inline-block; width: auto; margin: 0; }
.batch-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.small-btn { padding: 5px 10px; font-size: 12.5px; margin-left: 8px; }
.batch-list { list-style: none; margin: 16px 0 0; padding: 0; }
.batch-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 160px auto;
  align-items: center; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.batch-info { min-width: 0; display: flex; flex-direction: column; }
.batch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-status { white-space: nowrap; text-align: right; min-width: 108px; color: var(--muted); }
.bar { display: block; height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.batch-item.done .bar i { background: var(--ok); }
.batch-item.fail .bar i, .batch-item.bad .bar i { background: var(--danger); }
.batch-item.skip .bar i { background: #8a8f9a; }
.batch-item.done .batch-status { color: var(--ok); }
.batch-item.fail .batch-status, .batch-item.bad .batch-status { color: var(--danger); }
.batch-item.skip .batch-status { color: var(--muted); }

@media (max-width: 640px) {
  .batch-item { grid-template-columns: 1fr; gap: 6px; }
  .batch-status { text-align: left; }
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: start; }
.row-actions form { margin: 0; }
.inline-details { position: relative; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.edit-panel {
  position: absolute; right: 0; top: 34px; z-index: 10; width: 320px;
  max-height: 70vh;
  overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}
.edit-form {
  position: static;
  width: 100%;
  margin-top: 12px;
  background: #0f141b;
  border: 1px solid #1a1f28;
  border-radius: 10px;
  padding: 12px;
  box-shadow: none;
}
.af-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.af-q { width: auto; min-width: 180px; padding: 7px 10px; margin: 0; }
.af-status { flex: 1 1 100%; }
.tag { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--bg-3); }
.tag.admin { background: #23304f; color: #a9c0ff; }
.tag.pending { background: #453519; color: #ffd88a; }
.pending-panel { border-color: #6b5520; }

.alert {
  padding: 10px 14px; margin-bottom: 16px; border-radius: 10px;
  background: #3a2020; border: 1px solid #5a2b2b; color: #ffb4b4;
}
.alert.ok { background: #16301f; border-color: #235c37; color: #a7f3c0; }

.empty { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 52px; margin: 0 0 8px; }
.foot { text-align: center; color: #565b66; font-size: 12.5px; padding: 24px; }

/* ---------- login ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; }
.auth-main { width: 100%; max-width: 380px; padding: 20px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .btn { margin-top: 8px; }
.auth-alt { margin: 14px 0 0; text-align: center; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-img { border: 1px solid var(--line); border-radius: 8px; background: #f6f6f9; }
.captcha-row input { flex: 1 1 120px; min-width: 120px; }

/* ---------- reader ---------- */
.reader-body { background: #000; }
.reader-body .foot { display: none; }
.reader-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid #1c1c1c;
  transition: transform .25s;
}
.reader-bar.hidden { transform: translateY(-105%); }
.reader-title { display: flex; flex-direction: column; min-width: 0; }
.reader-title strong, .reader-title span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reader-title span { font-size: 12.5px; }
.reader-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page-indicator { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* kontrol zoom gambar */
.zoom-ctl {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid #262b33; border-radius: 9px; padding: 2px;
}
.zoom-btn, .zoom-val {
  background: none; border: 0; color: var(--text); cursor: pointer;
  font: inherit; line-height: 1; border-radius: 7px; padding: 5px 7px;
}
.zoom-btn { font-size: 17px; min-width: 26px; }
.zoom-val { font-size: 12.5px; color: var(--muted); min-width: 46px; }
.zoom-btn:hover, .zoom-val:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.zoom-btn:active, .zoom-val:active { transform: scale(.94); }
.zoom-btn:disabled { opacity: .35; cursor: default; }
.zoom-btn:disabled:hover { background: none; color: var(--text); }

.pages { --z: 1; }
.pages.page { display: none; }
.pages.webtoon { display: block; }
.pages.page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 120px);
}
.pages.page img {
  display: none;
  width: auto; height: auto;
  max-height: calc((100vh - 120px) * var(--z));
  max-width: calc(100% * var(--z));
}
.pages.page img.active { display: block; }
.pages.webtoon img {
  display: block;
  width: calc(min(100%, 900px) * var(--z));
  max-width: none;
  margin: 0 auto;
}

.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px;
}
.chapter-nav {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 14px 40px; flex-wrap: wrap;
}

.tapzones { position: fixed; inset: 46px 0 0; z-index: 15; }
.tapzone { position: absolute; top: 0; bottom: 0; width: 32%; }
.tapzone.left { left: 0; }
.tapzone.right { right: 0; }

@media (max-width: 640px) {
  .comic-head { flex-direction: column; gap: 14px; }
  .big-cover { width: 140px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 14px; }
  .search { max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .row-actions { flex-direction: column; }
  .edit-panel {
    position: fixed; right: 12px; left: 12px; top: 56px; width: auto;
    max-height: calc(100vh - 80px);
  }
  .af-q { width: 100%; }
  .meta-grid { grid-template-columns: 1fr; }
  /* pembaca: rapatkan bilah atas agar muat di layar sempit */
  .reader-bar { gap: 8px; padding: 8px 10px; }
  .reader-bar .page-indicator { display: none; }
  .mode-toggle .mt-txt { display: none; }
  .zoom-val { min-width: 40px; }
}

/* ---------- perpustakaan pribadi ---------- */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.tab {
  padding: 9px 14px; color: var(--muted); font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-n {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  background: var(--bg-3); border-radius: 999px; font-size: 11.5px;
  color: var(--muted); text-align: center;
}

.lib-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.lib-item { position: relative; }
.lib-item .comic-card { height: 100%; }
.lib-remove {
  position: absolute; top: 6px; right: 6px; margin: 0;
  opacity: 0; transition: opacity .15s;
}
.lib-remove .btn {
  padding: 2px 8px; font-size: 13px; border-radius: 8px;
  background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px);
}
.lib-item:hover .lib-remove,
.lib-item:focus-within .lib-remove { opacity: 1; }
@media (hover: none) {
  .lib-remove { opacity: 1; }
}

.lib-section { margin-bottom: 26px; }
.lib-section-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px; font-size: 18px;
}

.hist-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.hist-head form { margin: 0; }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-list li {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.hist-list li form { margin: 0; }
.hist-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; color: var(--text);
}
.hist-main:hover { background: var(--bg-2); text-decoration: none; }
.hist-cover {
  width: 42px; height: 62px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0;
}
.hist-text { display: flex; flex-direction: column; min-width: 0; }
.hist-text strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- aksi favorit / status di detail komik ---------- */
.lib-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px;
}
.lib-actions .btn { margin-top: 0; }
.fav-btn.on { border-color: #6b5520; color: #ffd88a; background: #2a2312; }
.fav-btn.on:hover { background: #332a15; }
.inline-label {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.inline-label select { width: auto; margin: 0; padding: 7px 10px; }

/* ---------- profil ---------- */
.profile-cols {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}
.profile-cols .panel { margin: 0; }
.stat-list { list-style: none; margin: 0 0 14px; padding: 0; }
.stat-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.stat-list span { font-weight: 700; color: var(--accent); }

/* ---------- dasbor admin ---------- */
.alert.warn { background: #453519; border-color: #6b5520; color: #ffd88a; }

.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.admin-head .page-title { margin-bottom: 4px; }
.admin-head p { margin: 0; }
.admin-quick { display: flex; gap: 8px; flex-wrap: wrap; }

.dash-cards {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  margin-bottom: 20px;
}
.stat-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 13px;
}
a.stat-card { color: inherit; }
a.stat-card:hover { text-decoration: none; border-color: var(--accent); }
.stat-ico { font-size: 19px; flex-shrink: 0; }
.stat-card > div { display: flex; flex-direction: column; min-width: 0; }
.stat-card strong { font-size: 21px; line-height: 1.15; color: #fff; }
.stat-card span.small { font-size: 11.5px; line-height: 1.35; }

.dash-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  margin-bottom: 22px;
}
.dash-sub {
  font-size: 12px; margin: 18px 0 8px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .07em;
}

.table .num { text-align: right; vertical-align: top; }
.table-tight td { padding-top: 8px; padding-bottom: 8px; }
.bar-row {
  height: 6px; background: var(--bg-3); border-radius: 999px;
  margin: 6px 0 5px; max-width: 230px; overflow: hidden;
}
.bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

/* grafik batang aktivitas harian */
.chart {
  display: flex; align-items: stretch; gap: 5px;
  height: 150px; padding-top: 16px;
  border-bottom: 1px solid var(--line);
}
.chart-col {
  position: relative; flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column;
}
.chart-plot { flex: 1; min-height: 0; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%; min-height: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 4px 4px 0 0; opacity: .8;
  transition: opacity .15s;
}
.chart-col:hover .chart-bar { opacity: 1; }
.chart-val {
  position: absolute; top: -15px; left: -2px; right: -2px;
  text-align: center; font-size: 10.5px; color: var(--muted);
}
.chart-lbl {
  font-size: 9.5px; color: var(--muted); text-align: center;
  height: 14px; line-height: 14px; white-space: nowrap;
}

/* umpan aktivitas terbaru */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.feed li:last-child { border-bottom: 0; }
.feed-ico {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  background: var(--bg-3); display: flex; align-items: center;
  justify-content: center; font-size: 13px;
}
.feed-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.feed-body a { color: var(--text); }
.feed-body a:hover { color: var(--accent); text-decoration: none; }
.feed-body a b { color: var(--accent); font-weight: 600; }
.feed-body span.small { font-size: 11.5px; }

/* daftar mini (pembaca, penyimpanan) */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.mini-list li:last-child { border-bottom: 0; }

/* pemeriksaan kesehatan pustaka */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 8px 11px; margin-bottom: 6px;
  background: var(--bg-3); border-radius: 8px; font-size: 13.5px;
}
.health-list li b { font-variant-numeric: tabular-nums; }
.health-list li.good { color: var(--muted); }
.health-list li.good b { color: var(--ok); }
.health-list li.warn { background: #453519; color: #f3e4c4; }
.health-list li.warn b { color: #ffd88a; }
.health-list li.bad { background: #3a2222; color: #f5d6d6; }
.health-list li.bad b { color: var(--danger); }

/* ---------- diskusi komentar ---------- */
.cmt-section { margin-top: 22px; }
.cmt-title { display: flex; align-items: baseline; gap: 8px; }
.cmt-title .muted { font-size: 15px; font-weight: 400; }

.cmt-form, .cmt-reply form { margin: 0; }
.cmt-form textarea,
.cmt-reply textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 14px; line-height: 1.5;
}
.cmt-form textarea:focus, .cmt-reply textarea:focus {
  outline: none; border-color: var(--accent);
}
.cmt-form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.cmt-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cmt-list, .cmt-replies { list-style: none; margin: 0; padding: 0; }
.cmt-list { margin-top: 18px; }
.cmt {
  padding: 12px 0; border-top: 1px solid var(--line);
}
.cmt-list > .cmt:first-child { border-top: 0; }
.cmt:target { background: var(--bg-2); border-radius: 10px; padding-left: 10px; }

.cmt-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px;
}
.cmt-ava {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-3); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; text-transform: uppercase;
}
.cmt-badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--accent); color: #0b0d12;
  border-radius: 999px; padding: 1px 7px; font-weight: 700;
}
.cmt-time { margin-left: auto; }
.cmt-del { margin: 0; }
.cmt-del button {
  background: none; border: 0; cursor: pointer; padding: 2px 4px;
  font-size: 13px; opacity: .45; line-height: 1;
}
.cmt-del button:hover { opacity: 1; }

.cmt-body {
  margin: 6px 0 0 34px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.cmt-empty { margin-top: 16px; }

.cmt-replies {
  margin: 6px 0 0 34px; padding-left: 14px;
  border-left: 2px solid var(--line);
}
.cmt-replies .cmt { padding: 9px 0; }
.cmt-replies .cmt-ava { width: 22px; height: 22px; font-size: 11.5px; }
.cmt-replies .cmt-head { font-size: 13.5px; }
.cmt-replies .cmt-body { margin-left: 30px; font-size: 13.5px; }

.cmt-reply { margin: 8px 0 2px 34px; }
.cmt-reply > summary {
  cursor: pointer; list-style: none; display: inline-block;
  font-size: 13px; color: var(--muted);
}
.cmt-reply > summary::-webkit-details-marker { display: none; }
.cmt-reply > summary:hover { color: var(--accent); }
.cmt-reply[open] > summary { margin-bottom: 8px; }

@media (max-width: 640px) {
  .cmt-body { margin-left: 0; }
  .cmt-replies { margin-left: 12px; }
  .cmt-replies .cmt-body { margin-left: 0; }
  .cmt-reply { margin-left: 0; }
  .cmt-time { margin-left: 0; flex-basis: 100%; }
}

/* ---------- koleksi tematik ---------- */
/* Seksi generik: dipakai halaman komik & koleksi (index.css menyesuaikannya
   khusus di beranda). */
.cv-section { margin-top: 26px; }
.cv-section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.cv-section-title h2 { font-size: 19px; margin: 0; }
.cv-section-title small { color: var(--muted); }

.page-head { margin-bottom: 18px; }
.page-head .muted { margin-top: 4px; }
.crumb { margin: 0 0 10px; font-size: 13px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }

.coll-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.coll-grid.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.coll-card {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.coll-card:hover {
  text-decoration: none; border-color: #33404f; transform: translateY(-2px);
}
.coll-cover {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0d1117;
}
.coll-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coll-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .72); color: #fff;
  font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.coll-body { padding: 12px 14px; }
.coll-body h3 { margin: 0 0 4px; font-size: 16px; }
.coll-body p { margin: 0; }

.coll-members { list-style: none; margin: 10px 0 12px; padding: 0; }
.coll-members li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.coll-members li img {
  width: 32px; height: 46px; object-fit: cover;
  border-radius: 5px; border: 1px solid var(--line); flex-shrink: 0;
}
.coll-members li span {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.coll-members li form { margin: 0; }

.chips-mini { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chips-mini span {
  font-size: 10.5px; color: var(--muted);
  background: var(--bg-3); border-radius: 999px; padding: 2px 8px;
}

/* ---------- pembaca: preferensi lebar gambar (+ zoom) ---------- */
.pages.webtoon.fit-lebar img { width: calc(100% * var(--z)); }
.pages.webtoon.fit-asli img { width: auto; max-width: none; zoom: var(--z); }
.pages.page.fit-lebar img.active {
  width: calc(100% * var(--z)); height: auto; max-width: none; max-height: none;
}
.pages.page.fit-asli img.active { max-width: none; max-height: none; zoom: var(--z); }

/* ---------- daftar pengunjung (panel admin) ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .table { min-width: 640px; }

.visit-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; margin: 4px 0 16px;
}
.visit-chips > a {
  font-size: 12.5px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-3); color: var(--muted); border: 1px solid var(--line);
}
.visit-chips > a:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.visit-chips > a.on {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600;
}
.visit-search, .visit-clear { display: flex; gap: 8px; align-items: center; margin: 0; }
.visit-search input { width: 210px; margin: 0; }
.visit-search .btn, .visit-clear .btn { margin: 0; }

.kind {
  display: inline-block; font-size: 11.5px; line-height: 1.6;
  padding: 1px 9px; border-radius: 999px; white-space: nowrap;
}
.kind.tamu { background: var(--bg-3); color: var(--muted); }
.kind.pembaca { background: #16301f; color: #a7f3c0; }
.kind.admin { background: #3b2a12; color: #ffd88a; }
.kind.bot { background: #3a2222; color: #f5d6d6; }

.visit-table td { font-size: 13px; }
.visit-table tr.is-bot { opacity: .72; }
.visit-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.visit-ip { font-variant-numeric: tabular-nums; white-space: nowrap; }
.visit-path {
  font-size: 11.5px; color: var(--muted);
  word-break: break-all; margin-top: 2px;
}
.visit-flag { font-size: 11.5px; color: var(--muted); }
.session-link { font-size: 11.5px; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-top {
  display: flex; justify-content: space-between; gap: 10px;
  align-items: baseline; font-size: 13.5px;
}
.rank-top a { color: var(--text); }
.rank-top a:hover { color: var(--accent); text-decoration: none; }
.rank-bar {
  margin-top: 6px; height: 6px; border-radius: 999px;
  background: var(--bg-3); overflow: hidden;
}
.rank-bar i { display: block; height: 100%; background: var(--accent); }

@media (max-width: 640px) {
  .visit-chips { gap: 6px; }
  .visit-search, .visit-clear { flex: 1 1 100%; }
  .visit-search input { width: auto; flex: 1; min-width: 0; }
  .table-scroll .table { min-width: 560px; }
}
