.mobile-tools-dock {
  grid-column: 3;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 148px;
  height: 100vh;
  padding: 18px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(18, 42, 37, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 24px rgba(9, 20, 18, 0.08);
  scrollbar-width: thin;
}

#appView {
  grid-template-columns: 220px minmax(0, 1fr);
}

#appView.has-mobile-tools {
  grid-template-columns: 220px minmax(0, 1fr) 148px;
}

.mobile-tools-dock[hidden] {
  display: none !important;
}

.mobile-tools-dock > [class*="launcher"] {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  flex: 0 0 44px !important;
  width: 124px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  #appView {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar,
  #appView > main,
  .topbar,
  .metrics,
  .toolbar,
  .dispatch-grid,
  .orders,
  .rider-pane {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    overflow: hidden;
  }

  .sidebar nav {
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    height: auto;
    min-height: 76px;
    gap: 10px;
  }

  .account {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .status-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .order-card {
    grid-template-columns: 24px minmax(0, 1fr) !important;
  }

  .order-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  body.is-authenticated {
    padding-bottom: 0;
  }

  body.is-authenticated.has-mobile-tools {
    padding-bottom: 68px;
  }

  .mobile-tools-dock {
    position: fixed;
    z-index: 1200;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    grid-column: auto;
    grid-row: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 58px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(18, 25, 35, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 -10px 30px rgba(9, 14, 22, 0.22);
    backdrop-filter: blur(18px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-tools-dock::-webkit-scrollbar {
    display: none;
  }

  .mobile-tools-dock > [class*="launcher"] {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 42px !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
  }

  .qsy-preview-badge {
    display: none !important;
  }
}
