/* Mobile bottom tab bar. Each site sets --tab-bg, --tab-fg, --tab-accent, --tab-line before this file. */
.tabbar, .tab-next { display: none; }
@media (max-width: 719px) {
  html.has-tabbar body { padding-bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
  html.tabs-on [data-tab]:not(.tab-active) { display: none !important; }
  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--tab-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--tab-line);
    box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, 0.45);
  }
  .tabbar > button, .tabbar > a {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    min-height: 3.6rem; padding: 0.25rem 0.1rem;
    border: 0; border-radius: 12px; background: none; cursor: pointer;
    font: inherit; font-size: 0.7rem; font-weight: 600; line-height: 1.1; letter-spacing: 0.01em;
    color: var(--tab-fg); text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar > * span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar > [aria-current] { color: var(--tab-accent); }
  .tabbar > [aria-current] svg { transform: translateY(-1px); }
  .tabbar > *:active { background: var(--tab-press, rgba(127, 127, 127, 0.15)); }
  .tabbar > *:focus-visible { outline: 2px solid var(--tab-accent); outline-offset: -2px; }
  html.tabs-on .tab-next {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 3rem; margin: 1.75rem 0 0.5rem;
    border: 1px solid var(--tab-line); border-radius: 12px; background: none; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--tab-accent);
  }
  @media (prefers-reduced-motion: no-preference) {
    html.tabs-on [data-tab].tab-active.tab-anim { animation: tab-in 180ms ease-out; }
    @keyframes tab-in { from { transform: translateY(8px); } to { transform: none; } }
  }
}

/* "Show all" for long lists (phones only; desktop shows everything) */
.show-all { display: none; }
@media (max-width: 719px) {
  .collapsed { display: none !important; }
  .show-all {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 3rem; margin: 0.75rem 0 0;
    border: 1.5px dashed var(--tab-line); border-radius: 12px; background: none; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--tab-accent);
  }
}

/* "Add to home screen" banner, just above the tab bar (phones only) */
.install-banner {
  position: fixed; left: 0.6rem; right: 0.6rem; z-index: 60;
  bottom: calc(4.9rem + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 0.8rem;
  background: var(--tab-bg); color: inherit;
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--tab-line); border-radius: 16px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  .install-banner { animation: ib-in 260ms ease-out; }
  @keyframes ib-in { from { transform: translateY(16px); } to { transform: none; } }
}
.install-banner img { border-radius: 10px; flex: none; }
.install-banner p { margin: 0; flex: 1; min-width: 0; font-size: 0.85rem; line-height: 1.3; }
.install-banner strong { display: block; font-size: 0.92rem; }
.install-banner span { opacity: 0.75; }
.install-banner .ib-install {
  flex: none; min-height: 2.5rem; padding: 0 1rem; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; background: var(--tab-accent); color: var(--tab-on-accent, #fff);
}
.install-banner .ib-close {
  flex: none; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: inherit; opacity: 0.6;
}
@media (min-width: 720px) { .install-banner { display: none; } }
