/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #FFFFFF;
  --bg-2:      #FFFFFF;
  --surface:   #FFFFFF;

  /* Borders */
  --border:    rgba(27,44,79,0.10);
  --border-2:  rgba(27,44,79,0.18);

  /* Text */
  --text-1:    #1A1E26;
  --text-2:    #6B7890;
  --text-3:    #9BA8B8;

  /* Semantic */
  --accent:    #1B2C4F;
  --orange:    #FF6B35;
  --error:     #EF4444;
  --success:   #2DC870;

  /* Radius */
  --radius:      8px;
  --radius-sm:   8px;
  --radius-xs:   4px;
  --radius-lg:   14px;
  --radius-card: 14px;
  --radius-pill: 20px;

  /* Spacing */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;

  /* Card shadow */
  --card-shadow: 0 2px 8px rgba(0,0,0,0.14);
}

/* ── Logo Gradient ─────────────────────────────────────────────────────────── */
.logo-gradient {
  background: linear-gradient(135deg, #7B5CF5, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: none;
}

@keyframes logoGreen {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Logo split into two independently-shimmering halves: "Go" green,
   "With Me" purple (was a single rainbow gradient across the whole
   wordmark). Each half still shimmers via the same background-position
   animation, just over its own two-tone gradient instead of one shared one. */
.logo-rainbow {
  text-decoration: none;
  display: inline-block;
}
.logo-go {
  background: linear-gradient(135deg, #1CB65B, #2DC870, #1CB65B);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoGreen 4s ease infinite;
}
.logo-withme {
  background: linear-gradient(135deg, #5B32C7, #7C4DE0, #5B32C7);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoGreen 4s ease infinite;
}

/* ── Card shadow utility ──────────────────────────────────────────────────── */
.card-shadow {
  box-shadow: var(--card-shadow);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }
html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}
body {
  /* Same blue as login.html's own page background — on wide screens
     .app caps out and centers, leaving this showing in the margins on
     either side. .app itself always paints its own background (var(--bg))
     over its full fixed area, so nothing inside the app is affected. */
  background: #F0F2F8;
  color: var(--text-1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  font-size: 16px; /* prevent iOS auto-zoom on focus */
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
.app {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior-y: none;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top, 0) 16px 0;
  padding-bottom: 8px;
  padding-top: calc(8px + env(safe-area-inset-top, 0));
  height: calc(50px + env(safe-area-inset-top, 0));
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: calc(50px + env(safe-area-inset-top, 0));
}

.header-logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7B5CF5, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-action {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  color: var(--text-1);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  text-decoration: none;
  transition: background 0.15s;
  line-height: 1;
}
.header-action:hover { background: var(--border); }
.header-action.plus-blink { animation: plusBlink 2.2s ease-in-out infinite; }
@keyframes plusBlink {
  0%, 100% { color: var(--text-1); }
  50%      { color: #2DC870; }
}
.header-action img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  height: 34px;
  transition: opacity 0.15s;
}
.btn-back:active { opacity: 0.6; }
/* ── Post header ⋮ menu (follow / edit / delete) ─────────────────────────────
   Mirrors dm.html's .dm-more-menu/.dm-more-item pattern. */
.post-more-btn {
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.post-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 170px;
  z-index: 20;
  display: none;
  overflow: hidden;
  padding: 8px 0; /* halves of the 16px gap between items — the other half
    comes from each item's own 8px vertical padding, so edge-to-text and
    item-to-item both land on exactly 16px total (2x the previous 8px). */
}
.post-more-menu.open { display: block; animation: postMenuPop 0.15s ease both; }
.post-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Horizontal 16px matches the vertical edge-to-content distance (menu's
     own 8px top/bottom padding + this item's 8px = 16px) — the menu itself
     has no left/right padding, so this item's own padding has to carry the
     full 16px alone on that axis. */
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.post-more-item:active { background: var(--bg-2); }
.post-more-item.danger { color: #EF4444; }
@keyframes postMenuPop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  min-height: 0;
  /* Nav is now a floating bubble (16px bottom margin + 47px tall), not a
     flush bar — reserve enough space so the last card in the feed doesn't
     sit underneath it. */
  padding-bottom: calc(79px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  /* none (not contain) — now that the search bar/filters live inside .main
     as its first children, the elastic rubber-band bounce at the top
     visibly stretched them along with the rest of the content when pulled
     past the edge. none gives a hard stop instead of a bounce (still no
     chaining up to the page either way), trading the bounce feel for not
     dragging the search bar around. */
  overscroll-behavior-y: none;
}
.main--no-nav { padding-bottom: 16px; flex: 1; }

/* ── Bottom Nav ───────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  /* Floating bubble, not flush with the screen edge — lifted clear of the
     home-indicator/gesture area via the safe-area inset instead of padding
     content down inside a flush bar. */
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  /* Content-sized pill, not stretched to fill the screen — its width now
     comes purely from the 32px edge padding + 32px gaps + icon sizes below,
     so those numbers stay exact at any viewport width. */
  width: fit-content;
  max-width: calc(100% - 8px); /* just enough safety margin not to touch the screen edge — content itself is narrower */
  background: rgba(255,255,255,0.8); /* white, 80% opacity — not fully solid */
  /* Blurs whatever scrolls behind the bar (feed content underneath it),
     not just tints it — a frosted-glass bar instead of a flat translucent one. */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* All-around shadow (not just a bottom drop-shadow) so the white bar
     still reads as a raised, separate layer against a light page bg. */
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  border-radius: 23.5px; /* half of the 47px height = a true pill/capsule */
  display: flex;
  align-items: center;
  height: 47px; /* 31px icon + 8px clearance top and bottom */
  padding: 0 32px;
  gap: 32px;
  z-index: 100;
}
.nav-item {
  /* Content-sized (not flex:1) — fixed gaps between items only stay exact
     if items don't stretch to fill leftover space. */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1); /* black icons on the now-white bar */
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: #2DC870; }
/* 28px — 31px minus another 10%. Bar itself (height/padding/gap) unchanged. */
.nav-item svg { width: 28px; height: 28px; flex-shrink: 0; }
.nav-item span { display: none; } /* icon-only row now that it's search-bar height */
.nav-item-wrap { position: relative; display: inline-flex; }

/* Профиль — same avatar image/initial as the header avatar button, same
   28px size as the other nav icons. */
#navProfileAvatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-item[href="/profile.html"].active #navProfileAvatar { border-color: #2DC870; }
/* Same size as .notif-badge (the header bell's red badge) — was smaller
   and inconsistent with the rest of the app. */
.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ── GO Filter Bar ────────────────────────────────────────────────────────── */
.go-filter-bar {
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 50px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
}
.go-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--success);
  color: var(--bg);
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  letter-spacing: 0.1px;
}
.go-filter-btn:active { opacity: 0.75; }

/* Category list in modal */
.cat-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: color 0.12s;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.cat-option:last-child { border-bottom: none; }
.cat-option.active { color: var(--text-1); font-weight: 700; }
.cat-option.active::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--text-1);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 48px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.1px;
  line-height: 1;
}
.btn:active { opacity: 0.75; transform: scale(0.98); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--success);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1.5px solid var(--border-2);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-full { width: 100%; }
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius);
}

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 16px;
  transition: border-color 0.15s;
  outline: none;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--text-1); }
