/* ── Inter font (self-hosted — Google Fonts is blocked for some RU ISPs without a VPN) ── */
@import url('/fonts/inter/inter.css');

/* ── 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);
}

/* Profile cover photo is a background on the header div itself, not an
   <img> — set via --cover-bg (a custom property, assigned inline in JS only
   when the user actually has a cover photo) on a ::before so the header's
   actual content (avatar, name) can sit in normal flow on top of it. No
   custom cover photo → JS leaves --cover-bg unset entirely and these two
   rules' own var() fallback supplies the theme-appropriate default image,
   so it also switches live if the user toggles theme, no JS re-render
   needed. */
.profile-cover-bg { position: relative; }
.profile-cover-bg::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: var(--cover-bg, url(/cover-default-light.webp) center/cover no-repeat);
}
:root[data-theme="dark"] .profile-cover-bg::before {
  background: var(--cover-bg, url(/cover-default-dark.webp) center/cover no-repeat);
}
/* Text drawn over the cover (name, @username, cover-edit pencil, stats and
   their labels) follows the cover's overall brightness: dark cover → light
   text, light cover → dark text. data-cover-tone is set by app.js's
   applyCoverTone() from the server's users.cover_tone ('light'|'dark');
   'default' = no custom cover, so the tone tracks the theme's default image
   (light image ≈ white, dark image ≈ black) and flips live with the theme.
   Back arrow / Подписаться on user.html sit on their own glass pills and
   don't use these. */
.profile-cover-bg {
  --pc-fg: #FFFFFF;
  --pc-fg-2: rgba(255,255,255,0.7);
  --pc-shade: rgba(0,0,0,0.30);
}
.profile-cover-bg[data-cover-tone="light"],
:root:not([data-theme="dark"]) .profile-cover-bg[data-cover-tone="default"] {
  --pc-fg: #1A1E26;
  --pc-fg-2: rgba(26,30,38,0.68);
  --pc-shade: rgba(255,255,255,0.30);
}
.pc-fg { color: var(--pc-fg); transition: color 0.2s ease; }
.pc-fg-2 { color: var(--pc-fg-2); transition: color 0.2s ease; }

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

.logo-rainbow {
  text-decoration: none;
  display: inline-block;
}
/* Fixed brand colors sampled from icon.png, same as login.html's big logo —
   this is the app's identity mark, not a themeable UI accent, so it's
   hardcoded rather than pulled from the admin-editable --success/--dm-purple
   and doesn't shift if those are retuned. */
.logo-go {
  background: none;
  -webkit-text-fill-color: #1bd557;
  color: #1bd557;
}
.logo-withme {
  background: none;
  -webkit-text-fill-color: #843ff5;
  color: #843ff5;
}

/* ── 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: var(--dm-bg);
  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;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
/* No native link/image drag: pressing and pulling an icon or avatar used to
   lift a "Go · getgowithme.app" link ghost (or the image) off the page. Every
   real drag in the app (map, call bubble, voice trim) runs on pointer/touch
   events, and dropping files INTO a chat never starts a dragstart here, so
   nothing relies on this. app.js also cancels dragstart for Firefox, which
   ignores -webkit-user-drag. */
a, img, svg { -webkit-user-drag: none; }
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%);
  /* 1px wider than the viewport on each side (the +2px/432px vs. the old
     100%/430px) — on real 3x-DPR phones this centering math can round to a
     hairline short of the true edge, revealing whatever's behind .app as a
     thin line down the side. Bleeding 1px past the edge is invisible (the
     viewport never paints past its own bounds), so this only ever adds
     harmless overlap, never a visible shift. Only affects ≤430px viewports —
     every page's own `@media (min-width:431px) { .app {...} }` rule fully
     replaces width/max-width for wider screens, untouched by this. */
  width: calc(100% + 2px);
  max-width: 432px;
  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);
  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: var(--success); }
}
.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;
  /* Plain <button> has no color:inherit anywhere in this stylesheet, so
     without this it renders the browser's default black button text —
     invisible/near-invisible against a dark-theme background. */
  color: var(--text-1);
  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: var(--error); }
@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: var(--bottom-nav-bg);
  /* 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, plus
     a brand-colored reflection on the glass itself — green (#1bd557, the
     "Go" mark) catching the top inner edge, purple (#843ff5, "With Me"'s)
     the bottom, same recipe as chats/go/index's own header-action glass. */
  box-shadow: 0 4px 16px rgba(0,0,0,0.18), inset 0 1px 0 rgba(27,213,87,0.4), inset 0 -1px 0 rgba(132,63,245,0.4);
  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: var(--success); }
