:root {
  --bg-deep:      #0A0A0A;
  --bg-deep-2:    #111111;
  --bg-panel:     #1A1A1A;
  --cream:        #FAFAFA;
  --cream-soft:   #FFFFFF;
  --mint:         #E5E5E5;
  --coral:        #1ee7ee;
  --coral-dark:   #14c4cc;;
  --orange:       #11cefd;
  --lavender:     #B8A0E8;
  --text-on-dark: #FAFAFA;
  --text-muted:   #8A8A8A;
  --text-dark:    #0A0A0A;

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 999px;

  --font: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overscroll-behavior-y: contain; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-on-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .18;
  pointer-events: none;
  z-index: 0;
}
body::before { width: 520px; height: 520px; background: var(--coral); top: -180px; right: -120px; }
body::after  { width: 460px; height: 460px; background: var(--lavender); bottom: -160px; left: -100px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* ============ Layout ============ */
.app .layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 100px;
}

/* ============ Sidebar ============ */
.sidebar {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: fit-content;
  position: sticky;
  top: 28px;
}
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; padding: 0 8px 4px; }

.user-block {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border-radius: var(--r-md);
}
.user-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--coral);
  display: grid; place-items: center;
  font-weight: 800; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { min-width: 0; }
.user-name {
  font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-action { font-size: 12px; color: var(--coral); cursor: pointer; font-weight: 600; }
.user-action:hover { text-decoration: underline; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600; font-size: 15px;
  transition: .2s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text-on-dark); }
.nav-item.active {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255,123,107,.35);
}
.nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
}

.btn-cta {
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 14px 20px;
  font-family: inherit;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .2s;
  text-decoration: none;
}
.btn-cta:hover { background: var(--coral-dark); transform: translateY(-1px); }
.attach-btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logout-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.15);
  color: var(--text-muted);
  border-radius: var(--r-pill);
  padding: 10px;
  font-family: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: .2s;
}
.logout-btn:hover { border-color: var(--coral); color: var(--coral); }

/* ============ Feed ============ */
.feed { min-width: 0; }
.search { position: relative; }
.search input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-pill);
  padding: 14px 20px;
  color: var(--text-on-dark);
  font-family: inherit; font-size: 14px;
  outline: none;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { border-color: var(--coral); }

.feed-title { font-size: 26px; font-weight: 800; margin: 24px 0 16px; }

.posts { display: flex; flex-direction: column; gap: 14px; }

