/* Shared mobile polish loaded last so older page styles cannot override it. */
@media (max-width: 800px) {
  .hub-top-actions a,
  .hub-menu,
  .hub-nav a {
    min-width: 44px;
    min-height: 44px;
  }

  .topbar {
    height: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
  }

  .topbar .global-search {
    min-width: 0;
    margin: 0;
  }

  .topbar .top-actions {
    flex: 0 0 auto;
  }

  .topbar .icon-btn {
    width: 44px;
    height: 44px;
  }

  .nav a {
    min-height: 44px;
  }

  .viewer-directory-tools,
  .vip-directory-tools {
    width: 100%;
  }
}

@media (max-width: 600px) {
  body.hub-shell-page {
    padding-top: 132px !important;
  }

  .hub-topbar {
    min-height: 120px;
    align-content: start;
  }

  .hub-topbar .hub-search {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    margin: 2px 0 0;
    display: block;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .topbar .global-search {
    display: block;
  }

  .topbar .global-search-results {
    top: calc(100% + 8px);
    right: 0;
    left: 0;
  }

  .topbar .top-actions {
    gap: 6px;
  }

  .topbar .top-actions .icon-btn:nth-last-child(n + 3) {
    display: none;
  }

  .hero .buttons,
  .viewer-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero .buttons .btn,
  .viewer-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card,
  .error-card,
  .not-found-card,
  .offline-card {
    padding: 28px 18px;
  }
}

@media (max-width: 380px) {
  .hub-mobile-brand {
    font-size: 19px;
  }

  .hub-topbar {
    gap: 8px;
    padding-inline: 8px;
  }

  .hub-top-actions {
    gap: 4px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }
}
