/* ==========================================================
   "مجتمع نشتغل" (#view-network, js/network.js). Theme tokens from css/theme.css (light + dark).
   Desktop: profile | feed | suggestions; tablets: feed | side; phones: one column.
   ========================================================== */
#view-network.page-view { padding: 0 0 3rem; background: var(--canvas-2); min-height: 80vh; --net-sticky-top: 72px; }
@media (max-width: 1080px) { #view-network.page-view { --net-sticky-top: 62px; } }
@media (max-width: 760px) { #view-network.page-view { --net-sticky-top: 58px; } }
.net-wrap { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- top bar: brand | tabs (centre) | search ---------- */
.net-topbar { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); box-shadow: 0 1px 2px rgba(2, 27, 66, 0.06); margin-bottom: 1.25rem; position: sticky; top: var(--net-sticky-top, 0); z-index: 30; }
.net-topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; min-height: 64px; }
.net-topsearch { justify-self: end; display: flex; align-items: center; gap: 0.5rem; width: min(100%, 280px); background: var(--canvas-2); border-radius: 999px; padding: 0 0.9rem; min-height: 42px; }
.net-topsearch:focus-within { box-shadow: 0 0 0 2px var(--mint-2); background: var(--bg-surface); }
.net-topsearch svg { width: 17px; height: 17px; color: var(--text-faint); flex: 0 0 auto; }
.net-topsearch input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 0.9rem; color: var(--text-main); }
.net-brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.net-brand-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--mint); flex: 0 0 auto; }
[data-theme="dark"] .net-brand-icon { background: rgba(15, 170, 199, 0.16); }
.net-brand-icon svg { width: 22px; height: 22px; }
.net-title { font-size: 1.2rem; font-weight: 700; color: var(--text-main); margin: 0; line-height: 1.3; }
.net-subtitle { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.net-tabs { display: flex; align-self: stretch; gap: 0.35rem; }
.net-tab {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 0.8rem;
  padding: 0.35rem 1.4rem; cursor: pointer; min-width: 104px; border-radius: 10px 10px 0 0;
}
.net-tab svg { width: 24px; height: 24px; }
.net-tab:hover { color: var(--text-main); background: var(--canvas-2); }
.net-tab.is-active svg { color: var(--tx-primary); }
.net-tab::after { content: ""; position: absolute; inset-inline: 0.6rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.net-tab.is-active { color: var(--text-main); }
.net-tab.is-active::after { background: var(--navy); }
[data-theme="dark"] .net-tab.is-active::after { background: var(--mint); }
.net-tab .net-count { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); }
.net-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.7rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.net-count.is-muted { position: static; background: var(--canvas-2); color: var(--text-muted); }
.net-count[hidden] { display: none; }

/* ---------- layout ---------- */
.net-layout { display: grid; grid-template-columns: 270px minmax(0, 620px) 300px; justify-content: space-between; gap: 1.5rem; align-items: start; }
.net-layout.is-messages { grid-template-columns: minmax(0, 1fr); }
.net-layout.is-messages .net-side { display: none; }
.net-layout.is-people .net-side-end { display: none; }
.net-layout.is-people { grid-template-columns: 270px minmax(0, 1fr); }
.net-main { min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.net-pane { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.net-pane[hidden] { display: none; }
.net-side { display: flex; flex-direction: column; gap: 0.9rem; position: sticky; top: calc(var(--net-sticky-top, 0px) + 88px); min-width: 0; }

.net-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 1rem 1.1rem; min-width: 0; }
.net-card-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.98rem; color: var(--text-main); margin-bottom: 0.7rem; }
.net-card-title svg { width: 18px; height: 18px; color: var(--mint-2); }
.net-muted { color: var(--text-muted); font-size: 0.86rem; line-height: 1.6; }
.net-faint { color: var(--text-faint); font-size: 0.78rem; }
.net-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.net-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.net-pad { padding: 1rem; }
.net-center { text-align: center; }
.net-h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.02rem; font-weight: 700; color: var(--text-main); margin: 0 0 0.7rem; }
.net-link { border: 0; background: none; padding: 0; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--tx-primary); cursor: pointer; }
.net-link:hover { text-decoration: underline; }
.net-danger { color: #C0392B; }
[data-theme="dark"] .net-danger { color: #FF8A80; }
.net-tag { font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--accent-emerald-light); color: var(--tx-emerald); white-space: nowrap; flex: 0 0 auto; }
.net-verified { width: 16px; height: 16px; color: var(--mint-2); flex: 0 0 auto; }
.net-more[hidden], .net-view .btn[hidden] { display: none !important; }

/* ---------- avatars ---------- */
.net-av {
  --av: var(--navy);
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden;
  width: 40px; height: 40px; border-radius: 50%; background: var(--av); color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1;
}
.net-av b { font-weight: 700; letter-spacing: 0; }
.net-av.is-company { border-radius: 10px; }
.net-av.is-official { background: var(--navy); color: var(--mint); }
[data-theme="dark"] .net-av.is-official { background: var(--mint); color: var(--navy-3); }
.net-av svg { width: 55%; height: 55%; }
.net-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.net-av-sm { width: 34px; height: 34px; font-size: 0.8rem; }
.net-av-md { width: 46px; height: 46px; }
.net-av-lg { width: 72px; height: 72px; font-size: 1.45rem; }
.net-av-xl { width: 104px; height: 104px; font-size: 2.1rem; }
.net-av-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; flex: 0 0 auto; }
.net-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--text-main); cursor: pointer; text-align: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-name:hover { text-decoration: underline; color: var(--tx-primary); }
.net-name-row { display: flex; align-items: center; gap: 0.35rem; min-width: 0; flex-wrap: nowrap; }
.net-name-row.is-center { justify-content: center; }

