/* The portal shell: the navigation that wraps every page.
 *
 * Phone first, like the rest of this app. On a phone it is a bottom bar in the
 * same dock language the map already uses, because that is where a thumb is.
 * At 900px and up it becomes a top bar, because a laptop has no thumb and the
 * vertical space is worth more than the reach.
 *
 * Every token here carries a fallback, so the file works on a page that has
 * not loaded app.css. On the map, which has, it picks up the real brand
 * values and matches exactly. That is what makes this a drop in.
 */

.fshell {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(160%) blur(10px);
  border-top: 1px solid var(--line, #e4e7ec);
  box-shadow: 0 -6px 24px rgba(16, 24, 40, 0.10);
  padding-bottom: var(--safe-b, env(safe-area-inset-bottom, 0px));
  font-family: var(--body, 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}
.fshell-in {
  display: flex; align-items: center; gap: 10px;
  max-width: 1180px; margin: 0 auto; padding: 4px 8px;
}
/* The brand block is desktop only. On a phone the page owns its own header,
   and repeating the logo in the bar would eat a third of the bar's width. */
.fshell-brand { display: none; }
.fshell-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; flex: 1; min-width: 0; }

.fshell-tab {
  position: relative; min-height: 56px; border-radius: 12px; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2, #344054);
  font-family: var(--head, 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif);
  font-weight: 700; font-size: 12px; line-height: 1.15; text-align: center; padding: 4px 2px;
  -webkit-tap-highlight-color: transparent;
}
.fshell-tab svg { width: 21px; height: 21px; flex: none; }
.fshell-tab:hover { background: var(--blue-tint, #eaf4fe); }
.fshell-tab:focus-visible { outline: 3px solid var(--blue, #188bf6); outline-offset: -3px; }
/* The current section is marked three ways on purpose: a tint, a darker ink,
   and a solid bar. Colour alone is not a signal somebody with low vision can
   read, and aria-current alone is not one a sighted person can. */
.fshell-tab[aria-current="page"] { background: var(--blue-tint, #eaf4fe); color: #0b4f96; }
.fshell-tab[aria-current="page"]::after {
  content: ''; position: absolute; left: 18%; right: 18%; top: 0; height: 3px;
  border-radius: 0 0 3px 3px; background: #0b4f96;
}
.fshell-tab .fshell-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

@media (min-width: 900px) {
  .fshell {
    top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line, #e4e7ec);
    padding-bottom: 0; padding-top: var(--safe-t, env(safe-area-inset-top, 0px));
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  }
  .fshell-in { padding: 8px 16px; }
  .fshell-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
    flex: none; min-height: 44px; padding: 0 8px 0 4px; border-radius: 10px;
  }
  .fshell-brand:hover { background: var(--blue-tint, #eaf4fe); }
  .fshell-brand img { height: 30px; width: auto; display: block; }
  .fshell-brand b {
    font-family: var(--head, 'Montserrat', sans-serif); font-weight: 800; font-size: 14.5px;
    letter-spacing: -0.01em; color: var(--ink, #101828); white-space: nowrap;
  }
  .fshell-tabs { display: flex; flex: 0 1 auto; margin-left: auto; gap: 4px; }
  .fshell-tab {
    min-height: 44px; flex-direction: row; gap: 8px; padding: 0 14px; font-size: 13.5px;
  }
  .fshell-tab svg { width: 18px; height: 18px; }
  .fshell-tab[aria-current="page"]::after { top: auto; bottom: 0; left: 12px; right: 12px; height: 3px; border-radius: 3px 3px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fshell, .fshell * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
