/* ═══════════════════════════════════════
   VECTRY — Design System v2
   Black & White Minimalist
══════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --bg-3: #f4f4f4;
  --bg-4: #ebebeb;
  --border: #e0e0e0;
  --border-hover: #c0c0c0;
  --text: #0a0a0a;
  --text-muted: #888888;
  --text-soft: #555555;
  --accent: #0a0a0a;
  --accent-hover: #333333;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --right-w: 280px;
}

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

html { scroll-behavior: smooth; }

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

/* ══ SCROLLBAR ══ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ══ AUTH PAGE ══ */
#auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* Remove animated orbs — clean white background */
.auth-bg { display: none; }
.auth-orb { display: none; }

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.06);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  justify-content: center;
}

.logo-text {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  letter-spacing: -0.5px;
  color: var(--text);
  /* Remove gradient */
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--text);
  background-clip: unset;
}

.auth-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
  letter-spacing: 0.2px;
}

.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.auth-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.form-group input, .form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--text);
  box-shadow: none;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }

/* Password toggle */
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 44px; }
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.toggle-pw:hover { color: var(--text); }

.btn-primary {
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  transition: opacity 0.15s;
  margin-top: 4px;
  box-shadow: none;
}
.btn-primary:hover { opacity: 0.8; transform: none; box-shadow: none; }
.btn-primary:active { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.auth-error {
  color: #c0392b;
  font-size: 13px;
  display: none;
  background: rgba(192,57,43,0.06);
  border: 1px solid rgba(192,57,43,0.15);
  border-radius: 6px;
  padding: 8px 12px;
}
.auth-error.show { display: block; }

.auth-success {
  color: #27ae60;
  font-size: 13px;
  background: rgba(39,174,96,0.06);
  border: 1px solid rgba(39,174,96,0.15);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  line-height: 1.5;
}

/* ══ APP LAYOUT ══ */
#app-page {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 28px;
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--text);
  background-clip: unset;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
  text-align: left;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); }
.nav-item.active svg { stroke: var(--text); }

.notif-badge {
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: auto;
}

.compose-fab-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  margin: 20px 0;
  transition: opacity 0.15s;
  box-shadow: none;
}
.compose-fab-sidebar:hover { opacity: 0.8; transform: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  margin-top: auto;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-handle { font-size: 12px; color: var(--text-muted); }

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--text); }

/* ── MAIN ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-right: var(--right-w);
  min-height: 100vh;
  border-right: 1px solid var(--border);
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
}
.view-header h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: var(--text);
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 8px 16px;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--text); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 14px; flex: 1; }
.search-bar input::placeholder { color: var(--text-muted); }

/* ── COMPOSE BOX ── */
.compose-box {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.compose-row { display: flex; gap: 12px; }
.compose-right { flex: 1; }

.compose-right textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  line-height: 1.55;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.compose-right textarea:focus { border-bottom-color: var(--text); }
.compose-right textarea::placeholder { color: var(--text-muted); }

.compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.compose-media-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.12s;
}
.compose-media-btn:hover { color: var(--text); background: var(--bg-3); }

.btn-post {
  margin-left: auto;
  background: var(--text);
  border: none;
  border-radius: 40px;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  transition: opacity 0.15s;
}
.btn-post:hover { opacity: 0.75; }
.btn-post:disabled { opacity: 0.3; cursor: not-allowed; }

