/* ── iVirth Social — main.css ── */
/* Font: DM Sans | Palette: Black & White */

:root {
  --black:   #000000;
  --white:   #ffffff;
  --grey-50:  #fafafa;
  --grey-100: #f4f4f4;
  --grey-200: #e8e8e8;
  --grey-300: #d1d1d1;
  --grey-400: #a0a0a0;
  --grey-500: #6b6b6b;
  --grey-600: #474747;
  --grey-700: #2e2e2e;
  --grey-800: #1a1a1a;
  --grey-900: #0d0d0d;

  --bg:       var(--grey-100);
  --surface:  var(--white);
  --border:   var(--grey-200);
  --text:     var(--grey-900);
  --text-muted: var(--grey-500);
  --accent:   var(--black);
  --radius:   12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --topbar-h: 56px;
  --sidebar-w: 220px;
  --feed-w:   560px;
  --transition: .15s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         var(--grey-900);
    --surface:    var(--grey-800);
    --border:     var(--grey-700);
    --text:       var(--grey-100);
    --text-muted: var(--grey-400);
    --accent:     var(--white);
    --shadow:     0 1px 4px rgba(0,0,0,.4);
    --shadow-md:  0 4px 20px rgba(0,0,0,.6);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-text { display: none; }
@media (min-width: 640px) { .logo-text { display: inline; } }

.topbar-search {
  flex: 1;
  max-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search input {
  width: 100%;
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 7px 12px 7px 36px;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
@media (prefers-color-scheme: dark) {
  .topbar-search input { background: var(--grey-700); }
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--grey-400);
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
.search-icon {
  position: absolute;
  left: 11px;
  color: var(--grey-400);
  pointer-events: none;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item:hover, .nav-item.active { color: var(--text); text-decoration: none; }
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.nav-icon-wrap { position: relative; }
.badge {
  position: absolute;
  top: -5px; right: -8px;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}
@media (prefers-color-scheme: dark) {
  .badge { background: var(--white); color: var(--black); }
}

/* Profile Dropdown */
.nav-profile-wrap { position: relative; }
.nav-profile-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  background: none; border: none;
  transition: color var(--transition);
}
.nav-profile-btn:hover { color: var(--text); }
.nav-profile-btn span { display: flex; align-items: center; gap: 3px; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  padding: 8px;
  z-index: 200;
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  transition: background var(--transition);
}
.dropdown-menu a:hover { background: var(--grey-100); text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .dropdown-menu a:hover { background: var(--grey-700); }
}
.dropdown-menu a.danger { color: #c00; }
.dropdown-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 12px;
}
.dropdown-header strong { display: block; font-size: 14px; }
.dropdown-header small { font-size: 12px; color: var(--text-muted); display: block; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - var(--topbar-h)); }

.layout-feed {
  max-width: 1080px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--feed-w) 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout-feed { grid-template-columns: var(--sidebar-w) 1fr; }
  .layout-feed .col-right { display: none; }
}
@media (max-width: 640px) {
  .layout-feed { grid-template-columns: 1fr; gap: 12px; }
  .layout-feed .col-left { display: none; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 16px; }
.card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--grey-200);
  flex-shrink: 0;
}
.avatar-xs  { width: 28px;  height: 28px; }
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 40px;  height: 40px; }
.avatar-lg  { width: 56px;  height: 56px; }
.avatar-xl  { width: 80px;  height: 80px; }
.avatar-2xl { width: 120px; height: 120px; border: 4px solid var(--surface); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-primary:hover { background: var(--grey-800); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--grey-400);
}
.btn-outline:hover { background: var(--grey-100); }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--white); color: var(--black); border-color: var(--white); }
  .btn-primary:hover { background: var(--grey-200); }
  .btn-outline:hover { background: var(--grey-700); }
}
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--grey-100); color: var(--text); }
@media (prefers-color-scheme: dark) {
  .btn-ghost:hover { background: var(--grey-700); }
}
.btn-icon { padding: 8px; border-radius: 50%; }

/* ── Form Elements ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--grey-600);
}
@media (prefers-color-scheme: dark) { .form-label { color: var(--grey-300); } }
.form-input, .form-textarea, .form-select {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--grey-500);
  box-shadow: 0 0 0 3px rgba(0,0,0,.07);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ── Profile Sidebar Card ─────────────────────────────────────────────────── */