/* ---------- side: my card / why join ---------- */
.net-me { padding: 0 0 0.25rem; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; }
.net-me-cover { width: 100%; height: 62px; background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 55%, var(--mint-2) 100%); }
.net-me-av { margin-top: -36px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg-surface); }
.net-me-name { margin-top: 0.5rem; font-size: 1.05rem; padding: 0 0.9rem; max-width: 100%; }
.net-me-headline { padding: 0.15rem 0.9rem 0; font-size: 0.82rem; }
.net-me-stats { width: 100%; margin-top: 0.85rem; border-top: 1px solid var(--border-subtle); padding: 0.4rem 0; display: flex; flex-direction: column; }
.net-me-stats button { display: flex; justify-content: space-between; align-items: center; border: 0; background: none; font: inherit; font-size: 0.82rem; color: var(--text-muted); padding: 0.45rem 1rem; cursor: pointer; }
.net-me-stats button:hover { background: var(--canvas-2); }
.net-me-stats strong { color: var(--tx-primary); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.net-me-edit { display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; border: 0; border-top: 1px solid var(--border-subtle); background: none; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-soft); padding: 0.7rem; cursor: pointer; }
.net-me-edit:hover { background: var(--canvas-2); }
.net-me-edit svg { width: 15px; height: 15px; }
.net-why ul, .net-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.net-why li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.86rem; color: var(--text-soft); line-height: 1.6; }
.net-why li svg { width: 18px; height: 18px; color: var(--mint-2); flex: 0 0 auto; margin-top: 0.15rem; }
.net-rules ul { gap: 0.45rem; margin-bottom: 0.7rem; }
.net-rules li { position: relative; padding-inline-start: 1rem; font-size: 0.84rem; color: var(--text-soft); line-height: 1.6; }
.net-rules li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--mint-2); }