.post {
  background: rgba(255,255,255,.04);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-head-info { flex: 1; min-width: 0; }
.post-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--mint);
  display: grid; place-items: center;
  font-weight: 700; color: var(--bg-deep);
  overflow: hidden; flex-shrink: 0;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author {
  font-weight: 700; font-size: 14px;
  color: var(--text-on-dark);
  text-decoration: none;
}
.post-author:hover { color: var(--coral); }
.post-time { font-size: 12px; color: var(--text-muted); }
.post-body { font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; color: var(--text-on-dark); }
.post-foot { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.post-foot span { cursor: pointer; transition: .15s; user-select: none; }
.post-foot span:hover { color: var(--coral); }
.post-foot .like-btn { cursor: pointer; user-select: none; transition: .15s; }
.post-foot .like-btn:hover { color: var(--coral); transform: scale(1.05); }
.post-foot .like-btn.liked { color: var(--coral); font-weight: 700; }

/* ============ Spotlight ============ */
.spotlight-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.spot-card {
  border-radius: var(--r-xl);
  padding: 22px 18px 18px;
  text-align: center;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.spot-coral  { background: linear-gradient(160deg, var(--coral), var(--coral-dark)); }
.spot-orange { background: linear-gradient(160deg, var(--orange), #e8875f); }
.spot-card::before {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  top: -80px; right: -60px;
}
.spot-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,.6);
  overflow: hidden;
  position: relative; z-index: 1;
}
.spot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spot-role { font-size: 12px; opacity: .85; margin-bottom: 4px; position: relative; z-index: 1; }
.spot-name { font-weight: 800; font-size: 16px; margin-bottom: 14px; position: relative; z-index: 1; }
.spot-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.spot-btn {
  flex: 1;
  background: rgba(255,255,255,.9);
  color: var(--coral-dark);
  border: none;
  border-radius: var(--r-pill);
  padding: 10px;
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.spot-btn.ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }

/* ============ Modal ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  background: var(--bg-panel);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-lg);
  padding: 24px;
  width: min(520px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal-card h3 { margin-bottom: 14px; font-size: 20px; color: var(--text-on-dark); }
.modal-card textarea {
  width: 100%; min-height: 120px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-md);
  padding: 14px;
  font-family: inherit; font-size: 15px;
  resize: vertical; outline: none;
  background: rgba(255,255,255,.05);
  color: var(--text-on-dark);
}
.modal-card textarea::placeholder { color: var(--text-muted); }
.modal-card textarea:focus { border-color: var(--coral); }
.modal-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 12px; }
.char-count { font-size: 13px; color: var(--text-muted); }

/* ============ Mobile nav (плавающая пилюля) ============ */
.mobile-nav {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(20, 20, 20, .88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: 10px 16px;
  justify-content: space-around;
  align-items: center;
  z-index: 90;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.mn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  color: #6E6E6E;
  text-decoration: none;
  transition: .2s;
  position: relative;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.mn-item:hover { color: #A0A0A0; }
.mn-item.active { color: #FFFFFF; }
.mn-icon { width: 24px; height: 24px; display: block; stroke: currentColor; }
.mn-label { font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.mn-item.active .mn-label { font-weight: 700; }

.mn-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  border: 3px solid rgba(20,20,20,.88);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  margin-top: -26px;
  display: grid;
  place-items: center;
  padding: 0;
  transition: .2s;
  flex-shrink: 0;
}
.mn-fab:hover { background: var(--coral-dark); transform: translateY(-2px); }
.mn-fab svg { width: 22px; height: 22px; }

.mn-badge,
.unread-dot {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px #141414;
  pointer-events: none;
}
.mn-badge.hidden,
.unread-dot.hidden {
  display: none;
}

/* ============ Auth ============ */
.auth .auth-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1100px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 24px;
}
.auth-hero { max-width: 480px; }
.auth-logo { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 40px; }
.auth-slogan { font-size: clamp(32px, 4vw, 52px); font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.auth-slogan span {
  background: linear-gradient(120deg, var(--coral), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub { margin-top: 20px; color: var(--text-muted); font-size: 16px; line-height: 1.5; }

.auth-card {
  background: var(--bg-panel);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-lg);
  padding: 28px 26px;
}
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,.05);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  padding: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: .2s;
}
.auth-tab.active {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,123,107,.35);
}

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: inherit; font-size: 15px;
  color: var(--text-on-dark);
  outline: none;
  transition: .15s;
}
.field input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,123,107,.15); }
.field input::placeholder { color: var(--text-muted); }

.auth-submit { width: 100%; margin-top: 6px; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-msg { min-height: 20px; font-size: 13px; margin-bottom: 6px; }
.auth-msg.error { color: #e0554a; }

.auth-footer {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}
.link-btn {
  background: none; border: none;
  color: var(--coral);
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ============ Поиск ============ */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-on-dark);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.search-results.hidden { display: none; }
.search-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  transition: .15s;
}
.search-item:hover { background: rgba(255,255,255,.05); }
.search-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--mint);
  display: grid; place-items: center;
  font-weight: 700; color: var(--bg-deep);
  overflow: hidden; flex-shrink: 0;
}
.search-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--text-on-dark); }
.search-write {
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-family: inherit; font-weight: 700; font-size: 12px;
  cursor: pointer;
}
.search-write:hover { background: var(--coral-dark); }

/* ============ Комментарии ============ */
.comments-box {
  margin-top: 14px;
  padding-top: 14px;
  
}
.comments-box.hidden { display: none; }
.comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 6px; }
.comment { display: flex; gap: 10px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--mint);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--bg-deep);
  overflow: hidden; flex-shrink: 0;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.comment-head b { font-size: 13px; color: var(--text-on-dark); }
.comment-head span { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.4; word-wrap: break-word; color: var(--text-on-dark); }

.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input {
  flex: 1;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  font-family: inherit; font-size: 14px;
  outline: none;
  background: rgba(255,255,255,.05);
  color: var(--text-on-dark);
  min-width: 0;
}
.comment-form input::placeholder { color: var(--text-muted); }
.comment-form input:focus { border-color: var(--coral); }
.comment-form button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #fff;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.comment-form button:hover { background: var(--coral-dark); }
.comment-toggle { cursor: pointer; }

/* ============ Бейдж непрочитанных ============ */
.unread-badge {
  background: var(--coral);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  padding: 2px 7px;
  margin-left: auto;
}
.unread-badge.hidden { display: none; }

