.mobile-membership-button { display: none; }

@media (max-width: 640px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .side-nav { display: none; }
  .main-content { margin-left: 0; }
  .breadcrumb { display: none; }
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #dfe6ef;
  }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 16px; }
  .topbar .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }
  .topbar .local-status { display: none; }
  .topbar #memberSummary {
    grid-column: 1 / -1;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #52617a;
    font-size: 12px;
    line-height: 1.7;
  }
  .topbar #loginButton.login-button,
  .topbar #logoutButton.logout-button,
  .topbar .mobile-membership-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    padding: 10px 8px;
    border: 1px solid #bfcfe3;
    border-radius: 6px;
    background: #f7faff;
    color: #285b99;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
  }
  .topbar #logoutButton span { display: inline; }
  .topbar .mobile-membership-button { background: #b98327; border-color: #b98327; color: #fff; }
  .topbar .mobile-membership-button.active { background: #94651c; border-color: #94651c; }
  .topbar-actions button svg { width: 17px; height: 17px; flex-shrink: 0; }
  .mobile-nav {
    position: fixed;
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    inset: auto 0 0;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #dfe6ef;
    box-shadow: 0 -4px 16px rgba(31, 48, 78, .05);
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 56px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6f7b90;
    font-size: 11px;
    line-height: 1.3;
  }
  .mobile-nav button svg { width: 20px; height: 20px; }
  .mobile-nav button span { max-width: none; white-space: nowrap; }
  .mobile-nav button.active { background: #edf5ff; color: #2670cf; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}
