/**
 * Network page — mobile-first responsive (320px–767px+)
 * Full cards: 360px–767px · Compact list: ≤359px only
 * Scoped to body.page-network
 */
.page-network {
  --net-primary: #1e40af;
  --net-secondary: #7c3aed;
  --net-success: #10b981;
  --net-bg: #f8fafc;
  --net-bottom-nav-h: var(--app-m-bottom-nav-h, 68px);
  --net-appbar-h: 56px;
  --net-search-h: 52px;
  --net-fab-size: 52px;
  --net-radius: 14px;
  --net-touch: 44px;
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
}

.page-network .btn-profile-icon {
  display: none;
}

.page-network .site-content {
  background: var(--net-bg);
}

/* ── Desktop: hide mobile-only chrome ── */
.net-mobile-appbar,
.net-mobile-search,
.net-bottom-nav,
.app-m-bottom-nav,
.net-filter-fab,
.net-sheet-backdrop,
.net-menu-sheet {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE (≤767px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  body.page-network {
    --header-h: 0px;
    --net-fab-gap: 20px;
    --net-content-bottom: calc(
      var(--net-bottom-nav-h) + var(--net-fab-size) + var(--net-fab-gap) + 16px + env(safe-area-inset-bottom, 0px)
    );
    padding-bottom: var(--net-content-bottom);
  }

  body.page-network .header {
    display: none;
  }

  body.page-network .site-footer {
    display: none;
  }

  /* ── App bar ── */
  .net-mobile-appbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 180;
    height: var(--net-appbar-h);
    min-height: var(--net-appbar-h);
    padding: 0 14px;
    padding-top: env(safe-area-inset-top, 0px);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  }

  .net-mobile-appbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
  }

  .net-mobile-appbar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .net-mobile-appbar__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .net-mobile-appbar__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }

  .net-mobile-appbar__btn {
    width: var(--net-touch);
    height: var(--net-touch);
    border: none;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: background 0.15s, color 0.15s;
  }

  .net-mobile-appbar__btn:hover,
  .net-mobile-appbar__btn:focus-visible {
    background: #f1f5f9;
    color: var(--net-primary);
    outline: none;
  }

  .net-mobile-appbar__badge {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* ── Sticky search ── */
  .net-mobile-search {
    display: block;
    position: sticky;
    top: calc(var(--net-appbar-h) + env(safe-area-inset-top, 0px));
    z-index: 170;
    padding: 8px 12px;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    overflow: visible;
  }

  .net-mobile-search__inner {
    --net-search-ico-w: 36px;
    --net-search-gap: 10px;
    display: flex;
    align-items: center;
    gap: var(--net-search-gap);
    padding: 0 14px;
    height: var(--net-search-h);
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: visible;
  }

  .net-mobile-search__inner:has(.net-mobile-search__field--open) {
    z-index: 200;
  }

  .net-mobile-search__field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    align-self: stretch;
  }

  .net-mobile-search__field--open {
    z-index: 2;
  }

  .net-mobile-search__field .search-suggest-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: calc(-1 * (var(--net-search-ico-w) + var(--net-search-gap)));
    top: calc(100% + 8px);
    max-height: min(52vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
    z-index: 190;
    padding: 4px;
    direction: rtl;
    text-align: right;
  }

  .net-mobile-search__field .search-suggest-dropdown.open {
    display: block;
  }

  .net-mobile-search__field .search-suggest-item {
    width: 100%;
    border: none;
    background: transparent;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    border-radius: 10px;
    transition: background 0.12s;
    direction: rtl;
    min-height: var(--net-touch);
  }

  .net-mobile-search__field .search-suggest-item:hover,
  .net-mobile-search__field .search-suggest-item.active {
    background: #f1f5f9;
  }

  .net-mobile-search__field .search-suggest-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
  }

  .net-mobile-search__field .search-suggest-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f6ef7, #7c3aed);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
  }

  .net-mobile-search__field .search-suggest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
  }

  .net-mobile-search__field .search-suggest-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .net-mobile-search__field .search-suggest-item--freetext {
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2px;
    padding-bottom: 10px;
  }

  .net-mobile-search__field .search-suggest-sub,
  .net-mobile-search__field .search-suggest-alias {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .net-mobile-search__field .search-suggest-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 999px;
  }

  .net-mobile-search__field .search-suggest-query-ico {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef1ff;
    color: #4f6ef7;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .net-mobile-search__field .search-suggest-empty {
    padding: 14px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
  }

  .net-mobile-search__inner:focus-within {
    border-color: var(--net-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
  }

  .net-mobile-search__ico-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.12s, background 0.12s;
  }

  .net-mobile-search__ico-btn:hover,
  .net-mobile-search__ico-btn:focus-visible {
    color: #64748b;
    background: #f1f5f9;
    outline: none;
  }

  .net-mobile-search__ico {
    flex-shrink: 0;
    pointer-events: none;
  }

  .net-mobile-search__input {
    width: 100%;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }

  .net-mobile-search__input::-webkit-search-cancel-button,
  .net-mobile-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
  }

  .net-mobile-search__input::placeholder {
    color: #94a3b8;
    font-size: 13px;
  }

  /* ── Page layout ── */
  .page-network .page {
    flex-direction: column;
    min-height: auto;
    background: var(--net-bg);
  }

  .page-network .main {
    padding: 10px 12px 16px;
    max-width: 100%;
  }

  .page-network .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }

  .page-network .results-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
  }

  .page-network .top-bar > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
  }

  .page-network .results-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
  }

  .page-network .top-right {
    width: 100%;
  }

  .page-network .sort-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 12.5px;
    border-radius: 12px;
    border-color: #e2e8f0;
    background: #fff;
    color: #334155;
  }

  /* ── Stats 2×2 grid (collapsible) ── */
  .page-network .network-stats-wrap {
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }

  .page-network .network-stats-head {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    text-align: right;
  }

  .page-network .network-stats-head__text {
    flex: 1;
    min-width: 0;
  }

  .page-network .network-stats-title {
    font-size: 13px;
    margin: 0;
  }

  .page-network .network-stats-sub {
    font-size: 11px;
    margin: 2px 0 0;
  }

  .page-network .network-stats-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.15s;
  }

  .page-network .network-stats-wrap.is-expanded .network-stats-toggle {
    transform: rotate(180deg);
  }

  .page-network .network-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 10px 10px;
    display: none;
  }

  .page-network .network-stats-wrap.is-expanded .network-stats-row {
    display: grid;
  }

  .page-network .network-stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .page-network .network-stat-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .page-network .network-stat-card__icon svg {
    width: 16px;
    height: 16px;
  }

  .page-network .network-stat-card__val {
    font-size: 1.25rem;
  }

  .page-network .network-stat-card__lbl {
    font-size: 11px;
    margin-top: 2px;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .page-network .network-stat-card {
    min-width: 0;
  }

  /* ── Filter sidebar → bottom sheet ── */
  .page-network .adv-panel {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 90vh;
    height: auto;
    z-index: 300;
    border: none;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.16);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    order: unset;
    visibility: hidden;
    pointer-events: none;
  }

  .page-network .adv-panel.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .page-network .adv-panel .panel-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
  }

  .page-network .adv-panel .panel-hd {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
  }

  .page-network .adv-panel .panel-hd::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 0 auto 10px;
  }

  .page-network .adv-panel .panel-body {
    padding: 8px 16px 16px;
    gap: 0;
    max-height: calc(90vh - 130px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-network .adv-panel .panel-ft {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 2;
  }

  /* Accordion sections */
  .page-network .panel-sec {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0;
    gap: 0;
  }

  .page-network .panel-sec__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: right;
    gap: 8px;
  }

  .page-network .panel-sec__toggle .panel-label {
    margin: 0;
    font-size: 13px;
  }

  .page-network .panel-sec__chevron {
    width: 18px;
    height: 18px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .page-network .panel-sec.is-expanded .panel-sec__chevron {
    transform: rotate(180deg);
  }

  .page-network .panel-sec__body {
    display: none;
    padding-bottom: 12px;
    gap: 8px;
    flex-direction: column;
  }

  .page-network .panel-sec.is-expanded .panel-sec__body {
    display: flex;
  }

  /* ── FAB ── */
  .net-filter-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset-inline-end: 16px;
    bottom: calc(var(--net-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 160;
    width: var(--net-fab-size);
    height: var(--net-fab-size);
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--net-primary), #3b82f6);
    color: #fff;
    box-shadow: 0 6px 24px rgba(30, 64, 175, 0.38);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .net-filter-fab:active {
    transform: scale(0.94);
  }

  .net-filter-fab__badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--net-secondary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
  }

  .net-filter-fab.has-filters .net-filter-fab__badge {
    display: flex;
  }

  .net-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
  }

  .net-sheet-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .net-sheet-backdrop[hidden] {
    display: none !important;
  }

  /* ── Bottom nav ── */
  body.page-network .app-m-bottom-nav {
    display: flex;
    z-index: 150;
  }

  .net-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 150;
    height: calc(var(--net-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 6px 4px env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  }

  .net-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: #64748b;
    text-decoration: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
  }

  .net-bottom-nav__item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .net-bottom-nav__item--active {
    color: var(--net-primary);
  }

  .net-bottom-nav__item:hover,
  .net-bottom-nav__item:focus-visible {
    color: var(--net-primary);
    outline: none;
  }

  /* ── Cards grid (single column — avoids cramped 2-col) ── */
  .page-network .cards-grid {
    --card-gap: 10px;
    grid-template-columns: 1fr;
    max-width: 100%;
    padding-bottom: 20px;
    scroll-margin-bottom: var(--net-content-bottom, 80px);
  }

  .page-network .user-card {
    min-height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  }

  .page-network .card-header {
    height: 72px;
  }

  .page-network .skills-label {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .page-network .skill-chip {
    font-size: 12px;
    padding: 4px 10px;
  }

  .page-network .card-location,
  .page-network .card-age-meta {
    font-size: 12px;
  }

  .page-network .user-card:hover {
    transform: none;
  }

  .page-network .user-card.selected {
    transform: none;
  }

  .page-network .card-body {
    padding: 46px 14px 12px;
  }

  .page-network .card-actions {
    gap: 8px;
    padding-top: 10px;
  }

  .page-network .btn-follow,
  .page-network .btn-profile {
    min-height: 40px;
    font-size: 12px;
    border-radius: 10px;
  }

  .page-network .btn-follow {
    background: var(--net-primary);
  }

  .page-network .btn-follow:hover {
    background: #1d4ed8;
  }

  .page-network .btn-follow--following {
    background: #ecfdf5;
    color: #047857;
    border: 1.5px solid #a7f3d0;
    box-shadow: none;
  }

  .page-network .btn-follow--following:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
    box-shadow: none;
  }

  .page-network .btn-follow--pending {
    background: #fffbeb;
    color: #b45309;
    border: 1.5px solid #fde68a;
    box-shadow: none;
  }

  .page-network .btn-follow--pending:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
    box-shadow: none;
  }

  .page-network .btn-follow--received {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1.5px solid #ddd6fe;
    box-shadow: none;
  }

  .page-network .btn-follow--received:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #5b21b6;
    box-shadow: none;
  }

  .page-network .results-pagination {
    display: none;
  }

  .page-network .net-infinite-sentinel {
    height: 1px;
    margin: 8px 0;
  }

  .page-network .net-infinite-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
  }

  .page-network .net-infinite-loading .spinner {
    width: 22px;
    height: 22px;
    border-width: 2px;
    margin: 0;
  }

  /* ── Profile preview → bottom sheet ── */
  body.page-network #userPreviewModal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  body.page-network #userPreviewModal .upv-backdrop {
    background: rgba(15, 23, 42, 0.45);
  }

  body.page-network #userPreviewModal .upv-card {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: netSheetUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes netSheetUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  body.page-network #userPreviewModal .upv-close {
    top: 10px;
    left: 10px;
  }

  /* ── Connect popover → bottom sheet ── */
  body.page-network .connect-popover {
    align-items: flex-end;
    padding: 0;
  }

  body.page-network .connect-popover__panel {
    width: 100%;
    max-height: 60vh;
    border-radius: 20px 20px 0 0;
    animation: netSheetUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  body.page-network.team-pick-active {
    padding-bottom: calc(var(--net-content-bottom, 130px) + 72px);
  }

  /* ── Menu bottom sheet ── */
  .net-menu-sheet {
    display: block;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 310;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.16);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    pointer-events: none;
  }

  .net-menu-sheet.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .net-menu-sheet[hidden] {
    display: block !important;
  }

  .net-menu-sheet:not(.is-open)[hidden] {
    visibility: hidden;
    pointer-events: none;
  }

  .net-menu-sheet__handle {
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 10px auto 0;
  }

  .net-menu-sheet__hd {
    padding: 12px 16px 8px;
    border-bottom: 1px solid #f1f5f9;
  }

  .net-menu-sheet__user {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .net-menu-sheet__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
  }

  .net-menu-sheet__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .net-menu-sheet__name {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
  }

  .net-menu-sheet__email {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 0;
  }

  .net-menu-sheet__nav {
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(70vh - 90px);
    overflow-y: auto;
  }

  .net-menu-sheet__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: background 0.15s;
  }

  .net-menu-sheet__item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #64748b;
  }

  .net-menu-sheet__item:hover,
  .net-menu-sheet__item:focus-visible {
    background: #f1f5f9;
    outline: none;
  }

  .net-menu-sheet__item--danger {
    color: #dc2626;
  }

  .net-menu-sheet__item--danger svg {
    color: #dc2626;
  }

  .net-menu-sheet__divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 8px;
  }
}