/* ---------- side: suggestions ---------- */
.net-person-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; }
.net-person-row + .net-person-row { border-top: 1px solid var(--border-subtle); }
.net-person-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; gap: 0.05rem; }
.net-person-meta .net-muted { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-person-row .btn { padding: 0.3rem 0.65rem; min-height: 32px; font-size: 0.8rem; border-radius: 999px; }
.net-see-all { display: block; width: 100%; text-align: center; padding-top: 0.6rem; margin-top: 0.3rem; border-top: 1px solid var(--border-subtle); }

/* ---------- join ---------- */
.net-join { position: relative; overflow: hidden; text-align: center; padding: 2rem clamp(1rem, 4vw, 2.5rem) 1.75rem; border-radius: 16px; color: #fff;
  background: radial-gradient(circle at 15% 20%, rgba(15, 170, 199, 0.35), transparent 45%), linear-gradient(135deg, var(--navy-3), var(--navy) 55%, var(--navy-2)); }
.net-join[hidden] { display: none; }
.net-join-art { display: flex; justify-content: center; gap: 0.6rem; margin-bottom: 1rem; }
.net-join-bubble { width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.12); color: #fff; }
.net-join-bubble.b2 { background: var(--mint); color: var(--navy-3); transform: translateY(-6px); }
.net-join-bubble.b3 { background: var(--orange); }
.net-join-bubble svg { width: 22px; height: 22px; }
.net-join-title { margin: 0 0 0.5rem; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem); font-weight: 700; color: #fff; }
.net-join-text { margin: 0 auto 1.25rem; max-width: 56ch; line-height: 1.85; color: rgba(255, 255, 255, 0.82); font-size: 0.94rem; }
.net-join-form { max-width: 560px; margin: 0 auto; text-align: start; }
.net-join-form label { display: block; font-size: 0.82rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); margin-bottom: 0.4rem; }
.net-join-row { display: flex; gap: 0.5rem; background: #fff; border-radius: 12px; padding: 0.3rem; }
.net-join-row .form-input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent !important; color: #15263B !important; }
.net-join-row .btn { background: var(--orange); border-color: var(--orange); color: #fff; white-space: nowrap; }
.net-join-row .btn:hover { background: var(--orange-2); }

/* ---------- composer ---------- */
.net-composer { padding: 0.9rem 1rem 0.6rem; }
.net-composer[hidden] { display: none; }
.net-compose-row { display: flex; gap: 0.7rem; align-items: flex-start; }
.net-compose-row textarea {
  flex: 1; min-width: 0; resize: none; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-main);
  border-radius: 24px; padding: 0.7rem 1.1rem; font: inherit; font-size: 0.95rem; line-height: 1.6; min-height: 46px; max-height: 320px;
  transition: border-radius 0.15s ease;
}
.net-compose-row textarea:hover { background: var(--canvas); }
.net-compose-row textarea::placeholder { color: var(--text-muted); font-weight: 500; }
.net-compose.is-open .net-compose-row textarea { border-radius: 14px; min-height: 110px; background: var(--bg-surface); }
.net-compose-row textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 170, 199, 0.22); }
[data-theme="dark"] .net-compose-row textarea:focus { border-color: var(--mint); }
.net-compose-preview { position: relative; margin: 0.7rem 0 0; margin-inline-start: 56px; max-width: 360px; }
.net-compose-preview[hidden] { display: none; }
.net-compose-preview img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-subtle); display: block; }
.net-preview-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.net-preview-x svg { width: 16px; height: 16px; }
.net-compose-bar { display: flex; align-items: center; gap: 0.15rem; margin-top: 0.5rem; flex-wrap: wrap; }
.net-quick { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; background: none; font: inherit; color: var(--text-soft); font-size: 0.86rem; font-weight: 600; cursor: pointer; padding: 0.5rem 0.7rem; border-radius: 8px; }
.net-quick:hover { background: var(--canvas-2); }
.net-quick svg { width: 20px; height: 20px; }
[data-theme="dark"] .net-quick svg { filter: brightness(1.6); }
.net-compose-count { font-size: 0.76rem; color: var(--text-faint); margin-inline-start: auto; }
.net-compose-send { display: none; margin-inline-start: auto; border-radius: 999px; padding-inline: 1.3rem; }
.net-compose.is-open .net-compose-send { display: inline-flex; }
.net-compose.is-open .net-compose-count + .net-compose-send { margin-inline-start: 0.5rem; }

.net-scope { display: flex; align-items: center; gap: 0.4rem; }
.net-scope-label { font-size: 0.8rem; color: var(--text-muted); margin-inline-end: 0.2rem; }
.net-chip { border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-soft); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.25rem 0.85rem; border-radius: 999px; cursor: pointer; min-height: 32px; }
.net-chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .net-chip.is-active { background: var(--mint); border-color: var(--mint); color: var(--navy-3); }