.compose-images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.compose-img-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.compose-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.compose-img-remove {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── POSTS ── */
.post-card {
  display: flex;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.post-card:hover { background: var(--bg-2); }

.post-content { flex: 1; min-width: 0; }

.post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.post-name { font-weight: 600; font-size: 14px; cursor: pointer; }
.post-name:hover { text-decoration: underline; }
.post-dot { color: var(--text-muted); font-size: 12px; }
.post-handle { color: var(--text-muted); font-size: 13px; }
.post-time { color: var(--text-muted); font-size: 13px; margin-left: auto; }

.post-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.post-images {
  display: grid;
  gap: 2px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.post-images.count-1 { grid-template-columns: 1fr; }
.post-images.count-2 { grid-template-columns: 1fr 1fr; }
.post-images.count-3 { grid-template-columns: 1fr 1fr; }
.post-images.count-3 .post-img:first-child { grid-row: span 2; }
.post-images.count-4 { grid-template-columns: 1fr 1fr; }

.post-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  transition: opacity 0.12s;
  filter: grayscale(15%);
}
.post-img:hover { opacity: 0.88; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.12s;
}
.post-action:hover { background: var(--bg-3); color: var(--text); }
.post-action.liked { color: var(--text); font-weight: 600; }
.post-action.liked svg { fill: var(--text); }
.post-action.liked:hover { background: var(--bg-3); }

/* ── AVATAR ── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.compose-avatar { cursor: default; }

/* ── EXPLORE ── */
.explore-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.explore-user-card:hover { background: var(--bg-2); }
.explore-user-info { flex: 1; cursor: pointer; }
.explore-user-name { font-weight: 600; font-size: 14px; }
.explore-user-handle { font-size: 13px; color: var(--text-muted); }
.explore-user-bio { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── FOLLOW BTN ── */
.follow-btn {
  padding: 7px 16px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.follow-btn:hover { background: var(--text); color: white; border-color: var(--text); }
.follow-btn.following {
  background: var(--bg-3);
  color: var(--text-muted);
  border-color: var(--border);
}
.follow-btn.following:hover {
  background: transparent;
  color: #c0392b;
  border-color: rgba(192,57,43,0.4);
}

/* ── PROFILE VIEW ── */
.profile-banner {
  height: 140px;
  background: var(--bg-3);
  position: relative;
}

.profile-info {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-avatar-wrap {
  display: flex;
  align-items: flex-end;
  margin-top: -40px;
  position: relative;
  width: fit-content;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  border: 3px solid var(--bg);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar-btn {
  position: absolute;
  bottom: 2px;
  right: 0;
  width: 26px; height: 26px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.profile-avatar-btn:hover { background: var(--text); color: white; }

.profile-name { font-family: 'Instrument Serif', serif; font-size: 22px; font-weight: 400; color: var(--text); }
.profile-handle { font-size: 14px; color: var(--text-muted); }
.profile-bio { font-size: 14px; color: var(--text-soft); line-height: 1.5; }

.profile-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-stat { font-size: 14px; color: var(--text-muted); }
.profile-stat strong { color: var(--text); font-weight: 600; }
.profile-stat.clickable { cursor: pointer; }
.profile-stat.clickable:hover strong { text-decoration: underline; }

.edit-profile-btn {
  padding: 7px 20px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  width: fit-content;
}
.edit-profile-btn:hover { background: var(--bg-3); }

/* ── RIGHT PANEL ── */
.right-panel {
  width: var(--right-w);
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--border);
  background: var(--bg);
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.1px;
}

.suggestion-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.suggestion-info { flex: 1; cursor: pointer; }
.suggestion-name { font-size: 13px; font-weight: 600; }
.suggestion-handle { font-size: 12px; color: var(--text-muted); }

.trend-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.12s;
}
.trend-item:hover { color: var(--text); }

/* ── MODALS ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 48px rgba(0,0,0,0.12);
  position: relative;
}
.modal-large { max-width: 600px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  font-size: 18px;
  transition: background 0.12s;
}
.modal-close:hover { background: var(--bg-4); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-body .btn-primary { margin-top: 8px; }

/* Compose modal */
.compose-modal-card { max-width: 560px; }
.compose-modal-body {
  display: flex;
  gap: 12px;
  padding: 20px 24px 12px;
}
.compose-modal-body textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  line-height: 1.6;
}
.compose-modal-body textarea::placeholder { color: var(--text-muted); }
.compose-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.compose-modal-footer .btn-post { margin-left: auto; }

/* Comments */
.comment-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg);
}
.comment-input-row input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 16px;
  outline: none;
  transition: border-color 0.12s;
}
.comment-input-row input:focus { border-color: var(--text); }
.comment-input-row input::placeholder { color: var(--text-muted); }

.comment-card {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-content { flex: 1; }
.comment-author { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.comment-author span { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.comment-text { font-size: 14px; line-height: 1.5; }

/* ── LOADING ── */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.96);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 36px; height: 36px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.lightbox-close:hover { background: var(--bg-3); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  border: none;
  color: white;
  padding: 11px 22px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.2s;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── EXPLORE TABS ── */
.explore-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin: 12px 24px;
}
.explore-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.explore-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── STORIES ── */
.stories-row {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
.stories-list { display: flex; gap: 12px; }

.story-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.story-circle .avatar {
  width: 56px; height: 56px;
  border: 2px solid var(--text);
  transition: opacity 0.12s;
}
.story-circle .avatar:hover { opacity: 0.8; }
.story-circle span { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.story-add .avatar {
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.story-add .avatar:hover { border-color: var(--text); color: var(--text); }

/* Story Viewer */
.story-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.story-viewer.open { display: flex; }
.story-viewer img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}
.story-viewer-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  padding: 12px 16px 32px;
}
.story-progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
}
.story-progress-seg.active .story-progress-fill { width: 100%; }
.story-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.story-viewer-user .avatar {
  width: 32px; height: 32px;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
}
.story-viewer-close {
  background: none; border: none;
  color: #fff; font-size: 28px;
  cursor: pointer; opacity: 0.8;
}
.story-viewer-close:hover { opacity: 1; }
.story-delete-btn {
  background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 14px; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin-left: auto; transition: background 0.12s;
}
.story-delete-btn:hover { background: rgba(192,57,43,0.6); }
.story-viewer-nav {
  position: absolute;
  top: 50%; left: 0; right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
  z-index: 2;
}
.story-nav-btn {
  pointer-events: all;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.story-nav-btn:hover { background: rgba(255,255,255,0.3); }

/* ── MESSAGES ── */
.messages-layout {
  display: flex;
  height: calc(100vh - 70px);
}
.msg-sidebar {
  width: 280px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.msg-sidebar .view-header { position: static; backdrop-filter: none; }
.msg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.msg-conversations { flex: 1; overflow-y: auto; }

.conv-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.conv-card:hover { background: var(--bg-2); }
.conv-card.active { background: var(--bg-3); }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 14px; font-weight: 600; }
.conv-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.conv-online {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #27ae60;
  flex-shrink: 0;
}
.conv-online.offline { background: var(--border); }

.msg-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-bubble {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--text);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.received {
  align-self: flex-start;
  background: var(--bg-3);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}
.msg-bubble.received .msg-time { text-align: left; }
.msg-edited { font-size: 9px; opacity: 0.5; text-align: right; margin-top: -2px; }
.msg-menu-btn { cursor: pointer; opacity: 0.4; font-size: 12px; padding: 0 4px; }
.msg-menu-btn:hover { opacity: 1; }
.msg-context-menu {
  position: fixed; z-index: 9999; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); min-width: 140px;
}
.msg-context-menu button {
  display: block; width: 100%; padding: 8px 12px; border: none; background: none;
  color: var(--text); font-size: 13px; text-align: left; cursor: pointer; border-radius: 4px;
}
.msg-context-menu button:hover { background: var(--bg-3); }

.msg-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.msg-input-row input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: var(--text);
}
.msg-input-row input:focus { border-color: var(--text); }

.msg-back-btn {
  display: none;
  background: none; border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  font-size: 16px;
}

/* ── BLOCK BTN ── */
.block-btn {
  padding: 7px 16px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.block-btn:hover { border-color: #c0392b; color: #c0392b; }

/* ── VERIFIED BADGE ── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.verified-badge.admin-gear {
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 0;
  width: auto;
  height: auto;
}
.verified-badge.admin-gear:hover {
  color: #000;
}

/* ── ONLINE DOT ── */
.online-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #27ae60;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── NOTIFICATIONS ── */
.notif-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.notif-card:hover { background: var(--bg-2); }
.notif-card.notif-unread { background: var(--bg-2); }
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.notif-text strong { color: var(--text); }
.notif-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-dot {
  width: 8px; height: 8px;
  background: var(--text);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-mark-read {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.12s;
}
.notif-mark-read:hover { color: var(--text); }

/* ── MUSIC ── */
.music-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.music-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.music-tab:hover { color: var(--text); }
.music-tab.active { color: var(--text); border-bottom-color: var(--text); }

.music-card {
  display: flex;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.music-card:hover { background: var(--bg-2); }

.music-cover {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.music-cover-placeholder {
  width: 80px;
  height: 80px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.music-info { flex: 1; min-width: 0; }
.music-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.music-title-text {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-artist-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.music-album-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 4px;
}
.music-rating {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}
.music-rating .star {
  color: var(--text);
  font-size: 14px;
}
.music-rating .star.empty {
  opacity: 0.2;
}
.music-review-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 4px;
}
.music-review-author {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.music-review-author .avatar {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.music-review-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.music-review-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s;
}
.music-review-actions button:hover { color: var(--text); }

.music-embed {
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.music-embed iframe {
  width: 100%;
  border: none;
}

.star-rating {
  display: flex;
  gap: 4px;
  cursor: pointer;
}
.star-rating .star {
  font-size: 24px;
  color: var(--border);
  transition: color 0.1s;
  user-select: none;
}
.star-rating .star.active {
  color: var(--text);
}
.star-rating .star:hover {
  color: var(--accent-hover);
}

.music-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.music-empty svg { margin-bottom: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .right-panel { display: none; }
  .main-content { margin-right: 0; }
  .msg-sidebar { width: 240px; }
}
@media (max-width: 900px) {
  .msg-sidebar { width: 100%; border-right: none; }
  .msg-sidebar.hide { display: none; }
  .msg-main.show { display: flex; }
  .msg-main { display: none; }
  .msg-back-btn { display: block; }
  .story-circle .avatar { width: 48px; height: 48px; }
  .stories-row { padding: 12px 16px; gap: 10px; }
  .stories-list { gap: 10px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }
  body { font-size: 14px; }
  .sidebar { padding: 10px 6px; }
  .sidebar-logo { padding: 6px; margin-bottom: 16px; }
  .sidebar-logo span, .nav-item span, .compose-fab-sidebar span,
  .sidebar-user-info { display: none; }
  .compose-fab-sidebar { padding: 10px; border-radius: 50%; width: 38px; height: 38px; justify-content: center; margin: 12px 0; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-user { justify-content: center; padding: 8px; }
  .sidebar-logo { justify-content: center; }
  .view-header { padding: 14px 16px; }
  .view-header h2 { font-size: 18px; }
  .post-card { padding: 14px 16px; gap: 10px; }
  .compose-box { padding: 14px 16px; }
  .post-body { font-size: 14px; }
  .post-images.count-2, .post-images.count-3, .post-images.count-4 { grid-template-columns: 1fr 1fr; }
  .post-img { height: 140px; }
  .auth-card { padding: 28px 20px; margin: 0 12px; }
  .explore-user-card { padding: 12px 16px; }
  .explore-tabs { margin: 8px 16px; }
  .profile-banner { height: 100px; }
  .profile-avatar { width: 64px; height: 64px; font-size: 20px; }
  .profile-info { padding: 12px 16px 20px; }
  .profile-name { font-size: 18px; }
  .story-viewer img { width: 100%; height: 100%; object-fit: cover; }
}
@media (max-width: 480px) {
  :root { --sidebar-w: 48px; }
  .sidebar { padding: 8px 4px; }
  .nav-item { padding: 8px; }
  .compose-fab-sidebar { width: 34px; height: 34px; padding: 8px; margin: 8px 0; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .post-card { padding: 12px 12px; }
  .post-img { height: 100px; }
  .story-circle .avatar { width: 42px; height: 42px; }
  .stories-row { padding: 10px 12px; gap: 8px; }
  .stories-list { gap: 8px; }
  .msg-bubble { max-width: 85%; font-size: 13px; }
  .msg-input-row { padding: 8px 10px; }
  .msg-input-row input { font-size: 13px; padding: 8px 12px; }
}