/* 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: var(--success); }
/* 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: var(--error);
  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: 4px;
  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; transition: transform 0.1s ease; }
.avatar-editable:hover, .avatar-editable:active { transform: scale(1.03); }
.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: 1.6px 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 ───────────────────────────────────────────────────────── */
/* White bordered pill (background/border/radius/padding/font-size all match
   the recipe already established locally in create.html, create-emotion.html
   and dm.html's #dmFieldMsg) — only the text color stays semantic. This is
   the shared default; pages that need their own flavor (login.html,
   profile.html use a flat no-border chip) still override it locally. */
.msg-error, .msg-success {
  padding: 8px 16px;
  background: rgba(255,255,255,0.95);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14.3px;
  margin-bottom: 12px;
  display: none;
  line-height: 1.4;
}
.msg-error   { color: var(--error); }
.msg-success { color: var(--success); }

/* gwmToast() — the site-wide notification pill (app.js). */
.gwm-toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 5000; display: flex; align-items: center; gap: 8px; max-width: 420px; box-sizing: border-box; padding: 9px 16px 9px 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border-2); color: var(--text-1); font-size: 14.3px; font-weight: 500; line-height: 1.35; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; cursor: pointer; }
.gwm-toast.show { opacity: 1; transform: none; pointer-events: auto; }
.gwm-toast svg { flex-shrink: 0; color: var(--text-3); }
.gwm-toast[data-kind="ok"] svg { color: var(--success); }
.gwm-toast[data-kind="error"] svg { color: var(--error); }
.gwm-toast span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .gwm-toast { transition: opacity 0.18s ease; transform: none; } }

/* ── 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 {
  position: relative;
  width: 44px;
  height: 5px;
  background: var(--border-2);
  border-radius: 2.5px;
  margin: 16px auto 9px;   /* 16px from the handle to a title's letters */
  cursor: grab;
  touch-action: none;
}
/* Enlarges the actual touch/click target well past the visible pill —
   same trick as the DM audio player's drag handle — without changing how
   big the pill itself looks. */
.modal-handle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 36px;
}
.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: var(--dm-bg); }

@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 {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
/* Divider starts where the name/text does, not under the avatar column —
   14px left padding + 56px avatar + 12px gap to the text. */
.chat-item::after {
  content: '';
  position: absolute;
  left: 82px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
}
.chat-item:active { background: var(--bg-2); }
.chat-row-wrap .chat-item[data-pinned="1"] {
  background: color-mix(in srgb, var(--border-2) 30%, var(--border) 70%);
}

.chat-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  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: center;
  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: 11.7px;
  color: var(--text-2);
  flex-shrink: 0;
  font-weight: 600;
  position: relative;
  top: -8px;
  /* Fixed width sized for the longest string formatChatTime can produce
     ("28 февр." — a two-digit day + Russian short month with a period),
     text right-aligned inside it — so the checkmark before it never shifts
     depending on whether today's chats show a short "10:05" or a date. */
  display: inline-block;
  width: 58px;
  text-align: left;
}
.chat-preview {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 70px;
}
.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 {
  position: absolute;
  top: 40px;
  right: 14px;
  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;
  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: var(--success);
  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: var(--surface);
  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;
}
/* The one search field style for the whole site (chats header is the
   reference): 34px glass pill, brand reflection (green top / purple
   bottom inset line) instead of a border, 20px magnifier, 16px text.
   Every search input uses this markup — .search-bar > .search-icon +
   .search-input — only its width differs per place. */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: 34px;
  padding: 0 14px;
  border-radius: 22px;
  border: none;
  background: color-mix(in srgb, var(--bg-2) 28%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(200%);
  backdrop-filter: blur(18px) saturate(200%);
  box-shadow: inset 0 1px 0 rgba(27,213,87,0.35), inset 0 -1px 0 rgba(132,63,245,0.35);
  position: relative;
}
.search-icon { color: var(--text-3); flex-shrink: 0; display: flex; margin-left: -6px; }
.search-icon svg { width: 20px; height: 20px; }
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* Glass needs translucency to read — solid pill with a real border for
   people who turned transparency down or contrast up. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .search-bar {
    background: var(--bg-2);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    border: 1.5px solid var(--border-2);
  }
}
.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);
  /* A run with no spaces (long word, URL) can't wrap at a space and would
     otherwise overflow past the viewport edge instead — this still matters
     even with activity.html's own char-count truncation, since a truncated
     slice of an unbroken run is still unbroken. */
  overflow-wrap: break-word;
}