/* ---------- post ---------- */
.net-feed { display: flex; flex-direction: column; gap: 0.9rem; }
.net-post { padding: 0; overflow: visible; }
.net-post-head { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.95rem 1.1rem 0.4rem; }
.net-post-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.net-post-meta .net-muted { font-size: 0.8rem; }
.net-post-meta .net-faint { display: inline-flex; align-items: center; gap: 0.25rem; }
.net-post-body { padding: 0.3rem 1.1rem 0.7rem; color: var(--text-main); line-height: 1.85; font-size: 0.96rem; overflow-wrap: anywhere; }
.net-post-body.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.net-post-body a, .net-comment-bubble a, .net-msg a { color: var(--tx-primary); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.net-post-body a:hover, .net-comment-bubble a:hover { text-decoration: underline; }
.net-msg.is-mine a { color: inherit; text-decoration: underline; }
.net-post > .net-link { margin: -0.4rem 1.1rem 0.6rem; color: var(--text-muted); }
.net-post-img { display: block; width: 100%; border: 0; padding: 0; background: var(--canvas-2); cursor: zoom-in; border-block: 1px solid var(--border-subtle); }
.net-post-img img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.net-post-stats { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1.1rem; min-height: 2.1rem; font-size: 0.8rem; color: var(--text-muted); }
.net-post-stats:empty { display: none; }
.net-likes-count { display: inline-flex; align-items: center; gap: 0.35rem; }
.net-likes-count svg { width: 12px; height: 12px; padding: 3px; box-sizing: content-box; border-radius: 50%; background: var(--mint-2); color: #fff; }
.net-post-stats .net-link { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.net-post-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-subtle); margin: 0 0.6rem; padding: 0.2rem 0; }
.net-act { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; border: 0; background: none; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-muted); padding: 0.55rem; border-radius: 8px; cursor: pointer; min-height: 42px; }
.net-act:hover { background: var(--canvas-2); color: var(--text-main); }
.net-act svg { width: 19px; height: 19px; }
.net-act.is-on { color: var(--tx-emerald); }
.net-act.is-on svg { fill: currentColor; fill-opacity: 0.18; }
.net-hidden-note { display: flex; align-items: center; gap: 0.4rem; margin: 0; padding: 0.55rem 1.1rem; background: var(--orange-light); color: var(--orange-ink); font-size: 0.84rem; border-radius: 14px 14px 0 0; }
.net-hidden-note svg { width: 16px; height: 16px; }

.net-menu { position: relative; }
.net-icon-only { border: 0; background: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; flex: 0 0 auto; }
.net-icon-only:hover { background: var(--canvas-2); color: var(--text-main); }
.net-icon-only svg { width: 19px; height: 19px; }
.net-menu-list {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 20; min-width: 220px; padding: 0.35rem;
  background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.net-menu-list[hidden] { display: none; }
.net-menu-list button { display: flex; align-items: center; gap: 0.55rem; width: 100%; border: 0; background: none; font: inherit; font-size: 0.86rem; color: var(--text-main); padding: 0.6rem 0.7rem; border-radius: 8px; cursor: pointer; text-align: start; }
.net-menu-list button:hover { background: var(--canvas-2); }
.net-menu-list svg { width: 16px; height: 16px; color: var(--text-muted); }

/* ---------- comments ---------- */
.net-comments { border-top: 1px solid var(--border-subtle); padding: 0.8rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.65rem; }
.net-comments[hidden] { display: none; }
.net-comment { display: flex; gap: 0.55rem; align-items: flex-start; }
.net-comment-bubble { flex: 1; min-width: 0; background: var(--canvas-2); border-radius: 12px; border-start-start-radius: 4px; padding: 0.5rem 0.8rem; }
.net-comment-bubble .net-name-row { justify-content: space-between; }
.net-comment-bubble p { margin: 0.15rem 0 0; line-height: 1.7; font-size: 0.9rem; color: var(--text-main); overflow-wrap: anywhere; }
.net-comment-bubble .net-name { font-size: 0.85rem; }
.net-comment-actions { display: flex; gap: 0.8rem; margin-top: 0.15rem; }
.net-comment-actions .net-link { font-size: 0.76rem; color: var(--text-muted); }
.net-comment-form { display: flex; gap: 0.5rem; align-items: center; }
.net-comment-form .form-input { flex: 1; min-width: 0; border-radius: 999px; min-height: 40px; }

/* ---------- empty / starters ---------- */
.net-empty { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; padding: 2.25rem 1.25rem; color: var(--text-muted); }
.net-empty strong { color: var(--text-main); font-size: 1.05rem; }
.net-empty > span { max-width: 46ch; line-height: 1.7; font-size: 0.9rem; }
.net-empty .btn { margin-top: 0.5rem; }
.net-empty-icon { width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-emerald-light); color: var(--tx-emerald); margin-bottom: 0.35rem; }
.net-empty-icon svg { width: 26px; height: 26px; }
.net-starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; width: 100%; margin-top: 1rem; }
.net-starter { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; border: 1px solid var(--border-subtle); background: var(--canvas); border-radius: 12px; padding: 0.9rem 0.6rem; font: inherit; cursor: pointer; color: var(--text-main); }
.net-starter:hover { border-color: var(--navy); background: var(--bg-surface); }
[data-theme="dark"] .net-starter:hover { border-color: var(--mint); }
.net-starter svg { width: 22px; height: 22px; color: var(--mint-2); margin-bottom: 0.2rem; }
.net-starter strong { font-size: 0.9rem; }
.net-starter small { font-size: 0.76rem; color: var(--text-muted); }
.net-skel, .net-skel-post { height: 64px; border-radius: 12px; background: var(--canvas-2); animation: homePulse 1.4s ease-in-out infinite; }
.net-skel-post { height: 180px; border: 0; }
.net-more { align-self: center; }