.input::placeholder { color: var(--text-3); }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.required { color: var(--error); }
.form-stack { padding: 20px; display: flex; flex-direction: column; }

/* ── Loader ───────────────────────────────────────────────────────────────── */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 56px auto;
  width: 60px;
  height: 60px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--text-1);
  animation: goHeartbeat 1.1s ease-in-out infinite;
}
.spinner::before { content: 'GO'; }
@keyframes goHeartbeat {
  0%   { transform: scale(1);    opacity: 0.25; }
  12%  { transform: scale(1.55); opacity: 1;    }
  24%  { transform: scale(1);    opacity: 0.35; }
  38%  { transform: scale(1.3);  opacity: 1;    }
  52%  { transform: scale(1);    opacity: 0.25; }
  100% { transform: scale(1);    opacity: 0.25; }
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}
.empty-icon { font-size: 40px; margin-bottom: 16px; line-height: 1; }
.empty-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-1);
  letter-spacing: -0.2px;
}
.empty-text { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 0; }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}
.avatar-img, .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.avatar-sm  { width: 32px;  height: 32px;  font-size: 15px; }

.online-wrap { position: relative; flex-shrink: 0; }
.online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid var(--bg);
  display: none;
}
.online-dot.visible { display: block; }
.online-dot.offline { background: var(--text-3); }
.avatar-md  { width: 44px;  height: 44px;  font-size: 20px; }
.avatar-lg  { width: 72px;  height: 72px;  font-size: 30px; }
.avatar-xl  { width: 88px;  height: 88px;  font-size: 36px; }
.avatar-lg, .avatar-xl { border-width: 1.5px; }
.avatar-editable { position: relative; cursor: pointer; }
.avatar-edit-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 22px;
  height: 22px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--bg);
}