.profile-mini-card {
  text-align: center;
  overflow: hidden;
}
.profile-mini-cover {
  height: 60px;
  background: linear-gradient(135deg, var(--grey-300), var(--grey-200));
  background-size: cover;
  background-position: center;
  margin-bottom: -28px;
}
.profile-mini-avatar {
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.profile-mini-info { padding: 8px 16px 16px; }
.profile-mini-name { font-weight: 700; font-size: 15px; margin-top: 4px; }
.profile-mini-headline { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.profile-mini-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 15px; font-weight: 700; }
.stat-lbl { font-size: 11px; color: var(--text-muted); }

/* ── Post Composer ───────────────────────────────────────────────────────── */
.composer { margin-bottom: 16px; }
.composer-inner { display: flex; align-items: flex-start; gap: 10px; }
.composer-input {
  flex: 1;
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition);
}
.composer-input:hover { background: var(--grey-200); }
@media (prefers-color-scheme: dark) {
  .composer-input { background: var(--grey-700); }
  .composer-input:hover { background: var(--grey-600); }
}
.composer-actions {
  display: flex;
  gap: 4px;
  padding: 8px 8px 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.composer-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.composer-btn:hover { background: var(--grey-100); color: var(--text); }
@media (prefers-color-scheme: dark) {
  .composer-btn:hover { background: var(--grey-700); }
}

/* ── Post Card ───────────────────────────────────────────────────────────── */
.post-card { margin-bottom: 12px; }
.post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 8px;
}
.post-author { flex: 1; }
.post-author-name { font-weight: 600; font-size: 14px; }
.post-author-name a:hover { text-decoration: underline; }
.post-author-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; }
.post-body { padding: 0 16px 12px; }
.post-text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-text .hashtag { font-weight: 600; color: var(--grey-500); }
.post-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 0;
}
.post-stats {
  padding: 4px 16px 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.post-actions {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 4px 8px;
}
.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.post-action-btn:hover { background: var(--grey-100); color: var(--text); }
@media (prefers-color-scheme: dark) {
  .post-action-btn:hover { background: var(--grey-700); }
}
.post-action-btn.liked { color: var(--black); font-weight: 700; }
@media (prefers-color-scheme: dark) { .post-action-btn.liked { color: var(--white); } }

/* ── Comments ────────────────────────────────────────────────────────────── */
.comments-section { padding: 0 16px 12px; border-top: 1px solid var(--border); }
.comment-item { display: flex; gap: 8px; margin-top: 10px; }
.comment-bubble {
  flex: 1;
  background: var(--grey-100);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
}
@media (prefers-color-scheme: dark) { .comment-bubble { background: var(--grey-700); } }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-input-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.comment-input {
  flex: 1;
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--transition);
}
.comment-input:focus { outline: none; border-color: var(--grey-400); }
@media (prefers-color-scheme: dark) { .comment-input { background: var(--grey-700); } }