/* ── ≤359px: compact horizontal list cards (very small phones only) ── */
@media (max-width: 359px) {
  .page-network .cards-grid {
    grid-template-columns: 1fr;
    --card-gap: 8px;
  }

  .page-network .user-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 76px;
    grid-template-areas: 'avatar info action';
    grid-template-rows: auto;
    align-items: start;
    column-gap: 10px;
    row-gap: 0;
    padding: 10px 12px;
  }

  .page-network .card-header {
    grid-area: avatar;
    height: auto;
    width: 52px;
    position: relative;
    overflow: visible;
    border-radius: 0;
  }

  .page-network .card-header-media,
  .page-network .card-header-badges {
    display: none;
  }

  .page-network .card-avatar-wrap {
    position: static;
    transform: none;
    width: 48px;
    height: 48px;
    border-width: 1.5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  }

  .page-network .card-avatar-inner {
    width: 48px;
    height: 48px;
  }

  .page-network .card-avatar-inner svg,
  .page-network .card-avatar-wrap .avatar-initials {
    font-size: 14px;
  }

  .page-network .online-dot {
    width: 10px;
    height: 10px;
    bottom: 1px;
    right: 1px;
  }

  .page-network .card-body {
    display: contents;
  }

  .page-network .card-body-inner {
    grid-area: info;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    min-width: 0;
    gap: 2px;
  }

  .page-network .card-name {
    font-size: 14px;
    justify-content: flex-start;
  }

  .page-network .card-readiness-inline {
    display: inline-flex;
    margin-top: 1px;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    line-height: 1.25;
    border-radius: 9999px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-network .card-readiness-dot {
    width: 5px;
    height: 5px;
  }

  .page-network .card-role {
    font-size: 12px;
    margin: 0;
    text-align: right;
  }

  .page-network .card-location {
    display: inline-flex;
    margin: 2px 0 0;
    font-size: 11px;
    justify-content: flex-start;
    max-width: 100%;
  }

  .page-network .card-location-text {
    max-width: 100%;
  }

  .page-network .card-connections-stats,
  .page-network .card-age-wrap,
  .page-network .skills-label,
  .page-network .card-age-meta {
    display: none;
  }

  .page-network .card-edu {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 0;
    border-top: none;
    width: 100%;
    min-width: 0;
  }

  .page-network .card-edu-main {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    flex: 1;
  }

  .page-network .card-edu .edu-logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    margin-top: 0;
  }

  .page-network .card-edu .edu-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 0;
  }

  .page-network .card-edu-text {
    min-width: 0;
    flex: 1;
  }

  .page-network .edu-name {
    font-size: 10.5px;
    font-weight: 600;
    color: #475569;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: normal;
  }

  .page-network .edu-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
    margin-top: 1px;
    line-height: 1.2;
  }

  .page-network .edu-degree {
    font-size: 9.5px;
    padding: 0 5px;
    border-radius: 4px;
    line-height: 1.35;
  }

  .page-network .edu-field {
    font-size: 10px;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: normal;
    flex: 1;
    min-width: 0;
  }

  .page-network .card-edu-icons {
    display: none;
  }

  .page-network .skills-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 3px;
    margin: 4px 0 0;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .page-network .skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 3px 7px;
    max-width: 100%;
    line-height: 1.25;
  }

  .page-network .skill-chip-name {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-network .skill-dots {
    flex-shrink: 0;
  }

  .page-network .card-actions {
    grid-area: action;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    align-self: start;
    gap: 6px;
    padding: 0;
    margin: 0;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
  }

  .page-network .btn-profile {
    display: none;
  }

  .page-network .btn-profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    text-decoration: none;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .page-network .btn-profile-icon svg {
    width: 16px;
    height: 16px;
  }

  .page-network .btn-follow {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 0 6px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  .page-network .team-pick-check {
    display: none;
  }

  .page-network .network-stat-card__lbl {
    font-size: 11px;
  }
}

/* ── ≤320px: tighter compact cards ── */
@media (max-width: 320px) {
  .page-network {
    --net-appbar-h: 52px;
    --net-search-h: 46px;
    --net-bottom-nav-h: 62px;
    --net-fab-size: 46px;
  }

  .page-network .main {
    padding: 8px 8px 12px;
  }

  .page-network .results-title {
    font-size: 15px;
  }

  .page-network .network-stats-row {
    gap: 6px;
  }

  .page-network .network-stat-card {
    padding: 8px 10px;
  }

  .page-network .network-stat-card__val {
    font-size: 1.1rem;
  }

  .page-network .net-bottom-nav__item {
    font-size: 10px;
  }

  .page-network .net-bottom-nav__item svg {
    width: 18px;
    height: 18px;
  }

  .page-network .user-card {
    padding: 8px 10px;
    column-gap: 8px;
    grid-template-columns: 46px 1fr 72px;
  }

  .page-network .card-actions {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    gap: 5px;
  }

  .page-network .card-avatar-wrap {
    width: 42px;
    height: 42px;
  }

  .page-network .card-avatar-inner {
    width: 42px;
    height: 42px;
  }

  .page-network .card-name {
    font-size: 13px;
  }

  .page-network .btn-follow,
  .page-network .btn-profile-icon {
    min-height: 34px;
    height: 34px;
  }

  .page-network .btn-follow {
    font-size: 11px;
    padding: 0 4px;
  }

  .page-network .network-stats-row {
    padding: 0 8px 10px;
  }
}

/* ── 360px–767px: enhanced mobile spacing (full cards) ── */
@media (min-width: 360px) and (max-width: 767px) {
  .page-network .main {
    padding: 12px 16px 20px;
  }

  .page-network .cards-grid {
    --card-gap: 12px;
  }

  .page-network .net-bottom-nav__item {
    font-size: 10.5px;
  }

  .page-network .net-bottom-nav__item svg {
    width: 22px;
    height: 22px;
  }

  .page-network .net-filter-fab {
    width: 56px;
    height: 56px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLET (768px–1024px) — sidebar filters + 3-column grid
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  body.page-network {
    --header-h: 64px;
  }

  body.page-network .header {
    display: flex;
  }

  body.page-network .site-footer {
    display: block;
  }

  .page-network .page {
    flex-direction: row;
  }

  .page-network .main {
    padding: 20px 16px 24px;
    flex: 1;
    min-width: 0;
    order: 2;
  }

  .page-network .adv-panel {
    position: sticky;
    top: var(--header-h);
    align-self: flex-start;
    width: 280px;
    max-height: calc(100vh - var(--header-h));
    height: calc(100vh - var(--header-h));
    border-left: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 0;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    order: 1;
    box-shadow: none;
  }

  .page-network .adv-panel .panel-hd::before {
    display: none;
  }

  .page-network .adv-panel .panel-close-btn {
    display: none;
  }

  .page-network .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --card-gap: 12px;
    max-width: none;
  }

  .page-network .network-stats-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid !important;
    padding: 0;
  }

  .page-network .network-stats-wrap {
    border: none;
    background: transparent;
    margin-bottom: 16px;
  }

  .page-network .network-stats-head {
    display: none !important;
  }

  .page-network .network-stats-toggle {
    display: none;
  }

  .page-network .network-stat-card__lbl {
    font-size: 11px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP (≥768px) — sidebar filters stay expanded; no mobile accordion UI
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .page-network .page {
    flex-direction: row;
  }

  .page-network .main {
    order: 2;
    flex: 1;
    min-width: 0;
  }

  .page-network .adv-panel {
    position: sticky;
    top: var(--header-h);
    align-self: flex-start;
    width: var(--sidebar-w, 360px);
    max-height: calc(100vh - var(--header-h));
    height: calc(100vh - var(--header-h));
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    border-left: 1px solid var(--gray-200, #e2e8f0);
    border-right: none;
    border-radius: 0;
    box-shadow: none;
    order: 1;
  }

  .page-network .adv-panel .panel-hd::before {
    display: none;
  }

  .page-network .adv-panel .panel-close-btn {
    display: none;
  }

  .page-network .panel-sec {
    border-bottom: none;
    padding-bottom: 0;
    gap: 8px;
  }

  .page-network .panel-sec__toggle {
    display: none !important;
  }

  .page-network .panel-sec__body {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 0;
  }

  .page-network .network-stats-row {
    display: grid !important;
  }

  .page-network .network-stats-toggle {
    display: none;
  }

  .page-network .network-stats-head {
    display: none !important;
  }

  .page-network .network-stats-sub {
    display: none !important;
  }
}