/* ── Tags ─────────────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-2);
  color: var(--text-2);
}
.tag-past {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}

/* Category pill — kept for legacy compat in JS renders */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Message Toasts ───────────────────────────────────────────────────────── */
.msg-error, .msg-success {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
  line-height: 1.4;
}
.msg-error   { background: rgba(239,68,68,0.08);  color: var(--error);   border: 1px solid rgba(239,68,68,0.2); }
.msg-success { background: rgba(34,197,94,0.08);  color: var(--success); border: 1px solid rgba(34,197,94,0.2); }

/* ── Modals ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 20px 32px;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 16px auto 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab.active {
  color: var(--text-1);
  border-bottom-color: var(--text-1);
  font-weight: 600;
}

/* ── Filter / Filter Pills ────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 50px;
  z-index: 40;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.filter-pill.active {
  background: none;
  border-color: var(--text-1);
  color: var(--text-1);
}
.filter-pill:hover:not(.active) { border-color: var(--border-2); color: var(--text-1); }
#filterBtn.active { background: var(--text-1); border-color: var(--text-1); color: var(--bg); }

/* ── Feed Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.1s;
  display: block;
  margin: 16px 16px 0;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* Posts (Эмоции feed, on index.html/profile.html/user.html) — flush,
   edge-to-edge and shadowless, sitting on the same soft background as
   login.html instead of floating as a separate rounded/shadowed card.
   Only posts get this; activities elsewhere keep the normal .card look.
   8px bottom margin matches index.html's pre-existing page-local .card
   override (see its own <style> block) — that was the original "flat
   feed" reference this class is unifying profile.html/user.html with. */
.post-flat {
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 8px;
}
/* #postsFeed is NOT included here — it's reused for both the 3-column
   grid and the flat post feed (profile.html/user.html), and an odd
   post count leaves empty grid cells that would otherwise show this
   background instead of the page's white. Feed mode sets it inline
   per-render instead (see _renderProfilePostsArea/_renderUserPostsArea). */
#feed { background: #F0F2F8; }

@keyframes notifHighlight {
  0%   { background: var(--surface); }
  25%  { background: rgba(234,179,8,0.13); }
  75%  { background: rgba(234,179,8,0.13); }
  100% { background: var(--surface); }
}
.card-highlight { animation: notifHighlight 2s ease forwards; }

/* Grid tile you land back on after leaving a post's detail view (back
   button or swipe-right-on-first-photo) — see _animateReturnToGrid() in
   profile.html/user.html, which runs the shrink transition and then adds
   this class once the flying clone settles into the tile's spot. A soft
   white flash over the tile's own content (photo/emoji), not a colored
   ring around it — position:relative so the flash overlay has something
   to anchor to regardless of which tile variant (photo vs emoji/text,
   only the former sets its own position inline) this lands on. */
.profile-grid-tile { position: relative; }
.grid-tile-pulse::after {
  content: '';
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  animation: gridTileFlash 0.7s ease-out;
  pointer-events: none;
}
@keyframes gridTileFlash {
  0%   { opacity: 0.45; }
  100% { opacity: 0; }
}