/* ---------- people ---------- */
.net-search { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 0.35rem 0.35rem 0.35rem 0.35rem; padding-inline-start: 0.9rem; }
.net-search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 170, 199, 0.22); }
.net-search > svg { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; }
.net-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; color: var(--text-main); padding: 0.45rem 0; }
.net-search .btn { border-radius: 10px; }
.net-section { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 0.9rem; }
.net-section > .net-h3 { padding-bottom: 0.7rem; border-bottom: 1px solid var(--border-subtle); }
.net-section .net-card { border: 0; border-radius: 0; padding: 0.7rem 0; background: none; }
.net-section .net-card + .net-card { border-top: 1px solid var(--border-subtle); }
.net-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; }
.net-section .net-people-grid .net-person { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0; overflow: hidden; }
.net-person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; padding-bottom: 0.9rem !important; }
.net-person::before { content: ""; display: block; width: 100%; height: 46px; background: linear-gradient(120deg, var(--navy), var(--navy-2) 60%, var(--mint-2)); opacity: 0.9; }
.net-person .net-av-btn { margin-top: -36px; box-shadow: 0 0 0 3px var(--bg-surface); border-radius: 50%; }
.net-person .net-av-btn .net-av.is-company { border-radius: 12px; }
.net-person .net-muted { padding: 0 0.7rem; min-height: 2.9em; font-size: 0.8rem; }
.net-person .net-name-row { padding: 0 0.7rem; max-width: 100%; }
.net-person .btn { margin-top: auto; width: calc(100% - 1.4rem); border-radius: 999px; }
.net-request { display: flex; align-items: center; gap: 0.75rem; }
.net-request-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }
.net-request-actions .btn { border-radius: 999px; }
.net-note { margin: 0.3rem 0; font-size: 0.84rem; color: var(--text-soft); background: var(--canvas-2); border-radius: 10px; padding: 0.4rem 0.65rem; }
.net-view .btn i[data-lucide], .net-view .btn svg { width: 16px; height: 16px; }