/* ============ Диалоги ============ */
.dialogs { display: flex; flex-direction: column; gap: 6px; }
.dialog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text-on-dark);
  transition: .15s;
}
.dialog-item:hover, .dialog-item.active { background: rgba(255,255,255,.06); }
.dialog-item.active { background: rgba(255,123,107,.12); }
.dialog-info { flex: 1; min-width: 0; }
.dialog-name {
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.dialog-last {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.dialog-time { font-size: 11px; color: var(--text-muted); }

/* ============ Окно диалога ============ */
.dialog-panel {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 18px;
  height: calc(100vh - 56px);
  position: sticky;
  top: 28px;
}
.dialog-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.dialog-empty { color: var(--text-muted); font-size: 14px; }
.dialog-sub { font-size: 12px; color: var(--text-muted); }

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px;
}
.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px; line-height: 1.4;
  word-wrap: break-word;
}
.msg-mine .msg-bubble { background: var(--coral); color: #fff; }
.msg-theirs .msg-bubble { background: rgba(255,255,255,.08); color: var(--text-on-dark); }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.composer {
  display: flex; gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.composer.hidden { display: none; }
.composer input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-pill);
  padding: 12px 18px;
  color: var(--text-on-dark);
  font-family: inherit; font-size: 14px;
  outline: none;
  min-width: 0;
}
.composer input::placeholder { color: var(--text-muted); }
.composer input:focus { border-color: var(--coral); }
.btn-send {
  width: 46px; height: 46px;
  padding: 0;
  font-size: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============ Профиль ============ */
.profile-cover {
  height: 140px;
  border-radius: var(--r-lg);
  background: linear-gradient(
    135deg,
    var(--coral),
    var(--lavender),
    #1ee7ee,
    #B8A0E8,
    var(--coral)
  );
  background-size: 400% 400%;
  animation: coverFlow 15s ease infinite;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px 28px;
}

@keyframes coverFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Название Tribe — как водяной знак */
.profile-cover::before {
  content: 'Tribe';
  position: absolute;
  right: 24px;
  bottom: -8px;
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -3px;
  color: rgba(255, 255, 255, .18);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* Слоган — мелкий, над названием */
.profile-cover::after {
  content: 'твоё сообщество';
  position: absolute;
  right: 28px;
  bottom: 64px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  pointer-events: none;
  user-select: none;
}
.profile-card {
  background: rgba(255,255,255,.04);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 60px 24px 20px;
  position: relative;
  z-index: 2; 
  margin-bottom: 20px;
}
.profile-avatar-wrap {
  position: absolute;
  top: -50px;
  left: 24px;
  z-index: 3;
}
.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--bg-deep);
  background: var(--mint);
  display: grid; place-items: center;
  font-weight: 800; font-size: 36px; color: var(--bg-deep);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { margin-top: 8px; }
.profile-username { font-size: 24px; font-weight: 800; margin-bottom: 4px; color: var(--text-on-dark); }
.profile-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.meta-dot { opacity: .5; }
.meta-click { cursor: pointer; transition: .15s; }
.meta-click:hover { color: var(--coral); text-decoration: underline; }

.profile-actions { display: flex; gap: 8px; }
.profile-actions .btn-cta { flex: 1; }
.profile-actions .btn-cta.secondary {
  background: transparent;
  color: var(--coral);
  border: 1.5px solid var(--coral);
}
.profile-actions .btn-cta.secondary:hover { background: rgba(255,123,107,.1); }

/* ============ Настройки ============ */
.settings-card {
  background: rgba(255,255,255,.04);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
}
.settings-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--text-on-dark); }
.settings-hint { font-size: 14px; color: var(--text-muted); }
.settings-row { display: flex; align-items: center; gap: 16px; }
.user-avatar.big { width: 72px; height: 72px; font-size: 28px; }

/* ============ Кнопка удаления поста ============ */
.post-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: .15s;
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
  line-height: 1;
}
.post-delete:hover { background: rgba(224,85,74,.15); color: #e0554a; }
.post-delete:disabled { opacity: .5; cursor: wait; }

/* ============ Кнопка прикрепления ============ */
.attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: .15s;
  flex-shrink: 0;
  user-select: none;
}
.attach-btn:hover {
  background: rgba(255,123,107,.15);
  color: var(--coral);
  transform: scale(1.05);
}

/* ============ Превью картинки ============ */
.image-preview {
  position: relative;
  margin-top: 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(0,0,0,.2);
  max-height: 240px;
}
.image-preview.hidden { display: none; }
.image-preview img {
  width: 100%; height: auto; max-height: 240px;
  object-fit: cover;
  display: block;
}
.image-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  line-height: 1;
}
.image-remove:hover { background: rgba(0,0,0,.85); }

/* ============ Картинка в посте ============ */
.post-image {
  margin-top: 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  background: rgba(0,0,0,.2);
}
.post-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  transition: transform .25s;
}
.post-image:hover img { transform: scale(1.02); }