.card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-creator {
  font-size: 12px;
  color: var(--text-3);
}
.card-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
  margin-bottom: 14px;
  letter-spacing: -0.4px;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.card-meta-row {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

/* ── Go tab activity cards ─────────────────────────────────────────────────── */
.go-card {
  background: var(--surface);
  border-radius: 16px;
  cursor: pointer;
  margin: 0;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.1s;
}
.go-card:active { opacity: 0.85; }
.go-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-2);
}
.go-card-body {
  padding: 14px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.go-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.go-card-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.participants-badge {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.participants-badge .count { color: var(--text-1); font-weight: 700; }

/* ── Category grid (create form) ──────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.category-option.selected {
  border-color: var(--text-1);
  background: var(--text-1);
  color: var(--bg);
}
.category-option-icon { font-size: 20px; line-height: 1; }
.category-option-label { font-size: 11px; font-weight: 600; color: var(--text-2); }
.category-option.selected .category-option-label { color: var(--bg); }

/* ── Chat List (chats page) ───────────────────────────────────────────────── */
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.chat-item:active { background: var(--bg-2); }

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
  line-height: 1;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }

.chat-body { flex: 1; min-width: 0; }
.chat-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.chat-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}
.chat-time {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
  font-weight: 400;
}
.chat-preview {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-last-user { color: var(--text-1); font-weight: 500; }
.chat-meta { font-size: 11px; color: var(--text-3); }

/* Unread count badge in chat list */
.chat-unread-badge {
  min-width: 20px;
  height: 20px;
  background: #3B7BD4;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
  line-height: 1;
}

/* Filter pills for chats page */
.chat-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.chat-filter-bar::-webkit-scrollbar { display: none; }
.chat-filter-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: var(--card-shadow);
}
.chat-filter-pill.active {
  background: var(--text-1);
  border-color: var(--text-1);
  color: #fff;
}

/* Open status badge */
.status-open {
  background: #E8FBF0;
  color: #2DC870;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-closed {
  background: rgba(0,0,0,0.08);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Chat Messages (activity group chat) ──────────────────────────────────── */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: none;
}
.chat-list::-webkit-scrollbar { display: none; }

.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg--own { flex-direction: row-reverse; }

.chat-bubble {
  max-width: 72%;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
  word-break: break-word;
}
/* Scoped to the text line itself, not the whole .chat-bubble — .chat-bubble
   also wraps .chat-author and the timestamp div, each on their own line in
   the source template literal; white-space is inherited, so pre-wrap on
   the bubble rendered that literal's own indentation/newlines between
   those sibling divs as visible blank space. */
.chat-msg-text { white-space: pre-wrap; }
.chat-msg--own .chat-bubble {
  background: var(--text-1);
  color: var(--bg);
}
.chat-author {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 3px;
}
.chat-msg--own .chat-author { display: none; }

/* ── Chat Input (activity) ────────────────────────────────────────────────── */
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 20px 16px;
  border-top: 1px solid var(--border);
}
.chat-send-btn {
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  color: var(--text-1);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Section Header ───────────────────────────────────────────────────────── */
.section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-2);
  padding: 20px 20px 10px;
}

/* ── Search Bar ───────────────────────────────────────────────────────────── */
.search-bar-wrap {
  padding: 8px 20px 10px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 40;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Fills exactly to the pill's own border — the wrap around it (padding
     area outside the pill) stays transparent so the grid shows through
     there, but the pill itself needs a solid ground for its icon/text to
     read clearly against. */
  background: var(--bg-2);
  border: 1.5px solid var(--border-2);
  border-radius: 22px;
  padding: 0 14px;
  height: 40px;
  box-shadow: none;
  position: relative;
}
.search-icon { color: var(--text-3); flex-shrink: 0; display: flex; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text-1);
  min-width: 0;
}
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Profile Page ─────────────────────────────────────────────────────────── */
.profile-header {
  padding: 16px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-1);
  margin-top: 8px;
  margin-bottom: 2px;
}
.profile-username {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 10px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
}
.stat-label {
  font-size: 9px;
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mini card (profile activities list) */
.mini-card {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.mini-card:active { background: var(--bg-2); }
.mini-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.mini-card-meta {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Activity Detail ──────────────────────────────────────────────────────── */
.detail-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-1);
}

/* ── Auth Pages ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 48px 28px 40px;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
}
.auth-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
  margin-bottom: 40px;
}
.auth-headline {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text-1);
  line-height: 1.1;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 32px;
}
.auth-footer {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}
.auth-footer a {
  color: var(--text-1);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Emoji Grid ───────────────────────────────────────────────────────────── */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
}
.emoji-grid::-webkit-scrollbar { display: none; }
.emoji-option {
  aspect-ratio: 1;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1;
}
.emoji-option:hover { background: var(--bg-2); }
.emoji-option.selected {
  background: var(--bg-2);
  border-color: var(--text-1);
}

