:root {
  --mobile-nav-height: 4.25rem;
  --mobile-nav-accent: #8ec5ff;
  --mobile-nav-accent-dim: rgba(142, 197, 255, 0.14);
}

@media (min-width: 1024px) {
  .mobile-bottom-nav,
  .mobile-bottom-nav__sheet,
  .mobile-bottom-nav__backdrop {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  body.has-mobile-bottom-nav {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 45;
    pointer-events: none;
  }

  .mobile-bottom-nav__shell {
    pointer-events: auto;
    position: relative;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    background: rgb(var(--background) / 0.96);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav__track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    min-height: var(--mobile-nav-height);
    width: 100%;
    margin: 0;
    padding: 0.25rem 0 0.35rem;
  }

  .mobile-bottom-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    width: 100%;
    min-width: 0;
    min-height: 3.1rem;
    padding: 0.25rem 0 0.12rem;
    border: none;
    background: transparent;
    color: rgba(228, 228, 231, 0.72);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 0.24s ease;
  }

  .mobile-bottom-nav__item:active {
    color: var(--mobile-nav-accent);
  }

  .mobile-bottom-nav__item.is-active {
    color: var(--mobile-nav-accent);
  }

  .mobile-bottom-nav__icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
  }

  .mobile-bottom-nav__icon-wrap svg,
  .mobile-bottom-nav__icon-wrap i {
    position: relative;
    z-index: 1;
  }

  .mobile-bottom-nav__icon-wrap svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 1.75;
  }

  .mobile-bottom-nav__indicator {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--mobile-nav-accent-dim);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__indicator,
  .mobile-bottom-nav__item:active .mobile-bottom-nav__indicator {
    opacity: 1;
  }

  .mobile-bottom-nav__label {
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav__fab-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding-bottom: 0;
  }

  .mobile-bottom-nav__fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-top: -1.35rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    color: #0f172a;
    background: #ffffff;
    box-shadow:
      0 0 0 3px rgb(var(--background)),
      0 8px 22px -4px rgba(8, 16, 32, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
      opacity 0.24s ease,
      transform 0.2s ease,
      box-shadow 0.24s ease;
  }

  .mobile-bottom-nav__fab > * {
    position: relative;
    z-index: 1;
  }

  .mobile-bottom-nav__fab svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 2.25;
  }

  .mobile-bottom-nav__fab:active {
    opacity: 0.94;
    transform: scale(0.96);
    box-shadow:
      0 0 0 3px rgb(var(--background)),
      0 4px 12px -2px rgba(8, 16, 32, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .mobile-bottom-nav__fab.is-active {
    box-shadow:
      0 0 0 3px rgb(var(--background)),
      0 0 0 6px var(--mobile-nav-accent-dim),
      0 10px 26px -4px rgba(8, 16, 32, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .mobile-bottom-nav__fab-ring {
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 1px solid rgba(142, 197, 255, 0.35);
    opacity: 0.7;
    pointer-events: none;
  }

  .mobile-bottom-nav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 54;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.32s ease;
  }

  .mobile-bottom-nav__backdrop.is-visible {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .mobile-bottom-nav__sheet {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    max-height: min(78vh, 32rem);
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    background: rgb(var(--background) / 0.98);
    border-top: 1px solid rgba(142, 197, 255, 0.18);
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
    transform: translate3d(0, 100%, 0);
    visibility: hidden;
    pointer-events: none;
    will-change: transform;
    transition:
      transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.42s;
  }

  .mobile-bottom-nav__sheet.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  .mobile-bottom-nav__sheet-handle {
    flex-shrink: 0;
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.65rem auto 0.35rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.16);
  }

  .mobile-bottom-nav__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-bottom-nav__sheet-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fafafa;
  }

  .mobile-bottom-nav__sheet-title svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--mobile-nav-accent);
  }

  .mobile-bottom-nav__sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(228, 228, 231, 0.85);
    cursor: pointer;
    transition: background 0.18s ease;
  }

  .mobile-bottom-nav__sheet-close:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-bottom-nav__sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem 1rem;
  }

  .mobile-bottom-nav__search-field {
    position: relative;
    margin-bottom: 0.75rem;
    display: block;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-bottom-nav__search-field .site-header-search-field {
    position: relative;
    z-index: 1;
    width: 100%;
  }

  .mobile-bottom-nav__sheet--search.is-keyboard-open {
    bottom: var(--mobile-keyboard-offset, 0px);
    max-height: min(
      calc(100dvh - var(--mobile-keyboard-offset, 0px) - 0.75rem),
      28rem
    );
    padding-bottom: 0.75rem;
    transition:
      transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.4s;
  }

  .mobile-bottom-nav__sheet--search.is-keyboard-open.is-open {
    transition:
      transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  .mobile-bottom-nav__search-field:not(.has-search-value) .site-header-search-input {
    caret-color: transparent;
  }

  .mobile-bottom-nav__search-field.has-search-value .site-header-search-fake-ph {
    opacity: 0;
    visibility: hidden;
  }

  .mobile-bottom-nav__search-field.has-search-value .site-header-search-input {
    caret-color: #f4f4f5;
  }

  .mobile-bottom-nav__search-results {
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    max-height: min(42vh, 16rem);
    overflow-y: auto;
  }

  .mobile-bottom-nav__search-results.hidden {
    display: none;
  }

  .mobile-bottom-nav__cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: #e4e4e7;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition:
      background 0.18s ease,
      border-color 0.18s ease,
      color 0.18s ease;
  }

  .mobile-bottom-nav__cat-link + .mobile-bottom-nav__cat-link,
  .mobile-bottom-nav__cat-group + .mobile-bottom-nav__cat-link,
  .mobile-bottom-nav__cat-link + .mobile-bottom-nav__cat-group {
    margin-top: 0.35rem;
  }

  .mobile-bottom-nav__cat-link:active,
  .mobile-bottom-nav__cat-toggle:active {
    background: rgba(142, 197, 255, 0.1);
    border-color: rgba(142, 197, 255, 0.22);
  }

  .mobile-bottom-nav__cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: #e4e4e7;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  .mobile-bottom-nav__cat-toggle[data-state='open'] svg[data-lucide='chevron-down'] {
    transform: rotate(180deg);
  }

  .mobile-bottom-nav__cat-sub {
    display: none;
    padding: 0.25rem 0 0.25rem 0.65rem;
  }

  .mobile-bottom-nav__cat-sub[data-state='open'] {
    display: block;
  }

  .mobile-bottom-nav__cat-sub .mobile-bottom-nav__cat-link {
    font-size: 0.8125rem;
    padding: 0.55rem 0.75rem;
  }

  .mobile-bottom-nav__support-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e4e4e7;
    text-decoration: none;
    transition: background 0.18s ease;
  }

  .mobile-bottom-nav__support-link + .mobile-bottom-nav__support-link {
    margin-top: 0.45rem;
  }

  .mobile-bottom-nav__support-link:active {
    background: rgba(142, 197, 255, 0.08);
  }

  .mobile-bottom-nav__support-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    background: rgba(142, 197, 255, 0.1);
    flex-shrink: 0;
  }

  .mobile-bottom-nav__support-meta {
    flex: 1;
    min-width: 0;
  }

  .mobile-bottom-nav__support-name {
    font-size: 0.875rem;
    font-weight: 600;
  }

  .mobile-bottom-nav__support-desc {
    font-size: 0.6875rem;
    color: rgba(161, 161, 170, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-bottom-nav-sheet-open {
    overflow: hidden;
  }

  .mobile-bottom-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav__item,
  .mobile-bottom-nav__fab,
  .mobile-bottom-nav__sheet,
  .mobile-bottom-nav__backdrop,
  .mobile-bottom-nav__indicator {
    transition: none !important;
  }

  .mobile-bottom-nav__sheet.is-open {
    transform: none !important;
  }

  .mobile-bottom-nav__fab:active {
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 1023px) {
  #mobile-bottom-nav .mobile-bottom-nav__shell {
    background: rgba(255, 255, 255, 0.78) !important;
    border-top: 1px solid rgba(45, 142, 232, 0.16) !important;
    box-shadow: 0 -14px 34px -24px rgba(36, 106, 168, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  #mobile-bottom-nav .mobile-bottom-nav__item,
  #mobile-bottom-nav .mobile-bottom-nav__fab,
  #mobile-bottom-nav .mobile-bottom-nav__sheet-close,
  #mobile-bottom-nav .mobile-bottom-nav__cat-link,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle,
  #mobile-bottom-nav .mobile-bottom-nav__support-link {
    color: var(--ng-ink, #0b1220) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__icon-wrap,
  #mobile-bottom-nav .mobile-bottom-nav__fab,
  #mobile-bottom-nav .mobile-bottom-nav__sheet-close,
  #mobile-bottom-nav .mobile-bottom-nav__support-icon {
    border-radius: 9999px !important;
    background:
      radial-gradient(circle at 25% 14%, #ffffff 0 18%, transparent 19%),
      radial-gradient(circle at 50% 4%, #ffffff 0 24%, transparent 25%),
      radial-gradient(circle at 72% 18%, #ffffff 0 17%, transparent 18%),
      linear-gradient(180deg, #ffffff 0%, #eef8ff 100%) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: var(--ng-ink, #0b1220) !important;
    box-shadow: 0 10px 22px -14px rgba(36, 106, 168, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__icon-wrap svg,
  #mobile-bottom-nav .mobile-bottom-nav__fab svg,
  #mobile-bottom-nav .mobile-bottom-nav__sheet-close svg,
  #mobile-bottom-nav .mobile-bottom-nav__support-icon svg,
  #mobile-bottom-nav .mobile-bottom-nav__support-icon i {
    color: var(--ng-ink, #0b1220) !important;
    stroke: currentColor !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__label,
  #mobile-bottom-nav .mobile-bottom-nav__sheet-title,
  #mobile-bottom-nav .mobile-bottom-nav__support-name,
  #mobile-bottom-nav .mobile-bottom-nav__cat-link span,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle span {
    color: var(--ng-ink, #0b1220) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__support-desc {
    color: var(--ng-muted, #35506d) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet {
    background:
      radial-gradient(ellipse 24rem 9rem at 12% 0%, rgba(255, 255, 255, 0.88), transparent 70%),
      linear-gradient(180deg, rgba(237, 249, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
    border-color: rgba(45, 142, 232, 0.18) !important;
    color: var(--ng-ink, #0b1220) !important;
    box-shadow: 0 -22px 44px -28px rgba(36, 106, 168, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__cat-link,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle,
  #mobile-bottom-nav .mobile-bottom-nav__support-link {
    background: rgba(255, 255, 255, 0.72) !important;
    border-color: rgba(45, 142, 232, 0.13) !important;
    border-radius: 1rem !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__indicator,
  #mobile-bottom-nav .mobile-bottom-nav__fab-ring {
    background: var(--ng-blue, #2d8ee8) !important;
    box-shadow: 0 0 16px rgba(45, 142, 232, 0.48) !important;
  }
}

@media (max-width: 1023px) {
  #mobile-bottom-nav {
    --mobile-nav-accent: var(--ng-blue, #2f7fe0);
    --mobile-nav-accent-dim: rgba(47, 127, 224, 0.12);
  }

  #mobile-bottom-nav .mobile-bottom-nav__shell {
    background: rgba(255, 255, 255, 0.94) !important;
    border-top: 1px solid var(--ng-blue-line, rgba(47, 127, 224, 0.14)) !important;
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: 0 -8px 30px -18px rgba(23, 68, 122, 0.4) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__item,
  #mobile-bottom-nav .mobile-bottom-nav__label {
    color: var(--ng-ink-soft, #24405f) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__icon-wrap {
    background: var(--ng-sky-2, #e4f1ff) !important;
    border: none !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__icon-wrap svg,
  #mobile-bottom-nav .mobile-bottom-nav__icon-wrap i {
    color: var(--ng-blue-deep, #1b62bd) !important;
    stroke: currentColor !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__indicator {
    background: var(--ng-blue, #2f7fe0) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__fab {
    border: 1px solid rgba(27, 98, 189, 0.5) !important;
    background: linear-gradient(180deg, #4f9bf0 0%, #2f7fe0 52%, #1b62bd 100%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 10px 24px -10px rgba(47, 127, 224, 0.6) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__fab svg,
  #mobile-bottom-nav .mobile-bottom-nav__fab > * {
    color: #ffffff !important;
    stroke: currentColor !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__fab-ring {
    border-color: rgba(47, 127, 224, 0.28) !important;
    background: rgba(255, 255, 255, 0.94) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__backdrop {
    background: rgba(11, 27, 46, 0.42) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet {
    background: #ffffff !important;
    border-top: 1px solid var(--ng-blue-line, rgba(47, 127, 224, 0.14)) !important;
    box-shadow: 0 -20px 50px -25px rgba(23, 68, 122, 0.5) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet-handle {
    background: rgba(47, 127, 224, 0.25) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet-title {
    color: var(--ng-ink, #0b1b2e) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet-title svg {
    color: var(--ng-blue, #2f7fe0) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet-close {
    border: 1px solid var(--ng-blue-line, rgba(47, 127, 224, 0.14)) !important;
    background: var(--ng-sky-1, #f3f9ff) !important;
    color: var(--ng-ink-soft, #24405f) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__cat-link,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle {
    background: var(--ng-sky-1, #f3f9ff) !important;
    border: 1px solid var(--ng-blue-line, rgba(47, 127, 224, 0.14)) !important;
    color: var(--ng-ink, #0b1b2e) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__cat-link:active,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle:active {
    background: var(--ng-sky-2, #e4f1ff) !important;
    border-color: rgba(47, 127, 224, 0.3) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__cat-link svg,
  #mobile-bottom-nav .mobile-bottom-nav__cat-toggle svg {
    color: var(--ng-blue, #2f7fe0) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__search-results {
    background: #ffffff !important;
    border: 1px solid var(--ng-blue-line, rgba(47, 127, 224, 0.14)) !important;
    box-shadow: 0 20px 45px -25px rgba(23, 68, 122, 0.5) !important;
  }

  #mobile-bottom-nav .mobile-bottom-nav__sheet-body,
  #mobile-bottom-nav .mobile-bottom-nav__sheet-body p {
    color: var(--ng-muted, #5b7391) !important;
  }
}
