/* Shared mobile app tab bar — visible ≤900px */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 0px;
  --tabbar-bg: rgba(255, 255, 255, 0.94);
  --tabbar-line: rgba(10, 54, 50, 0.08);
  --tabbar-muted: #7a847c;
  --tabbar-active: #0a5c5f;
}

.app-tabbar { display: none; }

@media (max-width: 900px) {
  :root {
    --tabbar-h: calc(64px + var(--safe-bottom));
  }

  html {
    scroll-padding-bottom: var(--tabbar-h);
  }

  body {
    padding-bottom: var(--tabbar-h);
    -webkit-tap-highlight-color: transparent;
  }

  .app-tabbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: var(--tabbar-h);
    padding: 8px 6px var(--safe-bottom);
    background: var(--tabbar-bg);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    border-top: 1px solid var(--tabbar-line);
    box-shadow: 0 -12px 32px rgba(8, 51, 47, 0.08);
  }

  .app-tabbar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    color: var(--tabbar-muted);
    border-radius: 14px;
    text-decoration: none;
    transition: color .15s ease, transform .15s ease;
    -webkit-user-select: none;
    user-select: none;
  }

  .app-tabbar .tab-item:active { transform: scale(0.9); }

  .app-tabbar .tab-item.is-active {
    color: var(--tabbar-active);
  }

  .app-tabbar .tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, width .18s ease, height .18s ease, border-radius .18s ease;
  }

  .app-tabbar .tab-icon svg {
    width: 23px;
    height: 23px;
  }

  .app-tabbar .tab-item.is-active .tab-icon {
    width: 52px;
    height: 30px;
    border-radius: 16px;
    background: rgba(15, 133, 129, 0.16);
  }

  .app-tabbar .tab-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
    font-family: "Kalpurush", "Nirmala UI", sans-serif;
  }

  .app-tabbar .tab-item-form {
    display: contents;
  }
  .app-tabbar .tab-item-form .tab-item {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    padding: 0;
  }

  .app-tabbar .tab-item-btn {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    padding: 0;
    color: inherit;
  }
}
