/* Friday Funded Prop Mini App — compact, stable bottom navigation.
   This is intentionally scoped away from the standalone Rush app, which owns
   its separate two-destination navigation. */
@media (max-width: 768px) {
  html.miniapp-dashboard:not(.rush-miniapp-mode) {
    --ff-bottom-nav-offset: 8px;
    --ff-bottom-nav-height: 68px;
    --ff-bottom-nav-content-gap: 18px;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .app-shell {
    padding-bottom: calc(96px + var(--ff-safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .app-shell > .bottom-nav {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left, 0px)) !important;
    right: max(10px, env(safe-area-inset-right, 0px)) !important;
    top: auto !important;
    bottom: var(--ff-bottom-nav-bottom, max(8px, env(safe-area-inset-bottom, 0px))) !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: 56px !important;
    gap: 2px !important;
    width: auto !important;
    max-width: none !important;
    height: 68px !important;
    min-height: 68px !important;
    padding: 5px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px !important;
    background: rgba(12, 14, 18, 0.97) !important;
    box-shadow: 0 13px 32px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
    -webkit-backdrop-filter: blur(22px) saturate(130%) !important;
    backdrop-filter: blur(22px) saturate(130%) !important;
    isolation: isolate !important;
    transform: none !important;
    z-index: 90 !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body.rush-tab-enabled:not(.admin-page) .app-shell > .bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body.backtest-mode:not(.admin-page) .app-shell > .bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  @supports selector(.bottom-nav:has(.nav-button)) {
    html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .app-shell > .bottom-nav:has(.nav-button[data-tab="rush"]:not([hidden])) {
      grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav::before {
    content: none !important;
    display: none !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button,
  html.miniapp-dashboard:not(.rush-miniapp-mode) body.view-accounts-active:not(.admin-page) .bottom-nav .nav-button,
  html.miniapp-dashboard:not(.rush-miniapp-mode) body.view-accounts-active:not(.admin-page) .bottom-nav .nav-button.is-active {
    position: relative !important;
    display: grid !important;
    grid-template-rows: 28px 12px !important;
    align-content: center !important;
    justify-items: center !important;
    gap: 2px !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    margin: 0 !important;
    padding: 5px 1px 4px !important;
    overflow: hidden !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    background: transparent !important;
    color: #8c939e !important;
    box-shadow: none !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: color 150ms ease, transform 110ms ease !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button::before,
  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button::after {
    content: none !important;
    display: none !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button.is-active {
    border-color: transparent !important;
    background: transparent !important;
    color: #f7f8fa !important;
    box-shadow: none !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-icon,
  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button.is-active .nav-icon {
    display: grid !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    place-items: center !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 110ms ease !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button.is-active .nav-icon {
    border-color: rgba(239, 75, 85, 0.3) !important;
    background: linear-gradient(180deg, rgba(239, 75, 85, 0.18), rgba(239, 75, 85, 0.06)) !important;
    color: #ff6872 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-icon svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-icon img {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    opacity: 0.76 !important;
    filter: grayscale(1) brightness(1.65) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button.is-active .nav-icon img {
    opacity: 1 !important;
    filter: invert(47%) sepia(77%) saturate(1260%) hue-rotate(319deg) brightness(104%) contrast(100%) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-label,
  html.miniapp-dashboard:not(.rush-miniapp-mode)[lang="ru"] body:not(.admin-page) .bottom-nav .nav-label {
    position: static !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: nowrap !important;
    border: 0 !important;
    color: currentColor !important;
    font-size: 9px !important;
    font-weight: 760 !important;
    line-height: 12px !important;
    letter-spacing: 0.01em !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button.is-active .nav-label {
    color: #f7f8fa !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body.rush-tab-enabled:not(.admin-page) .bottom-nav .nav-label {
    font-size: 8px !important;
    letter-spacing: 0 !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button:active {
    transform: none !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button:active .nav-icon {
    transform: scale(0.91) !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button:focus-visible {
    outline: 1px solid rgba(255, 104, 114, 0.9) !important;
    outline-offset: -3px !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body.terminal-keyboard-open .bottom-nav {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(120%) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-button,
  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-icon {
    transition: none !important;
  }
}

@media (max-width: 340px) {
  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .app-shell > .bottom-nav {
    left: max(7px, env(safe-area-inset-left, 0px)) !important;
    right: max(7px, env(safe-area-inset-right, 0px)) !important;
    gap: 0 !important;
  }

  html.miniapp-dashboard:not(.rush-miniapp-mode) body:not(.admin-page) .bottom-nav .nav-label {
    font-size: 8px !important;
  }
}