/* ── Settings / Report ────────────────────────────────────────────────────── */
.report-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.report-option {
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.1s;
}
.report-option.selected { border-color: var(--text-1); }

/* ── Nearby Page ──────────────────────────────────────────────────────────── */
.nearby-person {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nearby-person-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.nearby-person-id { flex: 1; min-width: 0; }
.nearby-person-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.4px;
  line-height: 1.15;
  margin-bottom: 3px;
}
.nearby-person-dist {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.nearby-person-quote {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 14px;
}
.nearby-join-btn {
  width: 100%;
  height: 46px;
  background: var(--text-1);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  text-transform: uppercase;
}
.nearby-join-btn:active { opacity: 0.75; }
.nearby-join-btn.joined {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}

/* ── Events / Afisha ──────────────────────────────────────────────────────── */
.events-grid {
  display: flex;
  flex-direction: column;
}
.event-card {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  overflow: hidden;
}
.event-card:active { background: var(--bg-2); }
.event-card-img {
  width: 100%;
  aspect-ratio: 16/7;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
  position: relative;
}
.event-card-img-inner {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-card-body { padding: 16px 20px; }
.event-card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.event-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.2;
}
.event-card-meta {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Call page drop-down ──────────────────────────────────────────────────── */
.call-dropdown {
  position: relative;
}
.call-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  z-index: 60;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.call-dropdown-menu.open { display: block; }
.call-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.call-dropdown-item:hover { background: var(--bg-2); }
.call-dropdown-item + .call-dropdown-item { border-top: 1px solid var(--border); }

/* ── Notification bell & badge ─────────────────────────────────────────────── */
.notif-bell {
  position: relative;
  overflow: visible;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: #EF4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  line-height: 1;
}

/* ── Notification panel ────────────────────────────────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: transparent; }
.notif-item.unread .notif-item-text { font-weight: 600; color: var(--text-1); }
.notif-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  overflow: hidden;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-text { font-size: 14px; color: var(--text-2); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Incoming call overlay ────────────────────────────────────────────────── */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.call-overlay.active { display: flex; }
.call-overlay-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0a0a14 0%, #14141e 60%, #0a0a0a 100%);
}
.call-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 100px;
  z-index: 1;
}
.call-pulse {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  animation: callPulse 1.8s ease-out infinite;
}
.call-pulse:nth-child(2) { animation-delay: 0.6s; }
.call-pulse:nth-child(3) { animation-delay: 1.2s; }
@keyframes callPulse {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.5);  opacity: 0; }
}
.call-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #1e1e2e;
  border: 3px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 44px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
}
.call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-info { text-align: center; z-index: 1; margin-bottom: 56px; }
.call-name {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.call-username { font-size: 15px; color: rgba(255,255,255,0.5); margin-bottom: 10px; }
.call-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.call-actions {
  display: flex;
  gap: 48px;
  z-index: 1;
}
.call-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, opacity 0.15s;
}
.call-btn:active { transform: scale(0.9); opacity: 0.85; }
.call-accept-btn { background: #22C55E; }
.call-reject-btn { background: #EF4444; }
.call-btn-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  text-align: center;
}

/* Text starts visually lower than its 16px box-model margin suggests:
   line-height:1.55 on a 15px font adds ~6px of "half-leading" space above
   the actual glyphs (a normal CSS effect, invisible for the photo case
   since images have no line-height leading of their own) — pull it up to
   make the two look the same, matching the photo-post gap. */
/* overflow-wrap so a long unbroken run of characters (no spaces) wraps
   onto the next line instead of overflowing past the card's right edge —
   the card clips overflow, so without this the text just got cut off
   flush with the edge instead of wrapping in from it like the left side. */
/* pre-wrap so a manual line break the author typed renders as an actual
   line break here too, instead of collapsing onto one line like normal
   HTML whitespace handling would. */
.post-text-body { margin-top: -6px; overflow-wrap: break-word; word-break: break-word; white-space: pre-wrap; }

/* ── Post actions (likes / comments / share) ──────────────────────────────── */
.post-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 16px;
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.post-action-btn:hover { background: var(--bg-2); }
.post-action-btn.liked { color: #EF4444; }
.post-action-btn.liked svg { stroke: #EF4444; }
.post-action-btn svg { flex-shrink: 0; }
.post-actions-spacer { flex: 1; }
/* "Читать далее"/"Свернуть" flows inline right after the text — the JS in
   initReadMore() (index.html/profile.html) actually shortens the text
   content to fit 2 lines with the button appended, rather than CSS-clipping
   a longer string and overlaying the button on top (that approach left
   visible artifacts: -webkit-line-clamp's own auto-ellipsis doesn't
   reliably reach the box's true right edge, so the underlying text and the
   overlaid button collided instead of one cleanly masking the other). */
.post-read-more {
  display: none;
  font-size: 13.5px;
  color: var(--text-3);
  background: none;
  border: none;
  padding: 0 0 0 2px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.post-read-more.visible { display: inline; }

/* ── Comments section ─────────────────────────────────────────────────────── */
.comments-section {
  border-top: 1px solid var(--border);
  padding: 12px 0 0;
  margin-top: 4px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}
.comment-item + .comment-item { border-top: 1px solid var(--border); }
.comment-reply {
  margin-left: 42px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.comment-body { flex: 1; min-width: 0; }
.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.comment-text { font-size: 14px; color: var(--text-1); line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.comment-time { font-size: 11px; color: var(--text-3); }
.comment-like-btn, .comment-reply-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}
.comment-like-btn.liked { color: #EF4444; }
/* Floating over the scrollable comments list, not a separate solid footer
   strip — but the row itself has no background at all (not even glass);
   only the input pill and send button below are their own opaque shapes. */
.comment-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
/* Pill input + circular send — same shape/shadow language as dm.html's
   .dm-input-pill/.dm-send (no border, soft shadow instead) so the two
   comment/message composers read as the same component. height:44px (not
   min-height) so the default single-line box matches .comment-send-btn's
   44px exactly; the input/keydown JS still grows it via inline style as
   you type. */
.comment-input {
  flex: 1;
  height: 44px;
  max-height: 120px;
  resize: none;
  padding: 11px 16px;
  background: #fff;
  border: none;
  border-radius: 26px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: -0.1px;
  color: var(--text-1);
  outline: none;
  line-height: 1.4;
  overflow-y: hidden;
}
.comment-input::placeholder { color: var(--text-3); }
.comment-send-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  color: var(--text-1);
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.12s;
}
.comment-send-btn:active { transform: scale(0.91); }
/* ── Emoji picker button ──────────────────────────────────────────────────── */
.emoji-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
  transition: background 0.15s;
  line-height: 1;
}
.emoji-btn:hover { background: var(--border); }
.emoji-picker-panel {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 200;
  padding: 12px;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: 220px;
  overflow-y: auto;
}
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-pick-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  transition: background 0.1s;
  line-height: 1;
}
.emoji-pick-item:hover { background: var(--bg-2); }

/* ── @mention autocomplete ────────────────────────────────────────────────── */
.mention-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  z-index: 210;
  min-width: 200px;
  overflow: hidden;
}
.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.mention-option:hover, .mention-option.active { background: var(--bg-2); }
.mention-option-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.mention-option-user { font-size: 12px; color: var(--text-3); }

/* ── Post create bar ─────────────────────────────────────────────────────────── */
.post-create-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.post-create-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  overflow: hidden;
  line-height: 1;
}
.post-create-placeholder {
  flex: 1;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: background 0.15s;
}
.post-create-placeholder:hover { background: var(--border); }
.post-create-media-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background 0.15s;
}
.post-create-media-btn:hover { background: var(--bg-2); }

