/* =========================================================
   Bookshelf — gaya tampilan
   Palet diambil dari rak buku versi lama; mode gelap usulan baru.
   ========================================================= */
:root {
  --wall: #E3E7DC; --cabinet: #D3D9C6; --paper: #F6F7F2; --card: #FFFFFF;
  --line: #C4CBB8; --ink: #1F2B25; --ink-soft: #55625A;
  --wood: #84573A; --wood-light: #A3714D; --wood-dark: #5E3C27;
  --accent: #2F5D50; --on-accent: #F6F7F2; --mark: #F1D27A; --mark-ink: #1F2B25;
  --shadow: 0 12px 28px rgba(31, 43, 37, .16);
  --serif: "Libre Caslon Text", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --wall: #161B18; --cabinet: #202824; --paper: #1B211E; --card: #232A26;
  --line: #3A443D; --ink: #E7ECE4; --ink-soft: #A9B4AA;
  --wood: #5E3C27; --wood-light: #7A5136; --wood-dark: #3F2819;
  --accent: #7FB8A4; --on-accent: #161B18; --mark: #E2C063; --mark-ink: #161B18;
  --shadow: 0 12px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #161B18; --cabinet: #202824; --paper: #1B211E; --card: #232A26;
    --line: #3A443D; --ink: #E7ECE4; --ink-soft: #A9B4AA;
    --wood: #5E3C27; --wood-light: #7A5136; --wood-dark: #3F2819;
    --accent: #7FB8A4; --on-accent: #161B18; --mark: #E2C063; --mark-ink: #161B18;
    --shadow: 0 12px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 16px/1.5 var(--sans); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linklike { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linklike:focus-visible { outline: 3px solid var(--accent); }
mark { background: var(--mark); color: var(--mark-ink); border-radius: 2px; padding: 0 1px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-200%); background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { transform: none; }

/* ---------- Bilah atas ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--wall); border-bottom: 1px solid transparent; }
.topbar.is-stuck { border-bottom-color: var(--line); }
.topbar__row { display: flex; align-items: center; gap: 20px; padding-top: 16px; padding-bottom: 16px; }
.logo { font: 700 30px/1 var(--serif); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.search { position: relative; flex: 1 1 360px; max-width: 620px; display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; }
.search:focus-within { border: 2px solid var(--accent); padding: 0 13px; }
.search__icon { width: 18px; height: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__kbd { font: 500 12px var(--sans); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 7px; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: transparent; font-weight: 500; text-decoration: none; color: var(--ink); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn--primary[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--ghost { border-radius: 22px; }
.theme { margin-left: auto; }
.rakku { margin-left: auto; position: relative; text-decoration: none; color: var(--ink); }
.rakku + .theme, .rakku + .akun, .akun + .theme { margin-left: 0; }
.akun { position: relative; color: var(--ink); max-width: 180px; }
#akunLabel { overflow: hidden; text-overflow: ellipsis; }
.akun__av { display: inline-flex; flex: none; }
.akun__av .avatar--kecil { width: 26px; height: 26px; margin-left: -6px; }
.avatar { display: block; width: 100%; height: 100%; }
/* gaya ikon tombol (.btn svg, .akun svg: stroke & fill diwariskan) tidak boleh ikut ke gambar avatar:
   kalau ikut, setiap bentuk di avatar mendapat garis tepi warna teks (bintik hitam/putih di pinggirnya) */
svg.avatar.avatar { fill: initial; stroke: none; stroke-width: initial; stroke-linecap: initial; stroke-linejoin: initial; }
.akun svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rakku svg, .theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.rakku__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font: 700 11px/20px var(--sans); text-align: center; }

/* ---------- Saran saat mengetik ---------- */
.suggest { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px 0; max-height: 70vh; overflow: auto; z-index: 30; }
.suggest__group { padding: 6px 16px 2px; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.suggest__item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; }
.suggest__item[aria-selected="true"], .suggest__item:hover { background: var(--wall); }
.suggest__thumb { flex: 0 0 26px; height: 39px; border-radius: 2px 3px 3px 2px; }
.suggest__meta { font-size: 12px; color: var(--ink-soft); }
.suggest__hint { margin-top: 4px; padding: 8px 16px 4px; border-top: 1px solid var(--wall); font-size: 12px; color: var(--ink-soft); }

/* ---------- Filter ---------- */
.filters { display: grid; gap: 12px; margin-bottom: 32px; }
.filters .seg { justify-self: start; }
.filter-line { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.filter-line__label { flex: none; width: var(--label-w, 70px); line-height: 36px; font: 600 12px/36px var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); }
.filter-line .chips { flex: 1; min-width: 0; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--cabinet); border-radius: 22px; }
.seg button { min-height: 36px; padding: 0 18px; border: 0; border-radius: 18px; background: transparent; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip small { color: inherit; opacity: .65; margin-left: 4px; }

/* ---------- Tata letak ---------- */
.layout__main { min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font: 700 22px/1.25 var(--serif); }
/* Type & Availability: dua tombol pilihan bersebelahan (ringkas seperti Sort by, gaya pil seperti tombol segmen) */
.shelf-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 16px; }
.shelf-controls[hidden] { display: none; }
.pilih { position: relative; }
.pilih__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 14px; border: 0;
  border-radius: 22px; background: var(--cabinet); color: var(--ink); cursor: pointer; }
