/*
 * Floating tab bar — measured from Telegram for Android
 * (MainTabsActivity / MainTabsLayout / GlassTabView, night theme):
 *  - glass pill 56dp tall, fully rounded, tabs 48dp inside (4dp inset)
 *  - background #232324 over #181819 at 85% + blur; 0.4dp strokes
 *    (top white 2.4%, bottom white 6.7%)
 *  - tab: 24dp icon centred 16dp from top, 12dp Roboto Medium label at 28.33dp,
 *    selected = accent at 9% behind the tab, accent icon + label
 *  - counter: 16dp tall, centre (+11dp, 10dp), 10dp bold, 1.33dp cut-out ring
 *  - tab width = min(84dp, label + 32dp); bar wraps its tabs and is centred
 */
.tx-dock-fade {
  position: fixed; z-index: 39; left: 0; right: 0; bottom: 0; pointer-events: none;
  height: calc(60px + var(--tx-safe-bottom));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
}
.tx-app[data-view="thread"] .tx-dock-fade { display: none; }

.tx-dock {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(8px + var(--tx-safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 56px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 28px;
  background: rgba(37, 37, 38, 0.85);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 0.4px 0 rgba(255, 255, 255, 0.04),
    inset 0 -0.4px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 0.4px rgba(255, 255, 255, 0.05),
    0 0.85px 2.67px rgba(255, 255, 255, 0.016),
    0 6px 24px rgba(0, 0, 0, 0.35);
  user-select: none;
}
.tx-dock-tab {
  position: relative;
  width: 84px;
  height: 48px;
  flex: 0 0 84px;
  border-radius: 24px;
  color: #fff;
}
.tx-dock-tab::before {
  content: ''; position: absolute; inset: 0; border-radius: 24px;
  background: var(--tx-accent-fill); opacity: 0; transform: scale(0.6);
  transition: opacity 0.32s cubic-bezier(0, 0, 0.2, 1), transform 0.32s cubic-bezier(0, 0, 0.2, 1);
}
.tx-dock-tab.is-active::before { opacity: 0.09; transform: none; }
.tx-tab-icon {
  position: absolute; left: 50%; top: 4px; width: 24px; height: 24px; margin-left: -12px;
  display: flex; align-items: center; justify-content: center; color: inherit;
}
.tx-tab-icon svg { width: 24px !important; height: 24px !important; }
.tx-tab-icon svg path { fill: currentColor !important; }
.tx-tab-icon .icon { font-size: 24px; }
.tx-tab-icon .tx-avatar { width: 24px; height: 24px; font-size: 10px; }
.tx-tab-label {
  position: absolute; left: -8px; right: -8px; top: 28.33px; text-align: center;
  font-size: 12px; line-height: 14px; font-weight: 500; letter-spacing: 0.01em;
  white-space: nowrap; overflow: visible; /* long translations spill over the tab padding instead of being cut */
}
.tx-dock-tab.is-active { color: var(--tx-accent-fill); }
.tx-dock-tab.is-active .tx-tab-label { font-weight: 700; }
.tx-dock-tab.is-active .tx-avatar { box-shadow: 0 0 0 1.5px var(--tx-accent-fill); }

.tx-dock-tab .tx-badge {
  position: absolute; left: calc(50% + 11px); top: 10px; transform: translate(-50%, -50%);
  height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 16px; color: #fff;
  background: var(--tx-accent-fill);
  /* Cut-out ring in the colour of what is behind it (Telegram cuts the icon around the counter) */
  box-shadow: 0 0 0 1.5px var(--tx-dock-cut, rgb(37, 37, 38));
}
.tx-dock-tab { --tx-dock-cut: rgb(37, 37, 38); }
.tx-dock-tab.is-active { --tx-dock-cut: color-mix(in srgb, var(--tx-accent-fill) 14%, rgb(37, 37, 38)); }

html[lang='uk'] .tx-tab-label, html[lang='pt'] .tx-tab-label, html[lang='es'] .tx-tab-label { font-size: 11px; letter-spacing: 0; }
