/* Nexus Book 12.0 · stage 02 responsive layer.
   Loaded after design120.css and legacy page styles. */
:root{--nx-nav-clearance:calc(96px + env(safe-area-inset-bottom,0px))}
html{max-width:100%;scroll-padding-bottom:var(--nx-nav-clearance)}
body{min-width:0;max-width:100%;margin:0}
body:not(.nx-admin)>main{
  min-width:0;max-width:min(100%,1336px);
  padding-bottom:calc(var(--nx-nav-clearance) + 24px)!important;
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px))
}
body:not(.nx-admin)>header{
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px))
}
nav.bottom,.bottom{
  box-sizing:border-box;max-width:100%;
  padding-left:max(8px,env(safe-area-inset-left,0px))!important;
  padding-right:max(8px,env(safe-area-inset-right,0px))!important;
  padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important
}
nav.bottom button,.bottom button{min-width:0}
#cloudpanel,#stored,#books,#nbAccountShell,#nbWelcome,#nbTools,
.premium-tools,.nx-discover,.nx-feature,#detail .wrap,
.npSettings,.npSection,.npDialog,.accountRecoveryCard{
  min-width:0;max-width:100%
}
#stored>article,#books>article{min-width:0}
#stored>article img,#books>article img,#stored>article .cover,#books>article .cover{
  max-width:100%;height:auto
}
#stored>article h3,#books>article h3,
.nx-feature h3,.npSection,.accountCard{overflow-wrap:anywhere}
.premium-tools input,.premium-tools select,.premium-tools button,
.npSettings input,.npSettings select,.npSettings textarea,
.npAdmin input,.accountRecoveryCard input{box-sizing:border-box;max-width:100%;min-width:0}
.npDialog,.accountRecoveryDialog,.npAdmin{
  box-sizing:border-box;width:min(520px,calc(100vw - 24px));
  max-height:calc(100dvh - 24px);overflow:auto
}
.npSettings[open]{
  box-sizing:border-box;width:100%;max-width:100vw;height:100dvh;
  padding-top:max(18px,env(safe-area-inset-top,0px));
  padding-bottom:max(24px,env(safe-area-inset-bottom,0px));
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px))
}
#reader,#detail{max-width:100vw}
#reader .rhead,#reader .rfoot{
  padding-left:max(12px,env(safe-area-inset-left,0px));
  padding-right:max(12px,env(safe-area-inset-right,0px))
}
#reader .rfoot{padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
#reader :is(#readingSettings,#nbPanel,#epubExtra,#nb82Chapters){
  max-width:calc(100vw - 24px);max-height:calc(100dvh - 48px);overflow:auto
}
.nx-admin{min-width:0;max-width:100%}
.nx-admin :is(main,section,article,form,.accountCard){min-width:0;max-width:100%}
.nx-admin :is(input,select,textarea,button){max-width:100%;box-sizing:border-box}
@media(max-width:599px){
  body #stored:not(.premium-list),body #books{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:20px clamp(8px,3vw,14px)
  }
  body #nbWelcome{grid-template-columns:minmax(0,1fr);min-width:0}
  .premium-tools{flex-wrap:wrap}
  .premium-tools input,.premium-tools select{flex:1 1 100%}
  .npSettings .npSection form{grid-template-columns:minmax(0,1fr)!important}
  .npSettings .npSection{padding:clamp(14px,4vw,22px)}
  .npSettings .npSection form button{max-width:100%}
  #detail{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
}
@media(min-width:600px) and (max-width:1199px){
  body #stored:not(.premium-list),body #books{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(12px,2vw,24px)
  }
}
@media(min-width:1200px){
  body #stored:not(.premium-list),body #books{
    display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr))!important;
    gap:24px
  }
}
@media(display-mode:standalone){
  body:not(.nx-admin)>main{padding-bottom:calc(var(--nx-nav-clearance) + 32px)!important}
  nav.bottom,.bottom{padding-bottom:max(12px,env(safe-area-inset-bottom,0px))!important}
}
