:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e8e4dc;
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --primary-dark: #1d4ed8;
  --danger: #ef4444;
  --success: #22c55e;
  --accent: #f59e0b;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; }
img, video { max-width: 100%; display: block; }
#app { min-height: 100vh; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.navbar-inner,
.app-container {
  max-width: 1100px;
  width: calc(100% - 32px);
  margin: 0 auto;
}

.navbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
}

.nav-links,
.nav-right,
.post-header,
.post-actions,
.comment-input-row,
.comment-item,
.profile-avatar-row,
.profile-id-block,
.profile-inline-meta,
.mini-stats,
.suggest-item,
.composer-actions,
.chat-header,
.dir-actions,
.auth-tabs-shell,
.field-grid-two,
.composer-inline-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links { gap: 4px; }
.nav-right { gap: 10px; }
.nav-avatar-chip { padding: 0; }

.nav-btn {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.18s;
}

.nav-btn:hover,
.nav-btn.active { background: var(--primary-light); color: var(--primary); }

.app-main { padding: 24px 0 36px; }
.app-container.single-column { max-width: 1100px; }
.content-column { min-width: 0; }

.card,
.auth-box,
.modal-card,
.messages-layout,
.empty-state {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #f0ede6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field-grid-two { align-items: stretch; }
.field-grid-two > * { flex: 1; }

.input,
.comment-input,
.chat-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
}

.input:focus,
.comment-input:focus,
.chat-input:focus { border-color: var(--primary); }
textarea.input { min-height: 84px; resize: vertical; }

.avatar,
.avatar-fallback {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #c7d2fe, #818cf8);
}

.avatar-xs { width: 32px; height: 32px; font-size: 12px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 80px; height: 80px; font-size: 28px; }
.avatar-xl { width: 110px; height: 110px; font-size: 38px; }
.avatar-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary); }

.auth-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  align-items: center;
}

.auth-centered {
  place-items: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #7c3aed 100%);
  padding: 24px;
  margin: -24px 0 -36px;
}

.auth-box {
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  border-radius: 20px;
}

.auth-header {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  padding: 32px;
  text-align: center;
}

.auth-header h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  color: white;
  font-size: 28px;
}

.auth-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.auth-tabs-shell {
  border-bottom: 1px solid var(--border);
  gap: 0;
}

.auth-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
}

.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { padding: 28px; display: grid; gap: 16px; }
.text-link { color: var(--primary); font-weight: 600; }
.centered-text { text-align: center; }

.home-page,
.profile-page-modern,
.directory-page-modern,
.messages-page-modern {
  display: grid;
  gap: 20px;
}

.stories-card { padding: 14px 18px; }
.stories-strip { display: flex; gap: 14px; overflow-x: auto; }
.story-bubble {
  min-width: 92px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 4px;
}
.story-bubble span,
.text-muted,
.post-meta span,
.comment-time,
.preview,
.dir-job,
.job-line,
.no-chat-inline {
  color: var(--text-muted);
  font-size: 12px;
}
.empty-stories { padding: 18px 0; color: var(--text-muted); }

.two-col-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.composer-card { padding: 18px; margin-bottom: 20px; }
.composer { display: flex; gap: 12px; align-items: flex-start; }
.composer-body { flex: 1; display: grid; gap: 10px; }
.composer textarea {
  border: 0;
  background: transparent;
  min-height: 70px;
  resize: none;
  outline: none;
  font-size: 15px;
}
.composer-actions { justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: #f0ede6;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  cursor: pointer;
}
.file-btn input { display: none; }
.composer-preview img,
.composer-preview video,
.image-preview img,
.image-preview video {
  max-height: 220px;
  border-radius: 10px;
  object-fit: cover;
}