.pilih__btn:hover .pilih__nilai { filter: brightness(1.08); }
.pilih__label { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.pilih__nilai { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 18px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; white-space: nowrap; }
.pilih__panah { color: var(--ink-soft); transition: transform .15s; }
.pilih__btn[aria-expanded="true"] .pilih__panah { transform: rotate(180deg); }
.pilih__menu { position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: 0; min-width: 100%;
  display: grid; gap: 2px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .14); }
.pilih__menu[hidden] { display: none; }
.pilih__menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px;
  padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font-weight: 500;
  text-align: start; white-space: nowrap; cursor: pointer; }
.pilih__menu button:hover, .pilih__menu button:focus-visible { background: var(--cabinet); }
.pilih__menu button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg__n { font-style: normal; font-size: 12px; opacity: .7; margin-inline-start: 2px; }
.seg__n:empty { display: none; }
.section-head__note { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.sort select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }

/* ---------- Pembuka + cari dari cerita (satu blok) ---------- */
.story { margin: 8px 0 22px; padding: 26px 28px 22px; border-radius: 18px; background: var(--cabinet); }
.story__intro h1 { margin: 0 0 6px; font: 700 clamp(24px, 3vw, 30px)/1.2 var(--serif); letter-spacing: -.01em; }
.story__intro p { margin: 0 0 20px; color: var(--ink-soft); max-width: 62ch; }
.story__label { display: block; font: 600 14px var(--sans); margin-bottom: 8px; }
.story__row { display: flex; gap: 10px; align-items: stretch; }
.story textarea { flex: 1; min-width: 0; resize: vertical; min-height: 52px; max-height: 160px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 400 16px/1.45 var(--sans); }
.story textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.story .btn--primary { align-self: stretch; min-height: 52px; }
.story__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.story__examples button { border: 1px dashed var(--line); background: transparent; color: var(--ink); border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.story__examples button:hover { border-color: var(--accent); color: var(--accent); }
.section-head__alt { margin: 4px 0 0; font-size: 14px; }
.section-head__alt button { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.book__why { font-size: 12px; line-height: 1.35; color: var(--ink-soft); }
.book__kutipan { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font: italic 12px/1.4 var(--serif); color: var(--ink-soft); }
.book__why b { color: var(--ink); font-weight: 600; text-decoration: underline 2px color-mix(in srgb, var(--mark) 85%, transparent);
  text-underline-offset: 3px; }

.moods-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.moods-inline button { all: unset; cursor: pointer; font-size: 13px; padding: 3px 10px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.moods-inline button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.moods-inline button:focus-visible { outline: 3px solid var(--accent); }
.cw { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--paper); }
.cw summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; list-style: none; }
.cw summary::-webkit-details-marker { display: none; }
.cw summary::before { content: "!"; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--sans);
  background: var(--mark); color: var(--mark-ink); }
.cw summary::after { content: attr(data-buka); margin-left: auto; font-weight: 500; font-size: 13px; color: var(--accent); }
.cw[open] summary::after { content: attr(data-tutup); }
.cw p { margin: 0 0 12px; font-size: 14px; }
.cw .muted { color: var(--ink-soft); font-size: 13px; }
.badge--offline { border-color: var(--line); }


/* ---------- Suasana ---------- */
.chip--mood { display: inline-flex; align-items: center; gap: 7px; }
.chip--mood::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); }
.chip--mood[aria-pressed="true"]::before { background: var(--paper); }

/* ---------- Deretan yang bisa digeser (rekomendasi, lanjutkan membaca) ---------- */
.row-scroll { position: relative; }
.related.related--row { display: grid; grid-auto-flow: column; grid-auto-columns: 124px; grid-template-columns: none; gap: 18px;
  overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.related--row::-webkit-scrollbar, .reading::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.related--row > button { scroll-snap-align: start; }
.related--row .cover__tim { display: none; }
.related small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related small i { font-style: normal; color: var(--ink); font-weight: 600; }
.reading { scrollbar-width: none; }

/* ---------- Offline ---------- */
.offline { background: var(--mark); color: var(--mark-ink); font-weight: 600; font-size: 14px; padding: 8px 0; text-align: center; }

/* ---------- Lanjutkan membaca ---------- */
.link-more { font-weight: 600; font-size: 14px; text-underline-offset: 3px; }
.reading { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 300px); gap: 14px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: thin; }
.reading__card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 14px 10px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; min-width: 0; }
.reading__card:hover { border-color: var(--accent); }
.reading__card .cover__title { font-size: 8px; } .reading__card .cover__author, .reading__card .cover__tag, .reading__card .cover__tim { display: none; }
/* pita "Tim Bookshelf" di atas sampul buku contoh */
.cover__tim { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; background: var(--accent); color: var(--on-accent);
  font: 700 9px/12px var(--sans); letter-spacing: .04em; text-transform: uppercase; text-align: center; white-space: nowrap; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
/* sampul bergambar sudah menulis jenis (Komik/Novel) di bagian atasnya, jadi label KOMIK tidak perlu */
.cover--tim:not(.cover--made) .cover__tag { display: none; }
.cover--tim .cover__prog, .cover--tim .cover__done { bottom: 24px; }
.related .cover__tim { display: none; }
.badge.badge--tim { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.reading__info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.reading__info b { font-size: 14px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reading__info small { font-size: 12px; color: var(--ink-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reading__go { font-size: 13px; font-weight: 600; color: var(--accent); }
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ---------- Rakku & seri ---------- */
.viewbar { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 20px; }
.viewbar__head h1 { margin: 0; font: 700 clamp(26px, 3.2vw, 34px)/1.15 var(--serif); }
.viewbar__head p { margin: 4px 0 0; color: var(--ink-soft); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0;
  border-bottom: 3px solid transparent; background: transparent; color: var(--ink-soft); font-weight: 600; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs small { min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--cabinet); color: var(--ink); font-size: 12px; line-height: 20px; }
.series-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.series-actions span { font-size: 14px; color: var(--ink-soft); }

/* tanda status di sampul */
.cover__prog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .55); overflow: hidden; }
.cover__prog i { display: block; height: 100%; background: var(--accent); }
.cover__done { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 9px; background: var(--accent); color: var(--on-accent);
  font: 700 10px/16px var(--sans); }
.cover__vol { position: absolute; left: 0; top: 8px; padding: 1px 8px 1px 6px; border-radius: 0 9px 9px 0; background: rgba(0,0,0,.62); color: #fff; font: 700 11px/18px var(--sans); }

/* pilihan status di detail */
.status { position: relative; display: inline-flex; }
.status select { appearance: none; -webkit-appearance: none; min-height: 48px; padding: 0 40px 0 18px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--paper); font-weight: 600; cursor: pointer; }
.status select.is-set { border-color: var(--accent); color: var(--accent); }
.status::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; color: var(--ink-soft); }
.facts dd button { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.facts dd button:focus-visible { outline: 3px solid var(--accent); }

/* ---------- Kartu penulis ---------- */
.authors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.authors__label { font: 600 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-right: 4px; }
.author-card { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 6px; border: 1px solid var(--line);
  border-radius: 24px; background: var(--paper); text-align: left; }
.author-card__avatar { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; background: var(--accent);
  color: var(--on-accent); font: 700 15px var(--serif); }
.author-card small { display: block; color: var(--ink-soft); font-size: 12px; }

/* ---------- Rak (lemari kayu, sampul menghadap depan) ---------- */
.cabinet { --cover-w: 112px; border: 12px solid var(--wood); border-bottom-width: 14px; border-radius: 6px; background: var(--cabinet);
  box-shadow: inset 0 10px 22px rgba(0, 0, 0, .12); padding: 22px 20px 6px; overflow: hidden;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cover-w), 1fr)); column-gap: 24px; row-gap: 18px; }