/* ── Media upload zone ───────────────────────────────────────────────────────── */
.media-upload-zone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  transition: border-color 0.15s, background 0.15s;
}
.media-upload-zone:hover {
  border-color: var(--text-2);
  background: var(--bg-2);
}

/* ── Emotion picker ──────────────────────────────────────────────────────────── */
.emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.emotion-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--bg-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.emotion-item:hover { background: var(--border); }
.emotion-item.selected {
  border-color: var(--text-1);
  background: var(--surface);
}
.emotion-emoji { font-size: 26px; line-height: 1; }
.emotion-label { font-size: 11px; color: var(--text-2); font-weight: 500; text-align: center; line-height: 1.2; }

/* ── Impression post display (in feed) ───────────────────────────────────────── */
.impression-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 10px 0 4px;
}
.impression-emoji { font-size: 44px; line-height: 1; flex-shrink: 0; }
.impression-label { font-size: 20px; font-weight: 700; color: var(--text-1); letter-spacing: -0.4px; }

/* ── Post attach buttons (in create modal) ───────────────────────────────────── */
.post-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.post-attach-btn:hover { background: var(--border); }

.inline-post-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 41;
  background: var(--surface);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.inline-post-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-2);
  border-radius: 22px;
  padding: 6px 10px 6px 14px;
  min-height: 40px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}
