/* ==================================================================
   Общий tabbar для всех мини-приложений.
   Подключается через <link rel="stylesheet" href="/shared/tabbar.css">.
   Переменные намеренно с префиксом --tb-, чтобы не конфликтовать
   с :root каждого приложения.

   Дизайн: компактная плавающая капсула, только иконки — подпись
   разворачивается лишь у активного таба. Прячется при скролле вниз
   и возвращается при скролле вверх или у самого верха страницы,
   чтобы не перекрывать контент и не "висеть" постоянно на экране.
================================================================== */
:root{
  --tb-line: rgba(255,255,255,0.07);
  --tb-text: #eef0f3;
  --tb-muted: #82868f;
  --tb-accent: #5b8cff;
  --tb-accent-soft: rgba(91,140,255,0.20);
  --tb-radius: 18px;
  --tb-icon-size: 34px;
  --tb-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 10px calc(8px + var(--tb-safe-bottom));
  pointer-events: none;
  transform: translateY(0);
  opacity: 1;
  transition: transform .26s cubic-bezier(.4,0,.2,1), opacity .22s ease;
}
.tabbar.tb-hidden {
  transform: translateY(calc(100% + 20px));
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .tabbar { transition: opacity .12s linear; transform: none !important; }
  .tabbar.tb-hidden { opacity: 0; }
}

.tabbar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  background: rgba(18,19,24,0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius);
  box-shadow: 0 8px 22px rgba(0,0,0,0.30);
  max-width: calc(100vw - 20px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar-inner::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 9px;
  border-radius: 13px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease;
  flex: 0 0 auto;
}
.tab:hover { background: rgba(255,255,255,0.05); }
.tab:focus-visible { outline: 2px solid var(--tb-accent); outline-offset: 2px; }

.tab .logo {
  width: var(--tb-icon-size);
  height: var(--tb-icon-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
  background: transparent;
  transition: background .18s ease, transform .18s cubic-bezier(.34,1.56,.64,1);
}

.tab .label {
  display: inline-block;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--tb-text);
  white-space: nowrap;
  transition: max-width .22s ease, opacity .16s ease, margin .22s ease;
}

.tab.active .logo {
  background: var(--tb-accent-soft);
  transform: scale(1.05);
}
.tab.active .label {
  max-width: 120px;
  opacity: 1;
  margin-left: 4px;
}