.book { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.book__btn { all: unset; cursor: pointer; display: block; position: relative; padding-bottom: 14px; border-radius: 4px; }
.book__btn::after { /* papan rak di bawah sampul, menyambung ke buku sebelahnya */
  content: ""; position: absolute; left: -12px; right: -12px; bottom: 0; height: 14px;
  background: linear-gradient(var(--wood-light), var(--wood) 45%, var(--wood-dark)); }
.book__btn:focus-visible { outline: none; }
.book__btn:focus-visible .cover { outline: 3px solid var(--accent); outline-offset: 3px; }
.book__btn:hover .cover, .book.is-active .cover { transform: translateY(-8px); }
.book.is-active .cover { outline: 3px solid var(--accent); outline-offset: 3px; }
.book__title { font-weight: 600; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book__author { font-size: 12px; color: var(--ink-soft); line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.book__badge { align-self: flex-start; margin-top: 2px; font: 600 11px var(--sans); color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 0 7px; }

.cover { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 2px 6px 6px 2px; overflow: hidden;
  box-shadow: 3px 4px 8px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.2, .8, .2, 1); background: var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover--made { display: flex; flex-direction: column; justify-content: space-between; padding: 12% 10% 10% 14%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, 0) 7%), var(--bg); color: var(--fg); }
.cover--made::before { content: ""; border-top: 2px solid currentColor; opacity: .55; }
.cover__title { font: 700 clamp(11px, 1.2vw, 14px)/1.2 var(--serif); overflow-wrap: anywhere; }
.cover__author { font: 500 9px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.cover__tag { position: absolute; top: 6px; right: 6px; font: 700 9px var(--sans); letter-spacing: .06em; text-transform: uppercase;
  background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding: 2px 5px; }
.cover__lang { position: absolute; top: 6px; left: 6px; font: 700 9px var(--sans); letter-spacing: .06em;
  padding: 2px 5px; border-radius: 4px; background: rgb(255 255 255 / .92); color: #1d2b25; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
[dir=rtl] .cover__lang { left: auto; right: 6px; }
.reading__card .cover__lang, .koleksi-kartu__sampul .cover__lang { display: none; }

.skeleton .cover { background: var(--line); animation: pulse 1.2s ease-in-out infinite alternate; box-shadow: none; }
.skeleton .book__title, .skeleton .book__author { height: 10px; border-radius: 5px; background: var(--line); }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

.empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); }
.empty h3 { margin: 0 0 6px; font: 700 18px var(--serif); }
.empty p { margin: 0 0 12px; color: var(--ink-soft); }

/* ---------- Kartu genre (dengan ilustrasi) ---------- */
/* satu baris yang digeser ke samping (4 kartu terlihat di layar lebar, kartu berikutnya mengintip di layar kecil) */
.genre-grid { --kolom: 4; --jarak: 16px; display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--kolom) - 1) * var(--jarak)) / var(--kolom)); gap: var(--jarak);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px 2px 10px; margin: -4px -2px -10px; scroll-padding-inline: 2px; }
.genre-grid::-webkit-scrollbar { display: none; }
.genre-grid > .genre-card { scroll-snap-align: start; }
@media (min-width: 901px) and (max-width: 1100px) { .genre-grid { --kolom: 3; } }
/* panah di sisi kiri dan kanan deretan, di tengah tinggi kartu */
.geser { position: relative; }
.geser__btn { position: absolute; top: calc(50% - 3px); z-index: 2; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  transition: opacity .2s, border-color .15s, color .15s, transform .15s; }
.geser__btn--kiri { left: -20px; }
.geser__btn--kanan { right: -20px; }
[dir="rtl"] .geser__btn--kiri { left: auto; right: -20px; }
[dir="rtl"] .geser__btn--kanan { right: auto; left: -20px; }
.geser__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-50%) scale(1.06); }
.geser__btn:disabled { opacity: 0; pointer-events: none; }   /* di ujung deretan panahnya disembunyikan */
.geser__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.geser__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .geser__btn svg { transform: scaleX(-1); }
.genre-card { all: unset; cursor: pointer; position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 12px;
  display: flex; flex-direction: column; justify-content: flex-end; background: var(--bg); color: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14); transition: transform .2s ease, box-shadow .2s ease; }