/* Loading ring for share/publish buttons — an SVG outline traces around
   the button as --progress-pct climbs (set from JS via stroke-dasharray,
   pathLength="100" so the dasharray is just 0-100 regardless of the
   button's actual perimeter). Same technique as this app's dashed-border
   boxes (see _sizeBigAddBoxOutline in create-emotion.html) rather than a
   CSS mask trick, which rendered inconsistently. Lives on a sibling of
   the button, not inside it — .pill-cta's own overflow:hidden (for
   text-ellipsis) would otherwise clip a ring sitting outside its box.
   Replaces an earlier same-color fill-sweep that was invisible against
   an identically-colored button. */
.btn-progress-ring-wrap { position: relative; display: inline-flex; }
.btn-progress-ring {
  display: none;
  position: absolute;
  /* Traces just inside the button's own edge (not outset around it) — a
     white stroke sitting outside the button spills onto the page's own
     white background and disappears there; drawn against the button's
     own fill instead, it's visible along its whole length. */
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.inline-post-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-1);
  outline: none;
  position: relative;
  z-index: 2;
  min-width: 0;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  padding: 4px 0;
  max-height: 120px;
  overflow-y: auto;
}
.inline-post-input::placeholder { color: var(--text-3); }
.inline-post-attach {
  border: none;
  background: #E8EAED;
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin-bottom: 2px;
}
.inline-post-attach:hover { background: #D8DADD; }
[data-theme="dark"] .inline-post-attach { background: rgba(255,255,255,0.12); color: var(--text-2); }
[data-theme="dark"] .inline-post-attach:hover { background: rgba(255,255,255,0.18); }
.inline-post-send {
  border: none;
  background: #22C55E;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin-bottom: 2px;
}
.inline-post-send:hover { opacity: 0.85; }

/* ── Post photo editor filter thumbs ──────────────────────────────────────── */
.filter-thumb { display:inline-flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer; }
.filter-thumb-img {
  width: 64px; height: 80px; border-radius: 10px;
  background: var(--bg-2); overflow: hidden;
  border: 2.5px solid transparent; transition: border-color 0.15s;
  background-size: cover; background-position: center;
  /* Default (padding-box) confines the background to inside the border,
     leaving the border's own 2.5px ring painted over bare --bg-2 —  a
     visible corner gap whenever the border itself isn't fully opaque
     (the inactive transparent state) or antialiasing doesn't perfectly
     deflate the inner curve to match. border-box lets the image paint
     straight under the border, so there's no seam to begin with. */
  background-origin: border-box;
}
.filter-thumb.active .filter-thumb-img { border-color: var(--success); }
.filter-thumb-label { font-size: 11px; color: var(--text-2); font-weight: 500; }

.profile-joined-strip {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
  flex-wrap: wrap;
}
.profile-joined-strip::-webkit-scrollbar { display: none; }
.profile-joined-tile {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.15s;
}

#coverCropArea {
  border-radius: 0 !important;
}
.profile-joined-tile:hover { background: var(--border); }