.feed-stack { display: grid; gap: 16px; }
.post-card { padding: 18px; }
.post-header { margin-bottom: 14px; }
.post-meta { flex: 1; display: grid; gap: 3px; }
.post-meta strong { font-size: 14px; }
.post-text { font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.post-image { width: 100%; border-radius: 10px; margin-bottom: 12px; max-height: 400px; object-fit: cover; }
.post-actions { gap: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.action-btn:hover { background: #f5f4f0; }
.action-btn.liked { color: var(--danger); }
.action-btn.static-action { cursor: default; }
.delete-btn { margin-left: auto; color: var(--danger); }

.comments-section {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  background: #fafaf8;
  border-radius: 0 0 var(--radius) var(--radius);
}
.comment-input-row { margin-bottom: 14px; }
.comment-input { flex: 1; border-radius: 20px; }
.comment-send,
.chat-send {
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.comment-body {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 8px 12px;
}
.comment-body p { margin: 3px 0 0; font-size: 13px; }
.del-comment { margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.centered-mini { text-align: center; }

.home-rail { display: grid; gap: 16px; }
.widget { padding: 18px; }
.profile-mini-top { display: flex; gap: 12px; align-items: center; }
.profile-mini-name { font-weight: 700; font-size: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.mini-stats { justify-content: space-around; text-align: center; }
.mini-stats div { display: grid; gap: 2px; }
.mini-stats strong { color: var(--primary); }
.mini-stats span { font-size: 12px; color: var(--text-muted); }
.suggestions-list { display: grid; gap: 12px; }
.suggest-item .info { flex: 1; display: grid; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  font-family: "Playfair Display", serif;
}

.dir-search-row { display: flex; gap: 10px; }
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.dir-card-modern {
  padding: 20px 16px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.dir-actions { justify-content: center; margin-top: 6px; }

.profile-shell { overflow: hidden; }
.profile-cover { height: 180px; background: linear-gradient(135deg, #1e3a8a, #7c3aed); }
.profile-info { padding: 0 24px 24px; }
.profile-avatar-row { align-items: flex-end; justify-content: space-between; margin-top: -55px; margin-bottom: 14px; }
.profile-name {
  font-size: 22px;
  font-weight: 700;
  font-family: "Playfair Display", serif;
}
.profile-dept { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.profile-bio { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin-bottom: 16px; }
.profile-inline-meta { flex-wrap: wrap; margin-bottom: 12px; }
.profile-inline-meta span { font-size: 13px; color: var(--text-muted); }
.profile-stats { display: flex; gap: 24px; margin: 16px 0; }
.stat { text-align: center; }
.num { font-size: 20px; font-weight: 700; color: var(--primary); }
.lbl { font-size: 12px; color: var(--text-muted); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-posts-stack { display: grid; gap: 16px; }
.profile-post-card { overflow: hidden; }
.profile-post-image { width: 100%; max-height: 360px; object-fit: cover; }
.profile-post-copy { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-post-copy p { margin: 0; }
.with-image { border-top: 1px solid var(--border); }

.messages-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 140px);
  overflow: hidden;
}
.msg-sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.msg-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.user-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0ede6;
  text-align: left;
}
.user-list-item.active,
.user-list-item:hover { background: var(--primary-light); }
.name { font-size: 14px; font-weight: 600; }
.preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.chat-area { display: flex; flex-direction: column; background: white; }
.chat-header { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f8f5;
}
.chat-message-wrap { display: flex; flex-direction: column; }
.sent-wrap { align-items: flex-end; }
.received-wrap { align-items: flex-start; }
.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-bubble.sent { background: var(--primary); color: white; border-radius: 16px 16px 4px 16px; }
.chat-bubble.received { background: white; border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; }
.bubble-time { font-size: 10px; opacity: 0.6; margin-top: 3px; }
.chat-input-row { gap: 8px; padding: 14px; border-top: 1px solid var(--border); background: white; }
.chat-input { border-radius: 24px; }
.chat-send { width: 40px; height: 40px; }
.no-chat,
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  padding: 48px 24px;
  text-align: center;
}

.modal-backdrop.hidden { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; }
.modal-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 22px;
  animation: popIn 0.2s ease;
}
.story-viewer { max-width: 720px; }
.story-viewer img,
.story-viewer video { width: 100%; border-radius: 14px; max-height: 70vh; object-fit: contain; background: black; }
.modal-close { position: absolute; top: 14px; right: 14px; font-size: 20px; color: var(--text-muted); }
.stack-form { display: grid; gap: 14px; }

#toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
}
.toast {
  opacity: 0;
  transform: translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s, opacity 0.3s;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #1a1a1a; }
.toast-error { background: var(--danger); }

.config-screen .auth-shell { min-height: 100vh; }
.config-screen .auth-brand-card {
  padding: 32px;
  max-width: 520px;
  margin: 0 auto;
}

@keyframes popIn {
  from { transform: scale(0.93); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 900px) {
  .two-col-layout,
  .messages-layout { grid-template-columns: 1fr; }
  .home-rail { order: -1; }
}

@media (max-width: 720px) {
  .navbar-inner { height: auto; padding: 12px 0; align-items: flex-start; flex-direction: column; }
  .nav-links { width: 100%; overflow-x: auto; }
  .profile-avatar-row,
  .profile-id-block,
  .field-grid-two { flex-direction: column; align-items: flex-start; }
  .profile-info { padding: 0 18px 18px; }
  .app-container { width: calc(100% - 20px); }
}

.auth-brand-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.story-viewer-head {
  margin-bottom: 14px;
}

.config-screen code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
}


.edit-profile-modal-card {
  max-width: 820px;
  padding: 22px;
}

.edit-profile-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.edit-profile-main-column,
.edit-profile-side-column {
  display: grid;
  gap: 14px;
}

.edit-profile-side-column {
  align-content: start;
}

@media (max-width: 720px) {
  .edit-profile-form-grid {
    grid-template-columns: 1fr;
  }
}


.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card,
.page-loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 32px 28px;
}

.boot-card {
  min-width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.boot-brand {
  font-family: "Playfair Display", serif;
  font-size: 30px;
  color: var(--primary);
}

.boot-card p,
.page-loading-card p {
  margin: 0;
  color: var(--text-muted);
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.page-loading-card {
  min-height: 240px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.profile-posts-section {
  display: grid;
  gap: 16px;
}

.profile-posts-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.profile-posts-bar-icon {
  color: var(--primary);
  font-size: 14px;
}

.profile-posts-stack { display: block; }

.profile-grid-posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-grid-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f3f4f6;
}

.profile-grid-image,
.profile-grid-text-tile {
  width: 100%;
  height: 100%;
}

.profile-grid-image {
  object-fit: cover;
}

.profile-grid-text-tile {
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.profile-grid-text-tile p {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.profile-grid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.04));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.profile-grid-tile:hover .profile-grid-overlay {
  opacity: 1;
}

.profile-grid-meta {
  display: grid;
  gap: 6px;
  color: white;
}

.profile-grid-meta span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.84;
}

.profile-grid-meta strong {
  font-size: 13px;
  line-height: 1.4;
}

.profile-grid-delete {
  align-self: flex-end;
  background: rgba(239, 68, 68, 0.92);
  color: white;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .profile-grid-posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .profile-grid-overlay {
    padding: 10px;
  }

  .profile-grid-meta strong {
    font-size: 12px;
  }
}

.auth-minimal-shell {
  min-height: calc(100vh - 40px);
  place-items: center;
  padding: 32px 16px 40px;
  margin: -24px 0 -36px;
  background: linear-gradient(135deg, #fdfbfb, #ebedee);
}

.auth-outer {
  width: 100%;
  max-width: 380px;
  display: grid;
  gap: 14px;
}

.auth-outer-wide {
  max-width: 420px;
}

.auth-minimal-card {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #dbdbdb;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.08);
  overflow: hidden;
  padding: 28px 28px 24px;
}

.auth-logo-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo-orb {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4);
  box-shadow: 0 12px 20px rgba(129, 52, 175, 0.18);
}

.auth-logo-wrap h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 30px;
  line-height: 1.08;
  color: #1a1a1a;
}

.auth-logo-wrap p {
  margin: 0;
  color: #6b6b6b;
  font-size: 14px;
}

.auth-minimal-form {
  gap: 14px;
  padding: 0;
}

.auth-input {
  border-radius: 10px;
  border: 1px solid #dbdbdb;
  background: #fff;
  min-height: 46px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-input:focus {
  border-color: #0095f6;
  box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.12);
}

.auth-primary-button {
  margin-top: 4px;
  background: #0095f6;
  border-radius: 10px;
  font-weight: 700;
  min-height: 46px;
}

.auth-primary-button:hover {
  background: #007edb;
}

.auth-switch-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #dbdbdb;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.auth-switch-card span {
  color: #6b6b6b;
  font-size: 14px;
}

.auth-switch-link {
  font-weight: 700;
  color: #0095f6;
}

.auth-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-image-preview img {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  margin-top: 4px;
}

@media (max-width: 540px) {
  .auth-minimal-card {
    padding: 24px 18px 20px;
  }

  .auth-logo-wrap h1 {
    font-size: 24px;
  }

  .auth-two-col {
    grid-template-columns: 1fr;
  }
}

.post-card {
  position: relative;
  overflow: hidden;
}

.post-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.post-image-wrap .post-image {
  margin-bottom: 0;
  transition: transform 0.3s ease;
}

.post-image-wrap:hover .post-image {
  transform: scale(1.015);
}

.post-big-heart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.post-big-heart span {
  font-size: 88px;
  line-height: 1;
  color: white;
  text-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  transform: scale(0.35);
}

.post-big-heart.burst {
  animation: post-heart-burst 0.72s ease-in-out;
}

.post-big-heart.burst span {
  animation: post-heart-scale 0.72s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.post-actions {
  gap: 10px;
}

.action-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn::after {
  content: "";
  position: absolute;
  inset: auto auto 50% 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 149, 246, 0.16);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.action-btn:hover::after {
  animation: action-ripple 0.55s ease-out;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: 16px;
  transform-origin: center;
}

.like-action.liked {
  color: #ef4444;
}

.like-action.liked .heart-icon {
  animation: heart-pulse 0.34s ease;
}

.like-action.like-animate {
  animation: like-bounce 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.like-action.like-animate .heart-icon {
  animation: heart-pop 0.32s ease-in-out;
}

.comment-toggle.active {
  color: #0095f6;
  background: rgba(0, 149, 246, 0.08);
}

.comments-shell {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.32s ease, opacity 0.24s ease;
}

.comments-shell.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.comments-section {
  min-height: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.3s ease;
}

.comments-shell.open .comments-section {
  transform: translateY(0);
}

.comments-list {
  display: grid;
  gap: 10px;
}

.comment-send {
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-send:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0, 149, 246, 0.22);
}

.comment-item {
  opacity: 1;
  transform: translateY(0);
}

.comment-item-new {
  animation: comment-enter 0.36s ease-out;
}

.comment-item-leaving {
  animation: comment-exit 0.22s ease-in forwards;
}

.del-comment {
  transition: color 0.18s ease, transform 0.18s ease;
}

.del-comment:hover {
  transform: translateX(2px);
}

@keyframes like-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes heart-pop {
  0% { transform: scale(0.7); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes heart-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes action-ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.4;
  }
  100% {
    transform: translate(-50%, -50%) scale(14);
    opacity: 0;
  }
}

@keyframes post-heart-burst {
  0%, 100% { opacity: 0; }
  16%, 68% { opacity: 1; }
}

@keyframes post-heart-scale {
  0% { transform: scale(0.3); }
  22% { transform: scale(1.12); }
  46% { transform: scale(0.96); }
  100% { transform: scale(1.36); opacity: 0; }
}

@keyframes comment-enter {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes comment-exit {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 120px;
  }
  100% {
    opacity: 0;
    transform: translateX(18px);
    max-height: 0;
    margin-bottom: 0;
  }
}

:root {
  --bg: #171735;
  --card: rgba(38, 33, 82, 0.9);
  --text: #f5f7ff;
  --text-muted: #a9add1;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #8b5cf6;
  --primary-light: rgba(139, 92, 246, 0.16);
  --primary-dark: #6d3df1;
  --danger: #ff6b9f;
  --success: #34d399;
  --accent: #22d3ee;
  --shadow: 0 22px 60px rgba(6, 10, 34, 0.36);
  --shadow-lg: 0 26px 80px rgba(8, 10, 33, 0.5);
}

body {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 24%),
    linear-gradient(180deg, #14132f 0%, #171735 44%, #100f26 100%);
  color: var(--text);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(88px);
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: 88px;
  left: -100px;
  background: rgba(139, 92, 246, 0.22);
}

body::after {
  right: -120px;
  bottom: 80px;
  background: rgba(255, 107, 159, 0.18);
}

.navbar {
  background: rgba(18, 18, 42, 0.78);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 40px rgba(5, 6, 20, 0.35);
}

.navbar-inner,
.app-container {
  max-width: 1180px;
}

.navbar-inner {
  gap: 22px;
}

.nav-brand {
  position: relative;
  color: #f8ebff;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.nav-brand::before {
  content: "?";
  display: inline-flex;
  margin-right: 10px;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.75);
}

.nav-links {
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-btn {
  border-radius: 14px;
  color: var(--text-muted);
}

.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.26), rgba(34, 211, 238, 0.16));
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(71, 56, 202, 0.2);
}

.nav-avatar-chip {
  padding: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(34, 211, 238, 0.72));
  box-shadow: 0 12px 24px rgba(64, 44, 174, 0.28);
}

.card,
.auth-box,
.modal-card,
.messages-layout,
.empty-state,
.auth-switch-card {
  background: linear-gradient(180deg, rgba(42, 36, 92, 0.9), rgba(28, 25, 63, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.btn {
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b9f, #8b5cf6 58%, #4f7cff);
  box-shadow: 0 16px 34px rgba(129, 76, 255, 0.34);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff76a7, #9a6cff 58%, #5a8aff);
  transform: translateY(-1px);
}

.btn-outline,
.btn-ghost {
  border-color: rgba(255, 255, 255, 0.1);
  color: #ebecff;
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover,
.btn-ghost:hover {
  background: rgba(139, 92, 246, 0.12);
}

.input,
.comment-input,
.chat-input {
  background: rgba(13, 14, 36, 0.62);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.input::placeholder,
.comment-input::placeholder,
.chat-input::placeholder,
.composer textarea::placeholder {
  color: #7f84b2;
}

.input:focus,
.comment-input:focus,
.chat-input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.avatar-ring {
  box-shadow: 0 0 0 3px rgba(17, 17, 42, 1), 0 0 0 5px rgba(139, 92, 246, 0.92), 0 0 24px rgba(34, 211, 238, 0.35);
}

.auth-minimal-shell,
.auth-centered {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.28), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255, 107, 159, 0.22), transparent 28%),
    linear-gradient(145deg, #12112c, #1b1741 52%, #110f25);
}

.auth-outer,
.auth-outer-wide {
  position: relative;
}

.auth-minimal-card,
.auth-switch-card {
  background: linear-gradient(180deg, rgba(45, 40, 99, 0.94), rgba(23, 20, 56, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(8, 10, 33, 0.54);
}

.auth-logo-orb {
  box-shadow: 0 16px 30px rgba(139, 92, 246, 0.3), 0 0 30px rgba(34, 211, 238, 0.18);
}

.auth-logo-wrap h1,
.auth-logo-wrap p,
.field label,
.auth-switch-card span,
.text-link,
.text-muted,
.post-meta span,
.comment-time,
.preview,
.bubble-time,
.profile-dept,
.profile-inline-meta,
.no-chat p,
.no-chat-inline,
.empty-state p,
.empty-stories,
.suggest-item .info span {
  color: var(--text-muted);
}

.auth-primary-button {
  box-shadow: 0 16px 32px rgba(139, 92, 246, 0.34);
}

.stories-card,
.composer-card,
.widget,
.post-card,
.profile-shell,
.messages-layout,
.modal-card,
.profile-posts-section,
.dir-card,
.empty-state {
  position: relative;
  overflow: hidden;
}

.stories-card::before,
.composer-card::before,
.widget::before,
.post-card::before,
.profile-shell::before,
.messages-layout::before,
.modal-card::before,
.profile-posts-section::before,
.dir-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 28%, transparent 72%, rgba(34, 211, 238, 0.06));
  pointer-events: none;
}

.stories-card {
  padding: 18px 22px;
}

.story-bubble {
  min-width: 96px;
  padding: 10px 4px;
}

.story-bubble > .avatar,
.story-bubble > .avatar-fallback,
.story-bubble .avatar {
  box-shadow: 0 0 0 2px rgba(16, 15, 40, 1), 0 0 0 4px rgba(255, 107, 159, 0.9), 0 0 18px rgba(139, 92, 246, 0.45);
}

.story-bubble.add-story > .avatar,
.story-bubble.add-story > .avatar-fallback {
  box-shadow: 0 0 0 2px rgba(16, 15, 40, 1), 0 0 0 4px rgba(34, 211, 238, 0.85), 0 0 18px rgba(34, 211, 238, 0.24);
}

.story-bubble span {
  color: #eef0ff;
  font-size: 12px;
}

.composer-card,
.post-card,
.widget,
.dir-card,
.profile-shell,
.messages-layout {
  background: linear-gradient(180deg, rgba(41, 36, 90, 0.94), rgba(28, 25, 64, 0.95));
}

.composer textarea {
  color: #ffffff;
}

.file-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.file-btn:hover {
  background: rgba(34, 211, 238, 0.12);
  color: #dffcff;
  border-color: rgba(34, 211, 238, 0.34);
}

.post-meta strong,
.profile-mini-name,
.section-title,
.profile-name,
.msg-sidebar-header,
.chat-header strong,
.name,
.dir-card strong {
  color: #f8f8ff;
}

.post-image,
.profile-grid-image,
.profile-post-image {
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(4, 5, 20, 0.28);
}

.post-actions {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.comments-section {
  background: linear-gradient(180deg, rgba(18, 20, 48, 0.76), rgba(20, 20, 49, 0.5));
}

.comment-body {
  background: rgba(10, 13, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.divider,
.msg-sidebar,
.msg-sidebar-header,
.chat-header,
.chat-input-row,
.profile-posts-bar,
.profile-post-copy.with-image,
.user-list-item {
  border-color: rgba(255, 255, 255, 0.06);
}

.mini-stats strong,
.profile-posts-bar-icon,
.tag,
.job-line {
  color: var(--accent);
}

.tag {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.profile-cover {
  background:
    radial-gradient(circle at 22% 22%, rgba(34, 211, 238, 0.24), transparent 20%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 159, 0.24), transparent 26%),
    linear-gradient(135deg, #181742, #2d2466 58%, #1d1a4c);
}

.profile-posts-bar {
  color: #eaedff;
  letter-spacing: 0.16em;
}

.profile-grid-text-tile {
  background: linear-gradient(135deg, rgba(53, 43, 110, 0.95), rgba(24, 21, 60, 0.94));
}

.profile-grid-text-tile p,
.profile-bio,
.post-text,
.comment-body p,
.chat-bubble,
.no-chat h3 {
  color: #f2f4ff;
}

.dir-card,
.suggest-item,
.user-list-item,
.chat-area,
.msg-sidebar,
.chat-input-row,
.chat-header {
  background: transparent;
}

.dir-card {
  background: linear-gradient(180deg, rgba(46, 40, 100, 0.94), rgba(26, 24, 60, 0.95));
}

.dir-card:hover {
  box-shadow: 0 24px 56px rgba(6, 10, 34, 0.46);
}

.messages-layout {
  background: linear-gradient(180deg, rgba(39, 34, 88, 0.95), rgba(19, 19, 43, 0.96));
}

.user-list-item {
  border-radius: 14px;
  margin: 6px 10px;
  border: 1px solid transparent;
}

.user-list-item.active,
.user-list-item:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.08));
  border-color: rgba(255, 255, 255, 0.08);
}

.chat-messages {
  background:
    radial-gradient(circle at top, rgba(34, 211, 238, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(16, 17, 42, 0.78), rgba(13, 14, 32, 0.92));
}

.chat-bubble.sent {
  background: linear-gradient(135deg, #ff6b9f, #8b5cf6 62%, #4f7cff);
  box-shadow: 0 16px 32px rgba(124, 72, 233, 0.26);
}

.chat-bubble.received {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.chat-send,
.comment-send {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  color: white;
  box-shadow: 0 14px 30px rgba(69, 140, 230, 0.24);
}

.no-chat,
.empty-state {
  background: linear-gradient(180deg, rgba(34, 30, 74, 0.94), rgba(20, 18, 48, 0.94));
}

.modal-overlay {
  background: rgba(6, 8, 20, 0.76);
  backdrop-filter: blur(10px);
}

.modal-close {
  color: #eef0ff;
}

.toast {
  background: rgba(20, 19, 45, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 40px rgba(8, 10, 33, 0.42);
}

.toast-success {
  background: linear-gradient(135deg, rgba(46, 39, 103, 0.98), rgba(30, 28, 73, 0.98));
}

.toast-error {
  background: linear-gradient(135deg, rgba(255, 107, 159, 0.94), rgba(139, 92, 246, 0.92));
}

.boot-screen,
.page-loading-card,
.config-screen .auth-brand-card {
  background: linear-gradient(180deg, rgba(39, 34, 88, 0.96), rgba(21, 18, 49, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
}

.boot-brand,
.page-loading-card h3,
.config-screen h1 {
  color: #f7f1ff;
}

.boot-spinner {
  border-top-color: var(--accent);
  border-right-color: var(--primary);
}

@media (max-width: 720px) {
  .nav-links {
    width: 100%;
    padding: 4px;
  }

  .navbar-inner {
    gap: 14px;
  }
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-logo-auth {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  box-shadow: 0 18px 36px rgba(12, 14, 40, 0.42);
}

.brand-logo-nav {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 20px rgba(8, 10, 33, 0.34);
}

.brand-logo-boot {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 24px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-brand-with-logo::before {
  display: none;
}

.nav-brand-with-logo span {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 720px) {
  .brand-logo-auth {
    width: 104px;
    height: 104px;
    border-radius: 24px;
  }

  .brand-logo-nav {
    width: 38px;
    height: 38px;
  }
}

.meta-separator { display: inline-block; margin: 0 6px; color: var(--text-muted); }

