html {scrollbar-color:var(--ui-muted) var(--ui-bg)}
html body:not(.reading-room),html body.bg-reading-ui,html body.bg-admin-20261030 {
  background:var(--ui-bg)!important;color:var(--ui-text)!important;
}
body :is(input,select,textarea){accent-color:var(--ui-accent)}
body :is(input,select,textarea)::placeholder {color:var(--ui-muted);opacity:1}
body :is(a,button,summary,input,textarea,select,[tabindex]):focus-visible {
  outline:2px solid var(--ui-text)!important;outline-offset:4px;
}
body :is(button,a,summary){-webkit-tap-highlight-color:transparent}
body :is(.site-header,.nav-row,.mobile-menu,.bottom-nav,.bg-admin-topbar) {
  background:var(--ui-bg)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.site-footer,.reading-footer,.bg-admin-footer) {
  background:var(--ui-sidebar)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.footer-story p,.footer-note,.footer-bottom,.footer-column>a,.footer-connect .access-label) {color:var(--ui-muted)!important}
body :is(.site-footer .brand img,.site-header .brand img,.bg-admin-brand img) {filter:brightness(0)!important}
html[data-theme="dark"] body :is(.site-footer .brand img,.site-header .brand img,.bg-admin-brand img) {filter:brightness(0) invert(1)!important}
body .bg-admin-sidebar {background:var(--ui-sidebar)!important;color:var(--ui-text)!important;border-right:1px solid var(--ui-border)!important}
body .bg-admin-sidebar :is(.bg-admin-nav a,.bg-admin-nav summary,.hm-sidebar-foot) {color:var(--ui-muted)!important}
body .bg-admin-sidebar .bg-admin-nav :is(a,summary):hover {background:var(--ui-soft)!important;color:var(--ui-text)!important}
body .bg-admin-sidebar .bg-admin-nav a[aria-current="page"] {background:var(--ui-soft)!important;color:var(--ui-text)!important;border-left-color:var(--ui-text)!important}
body :is(.search-box,.account-menu-v2,.hm-dropdown-panel,.hm-filter-dialog,.bg-mobile-menu-panel) {
  background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body .search-box input {background:transparent!important;color:var(--ui-text)!important}
body :is(.discovery-nav a,.hm-admin-location span,.hm-visit,.shelf-link,.eyebrow,.library-note) {color:var(--ui-muted)!important}
body .discovery-nav a[aria-current="page"] {color:var(--ui-text)!important;border-bottom-color:var(--ui-text)!important}
body :is(.header-actions,.account-nav-v2,.hm-top-actions) {display:flex;align-items:center;gap:8px}
body .native-account {display:flex;align-items:center}
body :is(.theme-toggle-v2,.account-trigger-v2,.hm-top-actions>.hm-icon-button,.hm-notifications>summary,.hm-account>summary) {
  box-sizing:border-box;display:inline-flex!important;align-items:center;justify-content:center;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  padding:0!important;gap:0!important;line-height:1!important;vertical-align:middle;
  border:1px solid var(--ui-border)!important;border-radius:12px!important;
  background:transparent!important;color:var(--ui-text)!important;box-shadow:none!important;cursor:pointer;
  flex-shrink:0;list-style:none;
}
body :is(.theme-toggle-v2,.account-trigger-v2,.hm-top-actions>.hm-icon-button,.hm-notifications>summary,.hm-account>summary,.mobile-toggle):hover {
  background:var(--ui-soft)!important;border-color:var(--ui-muted)!important;
}
body :is(.theme-toggle-v2,.account-trigger-v2,.hm-top-actions>.hm-icon-button,.hm-notifications>summary,.hm-account>summary,.mobile-toggle) svg {
  display:block;width:22px!important;height:22px!important;flex:none;stroke-width:1.7;
}
body .shelf-link {display:inline-flex;align-items:center;justify-content:center;min-height:44px;gap:8px;padding-inline:10px;border-radius:12px}
body .mobile-toggle {width:44px;height:44px;min-height:44px;padding:10px;border-radius:12px;color:var(--ui-text);background:transparent;border-color:var(--ui-border)}
body .shelf-link:hover {background:var(--ui-soft);color:var(--ui-text)!important}
body .shelf-link svg {display:block;width:22px;height:22px}
body .theme-toggle-icon-wrap {position:relative;display:grid;place-items:center;width:22px;height:22px;line-height:0}
body .theme-toggle-v2 .theme-icon {position:static;inset:auto;width:22px;height:22px;opacity:1;transform:none}
body .theme-toggle-v2 .theme-icon-sun {display:none}
html[data-theme="dark"] body .theme-toggle-v2 .theme-icon-moon {display:none}
html[data-theme="dark"] body .theme-toggle-v2 .theme-icon-sun {display:block}
body .hm-account>summary::-webkit-details-marker {display:none}
body .hm-account>summary::marker {content:""}
body .account-menu-v2 {border-radius:16px;box-shadow:var(--ui-shadow);top:calc(100% + 8px);right:0;left:auto}
body .account-menu-head-v2 {border-radius:10px;color:var(--ui-text);background:var(--ui-soft)}
body .account-avatar-fallback-v2 {background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body :is(.account-menu-group-v2 a,.account-logout-form-v2 button,.hm-dropdown-panel a,.hm-dropdown-panel button) {color:var(--ui-text)!important}
body :is(.account-menu-group-v2 a,.account-logout-form-v2 button,.hm-dropdown-panel a,.hm-dropdown-panel button):hover {background:var(--ui-soft)!important}
body :is(.button.primary,.btn-primary,.reading-button.primary,.bd13-mini-btn.primary,.hm-button:not(.hm-secondary),.bds-button-primary,.bds-button.bds-primary,.bds-button.is-primary,.btv-button.is-primary,.account-button:not(.secondary),.native-filter-submit) {
  color:var(--ui-on-accent)!important;background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;
}
body :is(.button.primary,.btn-primary,.reading-button.primary,.bd13-mini-btn.primary,.hm-button:not(.hm-secondary),.bds-button-primary,.account-button:not(.secondary)):hover {opacity:.88}
body :is(.button.outline,.button.light,.hm-button.hm-secondary,.bds-button:not(.bds-primary):not(.bds-button-primary):not(.is-primary),.btn-secondary,.account-button.secondary,.bd13-mini-btn:not(.primary)) {
  background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.recent-section,.recommend-panel,.small-feature,.curated-card,.knowledge-section,.topic-chip,.book-review-teaser) {
  background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.recent-card,.ranked-book,.book-card,.journal-card,.knowledge-links a,.catalog-sidebar,.bds-card,.sth-card,.nt-card,.cw-card) {
  background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.recent-card strong,.small-feature strong,.curated-card h3,.knowledge-intro h2,.knowledge-links a,.recent-heading h2) {color:var(--ui-text)!important}
body :is(.recent-card small,.small-feature .eyebrow,.small-feature-cta,.curated-card p,.curated-link,.knowledge-intro p,.knowledge-intro .eyebrow) {color:var(--ui-muted)!important}
body .hero-panel {background:var(--ui-strong)!important;border:1px solid var(--ui-border);color:var(--ui-on-strong)!important}
body .hero-panel :is(h2,h2 span,.hero-label,.hero-small,.hero-copy>p) {color:var(--ui-on-strong)!important}
body .hero-panel .status-dot {background:currentColor!important}
body .recommend-art {background:var(--ui-soft)!important;border-color:var(--ui-border)!important}
body .recommend-art :is(span,em) {color:var(--ui-text)!important;text-shadow:none!important}
body .account-intro {background:var(--ui-strong)!important;color:var(--ui-on-strong)!important}
body .account-intro :is(h1,p,a,.account-kicker) {color:var(--ui-on-strong)!important}
body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),select,textarea) {
  background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body .search-box input {background:transparent!important}
body :is(.book-author,.book-author a,.book-author span,.book-author summary,.ui-author,.ui-author a,.ui-author span,.ranked-info>p,.journal-meta,.journal-card-copy>p,.journal-category,.about-native-stats,.about-native-stats span,.breadcrumb,.breadcrumb a,.breadcrumb span,.bottom-nav a) {color:var(--ui-muted)!important}
body .bottom-nav a[aria-current="page"] {color:var(--ui-text)!important}
body :is(.book-save,.journal-art) {background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body .journal-art>span {color:var(--ui-text)!important}
body :is(.current-page,.hm-pagination [aria-current="page"],.reading-pagination [aria-current="page"]) {background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important}
body :is(.book-rank,.recommend-panel .section-heading p,.curated-label) {color:var(--ui-muted)!important}
body .native-mobile-filter {background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body .format-label {background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body .rx-directory-hero {background:var(--ui-strong)!important;color:var(--ui-on-strong)!important}
body .rx-directory-hero :is(h1,h1+p,.rx-directory-breadcrumb,.rx-directory-breadcrumb a) {color:var(--ui-on-strong)!important}
body :is(.shuffle-button,.pagination a,.catalog-pagination a,.discovery-pagination a,.hm-pagination a,.bg-action:not(.bg-action--primary)) {background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body .bg-action.bg-action--primary {background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important}
body .hm-notice-badge {background:var(--ui-accent)!important;color:var(--ui-on-accent)!important}
body .bg-admin-skip:focus {position:fixed!important;left:12px!important;top:12px;z-index:10000;background:var(--ui-surface);color:var(--ui-text);padding:12px 16px}
body[data-theme="dark"].reading-room {background:var(--ui-bg);color:var(--ui-text)}
body:not([class])>main {color:var(--ui-text)}
@media(max-width:700px) {
  body :is(.header-actions,.account-nav-v2,.hm-top-actions) {gap:6px}
  body .shelf-link {padding-inline:4px}
  body .account-menu-v2 {right:0;left:auto;width:min(320px,calc(100vw - 24px))}
}
@media(prefers-reduced-motion:reduce) {
  body :is(.theme-toggle-v2,.account-trigger-v2,.hm-account>summary) {transition:none!important}
}

/* Common aliases also cover any stylesheet retained by a browser cache. */
html body.bg-discovery,html body.bg-admin-20261030,html body.bg-reading-ui {
 --bg:var(--ui-bg)!important;--paper:var(--ui-surface)!important;--card:var(--ui-surface)!important;
 --surface:var(--ui-surface)!important;--surface-2:var(--ui-soft)!important;
 --text:var(--ui-text)!important;--ink:var(--ui-text)!important;--muted:var(--ui-muted)!important;
 --line:var(--ui-border)!important;--indigo:var(--ui-accent)!important;--navy:var(--ui-accent)!important;
 --blue:var(--ui-accent)!important;--primary:var(--ui-accent)!important;--primary-soft:var(--ui-soft)!important;
}
/* Every search is a single continuous surface, including its input. */
body :is(.search-box,.reading-search,.catalog-search,.blog-search-field>div,.article-search,.hm-search-input,.room-search>div) {
 background:var(--ui-search)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;
}
body :is(.search-box,.reading-search,.catalog-search,.blog-search-field,.article-search,.hm-search-input,.room-search) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
 background:transparent!important;background-image:none!important;color:var(--ui-text)!important;
 border-color:transparent!important;box-shadow:none!important;caret-color:var(--ui-text);
}
body :is(.search-box,.reading-search,.blog-search-field,.article-search,.hm-search-input,.room-search) svg {color:var(--ui-muted)!important}
body input:-webkit-autofill { -webkit-text-fill-color:var(--ui-text)!important;caret-color:var(--ui-text);box-shadow:0 0 0 1000px var(--ui-surface) inset!important; }
body :is(.search-box,.reading-search,.blog-search-field,.article-search,.hm-search-input,.room-search) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):-webkit-autofill {
 -webkit-box-shadow:0 0 0 1000px var(--ui-search) inset!important;box-shadow:0 0 0 1000px var(--ui-search) inset!important;
}
body .blog-hero h1 em {color:var(--ui-accent)!important}
body :is(.topic-chip,.knowledge-links a,.shelf-link) :is(.icon,svg) {color:inherit!important}

/* Light mode retains the original BacaGratis blue identity. */
html:not([data-theme="dark"]) body :is(.site-header .brand img,.bg-admin-brand img) {filter:none!important}
html:not([data-theme="dark"]) body .bg-admin-brand img {filter:brightness(0) invert(1)!important}
html:not([data-theme="dark"]) body .hero-panel {background:linear-gradient(135deg,#272a80,#36398a)!important;border-color:#36398a!important}
html:not([data-theme="dark"]) body .hero-panel h2 span {color:#facd76!important}
html:not([data-theme="dark"]) body .hero-panel .status-dot {background:#facd76!important}
html:not([data-theme="dark"]) body :is(.home-intro>.eyebrow,.home-intro .eyebrow,.blog-hero .eyebrow) {color:#272a80!important}
html:not([data-theme="dark"]) body :is(.button.outline,.button.light) {color:#272a80!important}
html:not([data-theme="dark"]) body :is(.discovery-nav a[aria-current="page"],.bottom-nav a[aria-current="page"]) {color:#272a80!important;border-bottom-color:#272a80!important}
html:not([data-theme="dark"]) body :is(.small-feature.family,.curated-card.peach) {background:#fcf0e2!important}
html:not([data-theme="dark"]) body :is(.small-feature.culture,.curated-card.sage) {background:#eaf1e9!important}
html:not([data-theme="dark"]) body .curated-card.lavender {background:#efedf8!important}
html:not([data-theme="dark"]) body .recommend-panel {background:#eaf2f9!important}
html:not([data-theme="dark"]) body :is(.site-footer,.reading-footer,.bg-admin-footer) {background:#1d205c!important;color:#ffffff!important}
html:not([data-theme="dark"]) body :is(.site-footer h2,.reading-footer h2) {color:#ffffff!important}
html:not([data-theme="dark"]) body :is(.footer-story p,.footer-note,.footer-bottom,.footer-column>a,.footer-connect .access-label) {color:#d9dbef!important}
html:not([data-theme="dark"]) body .site-footer .brand img {filter:brightness(0) invert(1)!important}
html:not([data-theme="dark"]) body .bg-admin-sidebar {background:#1d205c!important;color:#ffffff!important}
html:not([data-theme="dark"]) body .bg-admin-sidebar :is(.bg-admin-nav a,.bg-admin-nav summary,.hm-sidebar-foot) {color:#d5d7ed!important}
html:not([data-theme="dark"]) body .bg-admin-sidebar .bg-admin-nav :is(a,summary):hover {background:#ffffff12!important;color:#ffffff!important}
html:not([data-theme="dark"]) body .bg-admin-sidebar .bg-admin-nav a[aria-current="page"] {background:#ffffff18!important;color:#ffffff!important;border-left-color:#f3c46c!important}

/* The black reference is #0e0e0e; only controls and cards rise above it. */
html[data-theme="dark"] body .blog-hero h1 em {color:var(--ui-text)!important}
html[data-theme="dark"] body :is(.site-header,.nav-row,.bg-admin-topbar,.bg-admin-content) {background:#0e0e0e!important}
html[data-theme="dark"] body :is(.recent-section,.recommend-panel,.small-feature,.curated-card,.knowledge-section,.topic-chip) {background:#171717!important}
html[data-theme="dark"] body :is(.cover-stage,.about-native-hero,.catalog-sidebar,.journal-art) {background:#141414!important;border-color:var(--ui-border)!important}

/* BacaGratis mobile navigation. The light/black palette remains owned by theme v2. */
/* Keep the page background token on the body as well, including after WebKit page navigation. */
body[data-bg-mobile-ui]{--ui-bg:#ffffff}
html[data-theme="dark"] body[data-bg-mobile-ui]{--ui-bg:#0e0e0e}
.bg-user-avatar{position:relative;display:inline-grid;place-items:center;flex:none;width:32px;height:32px;overflow:hidden;border-radius:50%;background:var(--ui-soft);color:var(--ui-accent);border:1px solid var(--ui-border);vertical-align:middle}
.bg-user-avatar-fallback{display:grid;place-items:center;width:100%;height:100%;font-family:inherit;font-size:13px;font-weight:700;line-height:1;color:var(--ui-accent)}
.bg-user-avatar-image{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;object-fit:cover;border-radius:50%;filter:none!important}
.bg-user-avatar-image[hidden]{display:none!important}
.bg-user-avatar[data-avatar-state="photo"] .bg-user-avatar-fallback{visibility:hidden}
.account-trigger-v2 .bg-user-avatar,.hm-account>summary .bg-user-avatar{width:30px;height:30px}
.bg-profile-avatar{margin:4px 0 18px}
.bg-profile-avatar .bg-user-avatar{width:76px;height:76px}
.bg-profile-avatar .bg-user-avatar-fallback{font-size:28px}
body[data-bg-mobile-ui] .carousel-arrow{background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
body[data-bg-mobile-ui] .rx-sort{color:#626477}
html[data-theme="dark"] body[data-bg-mobile-ui] .rx-sort{color:#b4b4b4}
html.bg-mobile-menu-open,body.bg-mobile-menu-open{overflow:hidden!important;overscroll-behavior:none}
dialog.bg-mobile-sheet:not([open]){display:none!important}
dialog.bg-mobile-sheet{box-sizing:border-box;position:fixed;inset:auto 12px 12px;width:min(480px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);margin:0 auto;padding:18px 18px calc(18px + env(safe-area-inset-bottom,0px));border:1px solid var(--ui-border);border-radius:24px;background:var(--ui-surface);color:var(--ui-text);overflow:auto;overscroll-behavior:contain;box-shadow:0 20px 80px #0005;z-index:1000}
dialog.bg-mobile-sheet::backdrop{background:#0009;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.bg-mobile-sheet *{box-sizing:border-box}
.bg-sheet-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;background:var(--ui-surface)}
.bg-sheet-head h2{margin:0;font-size:20px;line-height:1.3;letter-spacing:-.02em;color:var(--ui-text)!important}
.bg-sheet-close{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:10px;border:1px solid var(--ui-border);border-radius:12px;background:transparent;color:var(--ui-text);cursor:pointer}
.bg-sheet-close svg{width:22px;height:22px}
.bg-sheet-identity{display:flex;align-items:center;gap:12px;min-width:0;margin:0 0 16px;padding:12px;border-radius:16px;background:var(--ui-soft);color:var(--ui-text)}
.bg-sheet-identity>.icon{display:grid;place-items:center;flex:none;width:40px;height:40px}
.bg-sheet-identity .bg-user-avatar{width:40px;height:40px}
.bg-sheet-identity>div{min-width:0}
.bg-sheet-identity strong,.bg-sheet-identity small{display:block;overflow-wrap:anywhere}
.bg-sheet-identity strong{font-size:14px;line-height:1.5;color:var(--ui-text)}
.bg-sheet-identity small{font-size:12px;line-height:1.6;color:var(--ui-muted)}
body .bg-mobile-sheet .bg-sheet-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body .bg-mobile-sheet .bg-sheet-links>a{display:flex;align-items:center;gap:10px;min-height:54px;min-width:0;padding:12px;border:1px solid var(--ui-border)!important;border-radius:14px;background:var(--ui-raised)!important;color:var(--ui-text)!important;font-size:13px;font-weight:600;line-height:1.4;text-decoration:none;opacity:1;box-shadow:none}
body .bg-mobile-sheet .bg-sheet-links>a .icon,body .bg-mobile-sheet .bg-sheet-links>a svg{width:20px;height:20px;flex:none;color:inherit}
body .bg-mobile-sheet .bg-sheet-links>a:hover,body .bg-mobile-sheet .bg-sheet-links>a[aria-current="page"]{background:var(--ui-soft)!important;border-color:var(--ui-accent)!important}
.bg-sheet-account{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--ui-border);margin-top:16px;padding-top:14px}
.bg-sheet-account>a,.bg-sheet-account button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid var(--ui-border);border-radius:12px;color:var(--ui-text);background:var(--ui-soft);font-family:inherit;font-size:13px;font-weight:600;line-height:1.4;text-decoration:none;cursor:pointer}
.bg-sheet-account>a.bg-sheet-login{color:var(--ui-on-accent);background:var(--ui-accent);border-color:var(--ui-accent)}
.bg-sheet-account svg{width:18px;height:18px}
.bg-sheet-account form{margin:0}
.bg-sheet-theme{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:14px;margin-top:14px;border-top:1px solid var(--ui-border);font-size:13px;color:var(--ui-muted)}
body .bottom-nav[data-bg-bottom-nav]{display:none}

@media(max-width:999px){
 body[data-bg-mobile-ui]{padding-bottom:calc(112px + env(safe-area-inset-bottom,0px))!important}
 body[data-bg-mobile-ui] .site-header{position:sticky;top:0;z-index:200}
 body[data-bg-mobile-ui] .site-header .header-inner{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;min-height:0;width:100%;max-width:100%;padding:12px 16px;margin:0}
 body[data-bg-mobile-ui] .site-header .brand{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:flex-start;width:clamp(142px,42vw,176px)!important;min-width:0;max-width:100%;margin:0;padding:0}
 body[data-bg-mobile-ui] .site-header .brand img{display:block;width:100%!important;height:auto!important;max-height:58px;object-fit:contain;margin:0}
 body[data-bg-mobile-ui] .site-header .header-actions{grid-column:2;grid-row:1;display:flex!important;align-items:center;justify-content:flex-end;gap:8px;min-width:0;width:auto;margin:0}
 body[data-bg-mobile-ui] .site-header .shelf-link,body[data-bg-mobile-ui] .site-header .account-login-link-v2,body[data-bg-mobile-ui] .site-header .account-register-btn-v2,body[data-bg-mobile-ui] .site-header .account-dropdown-v2{display:none!important}
 body[data-bg-mobile-ui] .site-header .native-account,body[data-bg-mobile-ui] .site-header .account-nav-v2{display:flex!important;align-items:center;gap:0;width:auto;min-width:0;margin:0}
 body[data-bg-mobile-ui] .site-header :is(.theme-toggle-v2,.mobile-toggle){display:inline-flex!important;align-items:center;justify-content:center;flex:none;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;margin:0;border:1px solid var(--ui-border)!important;border-radius:12px!important;background:transparent!important;color:var(--ui-text)!important;box-shadow:none!important}
 body[data-bg-mobile-ui] .site-header .mobile-toggle[aria-expanded="true"]{background:var(--ui-soft)!important}
 body[data-bg-mobile-ui] .site-header .mobile-toggle .icon,body[data-bg-mobile-ui] .site-header .mobile-toggle svg{display:block;width:22px!important;height:22px!important}
 body[data-bg-mobile-ui] .site-header .header-search{grid-column:1/-1;grid-row:2;display:flex!important;align-items:center;gap:10px;width:100%;min-width:0;max-width:100%;min-height:50px;margin:0;padding:4px 6px 4px 14px;border-radius:16px}
 body[data-bg-mobile-ui] .site-header .header-search>.icon{width:20px;height:20px;flex:none}
 body[data-bg-mobile-ui] .site-header .header-search input{flex:1;min-width:0;width:0;min-height:40px;padding:6px 0;font-size:16px!important;line-height:1.4}
 body[data-bg-mobile-ui] .site-header .header-search .button{flex:none;min-width:56px;min-height:40px;height:40px;padding:0 14px;border-radius:12px;font-size:14px;line-height:1.3}
 body[data-bg-mobile-ui] .site-header .nav-row{display:none!important}
 body[data-bg-mobile-ui] .section-heading{align-items:flex-start;flex-wrap:wrap;gap:10px 12px}
 body[data-bg-mobile-ui] .section-heading>div{flex:1 1 180px;min-width:0}
 body[data-bg-mobile-ui] .section-heading h2{font-size:clamp(22px,6vw,26px);line-height:1.3;overflow-wrap:break-word}
 body[data-bg-mobile-ui] .section-heading>.text-link,body[data-bg-mobile-ui] .shelf-controls>.text-link{flex:none;align-self:flex-end;min-height:44px;font-size:13px;white-space:nowrap;margin-left:auto}
 body[data-bg-mobile-ui] .book-tabs{display:flex;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;gap:20px}
 body[data-bg-mobile-ui] .book-tabs>button{flex:none;min-height:44px;white-space:nowrap}
 body[data-bg-mobile-ui] .carousel-arrow{width:44px;height:44px}
 body[data-bg-mobile-ui] .carousel-arrow.previous{left:4px!important}
 body[data-bg-mobile-ui] .carousel-arrow.next{right:4px!important}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]{box-sizing:border-box;position:fixed;inset:auto 12px calc(12px + env(safe-area-inset-bottom,0px));z-index:190;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;align-items:center;width:min(560px,calc(100% - 24px));min-height:72px;margin:0 auto;padding:8px;border:1px solid var(--ui-border)!important;border-radius:24px;background:var(--ui-surface)!important;color:var(--ui-muted);box-shadow:0 8px 32px #0002;overflow:visible;transition:opacity .15s ease,transform .15s ease}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>:is(a,button){box-sizing:border-box;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:56px;height:56px;margin:0;padding:4px 1px;border:0;border-radius:16px;background:transparent;color:var(--ui-muted)!important;text-decoration:none;font-family:inherit;font-size:12px;font-weight:500;line-height:16px;cursor:pointer}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>a[aria-current="page"]{background:var(--ui-soft)!important;color:var(--ui-accent)!important;font-weight:700}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-icon{display:grid;place-items:center;width:28px;height:28px;flex:none}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] :is(.bg-bottom-icon>.icon,.bg-bottom-icon svg){display:block;width:24px;height:24px;color:inherit}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-label{display:block;font-size:12px;line-height:16px;white-space:nowrap;color:inherit}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>.bg-bottom-search{justify-content:flex-end;padding-bottom:4px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-action-icon{box-sizing:border-box;position:absolute;left:50%;top:-24px;transform:translateX(-50%);display:grid;place-items:center;width:56px;height:56px;border:1px solid var(--ui-accent);border-radius:50%;background:var(--ui-accent);color:var(--ui-on-accent);box-shadow:0 0 0 7px var(--ui-bg),0 4px 14px #0002}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-action-icon :is(.icon,svg){display:block;width:25px;height:25px;color:inherit}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-user-avatar{width:28px;height:28px;border-color:var(--ui-border)}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] a[aria-current="page"] .bg-user-avatar{border-color:var(--ui-accent)}
 body[data-bg-mobile-ui].bg-input-focus .bottom-nav[data-bg-bottom-nav]{visibility:hidden;opacity:0;transform:translateY(120%);pointer-events:none}
}
@media(min-width:1000px){
 body[data-bg-mobile-ui] .site-header .mobile-toggle{display:none!important}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]{display:none!important}
 dialog.bg-mobile-sheet[open]{display:none!important}
}
@media(prefers-reduced-motion:reduce){body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]{transition:none}}

/* BacaGratis appearance v4: article surfaces, calmer artwork, compact mobile navigation. */
body .article-banner.generated-cover{box-sizing:border-box;width:100%;min-width:0;min-height:0;aspect-ratio:16/9}
body .article-banner.generated-cover>img{max-width:100%}
html[data-theme="dark"] body :is(.article-toc,.article-callout,.article-book,.review-bibliography,.article-correction,.blog-empty,.about-native-art){background:#141414!important;color:#f5f5f5!important;border-color:#333!important}
html[data-theme="dark"] body :is(.article-toc strong,.article-callout h3,.article-book h3,.review-bibliography h3,.review-bibliography dd,.article-correction strong){color:#f5f5f5!important}
html[data-theme="dark"] body :is(.article-toc a,.article-book p,.review-bibliography>span,.review-bibliography dt,.review-bibliography>p,.article-correction p,.article-sources,.article-sources strong){color:#b4b4b4!important}
html[data-theme="dark"] body :is(.article-toc a:hover,.article-toc a:focus-visible,.article-book a,.article-correction a,.article-sources a){color:#f5f5f5!important}
html[data-theme="dark"] body :is(.article-related,.article-sources,.home-journal,.blog-toolbar){border-color:#333!important}
html[data-theme="dark"] body .article-prose{color:#f5f5f5}
html[data-theme="dark"] body .article-prose :is(h2,h3,h4,h5,h6,strong,b,em,i,li,dt,dd,figcaption){color:inherit}
html[data-theme="dark"] body .article-prose :is(blockquote,pre){background:#1b1b1b!important;color:#e6e6e6!important;border-color:#555!important;box-shadow:none}
html[data-theme="dark"] body .article-prose blockquote :is(p,li,footer,cite){color:#d4d4d4!important}
html[data-theme="dark"] body .article-prose :is(a,code,kbd,samp){color:#ededed!important}
html[data-theme="dark"] body .article-prose :is(code,kbd,samp){background:#1b1b1b!important;border-color:#444!important}
html[data-theme="dark"] body .article-prose pre code{background:transparent!important}
html[data-theme="dark"] body .article-prose :is(table,td){background:#141414!important;color:#e6e6e6!important;border-color:#444!important}
html[data-theme="dark"] body .article-prose th{background:#202020!important;color:#f5f5f5!important;border-color:#444!important}
html[data-theme="dark"] body .article-prose :is(mark,[bgcolor]){background:#333!important;color:#f5f5f5!important}
html[data-theme="dark"] body .article-prose hr{border-color:#333!important}
html[data-theme="dark"] body .blog-topics button{background:#141414!important;color:#b4b4b4!important;border-color:#333!important}
html[data-theme="dark"] body .blog-topics button[aria-pressed="true"]{background:#f0f0f0!important;color:#0e0e0e!important;border-color:#f0f0f0!important}

/* Decorative layers must follow the panel, including the off-screen layers. */
html[data-theme="dark"] body .recommend-panel::before{background:#202020!important}
html[data-theme="dark"] body .recommend-panel::after{background:#242424!important}
html[data-theme="dark"] body .recommend-art{background:#141414!important;border-color:#333!important}
html[data-theme="dark"] body .recommend-art>span{top:0;left:0;right:0;padding:20px 22px 24px;background:linear-gradient(180deg,#141414 72%,#14141400)!important;color:#f5f5f5!important}
html[data-theme="dark"] body .recommend-art>span em{color:#d4d4d4!important}
html[data-theme="dark"] body :is(.journal-art,.article-banner)::before{border-color:#ffffff14!important}

/* Display filters adapt to the active theme; original artwork files are unchanged. */
html[data-theme="dark"] body :is(.recommend-art>img,img[src*="/illustrations/"]){filter:brightness(.64) saturate(.82)!important}
html[data-theme="dark"] body .journal-art.generated-cover>img{filter:brightness(.76) saturate(.88)!important}
html[data-theme="dark"] body .article-prose img:not(.bg-user-avatar-image):not([alt^="Sampul"]){filter:brightness(.82) saturate(.9)}

.article-prose pre{max-width:100%;overflow:auto;padding:18px;border-radius:10px;font-size:.9em;line-height:1.7}
.article-prose table{width:100%;table-layout:fixed;border-collapse:collapse;margin:24px 0;font-size:.9em}
.article-prose :is(th,td){padding:10px 12px;border:1px solid var(--ui-border,#ddd);text-align:left;overflow-wrap:anywhere}
@media(min-width:600px){.article-toc{max-height:calc(100dvh - 176px);overflow:auto;overscroll-behavior:contain}}
@media(min-width:600px) and (max-width:999px){.article-toc{max-height:calc(100dvh - 248px)}}

@media(max-width:999px){
 body[data-bg-mobile-ui]{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]{inset:auto 16px max(4px,env(safe-area-inset-bottom,0px));width:min(480px,calc(100% - 32px));min-height:62px;padding:6px;border-radius:21px;box-shadow:0 4px 20px #0002}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>:is(a,button){height:48px;min-height:48px;gap:3px;padding:3px 1px;border-radius:14px;font-size:11px;line-height:14px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-icon{width:24px;height:24px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] :is(.bg-bottom-icon>.icon,.bg-bottom-icon svg){width:21px;height:21px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-label{font-size:11px;line-height:14px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>.bg-bottom-search{padding-bottom:3px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-action-icon{width:44px;height:44px;top:-13px;box-shadow:0 0 0 5px var(--ui-bg),0 3px 9px #0002}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-action-icon :is(.icon,svg){width:22px;height:22px}
 body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-user-avatar{width:24px;height:24px}
}

/* One reader host, one focus layer. */
body .bg-detail-v1.rx-book-detail[data-booktabs-release] :is(.rx-book-tabs,.rx-book-panel){scroll-margin-top:0!important}
body .bg-detail-v1 .rx-inline-reader{min-width:0;background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:14px;overflow:hidden;margin:12px 0 24px}
body .bg-detail-v1 .rx-inline-reader .rx-reader-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:10px 12px;background:var(--ui-surface);color:var(--ui-text);border:0;border-bottom:1px solid var(--ui-border)}
body .bg-detail-v1 .rx-reader-format-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
body .bg-detail-v1 .rx-reader-format-group>span{font-size:12px;color:var(--ui-muted);margin-right:4px}
body .bg-detail-v1 .rx-reader-format-group>a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 12px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-soft);color:var(--ui-text);font-size:13px;font-weight:600}
body .bg-detail-v1 .rx-reader-format-group>a[aria-current="page"]{background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important}
body .bg-detail-v1 .rx-reader-tools>[data-reader-focus]{flex:none;margin-left:auto;min-height:44px;padding:8px 12px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-soft);color:var(--ui-text);font-size:13px}
body .bg-detail-v1 .rx-inline-reader:not(.rx-reader-focus) iframe{display:block;width:100%;height:var(--bg-reader-height,clamp(280px,calc(100svh - 360px),760px));min-height:0;max-height:none;border:0;border-radius:0;background:var(--ui-bg)}
body .bg-detail-v1 .rx-reader-status,body .bg-detail-v1 .rx-reader-fallback{margin:0;padding:10px 14px;background:var(--ui-surface);color:var(--ui-muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere}
body .bg-detail-v1 .rx-reader-fallback{border-top:1px solid var(--ui-border)}
body .bg-detail-v1 .rx-reader-fallback a{color:var(--ui-text)}
/* Once the reader is ready, avoid a second permanent action below it on phones. */
@media(max-width:999px){body .bg-detail-v1 .rx-inline-reader .rx-reader-status[hidden]~.rx-reader-fallback{display:none}}
body .bg-detail-v1 .rx-inline-reader.rx-reader-focus{position:fixed!important;inset:0!important;z-index:5000!important;display:flex;flex-direction:column;width:100%!important;height:100dvh!important;max-height:none!important;max-width:none!important;margin:0!important;padding:0 0 env(safe-area-inset-bottom,0px)!important;border:0!important;border-radius:0!important;background:var(--ui-bg)!important}
body .bg-detail-v1 .rx-inline-reader.rx-reader-focus iframe{display:block;flex:1;min-width:0;min-height:0!important;width:100%;height:0!important;max-height:none!important;border:0;border-radius:0;background:var(--ui-bg)}
body .bg-detail-v1 .rx-inline-reader.rx-reader-focus .rx-reader-tools,body .bg-detail-v1 .rx-inline-reader.rx-reader-focus [data-bg-reader-audio]{flex:none}
body .bg-detail-v1 .rx-inline-reader.rx-reader-focus .rx-reader-fallback{display:none}
body.rx-has-reader-focus{overflow:hidden!important;padding-bottom:0!important}
body.rx-has-reader-focus :is(.site-header,.site-footer){display:none!important}
body.rx-has-reader-focus[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]{display:none!important;visibility:hidden!important}
/* Cari stays an icon button with its accessible name on the button. */
body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav]>.bg-bottom-search{justify-content:center;padding:0}
body[data-bg-mobile-ui] .bottom-nav[data-bg-bottom-nav] .bg-bottom-search .bg-bottom-action-icon{position:static;transform:none;margin-top:-8px}
