/* KANS Academy · phone-first layout (see phone.js). Selectors are prefixed with
   "html body" so they win over the page's own rules, which load later. */
.mbar, .mtabs, .side-scrim, .side-close { display: none; }

@media (max-width: 900px) {
  html body .banner { font-size: .66rem; padding: 4px 12px; line-height: 1.35; }
  html body .mbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
  html body .mbar-brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; min-width: 0; }
  html body .mbar-brand .logo-mark { width: 54px; }
  html body .mbar-brand b { font-family: var(--f-display); font-size: 1.05rem; white-space: nowrap; }
  html body .mbar-who { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--ink); font: 600 .85rem var(--f-body); min-height: 40px; }
  html body .mbar-av { width: 30px; height: 30px; border-radius: 50%; background: var(--copper); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }

  html body .shell { display: block; }
  html body .side { position: fixed; top: 0; bottom: 0; left: 0; width: min(330px, 88vw); height: 100%; z-index: 46; transform: translateX(-104%);
    transition: transform .22s ease-out; box-shadow: 0 0 40px rgb(0 0 0 / .25); border-right: 1px solid var(--line); border-bottom: 0;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 14px; overflow-y: auto; visibility: hidden; }
  html body.side-open .side { transform: none; visibility: visible; }
  html body .side .nav { flex-direction: column; overflow: visible; }
  html body .side .nav button { white-space: normal; padding: 11px 10px; }
  html body .side-close { display: grid; place-items: center; position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1rem; }
  html body .side .brand { padding-right: 44px; }
  html body.side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(10 16 22 / .45); }

  html body .mtabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 18px rgb(0 0 0 / .06); }
  html body .mtabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; min-height: 56px; background: none; border: 0; border-top: 3px solid transparent;
    color: var(--ink-3); font: 600 .7rem var(--f-body); cursor: pointer; }
  html body .mtabs button svg { width: 22px; height: 22px; }
  html body .mtabs button[aria-current="page"] { color: var(--navy); border-top-color: var(--copper); }

  html body .main { padding-block: 18px calc(96px + env(safe-area-inset-bottom, 0px)); padding-inline: 14px; }
  html body .wrap { gap: 18px; }
  html body .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  html body .modal { padding: 10px; align-items: end; }
  html body .modal .card { max-height: calc(100vh - 20px); border-radius: 16px; }
  html body h1 { font-size: 1.6rem; }
  html body .btn { min-height: 42px; }
  html body .hero-logo .logo-h { width: min(340px, 100%); }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { html body .side { transition: none; } }
