/* Bottom menu shared by every MINI App page (nav.js adds it).
   Pages keep room for it with var(--nav-space, 0px) and use var(--safe-bottom, env(...)) for the
   iPhone home bar, so a page without this file looks exactly as before. */
:root {
  --nav-h: 58px;
  --nav-space: calc(var(--nav-h) + env(safe-area-inset-bottom));
  --safe-bottom: 0px; /* the menu already covers the home bar */
}

.vixi-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; /* under backdrops (9) and sheets (10) */
  background: var(--paper, #FAF9F5);
  border-top: 1.5px solid var(--line, #E6E2D6);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.vixi-nav ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 480px; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.vixi-nav a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3, #5B6690); text-decoration: none; font-size: 11px; font-weight: 600; line-height: 1.2;
  -webkit-tap-highlight-color: transparent; position: relative;
}
.vixi-nav svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.vixi-nav a[aria-current="page"] { color: var(--navy, #0A2A86); }
.vixi-nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1.5px; left: 22%; right: 22%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--orange, #FF7A45);
}
.vixi-nav a:focus-visible { outline: 3px solid var(--blue, #1F3FE0); outline-offset: -3px; }

/* Hidden while a text field has focus (keyboard open); pages get their space back. */
html.vixi-typing { --nav-space: 0px; --safe-bottom: env(safe-area-inset-bottom); }
html.vixi-typing .vixi-nav { display: none; }
