:root { --main-tabs-height: calc(64px + var(--safe-bottom)); }

.bottom-tabs {
  position: absolute;
  z-index: 1050;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: var(--main-tabs-height);
  padding: 4px 16px calc(4px + var(--safe-bottom));
  border-top: 1px solid #e9e4f2;
  background: #fcfbff;
  color: #8a849c;
}
.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  padding: 2px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.bottom-tab-icon { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 11px; }
.bottom-tab-icon svg { width: 23px; height: 23px; }
.bottom-tab[aria-current="page"] { color: #6753d5; font-weight: 650; }
.bottom-tab[aria-current="page"] .bottom-tab-icon { background: #eee9fc; }
.bottom-tab:hover { color: #6753d5; }
.bottom-tab:focus-visible { outline: 2px solid #7365f6; outline-offset: -2px; }
.tools-page.has-main-tabs > .tool-scroll { padding-bottom: calc(24px + var(--main-tabs-height)); }
.tools-page .bottom-tab { color: inherit; }
.tools-page .bottom-tab[aria-current="page"] { color: #6753d5; }

.home-tab-page { --home-tabs-offset: var(--main-tabs-height); }
.home-tab-page > .composer { bottom: calc(var(--home-tabs-offset) + var(--keyboard-inset)); padding-bottom: 14px; }
.chat-page.home-tab-page > .chat-feed { padding-bottom: calc(190px + var(--home-tabs-offset) + var(--keyboard-inset)); }
.chat-page.home-tab-page.attachment-open > .chat-feed { padding-bottom: calc(190px + var(--attachment-push) + var(--home-tabs-offset) + var(--keyboard-inset)); }
.chat-page.home-tab-page.attachment-opening > .chat-feed { animation-name: homeFeedPushUp; }
.chat-page.home-tab-page.attachment-closing > .chat-feed { animation-name: homeFeedPushDown; }
@keyframes homeFeedPushUp {
  from { padding-bottom: calc(190px + var(--home-tabs-offset) + var(--keyboard-inset)); }
  to { padding-bottom: calc(190px + var(--attachment-push) + var(--home-tabs-offset) + var(--keyboard-inset)); }
}
@keyframes homeFeedPushDown {
  from { padding-bottom: calc(190px + var(--attachment-push) + var(--home-tabs-offset) + var(--keyboard-inset)); }
  to { padding-bottom: calc(190px + var(--home-tabs-offset) + var(--keyboard-inset)); }
}
html.keyboard-open .bottom-tabs { display: none; }
html.keyboard-open .home-tab-page { --home-tabs-offset: 0px; }
html.keyboard-open .home-tab-page > .composer { padding-bottom: 12px; }
.tools-page .bottom-tabs { border-color: var(--tool-line); background: var(--tool-bg); color: var(--tool-muted); }
.tools-page .bottom-tab[aria-current="page"], .tools-page .bottom-tab:hover { color: var(--tool-accent-ink); }
.tools-page .bottom-tab[aria-current="page"] .bottom-tab-icon { background: var(--tool-soft); }
@media (forced-colors: active) {
  .bottom-tab[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-page.home-tab-page > .chat-feed { animation: none !important; }
}
