/* MADA V112 - one fixed bottom bar throughout the signed-in application.
   The old nav instances belong to replaceable page content; hide duplicates. */
:root{--mada112-nav-space:calc(70px + env(safe-area-inset-bottom,0px))}
.mada112-permanent-nav{display:none}
@media(max-width:1400px){
 body.mada112-nav-live .mada112-permanent-nav{display:flex!important;position:fixed!important;
   inset-inline:0!important;bottom:0!important;top:auto!important;left:0!important;right:0!important;
   width:100vw!important;max-width:100vw!important;margin:0!important;z-index:2147483002!important;
   box-sizing:border-box!important;align-items:stretch;justify-content:space-between;gap:3px;
   min-height:64px;padding:5px max(7px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(7px,env(safe-area-inset-left,0px));
   background:#fff!important;border:1px solid #e3e9f0!important;border-bottom:0!important;border-radius:17px 17px 0 0!important;
   box-shadow:0 -7px 24px rgba(34,51,79,.13)!important;transform:none!important;
   opacity:1!important;visibility:visible!important;pointer-events:auto!important;isolation:isolate;
   -webkit-transform:translateZ(0);-webkit-tap-highlight-color:transparent;
 }
 body.mada112-nav-live .mada112-permanent-nav button{
   flex:1 1 0!important;min-width:0!important;min-height:49px!important;width:auto!important;
   display:flex!important;align-items:center!important;justify-content:center!important;flex-direction:column!important;gap:1px!important;
   padding:3px 2px!important;background:transparent!important;border:0!important;border-radius:12px!important;
   box-shadow:none!important;transform:none!important;white-space:normal!important;color:#334860!important;
   font-size:12px!important;font-weight:800!important;line-height:1.16!important;cursor:pointer;touch-action:manipulation;
 }
 body.mada112-nav-live .mada112-permanent-nav button>span{font-size:clamp(20px,5.2vw,25px);line-height:1!important;font-weight:900;color:inherit}
 body.mada112-nav-live .mada112-permanent-nav button>small{font-size:clamp(10px,2.65vw,13px)!important;color:inherit!important;font-weight:800!important;line-height:1.2!important}
 body.mada112-nav-live .mada112-permanent-nav button.is-current{background:#fff0f8!important;color:#b51466!important}
 body.mada112-nav-live .mada112-permanent-nav button:focus-visible{outline:3px solid #2575b5!important;outline-offset:-2px}
 /* The old V105/V106/V109 bars disappeared on route changes and caused duplicates. */
 body.mada112-nav-live :is(.mada105-bottom,.mada-unified-bottom,.mada109-focus-nav){display:none!important}
 body.mada112-nav-live #mobile-simple-back{display:none!important}
 /* Document content must never be hidden behind the bottom tabs. */
 body.mada112-nav-live:not(.mada110-wide-mode):not(.number-piano-landscape) #main{padding-bottom:calc(var(--mada112-nav-space) + 12px)!important}
 body.mada112-nav-live:not(.mada110-wide-mode):not(.number-piano-landscape) .mada-shell{padding-bottom:0!important}
 /* Activity pages are viewport-fitted: reserve bar space instead of covering notes. */
 body.mada112-nav-live.mada110-wide-mode #main [data-mada110-wide]{
   bottom:var(--mada112-nav-space)!important;height:calc(100dvh - var(--mada112-nav-space))!important;
   max-height:calc(100dvh - var(--mada112-nav-space))!important;
 }
 body.mada112-nav-live.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance{
   bottom:var(--mada112-nav-space)!important;height:calc(100dvh - var(--mada112-nav-space))!important;
   max-height:calc(100dvh - var(--mada112-nav-space))!important;
 }
 body.mada112-nav-live.number-responsive-page.number-piano-landscape #main{padding-bottom:0!important}
 /* Other fullscreen stage wrappers must not cover the bar. */
 body.mada112-nav-live :is(.number-exam-panel.exam-finished){bottom:var(--mada112-nav-space)!important}
}
@media(max-width:1400px) and (orientation:landscape) and (max-height:550px){
 body.mada112-nav-live .mada112-permanent-nav{min-height:43px!important;border-radius:10px 10px 0 0!important;
   padding:1px max(5px,env(safe-area-inset-right,0px)) calc(1px + env(safe-area-inset-bottom,0px)) max(5px,env(safe-area-inset-left,0px))!important}
 body.mada112-nav-live .mada112-permanent-nav button{min-height:38px!important;flex-direction:row!important;gap:5px!important;padding:2px 4px!important}
 body.mada112-nav-live .mada112-permanent-nav button>span{font-size:19px!important}
 body.mada112-nav-live .mada112-permanent-nav button>small{font-size:11px!important}
}
@media(min-width:1401px){
 body.mada112-nav-live .mada112-permanent-nav{display:none!important}
 body.mada112-nav-live .mada105-bottom,body.mada112-nav-live .mada-unified-bottom{display:none!important}
}
@media(prefers-reduced-motion:reduce){.mada112-permanent-nav *{transition:none!important}}
/* Make the dedicated piano itself use the remaining viewport in either
   orientation. Previously only portrait used fixed positioning. */
@media(max-width:1400px){
 body.mada112-nav-live.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance{
   position:fixed!important;inset:0 0 var(--mada112-nav-space) 0!important;
   left:0!important;right:0!important;top:0!important;bottom:var(--mada112-nav-space)!important;
   width:100vw!important;max-width:100vw!important;
   height:calc(100dvh - var(--mada112-nav-space))!important;max-height:calc(100dvh - var(--mada112-nav-space))!important;
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important;
   z-index:51000!important;transform:none!important;min-height:0!important;overflow:hidden!important;
   padding:max(5px,env(safe-area-inset-top,0px)) max(5px,env(safe-area-inset-right,0px)) 4px max(5px,env(safe-area-inset-left,0px))!important;
 }
 body.mada112-nav-live.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-stage{
   min-height:0!important;height:100%!important;max-height:100%!important;overflow:hidden!important;
 }
}
