/* Mobile-first shell: it intentionally does not depend on JavaScript. */
@media (max-width: 1039px) {
  body { padding-top: 66px; padding-bottom: 88px; overflow-x: hidden; }
  aside { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 7px; width: min(320px, 88vw); padding: 20px 13px calc(30px + env(safe-area-inset-bottom)); background: #fff; border-right: 1px solid #d9dee3; box-shadow: 12px 0 32px rgba(18,30,40,.16); overflow: auto; transform: translateX(-105%); transition: transform .2s ease; }
  .mobile-menu-open aside { transform: translateX(0); }
  .mobile-header { position: fixed; z-index: 45; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; height: 66px; padding: 0 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid #d9dee3; backdrop-filter: blur(12px); }
  .mobile-brand { color: #1f2933; font-size: 1.12rem; font-weight: 850; letter-spacing: -.035em; text-decoration: none; }
  .mobile-menu-toggle { min-height: 40px; padding: 8px 12px; background: #edf2f7; color: #2c3a46; font-size: .84rem; }
  .mobile-menu-backdrop { position: fixed; z-index: 55; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(20,31,42,.35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .mobile-menu-open .mobile-menu-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-app-nav { position: fixed; z-index: 45; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; min-height: 72px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid #d9dee3; box-shadow: 0 -5px 18px rgba(20,30,25,.08); backdrop-filter: blur(12px); }
  .mobile-app-nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 3px; border-radius: 9px; color: #4d5a66; font-size: .7rem; font-weight: 800; line-height: 1.1; text-align: center; text-decoration: none; }
  .mobile-app-nav a[aria-current="page"] { background: #edf4ff; color: #1759bb; }
  .mobile-app-nav a.primary { background: #0b6cff; color: #fff; box-shadow: 0 3px 10px rgba(11,108,255,.25); }
  aside .brand { margin: 2px 10px 14px; color: #1f2933; font-size: 1.25rem; font-weight: 850; text-decoration: none; }
  aside .nav-group { display: grid; gap: 2px; margin: 0 0 8px; }
  aside .nav-group p { margin: 0; padding: 10px 10px 4px; color: #87929d; font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
  aside a, aside button.link { min-height: 42px; padding: 10px 11px; border-radius: 9px; color: #4d5a66; font-size: .95rem; font-weight: 650; text-decoration: none; }
  aside a[aria-current="page"] { background: #edf4ff; color: #1759bb; }
  aside button.link { background: transparent; text-align: left; }
}