.genre-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.genre-card::after { /* gradasi warna genre supaya teks selalu terbaca */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--fade, var(--bg)) 0%, color-mix(in srgb, var(--fade, var(--bg)) 92%, transparent) 34%, transparent 68%); }
.genre-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.genre-card:hover img { transform: scale(1.05); }
.genre-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.genre-card__text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.genre-card__name { font: 700 21px/1.2 var(--serif); }
.genre-card__desc { font-size: 13px; line-height: 1.35; opacity: .92; }
.genre-card__count { margin-top: 2px; font-size: 12px; font-weight: 600; opacity: .9; }

/* ---------- Jendela detail (modal di tengah) ---------- */
body:has(.modal[open]) { overflow: hidden; }
.modal { width: min(860px, calc(100% - 48px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 16px;
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); overflow: hidden; }
.modal::backdrop { background: rgba(22, 27, 24, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .22s cubic-bezier(.2, .8, .2, 1); }
.modal[open]::backdrop { animation: fade-in .22s ease; }
.modal.is-switching .modal__hero, .modal.is-switching .modal__body { animation: fade-in .18s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal__inner { position: relative; display: flex; flex-direction: column; max-height: inherit; overflow: auto; overscroll-behavior: contain; }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 85%, transparent); display: grid; place-items: center; }
.modal__close svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.modal__hero { display: grid; grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 28px; row-gap: 16px; align-items: end; padding: 40px 32px 28px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--book-bg) 30%, var(--paper)) 0%, var(--paper) 100%); }
.modal__cover { flex: 0 0 190px; grid-row: 1 / 3; align-self: end; }
.modal__cover .cover { box-shadow: 6px 10px 24px rgba(0, 0, 0, .35); }
.cover-note { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 8px 0 0;
  font-size: 11px; color: var(--ink-soft); text-align: center; }
.cover-note svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.modal__covernote { margin: 14px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); font-size: 13px;
  color: var(--ink-soft); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 6px 6px 0; }