/* ── 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: var(--error);
  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: var(--error);
  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: var(--error); }
.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, transform 0.1s ease;
  white-space: nowrap;
}
.post-action-btn:hover, .post-action-btn:active { background: var(--bg-2); transform: scale(1.06); }
.post-action-btn.liked { color: var(--error); }
.post-action-btn.liked svg { stroke: var(--error); }
.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: var(--error); }
/* 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: var(--surface);
  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: var(--surface);
  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; }
.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 {
  display: block;
  width: 64px; height: 80px; border-radius: 10px;
  background: var(--bg-2);
  border: 2.5px solid transparent; transition: border-color 0.15s;
  box-sizing: 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. */
/* transition here, not inline with the rest of the button's style (see
   arrowStyle const in index.html/profile.html/user.html) — transform itself
   has to stay inline-overridden below since the base translateY(-50%)
   centering is set inline and a plain external rule can't win against it. */
.cs-arrow { opacity: 0; transition: opacity 0.2s ease, transform 0.1s ease; }
@media (hover: hover) and (pointer: fine) {
  [data-cid]:hover .cs-arrow { opacity: 1; }
  /* translateZ(0) here too, not just on the base inline transform — real
     Safari can otherwise still drop this back out of its own compositing
     layer for the hover/active moment and let a <video> slide's hardware
     layer paint over it, the same bug .cs-vol-wrap had. */
  .cs-arrow:hover, .cs-arrow:active { transform: translateY(-50%) scale(1.06) translateZ(0) !important; }
}

/* ── Mixed-carousel volume slider — thumb styling only (the track's fill
   gradient is set inline per-value by _mSetVolume in index/profile/user.html,
   same pattern as the DM video lightbox's own volume slider). */
/* Real Safari (not Playwright's WebKit) renders <video> in its own
   hardware compositing layer that can paint over a plain, non-composited
   DOM sibling regardless of z-index — the mute button+slider sitting next
   to the video was completely unpainted (present in the DOM, clickable,
   just invisible) despite a higher z-index. Forcing this wrapper onto its
   own compositing layer makes WebKit actually stack it above the video. */
.cs-vol-wrap {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
/* Same real-Safari video-compositing fix as .cs-vol-wrap above — the "N / total"
   counter badge is the same kind of plain absolutely-positioned sibling of a
   <video class="cs">, just not yet reported as invisible the way the nav
   arrows and volume control were (a small text badge is easier to miss). */
.cc {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.cs-vol-slider {
  -webkit-appearance: none; appearance: none;
  outline: none; cursor: pointer;
}
.cs-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; cursor: pointer;
}
.cs-vol-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; cursor: pointer; }