/* ---------- messages ---------- */
.net-inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); padding: 0; height: min(calc(100vh - 210px), 760px); min-height: 460px; overflow: hidden; }
.net-convs { border-inline-end: 1px solid var(--border-subtle); overflow-y: auto; }
.net-convs-head { padding: 1rem 1.1rem; border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; background: var(--bg-surface); z-index: 1; }
.net-conv { display: flex; align-items: center; gap: 0.7rem; width: 100%; border: 0; background: none; font: inherit; text-align: start; padding: 0.8rem 1.1rem; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.net-conv:hover { background: var(--canvas-2); }
.net-conv.is-active { background: var(--primary-light); box-shadow: inset -3px 0 0 var(--mint); }
[dir="ltr"] .net-conv.is-active { box-shadow: inset 3px 0 0 var(--mint); }
.net-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.net-conv-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.net-conv-top strong { font-size: 0.92rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-conv-last { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-conv.is-unread .net-conv-last { color: var(--text-main); font-weight: 600; }
.net-conv .net-count { position: static; }
.net-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.net-chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--text-muted); text-align: center; padding: 2rem; }
.net-chat-empty svg { width: 44px; height: 44px; color: var(--mint-2); }
.net-chat-empty strong { color: var(--text-main); }
.net-chat-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border-subtle); }
.net-chat-back { display: none; }
.net-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; background: var(--canvas); }
.net-older { align-self: center; margin-bottom: 0.5rem; }
.net-day { display: flex; justify-content: center; margin: 0.6rem 0; }
.net-day span { font-size: 0.72rem; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 999px; padding: 0.1rem 0.7rem; }
.net-msg { align-self: flex-end; max-width: min(78%, 520px); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; border-end-end-radius: 4px; padding: 0.5rem 0.8rem 0.3rem; }
.net-msg.is-mine { align-self: flex-start; background: var(--navy); border-color: var(--navy); color: #fff; border-radius: 16px; border-end-start-radius: 4px; }
[data-theme="dark"] .net-msg.is-mine { background: #0B5A70; border-color: #0B5A70; }
.net-msg p { margin: 0; line-height: 1.7; font-size: 0.93rem; overflow-wrap: anywhere; color: inherit; }
.net-msg:not(.is-mine) p { color: var(--text-main); }
.net-msg-time { display: flex; justify-content: flex-end; align-items: center; gap: 0.2rem; font-size: 0.68rem; opacity: 0.7; margin-top: 0.1rem; }
.net-msg-time svg { width: 14px; height: 14px; }
.net-chat-form { display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.7rem; border-top: 1px solid var(--border-subtle); }
.net-chat-form textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--border-strong); background: var(--bg-input); color: var(--text-main); border-radius: 22px; padding: 0.6rem 1rem; font: inherit; line-height: 1.6; max-height: 140px; min-height: 44px; }
.net-chat-form textarea:focus { outline: none; border-color: var(--navy); }
[data-theme="dark"] .net-chat-form textarea:focus { border-color: var(--mint); }
.net-view .net-chat-form .net-send { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.net-view .net-chat-form .net-send svg { width: 20px; height: 20px; }
.net-chat-locked { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0; padding: 0.85rem 1rem; border-top: 1px solid var(--border-subtle); font-size: 0.86rem; color: var(--text-muted); }
.net-chat-locked svg { width: 16px; height: 16px; }

/* ---------- dialog ---------- */
.net-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow-y: auto; }
.net-modal[hidden] { display: none; }
.net-modal-backdrop { position: fixed; inset: 0; background: rgba(2, 27, 66, 0.55); }
.net-modal-box { position: relative; width: min(640px, 100%); background: var(--bg-surface); border-radius: 18px; padding: 1.25rem; box-shadow: var(--shadow-lg); }
.net-modal-close { position: absolute; top: 0.75rem; inset-inline-end: 0.75rem; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); color: #15263B; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.net-modal-close svg { width: 18px; height: 18px; }
body.net-modal-open { overflow: hidden; }
.net-modal-feed { display: flex; flex-direction: column; gap: 0.9rem; }
.net-profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.25rem; margin: -1.25rem -1.25rem 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.net-profile-cover { width: 100%; height: 110px; border-radius: 18px 18px 0 0; background: radial-gradient(circle at 80% 30%, rgba(15, 170, 199, 0.5), transparent 50%), linear-gradient(120deg, var(--navy-3), var(--navy) 55%, var(--navy-2)); margin-bottom: -52px; }
.net-profile .net-av { box-shadow: 0 0 0 4px var(--bg-surface); }
.net-profile-name { margin: 0.4rem 0 0; font-size: 1.35rem; font-weight: 700; color: var(--text-main); }
.net-profile p { margin: 0; padding: 0 1rem; }
.net-profile-actions { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.85rem; }
.net-profile-actions .btn { border-radius: 999px; }
.net-full-img { display: block; width: 100%; border-radius: 12px; }
.net-report { display: flex; flex-direction: column; gap: 0.6rem; }
.net-radio { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.8rem; border: 1px solid var(--border-subtle); border-radius: 12px; cursor: pointer; color: var(--text-main); }
.net-radio:has(input:checked) { border-color: var(--navy); background: var(--primary-light); }
[data-theme="dark"] .net-radio:has(input:checked) { border-color: var(--mint); }
.net-report .net-profile-actions { justify-content: space-between; }

