/* Home page mobile bottom navigation — app-style tab bar */
.home-mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  body.index_page {
    --home-mobile-bottom-nav-height: 68px;
  }

  body.index_page .home-mobile-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10040;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
  }

  body.index_page .home-mobile-bottom-nav__inner {
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    min-height: var(--home-mobile-bottom-nav-height);
    padding: var(--spacing-1) var(--spacing-1) var(--spacing-2);
    background: color-mix(in srgb, var(--color-bg-primary) 98%, transparent);
    border-top: var(--border-width-thin) solid var(--border-color-light);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  body.index_page .home-mobile-bottom-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-1);
    min-height: 52px;
    padding: 0 var(--spacing-1) var(--spacing-1);
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  body.index_page .home-mobile-bottom-nav__item:focus-visible {
    outline: var(--border-width-medium) solid var(--color-info);
    outline-offset: var(--spacing-1);
    border-radius: var(--border-radius-md);
  }

  body.index_page .home-mobile-bottom-nav__indicator {
    position: absolute;
    top: calc(var(--spacing-1) * -1.5);
    left: 50%;
    width: 28px;
    height: var(--border-width-medium);
    border-radius: var(--border-radius-full);
    background: var(--color-info);
    transform: translateX(-50%) scaleX(0);
    transition: transform var(--transition-fast, 0.2s ease);
  }

  body.index_page .home-mobile-bottom-nav__item.is-active {
    color: var(--color-info);
  }

  body.index_page .home-mobile-bottom-nav__item.is-active .home-mobile-bottom-nav__indicator {
    transform: translateX(-50%) scaleX(1);
  }

  body.index_page .hero-ai-assistant.is-bottom-nav-focus .hero-ai-assistant__bar {
    box-shadow:
      0 20px 48px rgba(0, 0, 0, 0.28),
      0 0 0 var(--border-width-thin) color-mix(in srgb, var(--color-white) 35%, transparent),
      0 0 0 var(--spacing-1) color-mix(in srgb, var(--color-info) 28%, transparent);
    transform: translateY(-1px);
  }

  body.index_page .home-mobile-bottom-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 21px;
    line-height: 1;
  }

  body.index_page .home-mobile-bottom-nav__label {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-normal, 0.01em);
    white-space: nowrap;
  }

  body.index_page .home-mobile-bottom-nav__item--center {
    margin-top: -18px;
    padding-bottom: 0;
  }

  body.index_page .home-mobile-bottom-nav__center-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: var(--border-radius-full);
    background-color: var(--color-info);
    background-image: linear-gradient(
      145deg,
      var(--gradient-blue-start) 0%,
      var(--gradient-blue-mid) 52%,
      var(--gradient-blue-end) 100%
    );
    border: var(--border-width-thick) solid var(--color-white);
    box-shadow: 0 var(--spacing-2) 22px var(--shadow-blue-default);
  }

  body.index_page .home-mobile-bottom-nav__center-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-white);
    font-size: 22px;
    line-height: 1;
  }

  body.index_page .home-mobile-bottom-nav__label--center {
    color: var(--color-info);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
  }

  body.index_page .fromtopmargin,
  body.index_page .modern-footer {
    padding-bottom: calc(var(--home-mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  body.index_page.home-mobile-sheet-open .home-mobile-bottom-nav,
  body.index_page.home-mobile-fullcalendar-open .home-mobile-bottom-nav,
  body.index_page.home-mobile-bottom-nav-hidden .home-mobile-bottom-nav,
  body.index_page.modal-open .home-mobile-bottom-nav,
  body.index_page:has(#show_log.show) .home-mobile-bottom-nav {
    display: none !important;
  }

  body.index_page.home-mobile-sheet-open .fromtopmargin,
  body.index_page.home-mobile-sheet-open .modern-footer,
  body.index_page.home-mobile-fullcalendar-open .fromtopmargin,
  body.index_page.home-mobile-fullcalendar-open .modern-footer,
  body.index_page.home-mobile-bottom-nav-hidden .fromtopmargin,
  body.index_page.home-mobile-bottom-nav-hidden .modern-footer,
  body.index_page.modal-open .fromtopmargin,
  body.index_page.modal-open .modern-footer {
    padding-bottom: 0;
  }
}

@media (min-width: 768px) {
  .home-mobile-bottom-nav {
    display: none !important;
  }
}