/* ── 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: var(--error); flex-shrink: 0; }

/* ── Shared post card (DM / group chats) ─────────────────────────────────── */
.post-share-card {
  display: flex; flex-direction: column; width: 236px; max-width: 100%;
  margin-bottom: 6px; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-1); text-decoration: none;
}
.psc-media { position: relative; display: block; height: 280px; overflow: hidden; background: #16131F; }
/* Chat bubbles size their own images (height:auto etc.) — the card's preview must not follow that. */
.post-share-card .psc-media img, .post-share-card .psc-media video { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: cover; display: block; border-radius: 0; }
.psc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.psc-media.psc-text {
  height: auto; min-height: 120px; padding: 18px 16px; box-sizing: border-box;
  background: var(--dm-purple); color: #fff; font-size: 16px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;
}
.psc-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 11px; }
.psc-by { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.psc-by img, .psc-by i { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; }
.psc-by b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.psc-by em { font-style: normal; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.psc-cap { font-size: 13px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-share-card.psc-gone .psc-cap { color: var(--text-3); }
/* A post published into a group: a bigger card with its counts. */
.post-share-card.psc-big { width: 264px; }
.post-share-card.psc-big .psc-media { height: auto; aspect-ratio: 4 / 5; }
.psc-stats { display: flex; align-items: center; gap: 14px; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.psc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.psc-stats .psc-open { margin-left: auto; color: var(--dm-purple, var(--text-1)); font-weight: 700; }
.psc-live .psc-media { cursor: pointer; }
.psc-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.psc-track::-webkit-scrollbar { display: none; }
.psc-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; position: relative; }
.psc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.psc-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.55); transition: width 0.2s ease; }
.psc-dots i.on { width: 14px; background: #fff; }
.psc-snd { position: absolute; left: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); background: rgba(0,0,0,0.4); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.psc-feed { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid rgba(255,255,255,0.45); background: rgba(0,0,0,0.4); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; text-decoration: none; }
.psc-live .psc-stats { gap: 6px; margin-top: 4px; }
.psc-act { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px 0 8px; border-radius: 16px; border: 1px solid var(--border); background: none; color: var(--text-1); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.psc-act:active { transform: scale(0.95); }
.psc-like.on { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, var(--border)); }
.psc-like.on svg { fill: currentColor; }
.psc-share { margin-left: auto; padding: 0 9px; }
.psc-more { align-self: flex-start; margin-top: 2px; padding: 0; border: none; background: none; color: var(--text-3); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.gwm-fl { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,0.4); display: flex; align-items: flex-end; justify-content: center; }
.gwm-fl-sheet { width: 100%; max-width: 480px; height: 78dvh; box-sizing: border-box; background: var(--surface); border-top: 1px solid var(--border); border-radius: 24px 24px 0 0; padding: 0 16px; display: flex; flex-direction: column; animation: feedFadeIn 0.18s ease-out; }
.gwm-fl-grab { width: 44px; height: 5px; border-radius: 2.5px; background: var(--border-2); margin: 16px auto 14px; flex-shrink: 0; }
.gwm-fl-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-2); flex-shrink: 0; }
.gwm-fl-tabs button { flex: 1; height: 34px; border: none; border-radius: 999px; background: none; color: var(--text-2); font-family: inherit; font-size: 14.3px; font-weight: 600; cursor: pointer; }
.gwm-fl-tabs button.on { background: var(--text-1); color: var(--bg); }
.gwm-fl-q { margin: 12px 0 6px; flex-shrink: 0; }
.gwm-fl-list { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.gwm-fl-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.gwm-fl-av img, .gwm-fl-av i { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; color: #fff; }
.gwm-fl-n { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text-1); }
.gwm-fl-n b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwm-fl-n span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwm-fl-btn { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 17px; border: none; background: var(--success); color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.gwm-fl-btn.on { background: none; border: 1px solid var(--border-2); color: var(--text-2); }
.gwm-fl-empty { padding: 32px 0; text-align: center; color: var(--text-3); font-size: 14.3px; }
.gwm-stat { cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.gwm-stat:active { opacity: 0.6; }
.gwm-invite { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; }
.gwm-invite-card { width: 100%; max-width: 430px; box-sizing: border-box; background: var(--surface); border-top: 1px solid var(--border); border-radius: 24px 24px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text-1); }
.gwm-invite-av img, .gwm-invite-av i { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 28px; font-weight: 700; color: #fff; }
.gwm-invite-card b { font-size: 18px; font-weight: 800; margin-top: 6px; }
.gwm-invite-card span { font-size: 13px; color: var(--text-3); }
.gwm-invite-card span em { font-style: normal; margin-left: 10px; }
.gwm-invite-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: var(--text-2); white-space: pre-wrap; }
.gwm-invite-go { width: 100%; height: 48px; margin-top: 12px; border-radius: 24px; border: none; background: var(--success); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.gwm-invite-no { width: 100%; height: 44px; border: none; background: none; color: var(--text-2); font-family: inherit; font-size: 14.3px; font-weight: 600; cursor: pointer; }
.post-viewer { position: fixed; inset: 0; z-index: 3000; background: #000; }
.post-viewer iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Chat music player (chat-music.js) */
.cm-list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.cm-list-head b { font-size: 16px; font-weight: 800; color: var(--text-1); }
.cm-list-head span { font-size: 13px; color: var(--text-3); }
.dm-audio-player-row.cm-row { height: 58px; position: relative; overflow: hidden; padding-left: 10px; }
.cm-row-n { display: flex !important; flex-direction: column; justify-content: center; gap: 2px; line-height: 1.2 !important; }
.cm-row-n b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-row-n span { font-size: 12.5px; color: var(--text-3); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-row-n i { font-style: normal; margin-left: 10px; }
.cm-row-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.cm-row-bar i { display: block; height: 100%; width: 0; background: var(--dm-purple, var(--success)); transition: width 0.3s linear; }
.cm-cover { width: 100%; height: 100%; border-radius: inherit; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; font-weight: 800; }
.dm-audio-player-bar-icon:has(.cm-cover) { background: none; overflow: hidden; }
.cm-mini { position: absolute; left: 10px; right: 10px; z-index: 40; display: none; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 8px; box-sizing: border-box; border-radius: 26px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; cursor: pointer; }
.cm-mini.show { display: flex; animation: feedFadeIn 0.15s ease-out; }
.cm-mini-cover { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.cm-mini-n { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cm-mini-n b { font-size: 14px; font-weight: 700; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-mini-n span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-mini-b { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; border: none; background: none; color: var(--text-1); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cm-mini-play { background: var(--dm-purple, var(--success)); color: #fff; }
.cm-mini-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--dm-purple, var(--success)); }

/* Direct messages, round two (dm-extras.js) */
.dmx-ov { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,0.4); display: flex; align-items: flex-end; justify-content: center; }
.dmx-sheet { width: 100%; max-width: 480px; max-height: 84dvh; box-sizing: border-box; background: var(--surface); color: var(--text-1); border-top: 1px solid var(--border); border-radius: 24px 24px 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; animation: feedFadeIn 0.18s ease-out; }
.dmx-grab { width: 44px; height: 5px; border-radius: 2.5px; background: var(--border-2); margin: 16px auto 12px; flex-shrink: 0; }
.dmx-title { text-align: center; font-size: 17px; font-weight: 800; margin: 2px 0 14px; }
.dmx-body { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.dmx-menu { display: flex; flex-direction: column; }
.dmx-item { display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 6px; border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text-1); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.dmx-item:last-child { border-bottom: none; }
.dmx-item svg { color: var(--text-2); flex-shrink: 0; }
.dmx-item.danger, .dmx-item.danger svg { color: var(--error); }
.dmx-col { display: flex; flex-direction: column; gap: 8px; }
.dmx-pill { height: 46px; border-radius: 23px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-1); font-family: inherit; font-size: 14.3px; font-weight: 600; cursor: pointer; }
.dmx-pri { height: 48px; border-radius: 24px; border: none; background: var(--success); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px; flex-shrink: 0; }
.dmx-pri:disabled { opacity: 0.5; }
.dmx-l { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.dmx-in { height: 44px; border-radius: 22px; border: 1px solid var(--border-2); background: var(--bg); color: var(--text-1); padding: 0 16px; font-family: inherit; font-size: 16px; outline: none; box-sizing: border-box; width: 100%; }
#dmxPollOpts { display: flex; flex-direction: column; gap: 8px; }
.dmx-add { align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; border-radius: 17px; border: 1px dashed var(--border-2); background: none; color: var(--text-2); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.dmx-note, .dmx-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 6px 0; }
.dmx-empty { padding: 28px 0; }
.dmx-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-2); flex-shrink: 0; }
.dmx-tabs button { flex: 1; height: 34px; border: none; border-radius: 999px; background: none; color: var(--text-2); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.dmx-tabs button.on { background: var(--text-1); color: var(--bg); }
.dmx-shared { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.dmx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: 14px; overflow: hidden; }
.dmx-grid button { position: relative; aspect-ratio: 1; padding: 0; border: none; background: var(--bg-2); cursor: pointer; }
.dmx-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dmx-grid span { position: absolute; top: 6px; left: 6px; color: #fff; display: flex; }
.dmx-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text-1); text-decoration: none; font-family: inherit; text-align: left; cursor: pointer; width: 100%; box-sizing: border-box; }
.dmx-row-ic { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--bg-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.dmx-row-n { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dmx-row-n b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmx-row-n span { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmx-row em { font-style: normal; font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.dmx-x { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--border-2); background: none; color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.dmx-walls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dmx-walls button, .dmx-walls label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: none; background: none; color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dmx-walls button > span, .dmx-wall-photo { width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; border: 2px solid var(--border); box-sizing: border-box; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.dmx-walls .on > span, .dmx-walls .on .dmx-wall-photo { border-color: var(--success); }
.dmx-muted { display: inline-flex; vertical-align: -1px; margin-left: 6px; color: var(--text-3); }
.dmx-sched-bar { display: flex; align-items: center; gap: 6px; align-self: center; margin: 0 auto 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dmx-sched-bar svg { width: 15px; height: 15px; }
.dmx-poll { min-width: 220px; max-width: 280px; display: flex; flex-direction: column; gap: 6px; padding: 2px 0 4px; }
.dmx-poll-q { font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 2px; }
.dmx-poll-o { position: relative; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 19px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-1); font-family: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; overflow: hidden; }
.dmx-poll-o i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--success) 20%, transparent); transition: width 0.25s ease; }
.dmx-poll-o span { position: relative; flex: 1; min-width: 0; }
.dmx-poll-o b { position: relative; font-size: 12.5px; color: var(--text-2); }
.dmx-poll-o.on { border-color: var(--success); }
.dmx-poll-n { font: inherit; font-size: 12px; color: var(--text-3); padding: 0 0 0 2px; border: none; background: none; text-align: left; cursor: pointer; }
.dmx-lp { display: flex; flex-direction: column; margin-top: 6px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); color: var(--text-1); text-decoration: none; max-width: 280px; }
.dmx-lp[hidden] { display: none; }
.dmx-lp img { width: 100%; max-height: 150px; object-fit: cover; display: block; }
.dmx-lp > span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.dmx-lp em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.dmx-lp b { font-size: 13.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dmx-lp i { font-style: normal; font-size: 12.5px; color: var(--text-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dmx-row-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* ── Desktop layout (≥1024px) ──────────────────────────────────────────────
   Below 1024px nothing here applies: phones and narrow windows keep the
   bottom pill nav and the single column. From 1024px the site becomes a
   centered frame (up to 1120px) on a --desk-side background: a 240px
   sidebar (.gwm-side, built by app.js) replaces the bottom pill, and .app
   fills the rest of the frame. .app keeps a transform so position:fixed
   pieces inside it (sheets, overlays) stay scoped to it, same as on mobile. */
.gwm-side { display: none; }
@media (min-width: 1024px) {
  :root {
    --desk-w: min(1120px, calc(100vw - 48px));
    --desk-nav-w: 240px;
    --desk-left: calc((100vw - var(--desk-w)) / 2);
  }
  html, body { background: var(--desk-side); }
  body .app {
    left: calc(var(--desk-left) + var(--desk-nav-w));
    width: calc(var(--desk-w) - var(--desk-nav-w));
    max-width: none;
    transform: translateX(0);
    border-right: 1px solid var(--border-2);
    box-shadow: none;
  }
  body .bottom-nav { display: none !important; }

  .gwm-side {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: 0; bottom: 0; left: var(--desk-left); z-index: 60;
    width: var(--desk-nav-w); box-sizing: border-box; padding: 20px 12px 16px;
    background: var(--bg); color: var(--text-1);
    border-left: 1px solid var(--border-2); border-right: 1px solid var(--border-2);
  }
  .gwm-side-logo { display: flex; align-items: center; height: 44px; padding: 0 12px; margin-bottom: 16px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; gap: 5px; }
  .gwm-side-logo .g { color: var(--success); }
  .gwm-side-logo .w { color: var(--dm-purple); }
  .gwm-side-item {
    display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px;
    border-radius: 23px; text-decoration: none; color: var(--text-1);
    font-size: 15px; font-weight: 500; transition: background 0.15s;
  }
  .gwm-side-item:hover { background: color-mix(in srgb, var(--text-1) 6%, transparent); }
  .gwm-side-item.active { font-weight: 700; background: color-mix(in srgb, var(--success) 14%, transparent); }
  .gwm-side-item.active svg { color: var(--success); }
  .gwm-side-item svg { flex-shrink: 0; }
  .gwm-side-av { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px !important; }
  .gwm-side-badge {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; box-sizing: border-box;
    border-radius: 11px; background: var(--success); color: #fff;
    font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center;
  }
  .gwm-side-badge.red { background: var(--error); }
  .gwm-side-spacer { flex: 1; }
  .gwm-side-create {
    height: 48px; border-radius: 24px; background: var(--success); color: #fff;
    font-size: 15px; font-weight: 700; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .gwm-side-create:active { transform: scale(0.98); }
}
@media (min-width: 1024px) {
  /* The sidebar has «Уведомления» — no second bell in page headers. */
  .app .header #notifBell { display: none; }
  /* Tile grids (search, profiles): emotions 4 across, Go cards 3 across. */
  .gwm-tgrid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px !important; }
  .gwm-ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 16px !important; padding: 8px 0 24px; }
  .gwm-ggrid .go-card { border-radius: 18px !important; }
  /* Pages that are a single reading column on a phone: keep that column
     centered at a comfortable width instead of stretching it. */
  .gwm-col .main > * { max-width: var(--gwm-col-w, 720px); margin-left: auto; margin-right: auto; }
}
/* Desktop (≥1024px) profile header (profile.html / user.html): the cover is
   a 230px band, the avatar overlaps its bottom edge, name and counters sit
   beside the avatar on the page background instead of over the photo. */
@media (min-width: 1024px) {
  .app .profile-cover-bg { overflow: visible !important; margin-top: 20px; }
  .app .profile-cover-bg::before { bottom: auto; height: 230px; border-radius: 22px; }
  .app .profile-cover-bg .pc-shade-ov { display: none; }
  .app .profile-cover-bg[data-cover-tone] { --pc-fg: var(--text-1); --pc-fg-2: var(--text-2); }
  .pc-in { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 28px; align-items: start; padding: 0 24px 22px !important; }
  .pc-sp { grid-column: 1 / -1; height: 174px !important; }
  .pc-row { display: contents !important; }
  .pc-row > :first-child { grid-column: 1; grid-row: 2 / span 2; width: 132px !important; height: 132px !important; }
  .pc-row .avatar { width: 132px !important; height: 132px !important; font-size: 44px !important; border: 4px solid var(--bg); box-sizing: border-box; }
  .pc-name { grid-column: 2; grid-row: 2; padding: 66px 0 0 !important; }
  .pc-name > :first-child { font-size: 26px !important; letter-spacing: -0.01em !important; }
  .pc-name > :last-child { font-size: 15px !important; }
  .pc-stats { grid-column: 2; grid-row: 3; transform: none !important; justify-content: flex-start; gap: 32px !important; margin-top: 12px; }
  .pc-stats .gwm-stat { flex: none !important; text-align: left !important; display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
  .pc-stats .gwm-stat > div { font-size: 15px !important; margin: 0 !important; }
  .pc-stats .gwm-stat > div:first-child { font-weight: 700 !important; }
  .pc-tabs { justify-content: center; gap: 48px; background: var(--bg) !important; border-top: 1px solid var(--border-2); }
  .pc-tabs > button { flex: none !important; padding: 14px 4px !important; }
  .app #coverEditBtn { top: 14px !important; right: 14px !important; width: 40px !important; height: 40px !important; border-radius: 20px; color: #fff !important; background: rgba(0,0,0,0.25) !important; border: 1px solid rgba(255,255,255,0.6) !important; }
}
/* Desktop (≥1024px): no phone bottom sheets — every sheet opens as a
   centered dialog with all corners rounded; the drag handle has no job. */
@media (min-width: 1024px) {
  .modal-overlay:not(#commentsModal), .gwm-fl, .gwm-invite, .dmx-ov,
  .ce-add-sheet, .ce-fx-bg, .ce-sheet-bg, .sheet-overlay {
    align-items: center !important; padding: 24px !important; box-sizing: border-box;
  }
  .modal-overlay:not(#commentsModal) > *, .gwm-fl-sheet, .gwm-invite-card, .dmx-sheet, .ce-sheet, .ce-fx {
    border-radius: 22px !important; border: 1px solid var(--border-2);
    max-height: min(680px, calc(100dvh - 48px)); max-width: 480px;
  }
  /* The phone sheets' 70dvh drag height (app.js) — a dialog fits its content. */
  .modal-overlay:not(#commentsModal) > * { height: auto !important; }
  .gwm-fl-sheet { height: min(78dvh, 720px); }
  .modal-handle, .gwm-fl-grab, .dmx-grab { display: none !important; }
  .modal-overlay:not(#commentsModal) .modal-handle + * { margin-top: 0; }
}
@media (min-width: 1024px) {
  /* A post opened in the viewer over a chat (index.html?embed=1): no
     sidebar, the post itself centered. */
  html.embed-post .gwm-side { display: none !important; }
  html.embed-post body .app { left: 50%; width: min(960px, calc(100vw - 48px)); transform: translateX(-50%); border-right: none; }
}
