/* Load last. Mobile header is brand-only; existing live controls live in Menu. */
#mobileNavigation[hidden], #mobileNavigationPanel[hidden] { display: none !important; }
@media (max-width: 720px) {
  body.mobile-nav-active { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.mobile-nav-active > header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: auto !important;
    min-height: 88px !important;
    gap: 0 !important;
    padding: calc(13px + env(safe-area-inset-top)) 18px 13px !important;
    box-sizing: border-box;
  }
  body.mobile-nav-active > header :is(.header-note,.avatar) { display: none !important; }
  body.mobile-nav-active > header .brand {
    flex: 0 1 auto !important;
    width: auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 11px !important;
    text-decoration: none;
  }
  body.mobile-nav-active > header #brand .brand-name {
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1.25;
    text-align: center;
  }
  body.mobile-nav-active > header .brand-name::after {
    content: 'BY SHIKSHAKUL';
    display: block;
    margin-top: 6px;
    font-family: Manrope, sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .23em;
    color: #a9d7e7;
  }
  #mobileNavigation {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
    z-index: 35;
    font-family: Manrope, sans-serif;
  }
  body.menu-open #mobileNavigation { visibility: hidden; }
  #mobileNavigation .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 12px 19px;
    border-radius: 18px;
    border: 1px solid #a5e6ff70;
    background: #152b3ef5;
    color: #effaff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 #ffffff35, 0 8px 28px #020b1866;
    backdrop-filter: blur(16px);
    cursor: pointer;
  }
  #mobileNavigation .mobile-nav-toggle svg {
    width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8;
  }
  #mobileNavigation .mobile-nav-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(300px, calc(100vw - 32px));
    max-height: min(62dvh, 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid #a5e6ff55;
    background: #0c1d2ff5;
    color: #effaff;
    box-shadow: inset 0 1px 0 #ffffff25, 0 18px 50px #020b1880;
    backdrop-filter: blur(20px);
  }
  #mobileNavigation .mobile-nav-title {
    margin: 0 0 12px;
    color: #b8d8e7;
    font-size: 12px;
    text-align: center;
  }
  #mobileNavigation .mobile-nav-controls,
  #mobileNavigation .header-journey {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 8px;
    margin: 0;
    width: 100%;
  }
  #mobileNavigation .mobile-nav-controls button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: none;
    min-height: 46px;
    height: auto;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #b0d8ee3d;
    border-radius: 12px;
    background: #ffffff0d;
    color: #edf8ff;
    font: inherit;
    font-size: 13px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #mobileNavigation #menuBtn::after { content: 'Chapters'; }
  #mobileNavigation button[hidden] { display: none !important; }
  #mobileNavigation button svg { width: 19px; height: 19px; flex-shrink: 0; }
  #mobileNavigation button:focus-visible { outline: 3px solid #91dfff; outline-offset: 3px; }
  #mobileNavigation button:active { background: #ffffff20; }
}

/* Compact top-right dropdown. */
@media(max-width:720px){
 body.mobile-nav-active{padding-bottom:0}
 body.mobile-nav-active>header{position:relative!important;min-height:88px!important;padding-right:72px!important;padding-left:12px!important}
 body.mobile-nav-active>header .brand{gap:7px!important}
 body.mobile-nav-active>header .brand-name{font-size:17px!important}
 body.mobile-nav-active>header .brand b{width:30px;height:30px}
 #mobileNavigation{position:absolute;top:calc(22px + env(safe-area-inset-top));right:12px;bottom:auto;z-index:35}
 #mobileNavigation .mobile-nav-toggle{width:46px;min-height:44px;padding:10px;border-radius:12px}
 #mobileNavigation .mobile-nav-toggle span{display:none}
 #mobileNavigation .mobile-nav-panel{top:calc(100% + 10px);bottom:auto;width:min(300px,calc(100vw - 24px));padding:12px;border-radius:16px;max-height:70dvh}
 #mobileNavigation .mobile-nav-title{display:none}
 #mobileNavigation .mobile-nav-controls button{width:100%!important;max-width:none!important;min-height:44px;margin:0!important;float:none!important;justify-self:stretch;text-align:center}
 #mobileNavigation .mobile-nav-controls{display:flex;flex-direction:column;gap:8px}
 #mobileNavigation .header-journey{display:flex;flex-direction:column;gap:8px}
}