/* ── Profile Page ────────────────────────────────────────────────────────── */
.profile-layout {
  max-width: 860px;
  margin: 24px auto;
  padding: 0 16px;
}
.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, var(--grey-300), var(--grey-200));
  background-size: cover;
  background-position: center;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 24px 20px;
  margin-bottom: 16px;
}
.profile-avatar-wrap {
  margin-top: -48px;
  margin-bottom: 12px;
}
.profile-name { font-size: 22px; font-weight: 700; }
.profile-headline { font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }
.profile-meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 16px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.profile-section { margin-bottom: 16px; }
.profile-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.experience-item, .edu-item {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.exp-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--grey-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.exp-info strong { font-size: 14px; font-weight: 600; display: block; }
.exp-info span { font-size: 13px; color: var(--text-muted); display: block; }
.exp-info p { font-size: 13px; margin-top: 4px; }

.skills-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ── Network / Suggestions ───────────────────────────────────────────────── */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.people-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
}
.people-card-cover {
  height: 40px;
  background: linear-gradient(135deg, var(--grey-300), var(--grey-200));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin: -20px -16px 8px;
  background-size: cover;
}
.people-card img { margin: 0 auto 8px; }
.people-card strong { display: block; font-size: 14px; font-weight: 600; }
.people-card span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ── Notifications ───────────────────────────────────────────────────────── */
.notif-list { }
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--grey-50); }
@media (prefers-color-scheme: dark) { .notif-item:hover { background: var(--grey-700); } }
.notif-item.unread { background: rgba(0,0,0,.02); }
@media (prefers-color-scheme: dark) { .notif-item.unread { background: rgba(255,255,255,.03); } }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--black); margin-top: 6px; flex-shrink: 0; }
@media (prefers-color-scheme: dark) { .notif-dot { background: var(--white); } }
.notif-content { flex: 1; font-size: 14px; }
.notif-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Messages ────────────────────────────────────────────────────────────── */
.messages-layout {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--topbar-h) - 80px);
}
.msg-sidebar {
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface);
  overflow-y: auto;
}
.msg-panel {
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.msg-thread-item {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.msg-thread-item:hover, .msg-thread-item.active { background: var(--grey-100); }
@media (prefers-color-scheme: dark) {
  .msg-thread-item:hover, .msg-thread-item.active { background: var(--grey-700); }
}
.msg-thread-info { flex: 1; overflow: hidden; }
.msg-thread-name { font-weight: 600; font-size: 14px; }
.msg-thread-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-bubble {
  max-width: 70%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.msg-bubble.mine {
  background: var(--black);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
@media (prefers-color-scheme: dark) { .msg-bubble.mine { background: var(--white); color: var(--black); } }
.msg-bubble.theirs {
  background: var(--grey-100);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
@media (prefers-color-scheme: dark) { .msg-bubble.theirs { background: var(--grey-700); } }
.msg-input-row {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.msg-input {
  flex: 1;
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
}
.msg-input:focus { outline: none; border-color: var(--grey-400); }
@media (prefers-color-scheme: dark) { .msg-input { background: var(--grey-700); } }

/* ── Auth Page ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-mark {
  width: 48px; height: 48px;
  background: var(--black);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
@media (prefers-color-scheme: dark) { .auth-logo .logo-mark { background: var(--white); } }
.auth-logo h1 { font-size: 22px; font-weight: 700; }
.auth-logo p { font-size: 14px; color: var(--text-muted); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  font-size: 13px; color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; border-top: 1px solid var(--border);
}
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  color: var(--text);
  text-decoration: none;
}
.btn-google:hover { background: var(--grey-100); box-shadow: var(--shadow); text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn-google:hover { background: var(--grey-700); } }
.btn-helix {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--black);
  border: 1.5px solid var(--black);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--white);
  margin-bottom: 12px;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-helix:hover { background: var(--grey-800); text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .btn-helix { background: var(--white); color: var(--black); border-color: var(--white); }
  .btn-helix:hover { background: var(--grey-200); }
}

/* ── Post Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 16px;
}
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Search Results ──────────────────────────────────────────────────────── */
.search-layout { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.search-result-item {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.search-result-info { flex: 1; }
.search-result-info strong { display: block; font-size: 14px; font-weight: 600; }
.search-result-info span { font-size: 12px; color: var(--text-muted); }

/* ── Right Sidebar ───────────────────────────────────────────────────────── */
.trending-list { }
.trending-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.trending-item:last-child { border-bottom: none; }
.trending-tag { font-weight: 600; display: block; }
.trending-count { color: var(--text-muted); font-size: 12px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--black);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  transition: transform .3s ease;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) { #toast { background: var(--white); color: var(--black); } }
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Infinite scroll loader ───────────────────────────────────────────────── */
.spinner {
  display: flex; justify-content: center; padding: 20px;
}
.spinner-ring {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@media (prefers-color-scheme: dark) { .spinner-ring { border-top-color: var(--white); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Open to Work Badge ──────────────────────────────────────────────────── */
.otw-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--black);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: .3px;
}
@media (prefers-color-scheme: dark) { .otw-badge { background: var(--white); color: var(--black); } }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.d-flex      { display: flex; }
.align-items-center { align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.w-100       { width: 100%; }
.flex-1      { flex: 1; }
.hidden      { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey-400); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .messages-layout { grid-template-columns: 1fr; }
  .msg-sidebar { display: none; }
  .msg-panel { border-radius: var(--radius); }
  .auth-card { padding: 28px 20px; }
  .profile-cover { height: 120px; }
  .profile-layout { padding: 0 8px; }
}
