/* Use the original logo colors; earlier themes applied monochrome image filters. */
:root #appShell .brand-logo {vertical-align:middle;line-height:0;flex-shrink:0;max-width:100%;filter:none!important;background:transparent!important}
:root #appShell .brand-logo .brand-image {
  width:100%;height:auto;max-height:none;object-fit:contain;
  filter:none!important;background:transparent!important;border-radius:0;mix-blend-mode:normal!important;
}
:root #appShell .brand-logo .brand-light {display:block}
:root #appShell .brand-logo .brand-dark {display:none}
html[data-app-theme="dark"] #appShell .brand-logo .brand-light {display:none}
html[data-app-theme="dark"] #appShell .brand-logo .brand-dark {display:block}
:root #appShell .sidebar .brand-logo {display:block;width:190px}
:root #appShell .prism-brand .brand-logo {display:block;width:168px}
:root #appShell .prism-menu-header .brand-logo {width:168px}
:root #appShell.app-preview[data-active-tab="dash"] .prism-mobile-top {display:flex}
:root #appShell .app-brand-logo {display:block;width:190px;height:auto}
.loading-brand {display:block;width:210px;max-width:65vw;line-height:0;margin:0 auto 12px}
.loading-brand img {width:100%;height:auto}
.loading-brand .loading-brand-light {display:block}
.loading-brand .loading-brand-dark {display:none}
html[data-app-theme="dark"] .loading-brand .loading-brand-light {display:none}
html[data-app-theme="dark"] .loading-brand .loading-brand-dark {display:block}
:root .account-gate::before {display:none}
.app-boot-brand {display:none}
html[data-app-loading]:not([data-account-loading]) .app-boot-brand {
  display:flex;position:fixed;inset:0;z-index:299;align-items:center;justify-content:center;
  background:var(--nook-loading-background);color:var(--ink);
}
html[data-account-loading] #accountGate {display:flex!important}
.nook-loader .loading-brand {width:180px}
@media(max-width:350px) {
  :root #appShell .prism-brand .brand-logo {width:142px}
}

/* A long, fading comet curves around the brand. */
.loading-brand {position:relative;display:flex;align-items:center;aspect-ratio:1;flex-shrink:0;margin-top:40px;margin-bottom:56px;isolation:isolate}
.loading-shooting-star {
  position:absolute;width:calc(100% + 48px);aspect-ratio:1;
  left:-24px;top:50%;margin-top:calc(-50% - 24px);
  pointer-events:none;animation:loading-star-orbit 5.5s linear infinite;
  filter:drop-shadow(0 0 5px #48d9e466);
}
.loading-shooting-star::before {
  content:'';position:absolute;inset:0;border-radius:50%;
  background:conic-gradient(from 0deg,transparent 0deg 195deg,#a17bef00 205deg,#a17bef30 245deg,#009ffc88 295deg,#48d9e4 340deg,#efffff 360deg);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3px),#000 calc(100% - 1px),transparent 100%);
  mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3px),#000 calc(100% - 1px),transparent 100%);
}
.loading-shooting-star::after {
  content:'';position:absolute;left:50%;top:2px;width:25px;height:25px;
  transform:translate(-50%,-50%);
  background:linear-gradient(135deg,#fff9e8 15%,#baf6ff 55%,#48d9e4);
  clip-path:polygon(50% 0,62% 34%,98% 35%,70% 57%,80% 94%,50% 73%,20% 94%,30% 57%,2% 35%,38% 34%);
}
@keyframes loading-star-orbit {from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce) {
  .loading-shooting-star {animation:none;transform:rotate(35deg)}
}

/* Heading colors sampled directly from the NovaNook logo. */
.account-gate h2 {color:#0369fd}
html[data-app-theme="dark"] .account-gate h2 {color:#478cfe}

/* Scale the scene itself to the available height, with horizontal exploration. */
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #roomViewport #room:not(.expanded) {
  height:100%!important;min-height:100%!important;max-height:none!important;
  width:max(100%,150cqh)!important;min-width:100%!important;max-width:none!important;
  aspect-ratio:auto!important;flex-shrink:0;
}
@media(max-width:960px) {
  :root #appShell[data-active-tab="library"] #roomViewport #room:not(.expanded) {
    height:100%!important;min-height:100%!important;max-height:none!important;
    width:max(100%,150cqh)!important;min-width:100%!important;max-width:none!important;
    aspect-ratio:auto!important;flex-shrink:0;
  }
}

/* Keep every mobile library within the header and bottom navigation. */
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview){display:flex!important;flex-direction:column;height:100dvh!important;min-height:0!important;overflow:hidden!important}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) .main-wrapper{display:flex!important;flex-direction:column;flex:1;min-height:0;width:100%;margin:0;overflow:hidden}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) :is(.page-heading,.room-toolbar,.room-bottom,.below-room,.explore-bar,.studio-bar,footer,.room-caption){display:none!important}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) main{display:flex!important;flex:1;min-height:0;overflow:hidden!important;padding:0!important;width:100%;max-width:none}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #libraryView{display:flex;flex-direction:column;flex:1;min-height:0}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #libraryView > :is(.room-experience,.trial-room-view){position:relative;flex:1;min-height:0;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #libraryView > .room-experience{display:flex;flex-direction:column}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #roomViewport{flex:1;min-height:0!important;height:100%!important;max-height:none!important;width:100%!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;container-type:size}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #room{border:0!important;border-radius:0!important}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) #legacyRoomDock{position:absolute!important;bottom:12px!important;left:50%!important;transform:translateX(-50%)!important;margin:0!important;z-index:40}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) .mobile-nav{position:relative!important;inset:auto!important;flex-shrink:0;margin:0!important;width:100%;z-index:50}
:root #appShell[data-active-tab="library"]:is(.phone-preview,.app-preview) :is(.prism-mobile-top,.app-header,.app-statusbar){flex-shrink:0}
@media(max-width:960px){
:root #appShell[data-active-tab="library"]{display:flex!important;flex-direction:column;height:100dvh!important;min-height:0!important;overflow:hidden!important}
:root #appShell[data-active-tab="library"] .main-wrapper{display:flex!important;flex-direction:column;flex:1;min-height:0;width:100%;margin:0;overflow:hidden}
:root #appShell[data-active-tab="library"] :is(.page-heading,.room-toolbar,.room-bottom,.below-room,.explore-bar,.studio-bar,footer,.room-caption){display:none!important}
:root #appShell[data-active-tab="library"] main{display:flex!important;flex:1;min-height:0;overflow:hidden!important;padding:0!important;width:100%;max-width:none}
:root #appShell[data-active-tab="library"] #libraryView{display:flex;flex-direction:column;flex:1;min-height:0}
:root #appShell[data-active-tab="library"] #libraryView > :is(.room-experience,.trial-room-view){position:relative;flex:1;min-height:0;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden}
:root #appShell[data-active-tab="library"] #libraryView > .room-experience{display:flex;flex-direction:column}
:root #appShell[data-active-tab="library"] #roomViewport{flex:1;min-height:0!important;height:100%!important;max-height:none!important;width:100%!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;container-type:size}
:root #appShell[data-active-tab="library"] #room{border:0!important;border-radius:0!important}
:root #appShell[data-active-tab="library"] #legacyRoomDock{position:absolute!important;bottom:12px!important;left:50%!important;transform:translateX(-50%)!important;margin:0!important;z-index:40}
:root #appShell[data-active-tab="library"] .mobile-nav{position:relative!important;inset:auto!important;flex-shrink:0;margin:0!important;width:100%;z-index:50}
:root #appShell[data-active-tab="library"] :is(.prism-mobile-top,.app-header,.app-statusbar){flex-shrink:0}
}