/* ---------- nav badge ("المجتمع" in the top bar, drawer and phone tab bar) ---------- */
.net-nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 0.3rem;
  border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 1; vertical-align: middle;
}
.net-nav-badge[hidden] { display: none; }
.m-tab { position: relative; }
.m-tab .net-nav-badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 4px); margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .net-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .net-layout.is-people { grid-template-columns: minmax(0, 1fr); }
  .net-side-start { display: none; }
  .net-strip:not([hidden]) { display: flex; }
}
@media (max-width: 860px) {
  .net-layout, .net-layout.is-people { grid-template-columns: minmax(0, 1fr); }
  .net-side-end { display: none; }
  .net-only-narrow:not([hidden]) { display: block; }
  .net-feed > .net-pymk { display: block; }
  .net-topbar-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .net-topsearch { display: none; }
}
@media (max-width: 760px) {
  .net-wrap { padding: 0 0.75rem; }
  .net-topbar { margin-bottom: 0.75rem; }
  .net-topbar-inner { min-height: 0; padding-top: 0.6rem; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .net-tab { border-radius: 0; }
  .net-subtitle { display: none; }
  .net-brand-icon { width: 34px; height: 34px; border-radius: 10px; }
  .net-brand-icon svg { width: 18px; height: 18px; }
  .net-title { font-size: 1.05rem; }
  .net-tabs { justify-content: space-around; }
  .net-tab { flex: 1; min-width: 0; padding: 0.45rem 0.3rem 0.55rem; }
  .net-card, .net-section { border-radius: 12px; }
  .net-compose-preview { margin-inline-start: 0; }
  .net-quick span { font-size: 0.8rem; }
  .net-quick { padding: 0.45rem 0.5rem; }
  .net-starters { grid-template-columns: minmax(0, 1fr); }
  .net-starter { flex-direction: row; justify-content: flex-start; gap: 0.6rem; text-align: start; }
  .net-starter svg { margin: 0; }
  .net-starter small { margin-inline-start: auto; }
  .net-inbox { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 58px - var(--tabbar-h, 64px) - 120px); min-height: 420px; }
  .net-inbox .net-chat { display: none; }
  .net-inbox.has-chat .net-convs { display: none; }
  .net-inbox.has-chat .net-chat { display: flex; }
  .net-chat-back { display: inline-flex; }
  .net-request { flex-wrap: wrap; }
  .net-request-actions { width: 100%; justify-content: flex-end; }
  .net-modal { padding: 0; align-items: flex-end; }
  .net-modal-box { border-radius: 18px 18px 0 0; max-height: 92dvh; overflow-y: auto; }
  .net-people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .net-join-row { flex-direction: column; background: transparent; padding: 0; }
  .net-join-row .form-input { background: #fff !important; border-radius: 10px; }
}

/* ---------- official pinned post ---------- */
.net-post.is-pinned { border-color: color-mix(in srgb, var(--mint) 45%, var(--border-subtle)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--mint) 25%, transparent); }
.net-pinned { display: flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.5rem 1.1rem; font-size: 0.78rem; font-weight: 600; color: var(--tx-emerald); border-bottom: 1px solid var(--border-subtle); background: var(--accent-emerald-light); border-radius: 14px 14px 0 0; }
.net-pinned svg { width: 14px; height: 14px; }

/* ==========================================================
   Social-network layout (Dec 2026): start = shortcuts menu without cards, centre = feed,
   end = requests / suggestions / contacts. Phones: shortcuts strip, requests card and a
   people-you-may-know carousel inside the feed.
   ========================================================== */
.net-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.net-card-head .net-card-title { margin: 0; }
.net-card-head .net-count { position: static; }