.modal__covernote--warn { border-left-color: #d9a13a; background: rgba(233, 176, 60, .10); }
.modal__covernote + .modal__covernote { margin-top: 8px; }
.modal__ket { display: flex; flex-direction: column; gap: 8px; }
.modal__ket .modal__covernote { margin: 0; }
.modal__cover .cover__title { font-size: 20px; }
.modal__cover .cover__author { font-size: 11px; }
.modal__info { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-right: 32px; }
.modal__kicker { font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.modal__title { margin: 0; font: 700 clamp(26px, 3.4vw, 36px)/1.15 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; outline: none; }
.modal__authors { font-size: 16px; color: var(--ink-soft); }
.modal__authors button { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.modal__authors button:focus-visible { outline: 3px solid var(--accent); }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; grid-column: 2; }
.btn--lg { min-height: 48px; padding: 0 24px; font-size: 16px; }
.badge { align-self: flex-start; font: 600 12px var(--sans); border-radius: 12px; padding: 2px 10px; border: 1px solid var(--line); color: var(--ink-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge--on { border-color: var(--accent); color: var(--accent); }
.badge--warn { border-color: #c9922e; color: #9a6a12; background: rgba(233, 176, 60, .12); }
.modal__body { padding: 4px 32px 24px; display: flex; flex-direction: column; gap: 24px; }
.modal__label { margin: 0 0 8px; font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.modal__synopsis { margin: 0; font: 400 18px/1.65 var(--serif); max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 24px; margin: 0;
  padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.related { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.related button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.related button:hover .cover { transform: translateY(-4px); }
.related button:focus-visible .cover { outline: 3px solid var(--accent); outline-offset: 2px; }
.related .cover__author { display: none; }
.related .cover__title { font-size: 11px; }
.related__title { font-weight: 600; font-size: 13px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.related small { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.modal__nav { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--paper); border-top: 1px solid var(--line); }
.navbtn { display: flex; align-items: center; gap: 6px; min-height: 44px; max-width: 40%; padding: 0 12px; border: 0; border-radius: var(--radius);
  background: transparent; font-weight: 500; }
.navbtn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.navbtn svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.navbtn:hover:not(:disabled) { background: var(--wall); }
.navbtn:disabled { color: var(--ink-soft); opacity: .5; cursor: default; }
.modal__pos { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; width: max-content; max-width: calc(100vw - 32px); text-align: center; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 20px; font-weight: 500; z-index: 60; }
.footer { margin-top: 56px; border-top: 6px solid var(--wood); background: var(--cabinet); color: var(--ink-soft); font-size: 14px; }
.footer__isi { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(140px, 1fr)) minmax(220px, 1.4fr);
  gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.footer__logo { font-size: 26px; }
.footer__merek p { margin: 12px 0 16px; line-height: 1.6; max-width: 34ch; }
.footer h2 { margin: 4px 0 12px; font: 600 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__kolom a, .footer__bawah a { color: var(--ink-soft); text-decoration: none; }
.footer__kolom a:hover, .footer__bawah a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer__catatan p { margin: 0 0 10px; line-height: 1.6; }
.footer__catatan b { color: var(--ink); font-weight: 600; }
.footer__catatan p a { text-decoration: underline; text-underline-offset: 3px; }
.footer__bawah { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  position: relative; padding-top: 16px; padding-bottom: 24px; font-size: 13px; }
.footer__bawah::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; border-top: 1px solid var(--line); }
.footer__atas { display: inline-flex; align-items: center; gap: 6px; }
.footer__atas svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1100px) {
  .footer__isi { grid-template-columns: repeat(3, 1fr); }
  .footer__merek, .footer__catatan { grid-column: 1 / -1; }
  .footer__merek p, .footer__catatan { max-width: 60ch; }
}
@media (max-width: 640px) {
  .footer { margin-top: 40px; }
  .footer__isi { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-top: 32px; }
  .footer__bawah { flex-direction: column; align-items: flex-start; }
  .footer__bawah::before { left: 16px; right: 16px; }
}

/* ---------- HP ---------- */
@media (max-width: 900px) and (min-width: 641px) {
  .genre-grid { --kolom: 2.4; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar__row { flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 12px; }
  .logo { font-size: 26px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search__kbd { display: none; }
  .story__row { flex-direction: column; }
  .story .btn--primary { min-height: 48px; }
  .story__examples { flex-wrap: nowrap; overflow-x: auto; margin: 10px -14px 0; padding: 0 14px 2px; scrollbar-width: none; }
  .story__examples button { flex: none; }
  .story { padding: 18px 16px 16px; }
  .story__intro p { margin-bottom: 14px; }
  .filter-line { flex-direction: column; align-items: stretch; gap: 4px; }
  .filter-line__label { line-height: 1.4; width: auto; }
  .related.related--row { grid-auto-columns: 104px; gap: 14px; margin: 0 -16px; padding: 4px 16px 6px; }
  .filters .seg { justify-self: stretch; }
  .pilih { flex: 1 1 0; min-width: 0; }
  /* layar sempit: label di atas nilainya, supaya "Not available" tidak terpotong */
  .pilih__btn { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "nilai panah";
    row-gap: 2px; padding: 6px 10px 6px 12px; border-radius: 18px; text-align: start; }
  .pilih__label { grid-area: label; padding-inline-start: 2px; }
  .pilih__nilai { grid-area: nilai; justify-self: start; max-width: 100%; min-height: 32px; padding: 0 12px;
    overflow: hidden; text-overflow: ellipsis; }
  .pilih__panah { grid-area: panah; }
  .theme span, .rakku span, #akunLabel { display: none; }
  .theme, .rakku, .akun { width: 44px; padding: 0; }
  /* sudah masuk: fotonya mengisi tombol bulat (tanpa lingkaran ganda), titik status di pojok kanan bawah */
  .akun:has(.avatar--kecil) { border-color: transparent; overflow: visible; }
  .akun__av .avatar--kecil { width: 44px; height: 44px; margin: 0; }
  .akun .akun__dot { position: absolute; top: auto; right: 0; bottom: 0; width: 12px; height: 12px; box-shadow: 0 0 0 2px var(--wall); }
  .cover__tim { font-size: 8px; letter-spacing: 0; padding: 3px 2px; }
  .rakku__n { position: absolute; top: 2px; right: -2px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; font-size: 10px; }
  .reading { grid-auto-columns: 78%; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .status, .status select { flex: 1; }
  .filters { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .filters > * { min-width: 0; }
  .seg button { flex: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .cabinet { --cover-w: 88px; column-gap: 16px; padding: 18px 14px 4px; border-width: 10px; }
  .book__btn::after { left: -8px; right: -8px; }
  .modal { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .modal[open] { animation: sheet-in .25s cubic-bezier(.2, .8, .2, 1); }
  .modal__hero { grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; padding: 64px 20px 20px; }
  .modal__cover { grid-row: 1; }
  .modal__cover { flex-basis: auto; }
  .modal__cover .cover__title { font-size: 13px; }
  .modal__cover .cover__author { font-size: 8px; }
  .modal__info { padding-right: 0; }
  .modal__actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; }
  .modal__actions > :first-child:not(.status) { grid-column: 1 / -1; }
  .modal__body { padding: 4px 20px 20px; }
  .modal__synopsis { font-size: 17px; }
  .related { grid-template-columns: repeat(5, 96px); overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .genre-grid { --kolom: 1.6; --jarak: 10px; margin: -4px -16px -10px; padding: 4px 16px 10px; scroll-padding-inline: 16px; }
  .geser__btn { display: none; }        /* di HP cukup digeser dengan jari */
  .genre-card__text { padding: 10px 12px; }
  .genre-card__name { font-size: 16px; }
  .genre-card__desc { display: none; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- akun (tahap 4) */
.akun__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.akun__dot[data-status="menyinkron"] { background: #d9a13a; animation: denyut 1s ease-in-out infinite alternate; }
.akun__dot[data-status="gagal"] { background: #c0473b; }
@keyframes denyut { to { opacity: .35; } }
.modal--akun { width: min(440px, calc(100% - 32px)); }
.akun__box { position: relative; padding: 32px 28px 24px; overflow: auto; max-height: inherit; }
.akun__tutup { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; cursor: pointer; }
.akun__tutup:hover { background: var(--cabinet); }
.akun__tutup svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.akun__judul { margin: 0 44px 6px 0; font: 700 26px/1.2 var(--serif); overflow-wrap: anywhere; }
.akun__lead { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.akun__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 12px; background: var(--cabinet); }
.akun__tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font: 600 14px var(--sans); cursor: pointer; }
.akun__tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.akun__form { display: flex; flex-direction: column; gap: 6px; }
.akun__form--sub { margin: 10px 0 6px; padding: 14px; border-radius: 12px; background: var(--cabinet); }
.akun__field { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.akun__field i { font-weight: 400; font-style: normal; color: var(--ink-soft); }
.akun__field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 16px var(--sans); }
.akun__field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.akun__hint, .akun__catatan { color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.akun__catatan { margin: 8px 0 0; }
.akun__pesan { margin: 6px 0 0; min-height: 1em; color: #c0473b; font-size: 14px; font-weight: 600; }
.akun__pesan:empty { display: none; }
.akun__kirim { margin-top: 12px; }
.akun__sinkron { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--cabinet); font-size: 14px; }
.akun__sinkron span { flex: 1 1 140px; }
.btn--kecil { min-height: 36px; padding: 0 12px; font-size: 13px; }
.akun__menu { list-style: none; margin: 16px 0; padding: 0; border-top: 1px solid var(--line); }
.akun__menu > li { border-bottom: 1px solid var(--line); }
.akun__link { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0; border: 0; background: none; color: var(--ink);
  font: 500 15px var(--sans); text-decoration: none; text-align: left; cursor: pointer; }
.akun__link:hover { color: var(--accent); }
.akun__link--bahaya, .akun__link--bahaya:hover { color: #c0473b; }
.akun__hapus { background: #c0473b; border-color: #c0473b; color: #fff; font-weight: 600; }
.akun__keluar { width: 100%; }

/* ---------------------------------------------------------------- sorotan & penanda (Rakku, detail buku) */
.cabinet.is-notes { display: block; border: 0; background: none; padding: 0; box-shadow: none; }
.notes-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.notes-book { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.notes-book__head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.notes-book__cover { flex: none; width: 56px; padding: 0; border: 0; background: none; cursor: pointer; --cover-w: 56px; }
.notes-book__cover .cover { width: 56px; }
.notes-book__cover .cover__title { font-size: 8px; } .notes-book__cover .cover__author { display: none; }
.notes-book h3 { margin: 0; font: 700 18px/1.25 var(--serif); }
.notes-book p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; }
.hl-list { list-style: none; margin: 0; padding: 0; }
.hl { border-top: 1px solid var(--line); }
.hl a { display: flex; flex-direction: column; gap: 5px; padding: 10px 6px; color: var(--ink); text-decoration: none; border-radius: 8px; }
.hl a:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hl__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.hl__meta svg { width: 13px; height: 13px; fill: var(--accent); stroke: none; }
.hl__swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--w, #F2C94C); flex: none; }
.hl[data-warna="kuning"] { --w: #F2C94C; } .hl[data-warna="hijau"] { --w: #6FCF97; } .hl[data-warna="biru"] { --w: #56A8F5; } .hl[data-warna="merah"] { --w: #F28BB0; }
.hl__quote { font: 400 15px/1.55 var(--serif); quotes: "“" "”"; padding-left: 10px; border-left: 3px solid var(--w, #F2C94C);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.hl__note { font-size: 14px; line-height: 1.5; color: var(--ink-soft); white-space: pre-wrap; }
.hl__note::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
.hl-list--compact .hl__quote { -webkit-line-clamp: 3; font-size: 14px; }
.modal__notes .hl-list { max-height: 340px; overflow: auto; }
@media (max-width: 600px) {
  .modal--akun { width: 100%; }
  .akun__box { padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- halaman masuk (wajib masuk) */
body.gerbang { min-height: 100vh; background: var(--wall); }
.gerbang__wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.gerbang__intro { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 48px; color: #F6F7F2; background: #1F2B25; }
.gerbang__art { position: absolute; inset: 0; background: url("/static/genres/fantasi.webp?v=3") center/cover no-repeat; }
.gerbang__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 24, 21, .1) 30%, rgba(18, 24, 21, .88) 100%); }
.gerbang__copy { position: relative; max-width: 480px; }
.gerbang__logo { display: inline-block; color: #F6F7F2; font-size: 44px; margin-bottom: 12px; }
.gerbang__tag { margin: 0 0 18px; font: 400 22px/1.35 var(--serif); }
.gerbang__fitur { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; opacity: .92; }
.gerbang__fitur li { padding-left: 22px; position: relative; }
.gerbang__fitur li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 7px; height: 7px; border-radius: 2px; background: #9fd3bf; transform: rotate(45deg); }
.gerbang__kartu { box-sizing: border-box; align-self: center; justify-self: center; width: min(420px, calc(100% - 48px)); padding: 40px 0; }
.gerbang__logo--kecil { display: none; margin-bottom: 18px; }
.gerbang__judul { margin: 0 0 6px; font: 700 32px/1.15 var(--serif); }
.gerbang__lead { margin: 0 0 22px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.gerbang__catatan { margin: 18px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.gerbang__langkah { margin: -8px 0 16px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }
.gerbang__langkah[hidden], .gerbang__catatan[hidden] { display: none; }
.gerbang__catatan--pulih { margin: 0 0 16px; }
.gerbang .akun__kirim { min-height: 48px; font-size: 16px; }
.gerbang__baris { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.gerbang__baris .akun__field span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sandi { display: flex; gap: 6px; font-weight: 400; }
.sandi input { flex: 1; min-width: 0; }
.sandi__lihat { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-soft); font: 600 13px var(--sans); cursor: pointer; }
.sandi__lihat:hover { color: var(--ink); }
@media (max-width: 820px) {
  .gerbang__wrap { grid-template-columns: 1fr; }
  .gerbang__intro { display: none; }
  .gerbang__baris { grid-auto-flow: row; gap: 6px; }
  .gerbang__kartu { align-self: start; padding: 48px 0 32px; }
  .gerbang__logo--kecil { display: inline-block; }
}

/* ---------------------------------------------------------------- tamu: ajakan masuk */
.tamu { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; padding: 10px 12px 10px 16px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.tamu[hidden] { display: none; }
.tamu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.tamu p { flex: 1; margin: 0; line-height: 1.45; color: var(--ink-soft); }
.tamu b { color: var(--ink); }
.tamu .btn { flex: none; min-height: 38px; padding: 0 16px; text-decoration: none; }
.tamu:not([hidden]) + .story { margin-top: 0; }
@media (max-width: 600px) {
  .tamu { flex-wrap: wrap; padding: 12px 14px; }
  .tamu p { flex: 1 1 calc(100% - 30px); }
  .tamu .btn { flex: 1; }
}
.empty__aksi { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0 !important; }
.empty__aksi .btn { text-decoration: none; }
.modal__actions .btn svg, .btn svg { flex: none; }
.gerbang__kembali { margin: 14px 0 0; font-size: 14px; }
.gerbang__kembali a { color: var(--accent); font-weight: 600; text-decoration: none; }
.gerbang__kembali a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- lupa kata sandi & kode pemulihan */
.gerbang__lupa { margin: 10px 0 0; text-align: center; font-size: 14px; }
.kode { display: flex; flex-direction: column; gap: 12px; }
.kode__info { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.kode__info b { color: var(--ink); }
.kode__isi { display: block; padding: 16px; border: 2px dashed var(--accent); border-radius: 12px; background: var(--paper);
  font: 700 22px/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .08em; text-align: center; user-select: all; }
.kode__aksi { display: flex; gap: 8px; }
.kode__aksi .btn { flex: 1; }
.kode__cek { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.kode__cek input { width: 18px; height: 18px; accent-color: var(--accent); }
.akun .kode, .akun__box .kode { margin-top: 10px; }
.akun__peringatan { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(233, 176, 60, .14); border: 1px solid rgba(201, 146, 46, .45); font-size: 13px; line-height: 1.5; }

/* ---------------------------------------------------------------- koleksi */
.koleksi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.koleksi-kartu { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
button.koleksi-kartu:hover { border-color: var(--accent); }
.koleksi-kartu__sampul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; min-height: 72px; margin-bottom: 8px; --cover-w: 40px; }
.koleksi-kartu__sampul .cover { width: 100%; }
.koleksi-kartu__sampul .cover__title { font-size: 6px; } .koleksi-kartu__sampul .cover__author, .koleksi-kartu__sampul .cover__tag, .koleksi-kartu__sampul .cover__tim { display: none; }
.koleksi-kartu__kosong { grid-column: 1 / -1; display: grid; place-items: center; min-height: 72px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 13px; }
.koleksi-kartu b { font: 700 16px var(--serif); }
.koleksi-kartu small { color: var(--ink-soft); }
.koleksi-baru { cursor: default; justify-content: center; gap: 8px; }
.koleksi-baru input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 15px var(--sans); }
.koleksi-pilih { position: relative; }
.koleksi-menu { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; min-width: 240px; max-height: 280px; overflow: auto; padding: 8px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.koleksi-menu label { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.koleksi-menu label:hover { background: var(--cabinet); }
.koleksi-menu input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.koleksi-menu__kosong { margin: 6px 8px; color: var(--ink-soft); font-size: 13px; }
.koleksi-menu form { display: flex; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.koleksi-menu form input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 14px var(--sans); }
.koleksi-menu form button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.notes-book__head { position: relative; }
.notes-book__ekspor { margin-left: auto; align-self: flex-start; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-soft);
  font: 600 12px var(--sans); padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.notes-book__ekspor:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- statistik */
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.stat__kartu { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat__kartu h3 { margin: 0 0 8px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.stat__besar { margin: 0; font: 700 40px/1.1 var(--serif); }
.stat__besar small { font: 500 15px var(--sans); color: var(--ink-soft); }
.stat__ket { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }
.stat__bar { height: 10px; margin-top: 12px; border-radius: 5px; background: var(--cabinet); overflow: hidden; }
.stat__bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.stat__form { display: flex; gap: 8px; margin-top: 12px; }
.stat__form input { width: 90px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 15px var(--sans); }
.stat__grafik { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; margin-top: 12px; align-items: end; }
.stat__grafik span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.stat__grafik i { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: var(--accent); }
.stat__grafik i.nol { background: var(--cabinet); }
.stat__grafik small { font-size: 11px; color: var(--ink-soft); }
.stat__lebar { grid-column: 1 / -1; }
.stat__buku { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.stat__buku .notes-book__cover { width: 64px; --cover-w: 64px; }
.stat__buku .cover { width: 64px; }
@media (max-width: 600px) { .koleksi-grid { grid-template-columns: 1fr 1fr; } .stat { grid-template-columns: 1fr; } }
.btn--ikon { width: 44px; padding: 0; }

.offline-slot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.offline-slot:empty { display: none; }
.offline-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.offline-ok svg, .offline-slot .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gerbang #hintUser { margin-top: -4px; line-height: 1.25; }

/* ---------- profil: karakter & warna ---------- */
.akun__kepala { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.akun__kepala .akun__judul { margin-right: 44px; }
.akun__kepala .akun__lead { margin-bottom: 8px; }
.akun__avbesar { width: 84px; height: 84px; flex: none; border-radius: 50%; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--line); }
.akun__kepala-teks { min-width: 0; }
.profil { margin-bottom: 14px; }
.profil__set { border: 0; margin: 0; padding: 0; min-width: 0; }
.profil__set legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.profil__karakter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .profil__karakter { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; } }
.profil__tab { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.profil__tab button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 500 13px var(--sans); cursor: pointer; }
.profil__tab button span { color: var(--ink-soft); font-size: 12px; }
.profil__tab button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.profil__tab button[aria-selected="true"] span { color: inherit; opacity: .8; }
.profil__grup { margin: 12px 0 6px; font-size: 12px; color: var(--ink-soft); }
.profil__tab + .profil__grup { margin-top: 2px; }
.profil__opsi { position: relative; aspect-ratio: 1; border-radius: 50%; cursor: pointer; }
.profil__opsi input, .profil__swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.profil__opsi .avatar { border-radius: 50%; transition: transform .12s; }
.profil__opsi:hover .avatar { transform: scale(1.06); }
.profil__opsi:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.profil__opsi:has(input:focus-visible), .profil__swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.profil__nama { margin: 10px 0 0; min-height: 1.4em; font-size: 13px; color: var(--ink-soft); }
.profil__warna { display: grid; grid-template-columns: repeat(6, 32px); gap: 10px; }
.profil__swatch { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--w); cursor: pointer; }
.profil__swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.profil__swatch:has(input:checked)::after { content: ""; position: absolute; left: 11px; top: 7px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.profil__aksi { display: flex; gap: 8px; }
@media (max-width: 480px) { .akun__avbesar { width: 68px; height: 68px; } .profil__warna { grid-template-columns: repeat(6, 30px); gap: 8px; } .profil__swatch { width: 30px; height: 30px; } .profil__swatch:has(input:checked)::after { left: 10px; top: 6px; } }

/* ---------- subgenre ---------- */
.chip--sub span { color: var(--ink-soft); font-size: 12px; margin-left: 2px; }
.chip--sub[aria-pressed="true"] span { color: inherit; opacity: .85; }
.chip--kosong { display: inline-flex; align-items: center; opacity: .55; cursor: default; border-style: dashed; }

/* ---------- pemilih bahasa (static/i18n.js) ---------- */
.bahasa { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); cursor: pointer; }
.bahasa svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bahasa__teks { font: 600 13px var(--sans); letter-spacing: .02em; }
.bahasa select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.bahasa:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar .bahasa { flex: none; }
.footer__bahasa { border: 1px solid var(--line); border-radius: 18px; padding: 6px 12px; background: var(--paper); }
.akun__bahasa { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: default; }
.gerbang__kartu { position: relative; }
.gerbang__bahasa { position: absolute; top: 16px; inset-inline-end: 16px; min-height: 36px; padding: 0 12px; }
@media (max-width: 640px) {
  .topbar .bahasa { width: 44px; padding: 0; }
  .topbar .bahasa .bahasa__teks { display: none; }
}

/* ---------- tata letak kanan-ke-kiri (bahasa Arab) ---------- */
[dir="rtl"] .rakku { margin-left: 0; margin-right: auto; }
[dir="rtl"] .theme { margin-left: 0; }
[dir="rtl"] .rakku + .theme, [dir="rtl"] .rakku + .akun, [dir="rtl"] .akun + .theme { margin-right: 0; }
[dir="rtl"] .akun__av .avatar--kecil { margin-left: 0; margin-right: -6px; }
@media (max-width: 640px) { [dir="rtl"] .akun .akun__dot { right: auto; left: 0; } [dir="rtl"] .akun__av .avatar--kecil { margin: 0; } }
[dir="rtl"] .rakku__n { right: auto; left: -2px; }
/* isi buku (judul, sinopsis, kutipan) tetap mengikuti arah teksnya sendiri, juga di tampilan RTL */
[dir="rtl"] :is(.modal__synopsis, .modal__title, .book__title, .book__author, .related__title, .hl__quote, .hl__note,
  .book__kutipan, .modal__covernote, .reading__info b, .notes-book h3, .story textarea, .koleksi-kartu b) { unicode-bidi: plaintext; text-align: start; }
[dir="rtl"] .navbtn svg { transform: scaleX(-1); }
.modal__terjemah { margin-inline-start: 8px; font: 600 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--accent); }
.asli { margin-top: 8px; }
.asli summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); list-style: none; }
.asli summary::-webkit-details-marker { display: none; }
.asli summary::before { content: "▸ "; }
.asli[open] summary::before { content: "▾ "; }
[dir=rtl] .asli summary::before { content: "◂ "; }
.asli .modal__synopsis { margin-top: 6px; color: var(--ink-soft); }