/* ── Carousel nav arrows — hidden until the user starts dragging, so the
   photo stays clean at rest; on desktop a hover reveals them since there's
   no swipe gesture to trigger on. ──────────────────────────────────────── */
/* Allow the browser's native vertical scroll (feed) but hand horizontal
   swipe and pinch on the photo itself entirely to our own JS — without
   this, a 2-finger pinch could still let the page's own scroll/zoom sneak
   in a tiny native movement alongside our transform. */
[data-cid], .cs1 { touch-action: pan-y; }
/* Only revealed by mouse hover (desktop) — never on touch, swiping stays
   arrow-free the whole time. */
.cs-arrow { opacity: 0; transition: opacity 0.2s ease; }
@media (hover: hover) and (pointer: fine) {
  [data-cid]:hover .cs-arrow { opacity: 1; }
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.2s ease;
}
.lightbox.lb-open {
  background: var(--bg);
  pointer-events: auto;
  cursor: zoom-out;
}
.lightbox img {
  /* contain, not cover — every post photo is already cropped to a fixed
     4:5 frame at upload, narrower than a typical phone's ~9:19 screen.
     "cover" filled the whole screen but silently cropped the left/right
     edges further to do it, so the lightbox showed less of the photo than
     the feed preview did. "contain" always shows the full photo (with
     empty space above/below on tall screens); pinch-to-zoom is still
     there for anyone who wants to fill the frame. */
  width: 100%;
  height: 100dvh;
  object-fit: contain;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease;
  pointer-events: none;
  cursor: default;
}
.lightbox.lb-open img {
  transform: scale(1);
  opacity: 1;
}

/* ── Push notification modal ── */
._pb-card {
  background: var(--bg);
  border-radius: 24px !important;
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}
._pb-icon-wrap {
  width: 76px;
  height: 76px;
  background: var(--surface, #F0EFEB);
  border-radius: 22px !important;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
._pb-bell {
  animation: bellSwing 2.4s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes bellSwing {
  0%,55%,100% { transform: rotate(0deg); }
  60%  { transform: rotate(16deg); }
  67%  { transform: rotate(-12deg); }
  74%  { transform: rotate(9deg); }
  81%  { transform: rotate(-5deg); }
  88%  { transform: rotate(3deg); }
  95%  { transform: rotate(0deg); }
}
._pb-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.4px;
  margin-bottom: 10px;
}
._pb-desc {
  font-size: 14px;
  color: var(--text-2, #6B6B6B);
  line-height: 1.55;
  margin-bottom: 28px;
}
._pb-btn {
  width: 100%;
  height: 54px;
  background: var(--text-1, #3D3D3D);
  color: var(--bg, #FAFAF8);
  border: none;
  border-radius: 14px !important;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
._pb-btn:active { opacity: 0.8; }
._pb-skip {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--text-3, #9CA3AF);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Permission/device-error toast ───────────────────────────────────────────
   Shared across call.html, dm.html, groupchat.html, nearby.html, create.html
   — "no mic/camera/location access" style messages. Grey bubble, red dot,
   8px padding on every side, horizontally centered. `bottom` is meant to be
   overridden inline per page (e.g. dm.html shifts it above the input bar). */
.perm-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(8px);
  max-width: calc(100% - 32px);
  background: rgba(40,40,46,0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.perm-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.perm-toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #EF4444; flex-shrink: 0; }