/* start column menu */
.net-sidemenu { display: flex; flex-direction: column; gap: 0.1rem; }
.net-sidemenu hr { border: 0; border-top: 1px solid var(--border-strong); margin: 0.6rem 0.5rem; opacity: 0.7; }
.net-sm-item { display: flex; align-items: center; gap: 0.75rem; width: 100%; border: 0; background: none; font: inherit; font-size: 0.93rem; font-weight: 600; color: var(--text-main); padding: 0.5rem 0.55rem; border-radius: 10px; cursor: pointer; text-align: start; min-height: 48px; position: relative; }
.net-sm-item:hover { background: color-mix(in srgb, var(--text-main) 7%, transparent); }
.net-sm-label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-sm-label small { font-size: 0.74rem; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-sm-me .net-av { width: 36px; height: 36px; }
.net-sm-ic { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
.net-sm-ic svg { width: 19px; height: 19px; }
.c-blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.c-green { background: linear-gradient(135deg, #22C55E, #15803D); }
.c-mint { background: linear-gradient(135deg, #22D3EE, var(--mint-2)); }
.c-orange { background: linear-gradient(135deg, #FB923C, var(--orange-2)); }
.c-amber { background: linear-gradient(135deg, #FBBF24, #D97706); }
.c-teal { background: linear-gradient(135deg, #2DD4BF, #0F766E); }
.c-violet { background: linear-gradient(135deg, #A78BFA, #6D28D9); }
.c-navy { background: linear-gradient(135deg, var(--navy-2), var(--navy)); }
.net-sm-meta { font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.net-sm-item .net-count { position: static; }
.net-sm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px var(--orange-light); flex: 0 0 auto; }
.net-sm-group { margin: 0.2rem 0.55rem 0.3rem; font-size: 0.86rem; font-weight: 700; color: var(--text-muted); }
.net-side-foot { margin: 0.2rem 0.55rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--text-faint); }
.net-side-foot .net-link { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }

/* phones/tablets: shortcuts strip */
.net-strip { display: none; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding: 0.1rem 0.1rem 0.2rem; margin: -0.2rem 0 0; scroll-snap-type: x proximity; }
.net-strip::-webkit-scrollbar { display: none; }
.net-strip-item { display: inline-flex; align-items: center; gap: 0.45rem; flex: 0 0 auto; border: 1px solid var(--border-subtle); background: var(--bg-surface); border-radius: 999px; padding-block: 0.25rem; padding-inline: 0.3rem 0.85rem; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--text-main); cursor: pointer; scroll-snap-align: start; position: relative; }
.net-strip-item .net-sm-ic { width: 30px; height: 30px; }
.net-strip-item .net-sm-ic svg { width: 16px; height: 16px; }
.net-strip-item em { font-style: normal; font-size: 0.75rem; color: var(--orange-ink); background: var(--orange-light); border-radius: 999px; padding: 0 0.45rem; }
[data-theme="dark"] .net-strip-item em { color: #FFB27A; }
.net-strip-item .net-sm-dot { position: absolute; top: 2px; inset-inline-start: 26px; width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--bg-surface); }

/* connection requests (end column + narrow card) */
.net-only-narrow { display: none; }
.net-req { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0; }
.net-req + .net-req { border-top: 1px solid var(--border-subtle); }
.net-req .net-av-lg { width: 58px; height: 58px; font-size: 1.2rem; }
.net-req-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.net-req-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; min-width: 0; }
.net-req-top .net-name-row { min-width: 0; }
.net-req-top .net-faint { flex: 0 0 auto; }
.net-req-body .net-muted { font-size: 0.78rem; }
.net-req-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; }
.net-req-btns .btn { border-radius: 8px; min-height: 34px; justify-content: center; }
.net-req-btns .btn-ghost { background: var(--canvas-2); border-color: transparent; }

/* contacts (click = chat) */
.net-contacts { display: flex; flex-direction: column; gap: 0.05rem; }
.net-contacts .net-sm-group { display: flex; justify-content: space-between; }
.net-contact { display: flex; align-items: center; gap: 0.65rem; width: 100%; border: 0; background: none; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text-main); padding: 0.4rem 0.55rem; border-radius: 10px; cursor: pointer; text-align: start; }
.net-contact:hover { background: color-mix(in srgb, var(--text-main) 7%, transparent); }
.net-contact span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-side-end .net-side-foot { margin-top: 0.3rem; }

/* people-you-may-know carousel inside the feed (narrow screens) */
.net-pymk { display: none; padding-inline: 0; }
.net-pymk .net-card-head { padding-inline: 1.1rem; }
.net-pymk-track { display: flex; gap: 0.65rem; overflow-x: auto; padding: 0.1rem 1.1rem 0.4rem; scroll-snap-type: x mandatory; scrollbar-width: none; }
.net-pymk-track::-webkit-scrollbar { display: none; }
.net-pymk-item { flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0.9rem 0.6rem 0.7rem; background: var(--bg-surface); }
.net-pymk-item .net-muted { font-size: 0.76rem; min-height: 2.9em; }
.net-pymk-item .net-name-row { max-width: 100%; }
.net-pymk-item .btn { width: 100%; justify-content: center; border-radius: 8px; margin-top: auto; }

/* composer like "what's on your mind?" */
.net-composer { padding: 0.8rem 1rem 0.35rem; }
.net-compose-row textarea { background: var(--canvas-2); border-color: transparent; }
.net-compose-row textarea:hover { background: color-mix(in srgb, var(--text-main) 9%, var(--bg-surface)); }
.net-compose-bar { border-top: 1px solid var(--border-subtle); margin-top: 0.75rem; padding-top: 0.3rem; }
.net-quick { flex: 1 1 auto; justify-content: center; }
.net-compose.is-open .net-quick { flex: 0 0 auto; }

/* feed filter */
.net-scope { gap: 0.5rem; }
.net-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
.net-chip svg { width: 15px; height: 15px; }

/* rules dialog */
.net-rules-modal ul { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.net-rules-modal li { position: relative; padding-inline-start: 1.1rem; line-height: 1.7; color: var(--text-soft); }
.net-rules-modal li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--mint-2); }
.net-rules-modal .net-h3 svg { width: 20px; height: 20px; color: var(--mint-2); }
.net-rules .net-rules-modal .net-h3 { font-size: 0.98rem; }
.net-rules .net-rules-modal li { font-size: 0.84rem; }

@media (max-width: 1100px) {
  .net-strip:not([hidden]) { display: flex; }
}
@media (max-width: 860px) {
  .net-only-narrow:not([hidden]) { display: block; }
  .net-feed > .net-pymk { display: block; }
}
@media (max-width: 760px) {
  .net-strip { margin-inline: -0.75rem; padding-inline: 0.75rem; }
  .net-req .net-av-lg { width: 52px; height: 52px; }
}
