/* Phone menu (_mobile_nav.html, 2026-11-28). Works in both headers: the ink site header (home-marginalia.css)
   and the light topbar (style.css): the button takes the header's text colour, the panel is always ink.
   Marginalia Bold: solid colours, no borders or divider lines, rounded corners, system font. */
.mnav-btn{display:none;flex:none;width:40px;height:40px;margin-left:2px;padding:0;border:0;border-radius:12px;
  background:transparent;color:inherit;cursor:pointer;place-items:center;-webkit-tap-highlight-color:transparent}
.mnav-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.mnav-btn .mnav-ic-close{display:none}
.mnav-btn[aria-expanded="true"]{background:#ffd435;color:#191f33}
.mnav-btn[aria-expanded="true"] .mnav-ic-open{display:none}
.mnav-btn[aria-expanded="true"] .mnav-ic-close{display:block}
.mnav-btn:focus-visible{outline:3px solid #d64533;outline-offset:2px}

.mnav-panel{position:absolute;left:0;right:0;top:100%;z-index:60;max-height:calc(100vh - 58px);max-height:calc(100dvh - 58px);
  overflow-y:auto;overscroll-behavior:contain;background:#191f33;color:#f9f6ee;padding:10px 20px 24px;
  border-radius:0 0 20px 20px;box-shadow:0 18px 40px -12px rgba(25,31,51,.45);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;text-align:left}
.mnav-panel[hidden]{display:none}
.mnav-h{margin:18px 0 4px;font-size:13px;font-weight:700;color:rgba(249,246,238,.55);letter-spacing:0}
.mnav-link{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 12px;margin:0 -12px;border-radius:12px;
  font-size:17px;font-weight:800;line-height:1.25;color:#f9f6ee;text-decoration:none}
.mnav-link--sub{min-height:42px;font-size:15px;font-weight:700;color:rgba(249,246,238,.78)}
.mnav-link:hover,.mnav-link:focus-visible{background:rgba(249,246,238,.08);outline:none}
.mnav-link[aria-current="page"]{color:#ffd435}
.mnav-tag{flex:none;margin-left:auto;padding:3px 9px;border-radius:12px;background:rgba(249,246,238,.12);color:#f9f6ee;font-size:12.5px;font-weight:800}
.mnav-tag--free{background:#ffd435;color:#191f33}
.mnav-app{display:flex;align-items:center;justify-content:center;min-height:50px;margin-top:22px;border-radius:12px;
  background:#ffd435;color:#191f33;font-size:16px;font-weight:800;text-decoration:none;box-shadow:4px 4px 0 rgba(249,246,238,.18)}

.mnav-login{display:block;width:100%;margin-top:12px;padding:12px;border:0;border-radius:12px;background:transparent;
  color:rgba(249,246,238,.8);font:inherit;font-size:15px;font-weight:600;cursor:pointer}
.mnav-login b{color:#ffd435;font-weight:800}
.mnav-login[hidden]{display:none}

/* Small phones: brand + Sign Up + menu must fit one 390px row, so the header's Log In moves into the menu */
@media(max-width:480px){
  #cw-user-slot .cw-login-btn{display:none}
  .mnav-btn{width:38px;height:38px}
}

/* Phones and small tablets: the desktop links hide below 900px, so the menu takes over */
@media(max-width:899px){
  .mnav-btn{display:grid}
  .topbar .nav{display:none}          /* base.html topbar: its links live in the menu */
  header.topbar,.topbar{position:sticky}
  header:has(.mnav-panel){position:sticky}
}
@media(prefers-reduced-motion:no-preference){
  .mnav-panel:not([hidden]){animation:mnav-in .16s ease-out}
  @keyframes mnav-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
}
