/* Only the local Books preview opts into this chrome. Other website surfaces
   keep their existing header/sidebar. The actual notification UI stays wired. */
.books-shell-action { display:none; }
body.on-books:has(#bookPage.books-mobile-v2) { background:#f6f4f9; --header-h:64px; }
body.on-books:has(#bookPage.books-mobile-v2) .topbar { height:64px; background:#faf9ff !important; color:#141625; box-shadow:none !important; border-bottom:1px solid #f0edf5 !important; backdrop-filter:none; padding:0 14px; gap:12px; }
body.on-books:has(#bookPage.books-mobile-v2) .topbar::after { display:none; }
body.on-books:has(#bookPage.books-mobile-v2) .topbar-actions { display:contents; }
body.on-books:has(#bookPage.books-mobile-v2) #topbarAvatar { order:-3; width:36px; height:36px; min-width:36px; border-radius:7px; border:0; box-shadow:none; margin:0; }
body.on-books:has(#bookPage.books-mobile-v2) #topbarLogoBtn { order:-2; margin:0 auto 0 0; padding:0; width:auto; height:44px; background:none; border:0; box-shadow:none; color:#141625; }
body.on-books:has(#bookPage.books-mobile-v2) #topbarLogoBtn img { display:none; }
body.on-books:has(#bookPage.books-mobile-v2) #topbarLogoBtn::after { content:'Selebox'; font:800 20px Inter,system-ui,sans-serif; letter-spacing:-.4px; }
body.on-books:has(#bookPage.books-mobile-v2) #topbarMenuBtn,
body.on-books:has(#bookPage.books-mobile-v2) .topbar-quests-wrap,
body.on-books:has(#bookPage.books-mobile-v2) #topbarCoinPill,
body.on-books:has(#bookPage.books-mobile-v2) #topbarSearch,
body.on-books:has(#bookPage.books-mobile-v2) #searchResults,
body.on-books:has(#bookPage.books-mobile-v2) #appSidebar,
body.on-books:has(#bookPage.books-mobile-v2) #wlQaBadge,
body.on-books:has(#bookPage.books-mobile-v2) #wlQaOpenBtn,
body.on-books:has(#bookPage.books-mobile-v2) #dmFloatingRoot { display:none !important; }
body.on-books:has(#bookPage.books-mobile-v2) .books-shell-action { display:flex; align-items:center; justify-content:center; width:30px; height:44px; padding:0; border:0; background:none; color:#141625; position:relative; flex:none; }
.books-shell-action svg { width:23px; height:23px; }
body.on-books:has(#bookPage.books-mobile-v2) #booksHeaderSearch { order:1; }
body.on-books:has(#bookPage.books-mobile-v2) .topbar-bell-wrap { order:2; margin:0; }
body.on-books:has(#bookPage.books-mobile-v2) #booksHeaderMessages { order:3; }
body.on-books:has(#bookPage.books-mobile-v2) #btnNotifications { width:30px; height:44px; padding:4px; background:none; color:#141625; box-shadow:none; border:0; }
body.on-books:has(#bookPage.books-mobile-v2) #btnNotifications svg { width:23px; height:23px; }
.books-shell-unread { position:absolute; right:-5px; top:1px; min-width:15px; padding:1px 3px; font:600 9px Inter,system-ui,sans-serif; color:#fff; background:var(--accent-primary); border:1px solid white; border-radius:9px; }
.books-shell-unread[hidden] { display:none; }
body.on-books:has(#bookPage.books-mobile-v2) #notifBadge { font-size:9px; min-width:15px; height:15px; top:1px; right:-3px; background:var(--accent-primary); border:1px solid white; }
body.on-books:has(#bookPage.books-mobile-v2) .main-wrap { width:100% !important; max-width:none !important; margin:64px 0 0 !important; padding:0 !important; }
#booksMobileV2 { overflow:clip; }
#booksMobileV2 .bmv2-shell { max-width:none; margin:0; padding:0 0 76px; }
#booksMobileV2 .bmv2-top { display:none; }
#booksMobileV2 .bmv2-tabs { position:sticky; top:64px; height:54px; margin:0; padding:7px 10px; gap:7px; border:0; border-radius:0; background:#faf9ff; box-shadow:none; backdrop-filter:none; overflow:visible; z-index:20; }
#booksMobileV2 .bmv2-tabs button { display:flex; align-items:center; justify-content:center; gap:6px; flex:1 1 0; min-width:0; min-height:38px; padding:0 7px; border-radius:999px; font:500 11px Inter,system-ui,sans-serif; color:#6e7685; background:none; box-shadow:none; white-space:nowrap; }
#booksMobileV2 .bmv2-tabs button.active { color:var(--accent-strong); font-weight:700; background:var(--accent-soft); }
#booksMobileV2 .bmv2-tabs svg { width:17px; height:17px; flex:none; }
#booksMobileV2 .bmv2-tabs button.active[data-bmv2-tab="foryou"] svg { fill:currentColor; }
#booksMobileV2 .bmv2-panel { min-height:calc(100vh - 178px); }
#booksMobileV2 .bmv2-panel > :not(.bfy):not(.bdv):not(.brv):not(.blv):not(.bllv) { margin:16px auto; max-width:1180px; padding:0 14px; }
.books-bottom-nav { position:fixed; bottom:0; left:0; right:0; z-index:90; display:flex; align-items:center; justify-content:space-around; height:64px; padding:7px 12px max(7px,env(safe-area-inset-bottom)); background:#fff; border-top:1px solid #f1eef6; }
.books-bottom-nav a { display:flex; width:52px; height:44px; align-items:center; justify-content:center; color:#111623; }
.books-bottom-nav svg { width:24px; height:24px; }
.books-bottom-nav a[aria-current] svg { fill:currentColor; stroke:white; stroke-width:1; }
#booksMobileV2 .bmv2-library-switch { display:flex; justify-content:center; gap:10px; margin:12px 0; }
#booksMobileV2 .bmv2-library-switch button { border:1px solid #e0d7ee; border-radius:99px; padding:8px 16px; background:white; color:#5c466d; font:600 12px Inter,sans-serif; }
#booksMobileV2 .bmv2-library-switch button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-strong); }
@media(min-width:760px) {
  #booksMobileV2 .bmv2-shell { max-width:none; margin-inline:auto; }
  #booksMobileV2 .bmv2-panel { max-width:1180px; margin-inline:auto; }
  body.on-books:has(#bookPage.books-mobile-v2) .topbar { padding-inline:max(24px,calc((100vw - 1180px)/2)); }
  #booksMobileV2 .bmv2-tabs { padding-inline:max(20px,calc((100vw - 1180px)/2)); height:60px; gap:20px; }
  #booksMobileV2 .bmv2-tabs button { flex:1 1 0; font-size:13px; }
}
@media(max-width:370px) { #booksMobileV2 .bmv2-tabs { gap:2px; padding-inline:5px; } #booksMobileV2 .bmv2-tabs button { font-size:10px; gap:4px; padding-inline:5px; } }

/* Reserve the existing desktop sidebar column without changing Books content. */
@media(min-width:769px) {
  body.on-books:has(#bookPage.books-mobile-v2) .main-wrap {
    margin-left:var(--sidebar-w) !important;
    width:calc(100% - var(--sidebar-w)) !important;
    padding-inline:20px !important;
  }
  body.on-books:has(#bookPage.books-mobile-v2) .topbar { padding-inline:22px; }
  /* Existing main-navigation links become centered header tabs on desktop. */
  .books-bottom-nav {
    top:0;
    bottom:auto;
    left:50%;
    right:auto;
    transform:translateX(-50%);
    z-index:110;
    width:min(680px,calc(100% - 400px));
    height:64px;
    padding:0;
    gap:6px;
    border:0;
    border-radius:0;
    box-shadow:none;
    background:transparent;
  }
  .books-bottom-nav a {
    position:relative;
    flex:1;
    min-width:0;
    height:64px;
    padding-top:3px;
    border-bottom:3px solid transparent;
    border-radius:8px 8px 0 0;
    color:#707582;
    transition:background .15s ease,color .15s ease;
  }
  .books-bottom-nav a:hover { background:#edeaf3; }
  .books-bottom-nav a:focus-visible { outline:2px solid var(--accent-primary); outline-offset:-5px; }
  .books-bottom-nav a[aria-current] { color:var(--accent-primary); border-bottom-color:var(--accent-primary); background:transparent; }
  .books-bottom-nav svg { width:27px; height:27px; }
  #booksMobileV2 .bmv2-shell { padding-bottom:24px; }
  #booksMobileV2 .bmv2-tabs { justify-content:center; padding-inline:12px; gap:12px; }
  #booksMobileV2 .blv-bulk {
    left:calc(50% + var(--sidebar-w)/2);
    width:calc(100% - var(--sidebar-w) - 40px);
    bottom:16px;
  }
}

/* Cached tabs keep their decoded covers while only the active view participates in layout. */
#booksMobilePanel > [hidden] { display:none !important; }
#booksMobilePanel img[data-book-cover-original] { background:#eee9f5; }
.bdv-battle:empty { min-height:360px; border-radius:20px; background:linear-gradient(135deg,#f5efff,#eee5fa); }