/* ============ Картинка в сообщении ============ */
.msg-image {
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 4px;
  max-width: 260px;
  background: rgba(0,0,0,.2);
}
.msg-image img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

/* ============ Полноэкранный просмотр ============ */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.92);
  display: grid;
  place-items: center;
  padding: 20px;
  cursor: zoom-out;
  animation: fadeIn .2s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.image-viewer img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: var(--r-md);
  object-fit: contain;
}

/* ============ Список подписчиков ============ */
.follows-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}
.follow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-on-dark);
  transition: .15s;
}
.follow-item:hover { background: rgba(255,255,255,.05); }

/* ============ Layout мессенджера ============ */
.chats-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  max-width: 1280px;
  height: calc(100vh - 56px);
  margin: 0 auto;
  padding: 28px 24px;
}
.chats-list {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-right: none;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.chats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chats-title { font-size: 20px; font-weight: 800; margin-top: 4px; }
.user-mini { cursor: pointer; }
.user-avatar.small { width: 36px; height: 36px; font-size: 14px; }

.dialog-back {
  display: none;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 22px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: .15s;
}
.dialog-back:hover { background: rgba(255,255,255,.06); }

/* ============ Адаптив ============ */
@media (max-width: 1024px) {
  .app .layout { grid-template-columns: 200px 1fr; }
  .spotlight { display: none; }
  .dialog-panel { display: none; }
  .dialog-panel.active-mobile { display: flex; }

  .chats-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 90px);
    padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 100px);
  }
  .chats-list {
    border-radius: var(--r-lg);
    border-right: 1px solid rgba(255,255,255,.06);
  }
  .dialog-panel {
    display: none;
    border-radius: var(--r-lg);
    height: calc(100vh - 120px);
  }
  .dialog-panel.active-mobile { display: flex; }
  .chats-list.hidden-mobile { display: none; }
  .dialog-back { display: inline-block; }
}

@media (max-width: 860px) {
  .auth .auth-wrap {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 60px 20px;
    text-align: center;
  }
  .auth-hero { max-width: 100%; margin: 0 auto; }
  .auth-logo { margin-bottom: 24px; }
  .auth-card { padding: 22px 20px; }
}

@media (max-width: 720px) {
  .app .layout {
    grid-template-columns: 1fr;
    padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 140px);
    gap: 16px;
  }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }

  .feed-title { font-size: 22px; margin: 16px 0 12px; }
  .post { border-radius: 20px; padding: 14px 16px; }
  .post-body { font-size: 14px; }
  .post-head { gap: 10px; margin-bottom: 8px; }
  .post-avatar { width: 38px; height: 38px; }
  .post-author { font-size: 13px; }
  .post-foot { gap: 14px; font-size: 12px; margin-top: 10px; }
  .post-delete { font-size: 15px; padding: 5px 6px; }

  .search input { padding: 12px 16px; font-size: 13px; }

  .modal { align-items: flex-end; }
  .modal-card {
    width: 100%;
    border-radius: 28px 28px 0 0;
    padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    max-height: 85vh;
    overflow-y: auto;
    
  }

  .profile-card { padding: 50px 18px 16px; }
  .profile-avatar-wrap { top: -40px; left: 18px; }
  .profile-avatar { width: 80px; height: 80px; font-size: 28px; border-width: 3px; }
  .profile-username { font-size: 20px; }
  

  .dialog-panel {
    height: auto;
    max-height: 70vh;
    position: relative;
    top: 0;
  }
  .messages { max-height: 50vh; }
  .btn-send { width: 42px; height: 42px; font-size: 18px; }
  .composer input { padding: 10px 16px; }

  .profile-cover {
  height: 100px;
  margin-bottom: 0;
  padding: 12px 18px;
}
.profile-cover::before {
  font-size: 48px;
  right: 16px;
  bottom: 10px;
}
.profile-cover::after {
  font-size: 9px;
  right: 18px;
  bottom: 60px;
  letter-spacing: 1.5px;
}
  .profile-card { padding: 50px 18px 16px; }
  .profile-avatar-wrap { top: -40px; left: 18px; }
  .profile-avatar { width: 80px; height: 80px; font-size: 28px; border-width: 3px; }
  .profile-username { font-size: 20px; }
  .profile-meta { font-size: 12px; }

  .attach-btn { width: 36px; height: 36px; font-size: 16px; }
  .post-image img { max-height: 380px; }
  .msg-image { max-width: 220px; }
  .msg-image img { max-height: 280px; }
}