/* Mobile library: shared header, edge-to-edge room, and the controls below. */
/* Lower the Large and Grand controls and their captions together on mobile. */
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] :is(.room-experience:has(#room.is-large-trial)>#legacyRoomDock,#grandLibraryView>.trial-dock){transform:translate(-50%,8px)!important}
@media(max-width:960px){
:root #appShell[data-active-tab="library"] :is(.room-experience:has(#room.is-large-trial)>#legacyRoomDock,#grandLibraryView>.trial-dock){transform:translate(-50%,8px)!important}
}
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] .page-heading,
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #libraryView > :is(.room-toolbar,.room-bottom,.below-room),
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #libraryView :is(.studio-bar,.explore-bar) {display:none!important}
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] main {padding:0!important;max-width:none;width:100%}
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #libraryView,
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #libraryView > :is(.room-experience,.trial-room-view,.library-grid-view),
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #roomViewport {margin:0!important;padding:0!important;border:0!important;border-radius:0!important;width:100%;max-width:none;box-shadow:none!important}
:root #appShell:is(.phone-preview,.app-preview)[data-active-tab="library"] #room {border:0!important;border-radius:0!important}
@media(max-width:760px) {
:root #appShell[data-active-tab="library"] .page-heading,
:root #appShell[data-active-tab="library"] #libraryView > :is(.room-toolbar,.room-bottom,.below-room),
:root #appShell[data-active-tab="library"] #libraryView :is(.studio-bar,.explore-bar) {display:none!important}
:root #appShell[data-active-tab="library"] main {padding:0!important;max-width:none;width:100%}
:root #appShell[data-active-tab="library"] #libraryView,
:root #appShell[data-active-tab="library"] #libraryView > :is(.room-experience,.trial-room-view,.library-grid-view),
:root #appShell[data-active-tab="library"] #roomViewport {margin:0!important;padding:0!important;border:0!important;border-radius:0!important;width:100%;max-width:none;box-shadow:none!important}
:root #appShell[data-active-tab="library"] #room {border:0!important;border-radius:0!important}
}

/* Keep vertical reading-list scrolling native while horizontal gestures page books. */
#booksView[data-catalog-compact=true] :is(#bookGrid,.lounge-book-wall) { touch-action:pan-y pinch-zoom; }
