/* 하단 탭(templates/betscore/partials/bottom_tabs.html).
   전역 메뉴가 햄버거로 접히는 폭(Tailwind lg 미만, <1024px)에서만 보인다. 앱 웹뷰는 앱이 제 탭을 그리므로 탭이 없다.
   탭이 있으면 body 에 --bs-tabbar-space 가 생기고, 화면 아래에 붙는 것들은 그만큼 위로 올라간다. */
.bs-tabbar { display: none; }

@media (max-width: 1023.98px) {
  body.bs-has-tabbar { --bs-tabbar-space: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: var(--bs-tabbar-space); }

  .bs-tabbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;   /* 모달(z 50)·시트 아래, 본문 위 */
    padding-bottom: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--bs-surface, #131e2b) 96%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--bs-border, #34485c); }
  .bs-tabbar nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 55px; max-width: 640px; margin: 0 auto; }   /* + 윗선 1px = 56px */
  .bs-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    color: var(--bs-muted, #a0b2c5); text-decoration: none; font-size: 11px; font-weight: 600; line-height: 1.2; -webkit-tap-highlight-color: transparent; }
  .bs-tab svg { width: 22px; height: 22px; flex: none; }
  .bs-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bs-tab:hover { color: var(--bs-text, #f2f6fa); }
  .bs-tab[aria-current="page"] { color: var(--bs-accent, #68e0bd); }
  .bs-tab:focus-visible { outline: 2px solid var(--bs-accent, #68e0bd); outline-offset: -4px; border-radius: 10px; }

  /* 탭 위로 올리는 것들 */
  body.bs-has-tabbar .betty-chat-btn { bottom: calc(var(--bs-tabbar-space) + 12px); }   /* 베티 대화 버튼(common/chatbot_widget.html) */
  body.bs-has-tabbar.pb-fab-up .betty-chat-btn { bottom: calc(var(--pb-slip-h, 0px) + var(--bs-tabbar-space) + 12px); }   /* 프로토 조합 띠 위(proto-list.css) */
  body.bs-has-tabbar .pb-slip { bottom: var(--bs-tabbar-space); }   /* 프로토 조합 띠(sticky) */
  body.bs-has-tabbar .betting-slip { bottom: var(--bs-tabbar-space); }   /* 도구 계산기 아래 띠 */
}

/* 프로토 필터 시트(proto-list.css .pb-fpanel)가 화면을 덮는 폭: 탭 위로 올라간 버튼이 시트의 스위치를 가리므로,
   조합 띠가 시트처럼 펼쳐질 때(pb-fab-off)처럼 숨긴다 */
@media (max-width: 760px) {
  body.bs-has-tabbar.pb-fp-open .betty-chat-btn { opacity: 0; visibility: hidden; }
}

/* 769px 이상은 대화 창이 버튼 위에 뜬다(768px 이하는 전체 화면이라 탭을 덮는다) */
@media (min-width: 769px) and (max-width: 1023.98px) {
  body.bs-has-tabbar .betty-chat-widget { bottom: calc(var(--bs-tabbar-space) + 82px); max-height: calc(100vh - 120px - var(--bs-tabbar-space)); }
}
