/* ============================================================
   Social Network — light social-media theme
   (white top navbar, 3-column layout, blue accent, rounded cards)
   ============================================================ */
:root{
  --bg: #eff2f6;
  --panel: #ffffff;
  --text: #14191e;
  --muted: #676a79;
  --line: #e1e4e8;
  --primary: #0f6fec;
  --primary-soft: #e5f0fd;
  --danger: #d6293e;
  --shadow: 0 1px 3px rgba(20, 25, 30, .07);
  --radius: 14px;
}

*{ box-sizing: border-box; }

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

/* media never pushes the layout wider than the screen */
img, video{ max-width: 100%; height: auto; }

/* author display rules must never defeat the hidden attribute */
[hidden]{ display: none !important; }

body{
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.container{
  width: min(1320px, 96vw);
  margin: 0 auto;
}

/* ---------- Top navigation ---------- */
.topbar{
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-wrap{
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 0;
}

.brand{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  flex: none;
}

.brand img{ display: block; width: 100%; height: 100%; object-fit: cover; }

.nav-search{
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  width: min(380px, 36vw);
  position: relative;
  margin: 0 auto;   /* centered between logo and right menu */
}

.nav-search svg{ flex: none; }

.nav-search input{
  border: none;
  background: transparent;
  height: 100%;
  width: 100%;
  padding: 0;
  font: inherit;
  color: var(--text);
  outline: none;
}

/* ---------- Search typeahead ---------- */
.search-dd{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 25, 30, .18);
  padding: 6px;
  z-index: 1200;
  max-height: 380px;
  overflow-y: auto;
}

.search-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.search-row:hover{ background: var(--primary-soft); }

.search-avatar{ width: 36px; height: 36px; font-size: 15px; }

.search-meta{ display: grid; line-height: 1.3; min-width: 0; }
.search-meta strong{ font-size: 14px; }
.search-meta span{
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-none{
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.nav-right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.nav-menu{
  display: flex;
  list-style: none;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav-item a{
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}

.nav-item a:hover{ color: var(--primary); }

.nav-item a.active{
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-avatar{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f5c33b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
  text-decoration: none;
}
.nav-avatar:hover{ filter: brightness(1.08); }

.logout-btn{ padding: 8px 12px; font-size: 13.5px; }

/* ---------- User dropdown ---------- */
.user-menu{ position: relative; }

.user-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--text);
}
.user-btn:hover{ background: var(--bg); }

.user-name{
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caret{ color: var(--muted); font-size: 11px; }

.user-dropdown{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 25, 30, .18);
  padding: 6px;
  z-index: 1100;
}

.user-dropdown form{ margin: 0; }

.user-dd-name{
  padding: 10px 12px 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.user-dd-item{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.user-dd-item:hover{ background: var(--primary-soft); color: var(--primary); }

/* ---------- Auth pages ---------- */
.auth-wrap{
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.auth-card{
  width: min(420px, 94vw);
  padding: 30px 30px 24px;
  text-align: center;
}

.auth-card-wide{ width: min(620px, 94vw); }

.auth-title{ margin: 0; font-size: 24px; }
.auth-sub{ margin: 6px 0 0; color: var(--muted); }

.auth-form{ padding: 20px 0 0; max-width: none; text-align: left; }

.form-2col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px){ .form-2col{ grid-template-columns: 1fr; } }

.form-error{
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(214, 41, 62, .08);
  border: 1px solid rgba(214, 41, 62, .35);
  border-radius: 8px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

label.check{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
label.check input{ width: auto; height: auto; }
label.check span{ margin: 0; font-weight: 400; font-size: 14px; }

.btn.wide{ width: 100%; justify-content: center; }

.auth-switch{
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.auth-switch a{ color: var(--primary); font-weight: 600; text-decoration: none; }

/* ---------- 3-column page grid ---------- */
.page-grid{
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
}

/* nav controls that only exist on small screens */
.nav-icon-btn{
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: none;
  align-items: center;
  justify-content: center;
}
.nav-icon-btn:hover{ background: var(--bg); color: var(--primary); }
.nav-icon-btn[hidden]{ display: none !important; }

.nav-badge{
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.mobile-tabs{ display: none; }
.drawer-backdrop{ display: none; }

/* ---- tablets (landscape) & small laptops: right column becomes a slide-in panel ---- */
@media (max-width: 1200px){
  .page-grid{ grid-template-columns: 270px minmax(0, 1fr); }
  .nav-bell{ display: inline-flex; }

  .sidebar-right{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 28px rgba(20, 25, 30, .18);
    transform: translateX(105%);
    transition: transform .22s ease;
    z-index: 1500;
    visibility: hidden;
  }
  body.drawer-right-open .sidebar-right{ transform: none; visibility: visible; }

  .drawer-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 30, .45);
    z-index: 1400;
  }
  .drawer-backdrop:not([hidden]){ display: block; }
  body.drawer-left-open,
  body.drawer-right-open{ overflow: hidden; }
}

/* ---- tablets (portrait) & phones: single column, left column becomes a drawer, bottom tabs ---- */
@media (max-width: 900px){
  .page-grid{ grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 0; }
  .nav-wrap{ gap: 10px; }
  .nav-burger{ display: inline-flex; }
  .nav-menu{ display: none; }
  .nav-search{
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
  }

  .sidebar-left{
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 8px 0 28px rgba(20, 25, 30, .18);
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 1500;
    visibility: hidden;
  }
  body.drawer-left-open .sidebar-left{ transform: none; visibility: visible; }

  .mobile-tabs{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
  }
  .mobile-tabs a{
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 2px 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
  }
  .mobile-tabs .tab-ico{ font-size: 20px; line-height: 1; }
  .mobile-tabs a.active{ color: var(--primary); }
  /* keep content clear of the fixed tab bar (only rendered when logged in) */
  body:has(.mobile-tabs){ padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .toast{ bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce){
  .sidebar-left, .sidebar-right, .toast{ transition: none; }
}

/* ---------- Side cards ---------- */
.side-card{
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.side-card.pad{ padding: 18px; }

.profile-card{ text-align: center; }

.cover{
  height: 85px;
  background: linear-gradient(110deg, #37475d 0%, #5b4a68 45%, #e98f6b 100%);
}

.avatar-lg{
  width: 72px;
  height: 72px;
  margin: -36px auto 0;
  border-radius: 14px;
  border: 3px solid #fff;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

.profile-name{ margin: 10px 16px 0; font-size: 18px; }
.profile-role{ margin: 2px 16px 0; color: var(--muted); font-size: 13px; }
.profile-bio{ margin: 12px 20px 0; color: var(--muted); font-size: 14px; }

.stats{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 16px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats div,
.stats a{ display: grid; gap: 2px; align-content: start; }
.stats div + div,
.stats div + a,
.stats a + div,
.stats a + a{ border-left: 1px solid var(--line); }
.stats strong{ font-size: 16px; }
.stats span{ color: var(--muted); font-size: 12px; line-height: 1.25; padding: 0 4px; }

.stat-link{
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}
.stat-link:hover{ background: var(--primary-soft); }
.stat-link:hover strong,
.stat-link:hover span{ color: var(--primary); }

.side-menu{
  list-style: none;
  margin: 8px 0;
  padding: 0 10px;
  text-align: left;
}
.side-menu a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.side-menu a:hover{ background: var(--bg); }
.side-menu a.active{ background: var(--primary-soft); color: var(--primary); }

.view-profile{
  display: block;
  padding: 12px;
  border-top: 1px solid var(--line);
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.view-profile:hover{ background: var(--primary-soft); }

.side-footer{
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}
.side-footer a{ color: var(--muted); text-decoration: none; }
.side-footer a:hover{ color: var(--primary); }

/* ---------- Right sidebar ---------- */
.side-title{ margin: 0 0 14px; font-size: 17px; }
.side-title-row{ display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-title-row .side-title{ margin-bottom: 14px; }
.notif-count{
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}
.link-btn{
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  white-space: nowrap;
}
.link-btn:hover{ text-decoration: underline; }

/* unread notification: tinted row with a dot until "Mark all read" */
.notif-unread{
  background: var(--primary-soft);
  position: relative;
}
.notif-unread::after{
  content: "";
  position: absolute;
  top: 12px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.notif-unread .notif-text{ font-weight: 600; }
.notif-unread:hover{ background: #d8e8fb; }

/* ---------- Notifications (fixed-size live feed) ---------- */
.notif-list{
  height: 330px;          /* card size stays constant; list scrolls inside */
  overflow-y: auto;
  display: grid;
  gap: 4px;
  align-content: start;
}

.notif-item{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 6px;
  border-radius: 8px;
}
.notif-item:hover{ background: var(--bg); }

.notif-icon{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
  background: var(--primary-soft);
}
.notif-like .notif-icon{ background: #e7f6ec; }
.notif-comment .notif-icon{ background: #fdf1e2; }

.notif-body{ display: grid; gap: 2px; min-width: 0; }
.notif-text{ font-size: 13.5px; line-height: 1.35; }
.notif-time{ color: var(--muted); font-size: 12px; }

.notif-new{ animation: notif-flash 2.5s ease-out; }
@keyframes notif-flash{
  0%{ background: var(--primary-soft); }
  100%{ background: transparent; }
}

.notif-actions{
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.notif-actions .btn{ padding: 6px 12px; font-size: 13px; }

.notif-status{
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.view-more[disabled]{ opacity: .55; cursor: default; }
button.view-more{ width: 100%; border: none; cursor: pointer; font: inherit; font-weight: 600; }

.avatar-sm{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: none;
  background: var(--primary);
}

.view-more{
  display: block;
  margin-top: 12px;
  padding: 9px;
  text-align: center;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.view-more:hover{ background: var(--primary); color: #fff; }

.news-item{
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.news-item:last-child{ border-bottom: none; padding-bottom: 0; }
.news-item strong{
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item span{ color: var(--muted); font-size: 12.5px; }

/* live tech headlines */
.news-list{ gap: 2px; }

.news-row{
  display: grid;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.news-row:hover{ background: var(--bg); }
.news-row:hover .news-title{ color: var(--primary); }

.news-title{
  font-size: 13.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta{ color: var(--muted); font-size: 12px; }

/* ---------- Avatar color variants (by member id) ---------- */
.av-0{ background: linear-gradient(135deg, #0f6fec, #6ba2e6) !important; }
.av-1{ background: linear-gradient(135deg, #e66ba2, #f5a3c7) !important; }
.av-2{ background: linear-gradient(135deg, #52b788, #95d5b2) !important; }
.av-3{ background: linear-gradient(135deg, #f59e0b, #fbd38d) !important; }
.av-4{ background: linear-gradient(135deg, #8b5cf6, #c4b5fd) !important; }

/* editable sidebar avatar */
.avatar-editable{
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.avatar-edit-overlay{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(20, 25, 30, .55);
  color: #fff;
  opacity: 0;
  transition: opacity .15s ease;
}
.avatar-editable:hover .avatar-edit-overlay{ opacity: 1; }

.avatar-uploading{ opacity: .6; pointer-events: none; }

/* profile pictures inside any avatar container */
.avatar-sm img,
.avatar-lg img,
.nav-avatar img,
.suggest-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* ---------- Friend suggestions ---------- */
.suggest-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.suggest-card{
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.suggest-avatar{
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 8px;
}
.suggest-avatar:hover{ filter: brightness(1.08); }

.suggest-name{
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}
.suggest-name:hover{ color: var(--primary); }

.suggest-meta{ color: var(--muted); font-size: 13.5px; }
.suggest-meta.small{ font-size: 12.5px; }

.suggest-actions{
  display: flex;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}
.suggest-actions .btn{ flex: 1; justify-content: center; padding: 9px 8px; }

.friend-card .suggest-actions .btn{ padding: 8px 4px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast{
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #14191e;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(20, 25, 30, .25);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2000;
  max-width: 90vw;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Profile page ---------- */
.profile-page{ text-align: center; }
.profile-actions{
  justify-content: center;
  padding: 0 16px 18px;
}

.friends-strip{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.friend-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.friend-chip:hover{ border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.friend-chip .avatar-sm{ width: 32px; height: 32px; font-size: 14px; }

/* ---------- Page heading ---------- */
.page-title{
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Content cards ---------- */
.card,
.cat-card{
  margin: 0 0 20px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Tables ---------- */
.table-wrap{ overflow-x: auto; }

.table{
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td{
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.table th{
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #fafbfc;
}

.table tbody tr:nth-child(even){ background: #fafbfc; }
.table tbody tr:hover{ background: var(--primary-soft); }

.table td.num,
.table th.num{
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.right{ text-align: right; }
.muted{ color: var(--muted); padding: 18px; }

/* ---------- Column sorting ---------- */
.table thead th.sortable{
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.table thead th.sortable:hover{ color: var(--primary); }
.table thead th.sort-asc::after{ content: " \25B2"; font-size: 10px; color: var(--primary); }
.table thead th.sort-desc::after{ content: " \25BC"; font-size: 10px; color: var(--primary); }

/* ---------- Scroll autoload ---------- */
.autoload-sentinel{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.autoload-spinner{
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: autoload-spin .8s linear infinite;
}

@keyframes autoload-spin{ to{ transform: rotate(360deg); } }

.autoload-empty{
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Feed / post cards ---------- */
.composer-bar{
  display: flex;
  align-items: center;
  gap: 12px;
}
.composer-avatar{ background: #f5c33b !important; color: #14191e; }
.composer-prompt{
  flex: 1;
  padding: 11px 16px;
  background: var(--bg);
  border: none;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.composer-prompt:hover{ background: #e7eaef; }

.composer-quick{
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  flex: none;
}
.composer-quick:hover{ background: #e7eaef; }

.composer-form{ display: grid; gap: 12px; }

.composer-form textarea{
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
  outline: none;
}
.composer-form textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 236, .18);
}

.composer-preview{
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.composer-preview img,
.composer-preview video{
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.preview-remove{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 25, 30, .65);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.preview-remove:hover{ background: rgba(20, 25, 30, .85); }

.composer-foot{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.composer-attach{ cursor: pointer; }
.composer-spacer{ flex: 1; }

.post-media{
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg);
}
.post-media img,
.post-media video{
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.feed{ display: grid; gap: 20px; }

.post-card{
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.post-head{
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-meta{ display: grid; line-height: 1.3; min-width: 0; }
.post-meta strong{ font-size: 15px; overflow-wrap: anywhere; }
.post-time{ color: var(--muted); font-size: 12.5px; }

.post-actions-menu{
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.post-actions-menu .btn{ padding: 6px 10px; font-size: 13px; }

/* ---------- Post ⋯ menu ---------- */
.post-menu{
  margin-left: auto;
  position: relative;
}

.post-dots{
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.post-dots:hover{ background: var(--bg); color: var(--text); }

.post-dd{
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 25, 30, .18);
  padding: 6px;
  z-index: 1100;
}
.post-dd form{ margin: 0; }

.dd-danger{ color: var(--danger); }
.dd-danger:hover{ background: rgba(214, 41, 62, .08) !important; color: var(--danger) !important; }

.post-content{ margin: 14px 0; font-size: 15px; overflow-wrap: anywhere; }

.post-foot{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.post-foot .share{ margin-left: auto; }

.pf-btn{
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.pf-btn:hover{ background: var(--bg); color: var(--text); }
.pf-btn.liked{ color: var(--primary); font-weight: 700; }

.post-vis{ margin-left: 6px; font-size: 11px; }

/* ---------- Comments ---------- */
.comments{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.view-prev{
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
}
.view-prev:hover{ color: var(--primary); }

.comment-list{ display: grid; gap: 8px; }

.comment-row{
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-avatar{ width: 32px; height: 32px; font-size: 13px; flex: none; }

.comment-bubble{
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 12px;
  display: grid;
  gap: 2px;
  max-width: 85%;
}

.comment-name{
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.comment-name:hover{ color: var(--primary); }

.comment-text{ font-size: 14px; }
.comment-time{ color: var(--muted); font-size: 11.5px; }

.comment-input-row{
  display: flex;
  gap: 8px;
  align-items: center;
}
.comment-me{ width: 32px; height: 32px; font-size: 13px; flex: none; }
.comment-input{
  flex: 1;
  height: 38px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid transparent;
  font-size: 14px;
}
.comment-input:focus{ background: var(--panel); }

.comment-photo{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
  font-size: 16px;
  flex: none;
}
.comment-photo:hover{ background: #e7eaef; }

.comment-post{ padding: 8px 14px; font-size: 13.5px; flex: none; }

.comment-image{
  max-width: 240px;
  max-height: 200px;
  border-radius: 10px;
  margin-top: 4px;
  display: block;
}

.comment-preview{
  position: relative;
  width: fit-content;
  max-width: 240px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.comment-preview img{
  display: block;
  max-width: 240px;
  max-height: 180px;
  object-fit: contain;
}

/* ---------- Shared post embed ---------- */
.share-label{ font-weight: 400; color: var(--muted); }

.shared-embed{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.embed-head{ margin-bottom: 8px; }
.embed-head .avatar-sm{ width: 32px; height: 32px; font-size: 13px; }

.embed-name{
  color: var(--text);
  text-decoration: none;
}
.embed-name:hover{ color: var(--primary); }

.shared-embed .post-content{ margin: 8px 0; font-size: 14.5px; }
.shared-embed .post-media{ margin-bottom: 0; }
.shared-embed .muted{ padding: 4px; }

.visibility-select{
  width: auto;
  height: 38px;
  padding: 0 32px 0 10px;
  font-size: 13.5px;
}

/* ---------- Jobs ---------- */
.jobs-basis{ margin: -6px 0 16px; padding: 0; font-size: 14px; }

.job-card{ display: grid; gap: 10px; }

.job-head{ display: grid; gap: 2px; }
.job-title{ margin: 0; font-size: 17px; }
.job-company{ color: var(--muted); font-size: 14px; font-weight: 600; }

.job-meta{ color: var(--muted); font-size: 13.5px; }

.job-excerpt{ margin: 0; font-size: 14px; color: var(--text); }

.job-tags{ display: flex; flex-wrap: wrap; gap: 6px; }
.job-tag{
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.job-foot{
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
}

.btn:hover{ border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn.primary{
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover{ filter: brightness(1.08); color: #fff; }

.btn.danger{
  border-color: rgba(214, 41, 62, .4);
  color: var(--danger);
}
.btn.danger:hover{ background: rgba(214, 41, 62, .08); border-color: var(--danger); }

.inline{ display: inline; }

/* ---------- Forms ---------- */
.form{
  padding: 18px;
  display: grid;
  gap: 14px;
  max-width: 560px;
}

label span{
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select{
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 14px;
}

select{
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23676a79' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input::placeholder{ color: #9ca0ab; }

input:focus,
select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 236, .18);
}

input:hover:not(:focus),
select:hover:not(:focus){ border-color: #b6bac3; }

input[readonly]{
  background: var(--bg);
  color: var(--muted);
}

.actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
  flex-wrap: wrap;
}

/* ---------- Tabs ---------- */
.tabs{
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-btn{
  border: none;
  background: transparent;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}
.tab-btn:hover{ color: var(--primary); background: var(--primary-soft); }
.tab-btn.active{
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.file-input{
  padding: 8px 12px;
  height: auto;
  cursor: pointer;
}
.file-input::file-selector-button{
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  padding: 6px 12px;
  margin-right: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.current-resume{
  margin: -4px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.current-resume a{ color: var(--primary); font-weight: 600; text-decoration: none; }
.current-resume small{ display: block; margin-top: 2px; }

/* ---------- Readonly fields ---------- */
.readonly-field,
input.readonly-field:disabled{
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

/* ---------- Phone with country code / privacy rows ---------- */
.phone-row{
  display: flex;
  gap: 8px;
}
.phone-row select{ width: 120px; flex: none; }
.phone-row input{ flex: 1; }

.priv-row{
  display: flex;
  gap: 8px;
}
.priv-row .priv-select{
  width: 128px;
  flex: none;
  font-size: 13px;
  padding-left: 8px;
}
.priv-row #phoneCode{ width: 110px; flex: none; }
.priv-row input{ flex: 1; min-width: 0; }

.profile-role span{ margin: 0 6px; }

/* ---------- Tag autosuggest ---------- */
.tagbox{
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: text;
}
.tagbox:focus-within{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 236, .18);
}

.tag-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.tag-x{
  border: none;
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.tag-x:hover{ color: var(--danger); }

.tagbox .tag-entry{
  flex: 1;
  min-width: 140px;
  border: none;
  height: 30px;
  padding: 0 4px;
  font-size: 14px;
  background: transparent;
}
.tagbox .tag-entry:focus{ box-shadow: none; border: none; }

.tag-suggest{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20, 25, 30, .18);
  padding: 6px;
  z-index: 1050;
}

.tag-opt{
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.tag-opt:hover{ background: var(--primary-soft); color: var(--primary); }

/* ---------- Q&A: question posts, answers, star ratings, credibility ---------- */
.composer-question {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted, #65676b);
  cursor: pointer;
  white-space: nowrap;
}
.composer-question input { accent-color: #0f6fec; }

.question-card { border-left: 4px solid #f5b400; }
.question-text { font-size: 1.08rem; font-weight: 600; }

.question-banner {
  background: #fff8e6;
  border: 1px solid #f3dfa0;
  color: #7a5d00;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.85rem;
}

.answer-bubble { background: #f3f7ff; border: 1px solid #e1eaff; }

.answer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.answer-rate { display: inline-flex; gap: 1px; }
.star-btn {
  background: none;
  border: none;
  padding: 0 1px;
  font-size: 1rem;
  line-height: 1;
  color: #c6c9ce;
  cursor: pointer;
  transition: transform 0.1s ease, color 0.1s ease;
}
.star-btn:hover { transform: scale(1.2); }
.star-btn:hover, .star-btn.filled { color: #f5b400; }
.answer-rate:hover .star-btn { color: #f5b400; }
.answer-rate .star-btn:hover ~ .star-btn { color: #c6c9ce; }
.star-btn:disabled { opacity: 0.6; cursor: default; }

.answer-avg {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a5d00;
}

.cred-badge {
  display: inline-block;
  align-self: flex-start;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff3cd;
  border: 1px solid #f3dfa0;
  color: #7a5d00;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: 1px;
  cursor: help;
}

/* ---------- notification post links + single post page ---------- */
.notif-postlink {
  color: inherit;
  text-decoration: none;
  display: block;
  border-radius: 4px;
}
.notif-postlink:hover { color: #0f6fec; }
.notif-postlink:hover strong { color: #0f6fec; }

.back-to-feed {
  display: inline-block;
  margin-bottom: 12px;
  color: #0f6fec;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.back-to-feed:hover { text-decoration: underline; }

/* ---------- messages & calls ---------- */
.chat-wrap{
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 540px;
  overflow: hidden;
}
.chat-threads{
  border-right: 1px solid var(--border, #e4e6eb);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-threads-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border, #e4e6eb);
}
.chat-new{ padding: 4px 10px; font-size: .8rem; }
.chat-contacts{ border-bottom: 1px solid var(--border, #e4e6eb); max-height: 220px; overflow-y: auto; }
.chat-thread-list{ overflow-y: auto; flex: 1; }
.chat-empty{ padding: 14px; font-size: .85rem; }
.chat-thread{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}
.chat-thread:hover, .chat-thread.active{ background: #f0f6ff; }
.thread-body{ display: flex; flex-direction: column; min-width: 0; flex: 1; }
.thread-preview{
  font-size: .78rem;
  color: var(--muted, #65676b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.thread-unread{
  background: #0f6fec;
  color: #fff;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
}

.chat-pane{ display: flex; flex-direction: column; min-width: 0; }
.chat-placeholder{
  margin: auto;
  text-align: center;
  color: var(--muted, #65676b);
  padding: 40px 20px;
  line-height: 1.8;
}
.chat-conv{ display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-head{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #e4e6eb);
}
.chat-name{ font-weight: 700; color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-spacer{ flex: 1; }
.chat-call{ font-size: 1rem; padding: 6px 10px; }
.chat-call:disabled{ opacity: .4; cursor: not-allowed; }
.chat-back{ display: none; padding: 6px 10px; font-size: 1rem; flex: none; }

.chat-banner{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fff8e6;
  border-bottom: 1px solid #f3dfa0;
  color: #7a5d00;
  font-size: .85rem;
}
.chat-banner .btn{ padding: 4px 12px; font-size: .8rem; }

.chat-messages{
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 300px;
  max-height: 420px;
}
.chat-msg{ display: flex; align-items: flex-end; gap: 6px; }
.chat-msg.mine{ flex-direction: row-reverse; }
.chat-bubble{
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: .9rem;
  line-height: 1.4;
  word-break: break-word;
  background: #f0f2f5;
}
.chat-msg.mine .chat-bubble{ background: #0f6fec; color: #fff; }
.chat-msg-time{ font-size: .68rem; color: var(--muted, #65676b); }

.chat-input-row{
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border, #e4e6eb);
}
.chat-input-row input{
  flex: 1;
  border: 1px solid var(--border, #e4e6eb);
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  outline: none;
}
.chat-input-row input:focus{ border-color: #0f6fec; }

/* call history rows inside the conversation */
.chat-call-row{
  align-self: center;
  margin: 4px 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--muted, #65676b);
  font-size: .78rem;
  text-align: center;
}
.chat-call-missed{ color: var(--danger); background: rgba(214, 41, 62, .08); }
.chat-call-declined{ color: #7a5d00; background: #fff8e6; }

/* call overlays */
.call-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, .8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.call-box{
  background: #1c1e21;
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  width: min(760px, 94vw);
  text-align: center;
}
.ring-box{ width: min(380px, 92vw); }
.ring-title{ font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; }
.call-status{ margin-bottom: 10px; color: #b9c0ca; }
.call-videos{ position: relative; }
.call-videos #remoteVideo{
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 10px;
  min-height: 240px;
}
.call-videos #localVideo{
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 150px;
  border-radius: 8px;
  background: #000;
  border: 2px solid rgba(255, 255, 255, .4);
}
.call-actions{ margin-top: 14px; display: flex; gap: 10px; justify-content: center; }
.call-hangup{ background: #d6293e; color: #fff; border-color: #d6293e; }
.call-hangup:hover{ background: #b51f31; }

/* ---------- post author links ---------- */
a.avatar-sm{ text-decoration: none; color: inherit; }
.post-author{ color: inherit; text-decoration: none; }
.post-author:hover{ color: #0f6fec; text-decoration: underline; }

/* ============================================================
   Small screens: messages become a single pane (list OR chat),
   forms stack, tap targets grow, and inputs stay >=16px so iOS
   does not zoom in on focus.
   ============================================================ */
@media (max-width: 760px){
  .chat-wrap{ grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .chat-threads{ border-right: none; }
  .chat-pane{ display: none; }
  .chat-wrap.chat-open .chat-threads{ display: none; }
  .chat-wrap.chat-open .chat-pane{ display: flex; }
  .chat-back{ display: inline-flex; }
  .chat-thread-list{ max-height: 60vh; }
  .thread-preview{ max-width: none; }
  .chat-messages{
    flex: none;
    min-height: 0;
    max-height: none;
    /* fill the screen between the top bar + chat header and the input row + tab bar */
    height: calc(100dvh - 300px - env(safe-area-inset-bottom));
  }
  .chat-bubble{ max-width: 82%; }
  .call-videos #localVideo{ width: 96px; }
  .call-videos #remoteVideo{ max-height: 60vh; }
}

@media (max-width: 640px){
  body{ font-size: 15px; }
  .container{ width: calc(100% - 20px); }
  .page-grid{ padding: 12px 0; gap: 12px; }
  .page-title{ font-size: 18px; margin-bottom: 12px; }

  /* larger, comfortable tap targets */
  .btn{ min-height: 40px; }
  .pf-btn{ padding: 8px 10px; min-height: 40px; }
  .post-dots{ width: 40px; height: 40px; }
  .nav-item a{ padding: 10px 12px; }

  /* prevent iOS auto-zoom on focus */
  input, select, textarea, .comment-input, .chat-input-row input, .tagbox .tag-entry{ font-size: 16px; }

  /* search results use the full screen width instead of the small input */
  .search-dd{
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    max-height: calc(100dvh - 140px);
  }

  .side-card.pad,
  .post-card{ padding: 14px; }
  .post-media img,
  .post-media video{ max-height: 70vh; }
  .comment-bubble{ max-width: 100%; }
  .comment-image,
  .comment-preview,
  .comment-preview img{ max-width: 100%; }

  /* composer: attach + visibility on one row, question toggle on the next */
  .composer-foot .composer-question{ flex: 1 1 100%; }
  .composer-foot .composer-spacer{ display: none; }
  .composer-foot .btn:not(.composer-attach){ flex: 1 1 auto; justify-content: center; }
  .composer-quick{ width: 40px; height: 40px; }

  /* people / friends cards: one per row */
  .suggest-grid{ grid-template-columns: minmax(0, 1fr); gap: 12px; }

  /* profile + edit-profile */
  .form{ padding: 14px; max-width: none; }
  .profile-actions .btn{ flex: 1 1 45%; justify-content: center; }
  .priv-row{ flex-wrap: wrap; }
  .priv-row .priv-select{ flex: 1 1 100%; width: auto; }
  .priv-row #phoneCode{ width: 136px; }
  .priv-row input{ flex: 1 1 140px; }
  .phone-row{ flex-wrap: wrap; }
  .phone-row input{ flex: 1 1 160px; }
  .tab-btn{ padding: 12px 14px; font-size: 14px; white-space: nowrap; }

  /* auth */
  .auth-wrap{ padding: 20px 0; }
  .auth-card{ padding: 22px 18px 18px; }
  .auth-title{ font-size: 22px; }

  /* tables (friendship / post admin lists) scroll sideways inside their card */
  .table th, .table td{ padding: 10px; white-space: nowrap; }

  /* jobs */
  .job-foot .btn{ width: 100%; justify-content: center; }
}

/* very narrow phones */
@media (max-width: 360px){
  .nav-wrap{ gap: 6px; }
  .brand{ width: 36px; height: 36px; }
  .mobile-tabs a{ font-size: 10px; }
  .mobile-tabs .tab-ico{ font-size: 18px; }
}

/* ---- legal pages (/privacy, /terms, /account/delete) ---- */
.legal-wrap{ display: flex; justify-content: center; padding: 32px 0 56px; }
.legal{ width: min(760px, 94vw); padding: 32px 36px; line-height: 1.6; }
.legal h1{ margin: 0 0 4px; font-size: 26px; }
.legal h2{ margin: 26px 0 6px; font-size: 17px; }
.legal p, .legal ul{ margin: 8px 0; }
.legal ul{ padding-left: 22px; }
.legal-meta{ color: var(--muted); font-size: 14px; }
.legal-done{ font-size: 18px; font-weight: 600; }
.legal-form{ max-width: 420px; }
.legal-links{ margin-top: 28px; color: var(--muted); }
.auth-legal{ margin: 14px 0 0; font-size: 13px; color: var(--muted); }
