/* v1.9.4 — Mobile portrait: visible category tabs on the left edge of the single page.
   This is live-only through body.nc-mobile-portrait-page and does not alter desktop/editor geometry. */
@media (max-width: 760px){
  body.nc-mobile-portrait-page .stage{
    overflow:hidden!important;
  }

  /* Make room for the category index while keeping the portrait page readable. */
  body.nc-mobile-portrait-page .book-wrap{
    width:min(calc(100vw - 58px), 450px)!important;
    margin-left:42px!important;
    margin-right:8px!important;
  }

  /* Keep only the left-side category index in mobile portrait mode. */
  body.nc-mobile-portrait-page .tabs.right{
    display:none!important;
  }
  body.nc-mobile-portrait-page .tabs.left{
    display:flex!important;
    position:absolute!important;
    left:-39px!important;
    top:6.2%!important;
    bottom:6.2%!important;
    width:44px!important;
    z-index:1!important;
    pointer-events:auto!important;
    flex-direction:column!important;
    justify-content:stretch!important;
    align-items:flex-end!important;
    gap:0!important;
    transform:none!important;
    opacity:1!important;
    filter:drop-shadow(-4px 8px 9px rgba(0,0,0,.24))!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:1 1 0!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    min-height:42px!important;
    margin:0!important;
    border:1px solid rgba(82,64,31,.38)!important;
    border-right:0!important;
    border-radius:10px 0 0 10px!important;
    background:
      linear-gradient(90deg, rgba(255,250,220,.92), rgba(205,183,119,.88) 72%, rgba(141,112,55,.82)),
      repeating-linear-gradient(90deg, rgba(95,72,35,.10) 0 1px, transparent 1px 5px)!important;
    box-shadow:
      inset -7px 0 8px rgba(75,50,17,.18),
      inset 1px 0 0 rgba(255,255,255,.44),
      -3px 2px 5px rgba(0,0,0,.22)!important;
    color:#33250d!important;
    overflow:hidden!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab.is-active,
  body.nc-mobile-portrait-page .tabs.left .tab[aria-current="page"]{
    background:
      linear-gradient(90deg, #f6ca3e, #d9a51e 72%, #9d6f10),
      repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 1px, transparent 1px 5px)!important;
    color:#1d1407!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab-label{
    position:static!important;
    display:block!important;
    transform:rotate(-90deg)!important;
    transform-origin:center!important;
    white-space:nowrap!important;
    font-size:8.6px!important;
    line-height:1!important;
    letter-spacing:.45px!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    text-align:center!important;
    max-width:none!important;
  }

  /* The visible paper stack sits behind the page and behind the tabs. */
  body.nc-mobile-portrait-page .stack-left{
    display:block!important;
    left:-12px!important;
    width:24px!important;
    top:4.2%!important;
    bottom:4.2%!important;
    z-index:-1!important;
    opacity:.9!important;
  }
  body.nc-mobile-portrait-page .stack-right{
    display:none!important;
  }

  body.nc-mobile-portrait-page .nc-mobile-drag-hint{
    bottom:92px!important;
  }
}

@media (max-width: 380px){
  body.nc-mobile-portrait-page .book-wrap{
    width:min(calc(100vw - 52px), 430px)!important;
    margin-left:38px!important;
    margin-right:6px!important;
  }
  body.nc-mobile-portrait-page .tabs.left{
    left:-35px!important;
    width:40px!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab-label{
    font-size:7.8px!important;
  }
}

/* v12.10.1 — mobile category labels wrap to two rows after rotation instead of clipping. */
@media (max-width:760px){
  body.nc-mobile-portrait-page .tabs.left .tab-label{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:1px!important;
    width:78px!important;
    height:auto!important;
    max-width:78px!important;
    max-height:none!important;
    writing-mode:horizontal-tb!important;
    white-space:normal!important;
    overflow:visible!important;
    line-height:1!important;
    left:auto!important;
    top:auto!important;
  }
  body.nc-mobile-portrait-page .tabs.left .tab-label .tab-line{
    display:block!important;
    writing-mode:horizontal-tb!important;
    white-space:nowrap!important;
    font-size:7.3px!important;
    line-height:1!important;
  }
}
@media (max-width:380px){
  body.nc-mobile-portrait-page .tabs.left .tab-label{width:72px!important;}
  body.nc-mobile-portrait-page .tabs.left .tab-label .tab-line{font-size:6.8px!important;}
}

/* v12.10.3 — mobile: move left category label 5px toward the tab center/outside, away from the page cover. */
@media (max-width:760px){
  body.nc-mobile-portrait-page .tabs.left .tab-label{
    transform:translateX(-5px) rotate(-90deg)!important;
  }
}