/* ============ Убираем подписи в нижнем меню ============ */
.mn-label { display: none; }
.mn-item { padding: 8px 12px; }
/* ============ Developer badge ============ */
.post-avatar.is-developer,
.comment-avatar.is-developer,
.search-avatar.is-developer,
.profile-avatar.is-developer,
.spot-avatar.is-developer,
.user-avatar.is-developer {
  box-shadow:
    0 0 0 2px var(--bg-deep),
    0 0 0 6px #FF8C42,
    0 0 18px rgba(255, 140, 66, .6);
}

.post .post-avatar.is-developer,
.comment .comment-avatar.is-developer {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .04),
    0 0 0 6px #FF8C42,
    0 0 18px rgba(255, 140, 66, .6);
}

@keyframes devPulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px var(--bg-deep),
      0 0 0 6px #FF8C42,
      0 0 18px rgba(255, 140, 66, .5);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--bg-deep),
      0 0 0 8px #FF8C42,
      0 0 30px rgba(255, 140, 66, 1);
  }
}

.post-avatar.is-developer,
.comment-avatar.is-developer,
.profile-avatar.is-developer {
  animation: devPulse 2s ease-in-out infinite;
}

/* В тёмной теме для карточек постов — сдвиг фона чуть другой */
.post .post-avatar.is-developer,
.comment .comment-avatar.is-developer {
  box-shadow:
    0 0 0 2px rgba(255,255,255,.04),
    0 0 0 4px var(--coral),
    0 0 12px rgba(255,123,107,.5);
}
/* ============ Bio (статус) ============ */
.profile-bio {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-on-dark);
  opacity: .85;
  margin: 6px 0 10px;
  word-wrap: break-word;
}

.bio-input {
  width: 100%;
  min-height: 80px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.05);
  color: var(--text-on-dark);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.bio-input::placeholder { color: var(--text-muted); }
.bio-input:focus { border-color: var(--coral); }

.bio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
/* ============ Чекбокс согласия ============ */
.agree-check {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-weight: 400;
}

.agree-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 1px;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: .15s;
  position: relative;
}

.agree-check input[type="checkbox"]:hover {
  border-color: var(--coral);
}

.agree-check input[type="checkbox"]:checked {
  background: var(--coral);
  border-color: var(--coral);
}

.agree-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4px;
  height: 8px;
  border: solid #0A0A0A;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agree-check span {
  display: inline;
}

.agree-check a {
  color: var(--text-on-dark);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,.3);
  transition: .15s;
}

.agree-check a:hover {
  color: var(--coral);
  border-bottom-color: var(--coral);
}
/* ============ Юридические страницы ============ */
.legal-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  padding: 28px;
  color: var(--text-on-dark);
  line-height: 1.6;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.legal-card h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-on-dark);
}
.legal-card h2:first-of-type { margin-top: 0; }

.legal-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.legal-card ul {
  margin: 10px 0 14px 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.legal-card ul li {
  margin-bottom: 4px;
}

.legal-card b {
  color: var(--text-on-dark);
  font-weight: 600;
}

.legal-card a {
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px dotted rgba(30,231,238,.4);
  transition: .15s;
}
.legal-card a:hover {
  border-bottom-color: var(--coral);
}

@media (max-width: 720px) {
  .legal-card { padding: 20px 16px; }
  .legal-card h2 { font-size: 15px; }
  .legal-card p, .legal-card ul { font-size: 13px; }
}
/* ============ Футер со ссылками ============ */
.site-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: .15s;
}
.site-footer a:hover {
  color: var(--coral);
}
.site-footer span {
  opacity: .4;
}

/* Ссылки в настройках */
.legal-link {
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px dotted rgba(30,231,238,.4);
  transition: .15s;
}
.legal-link:hover {
  border-bottom-color: var(--coral);
}

/* Мелкий текст под формой входа */
.auth-legal {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  opacity: .8;
}
.auth-legal a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,.25);
  transition: .15s;
}
.auth-legal a:hover {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

@media (max-width: 720px) {
  .site-footer { font-size: 10px; }
}
/* ============ Удаление аккаунта ============ */
.danger-card {
  border-color: rgba(224, 85, 74, .25);
  background: rgba(224, 85, 74, .05);
}

.danger-btn {
  background: transparent;
  border: 1.5px solid #e0554a;
  color: #e0554a;
  border-radius: var(--r-pill);
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: .2s;
  width: 100%;
}
.danger-btn:hover {
  background: rgba(224, 85, 74, .15);
}
.danger-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: transparent;
}

#deleteAccountModal .modal-card {
  max-width: 440px;
}
#deleteAccountModal input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md);
  padding: 12px 16px;
  color: var(--text-on-dark);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
}
#deleteAccountModal input[type="text"]:focus {
  border-color: #e0554a;
}