/* tabbar.css: the shared bottom tab bar for phones (js/tabbar.js). Today · Find · Dates · Help · More.
   Shown on screens 720px and narrower; never in print, in the map's full-screen mode or while the on-screen
   keyboard is open (html.tb-kbd). Uses the page tokens (css/pages.css, css/style.css) with fallbacks, light and dark.

   While the bar shows, :root carries --tabbar-h (0px otherwise) and <body> gets that much bottom padding.
   A page's own bottom bars are lifted above it at the end of this file. Class prefix tb-. */
:root { --tabbar-h: 0px; }
.tb { display: none; }

@media screen and (max-width: 720px) {
  html.tb-on { --tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px)); scroll-padding-bottom: calc(var(--tabbar-h) + 8px); }
  html.tb-on.tb-kbd, html.tb-on.mx-fs { --tabbar-h: 0px; }
  html.tb-on body { padding-bottom: var(--tabbar-h); }

  .tb { --tb-bg: var(--surface, #fff); --tb-fg: var(--muted, #5A6878); --tb-on: var(--accent, var(--blue-accent, #2468A8));
    --tb-line: var(--border, #DFE5EC); --tb-tint: var(--hover, #EEF4FB);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; box-sizing: border-box; height: var(--tabbar-h);
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--tb-bg); border-top: 1px solid var(--tb-line); box-shadow: 0 -2px 12px rgba(16, 32, 52, .08);
    font-family: var(--font, "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif); }
  html[data-theme="dark"] .tb { --tb-bg: var(--surface, #121F2D); --tb-fg: var(--muted, #9AAABB); --tb-on: var(--accent, var(--blue-accent, #6CB0F0));
    --tb-line: var(--border, #24374A); --tb-tint: var(--hover, #1B2F43); box-shadow: 0 -2px 12px rgba(0, 0, 0, .4); }
  html.tb-on .tb { display: grid; }
  html.tb-on.tb-kbd .tb, html.tb-on.mx-fs .tb { display: none; }

  .tb-i { position: relative; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 0; min-height: 48px; height: 100%; margin: 0; padding: 5px 2px 4px; border: 0; border-radius: 10px; background: transparent;
    color: var(--tb-fg); font: inherit; font-size: .6875rem; font-weight: 700; line-height: 1.2; letter-spacing: .01em; text-decoration: none;
    cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .tb-i svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tb-i span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-i:active { background: var(--tb-tint); }
  /* The current tab: colour, a heavier label and a marker on the top edge (never colour alone). */
  .tb-i[aria-current], .tb-i[aria-expanded="true"] { color: var(--tb-on); font-weight: 800; }
  .tb-i[aria-current] svg, .tb-i[aria-expanded="true"] svg { stroke-width: 2.4; }
  .tb-i[aria-current]::before { content: ""; position: absolute; top: 0; left: 50%; width: 32px; height: 3px; margin-left: -16px;
    border-radius: 0 0 3px 3px; background: currentColor; }
  .tb-i:focus-visible { outline: 3px solid var(--tb-on); outline-offset: -3px; }

  /* ---- Pages with their own bottom bars: they sit above the tab bar. ---- */
  /* find-school.html: sticky Back / Next (css/find-school.css) */
  html.tb-on .fy-nav { bottom: var(--tabbar-h); }
  html.tb-on:not(.tb-kbd) .fy-nav { padding-bottom: 10px; }
  html.tb-on:has(body.fy-page) { scroll-padding-bottom: calc(104px + var(--tabbar-h)); }
  /* partner pages: the slide-up call to action (css/pages.css); team.html: the build bar (css/team.css) */
  html.tb-on .sticky-cta { bottom: var(--tabbar-h); }
  html.tb-on:not(.tb-kbd) .sticky-cta { padding-bottom: 10px; }
  html.tb-on .tm-build-bar { bottom: var(--tabbar-h); }
  /* "Read it to me" bar (css/listen.css) and toasts (css/help-tools.css, the map's #toast) */
  html.tb-on .ls-bar { bottom: calc(12px + var(--tabbar-h)); }
  html.tb-on body.ls-on { padding-bottom: calc(110px + var(--tabbar-h)); }
  html.tb-on .ht-toast, html.tb-on #toast { bottom: calc(24px + var(--tabbar-h)); }
  /* The map (index.html, css/style.css): the bottom sheet with its #sheet-bar and the map itself end at the tab bar. */
  html.tb-on #sidebar { bottom: var(--tabbar-h); }
  html.tb-on #sidebar[data-sheet="full"] { height: calc(100vh - var(--appbar-h) - 8px - var(--tabbar-h)); height: calc(100dvh - var(--appbar-h) - 8px - var(--tabbar-h)); }
  html.tb-on #map-wrap { bottom: calc(var(--half-h) + var(--tabbar-h)); }
  html.tb-on #sidebar.collapsed ~ #map-wrap { bottom: calc(var(--peek-h) + var(--tabbar-h)); }
}

/* ---- "‹ Back" in the installed app (js/tabbar.js): first in the page header, phones only, and only while there
   is somewhere in the app to go back to (html.tb-back-on). It is a .btn-ghost of the header, so it takes the
   header's own colors in light and dark. Below 480px the brand keeps its logo and its name moves off screen
   (still read out), so the button never crowds the brand, language or menu buttons. */
html .tb-back { display: none; }
@media screen and (max-width: 720px) {
  html.tb-back-on .tb-back:not([hidden]), html.tb-back-on #appbar .tb-back:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; gap: 2px; flex: none;
    box-sizing: border-box; min-width: 44px; height: auto; min-height: 44px; margin: 0 6px 0 0; padding: 0 12px 0 6px; white-space: nowrap; }
  html.tb-back-on .tb-back svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  html.tb-back-on .tb-back:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
}
@media screen and (max-width: 480px) {
  html.tb-back-on .topbar .brand > :not(svg):not(img), html.tb-back-on #appbar .brand > :not(svg):not(img) {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}


/* ---- Desktop top navigation (js/tabbar.js mountTop): 1024px and wider, inside the page's own header (header.topbar
   .wrap or the map's #appbar), which is navy in both themes. Today · Find my school · Map · Dates · Private schools ·
   Help, then "My family" (gold with the number of kids saved) before the header's own dark mode / Español buttons,
   and "More" when the header has none. Below 1024px none of it shows (phones keep the bottom bar). */
.tb-top, .tb-fam, .tb-more-top { display: none; }
@media screen and (min-width: 1024px) {
  html.tb-dnav .tb-top { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 6px; }
  .tb-t { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 9px; color: #DCE6F0;
    font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif); font-size: .94rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
  .tb-t:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  /* The current page: white, bold, a tinted pill and a gold bar under it (not color alone). */
  .tb-t[aria-current] { color: #fff; font-weight: 800; background: rgba(255, 255, 255, .14); }
  .tb-t[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 2px; border-radius: 2px; background: #F2B33D; }
  .tb-t .tb-s { display: none; }
  html.tb-dnav .tb-fam { display: inline-flex; align-items: center; flex: none; box-sizing: border-box; min-height: 44px; padding: 0 14px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .35); color: #fff; font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif); font-size: .94rem; font-weight: 700;
    line-height: 1.2; text-decoration: none; white-space: nowrap; }
  html.tb-dnav .tb-fam:hover { background: rgba(255, 255, 255, .1); }
  .tb-fam-n:not(:empty) { margin-left: .35em; }
  html.tb-dnav .tb-fam.tb-fam-on { background: #F2B33D; border-color: #F2B33D; color: #14324F; font-weight: 800; }
  html.tb-dnav .tb-fam.tb-fam-on:hover { background: #F5C15E; }
  .tb-fam[aria-current] { box-shadow: inset 0 -3px 0 #F2B33D; }
  html.tb-dnav .tb-fam.tb-fam-on[aria-current] { box-shadow: inset 0 -3px 0 #14324F; }
  .tb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  html.tb-dnav .tb-more-top { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; min-height: 44px; }
  .tb-more-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .tb-t:focus-visible, .tb-fam:focus-visible, .tb-more-top:focus-visible { outline: 3px solid #F2B33D; outline-offset: 2px; }
  html.tb-dnav .tb-fam.tb-fam-on:focus-visible { outline-color: #fff; }
  /* The header's own extra links step aside: the bar and the More menu have them. */
  html.tb-dnav header.topbar .wrap > a.btn { display: none !important; }
  html.tb-dnav header.topbar .wrap { flex-wrap: nowrap; gap: 8px; }
  html.tb-dnav header.topbar .wrap > .brand { flex: none; }
  html.tb-dnav header.topbar .wrap > .spacer { flex: 1; }
  html.tb-dnav header.topbar .wrap > .btn { flex: none; }
  /* The map's bar: the short labels, no subtitle or counts, its tool buttons as icons (their names stay for
     screen readers and in the tooltips); the labels come back as the window grows. */
  html.tb-dnav-map #appbar { gap: 8px; }
  html.tb-dnav-map #appbar .brand-sub, html.tb-dnav-map #stats-banner { display: none; }
  html.tb-dnav-map #appbar .appbar-actions { gap: 6px; flex: none; }
  html.tb-dnav-map #appbar .appbar-actions > *, html.tb-dnav-map #appbar > .brand { flex: none; }
  html.tb-dnav-map #share-btn .btn-label, html.tb-dnav-map #export-btn .btn-label, html.tb-dnav-map #pros-btn .btn-label,
  html.tb-dnav-map #print-btn .btn-label, html.tb-dnav-map #lang-btn .btn-label {
    display: inline !important; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  html.tb-dnav-map #share-btn, html.tb-dnav-map #export-btn, html.tb-dnav-map #pros-btn, html.tb-dnav-map #print-btn, html.tb-dnav-map #lang-btn { padding: 8px 10px; }
  html.tb-dnav-map #appbar .appbar-actions .btn svg { flex: none; width: 18px; height: 18px; }
  html.tb-dnav-map #pros-btn svg { fill: currentColor; stroke: none; }
  html.tb-dnav-map .tb-fam { display: none; }
}
/* Short labels: every header below 1280px, the map below 1440px. */
@media screen and (min-width: 1024px) and (max-width: 1279.98px) {
  .tb-t[data-tb-short] .tb-l { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .tb-t[data-tb-short] .tb-s { display: inline; }
  .tb-t { padding: 0 9px; }
}
@media screen and (min-width: 1280px) {
  /* Wide enough for the full labels: the header row grows to the home page's width (1200px). */
  html.tb-dnav header.topbar .wrap { max-width: 1200px; }
  html.tb-dnav-map .tb-fam { display: inline-flex; }
  html.tb-dnav-map #print-btn .btn-label, html.tb-dnav-map #lang-btn .btn-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  html.tb-dnav-map #print-btn, html.tb-dnav-map #lang-btn { padding: 8px 14px; }
}
@media screen and (min-width: 1280px) and (max-width: 1439.98px) {
  html.tb-dnav-map .tb-t[data-tb-short] .tb-l { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  html.tb-dnav-map .tb-t[data-tb-short] .tb-s { display: inline; }
}
@media screen and (min-width: 1680px) {
  html.tb-dnav-map #share-btn .btn-label, html.tb-dnav-map #export-btn .btn-label, html.tb-dnav-map #pros-btn .btn-label {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  html.tb-dnav-map #share-btn, html.tb-dnav-map #export-btn, html.tb-dnav-map #pros-btn { padding: 8px 14px; }
}
@media (prefers-reduced-motion: no-preference) { .tb-i { transition: color .15s ease; } }
@media print { .tb, .tb-back, .tb-top, .tb-fam, .tb-more-top { display: none !important; } }
