/* Kinda Critic v2 — phone bottom tab bar (US-24).
 *
 * Linked only when KC_UI_V2=1. Below 640px the top nav's link list goes (the
 * wordmark and search stay) and a fixed bar takes its place. From 640px up the
 * bar is hidden and the top nav is what it was. The page body gets bottom
 * padding so the last row of content is never under the bar.
 */
.tabbar { display: none; }

@media (max-width: 639.98px) {
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-tabbar nav.site { display: none; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0; min-height: 56px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px; color: var(--ink-muted);
    font-size: var(--t-label); font-weight: 500; line-height: 1.2;
    text-decoration: none;
  }
  .tabbar a svg { flex: none; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar a:hover { color: var(--ink-2); text-decoration: none; }
  /* The bar sits on the screen edge, so an outside ring would be clipped: draw it inside. */
  .tabbar a:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: var(--r-md); }
  .tabbar a[aria-current="page"] { color: var(--accent); }
}
