@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');
@import url('./theme/tokens.css');
@import url('./theme/dark-theme.css');
@import url('./theme/components.css');
@import url('./theme/pages.css');

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

html, body {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% -10%, rgba(124,92,255,0.22), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(45,212,191,0.13), transparent 28%),
    linear-gradient(180deg, #070a12 0%, #0a0f1a 52%, #070a12 100%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

html,
body {
  max-width: 100%;
}

button, input, textarea {
  font: inherit;
}

input,
textarea,
select {
  font-size: 16px;
}

.chat-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  pointer-events: auto;
  background: transparent;
}

.chat-menu-overlay .chat-menu-sheet {
  position: fixed;
  top: var(--chat-menu-top, 72px);
  right: var(--chat-menu-right, 18px);
  bottom: auto;
  z-index: 2601;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--chat-menu-top, 72px) - env(safe-area-inset-bottom, 0px) - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message-media,
.message-video,
.post-media-frame,
.profile-media-tile,
.profile-video-tile,
.story-media-shell,
.viewer-stage {
  position: relative;
  overflow: hidden;
}

.media-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
  padding: 14px;
  color: rgba(244, 247, 255, 0.92);
  background: linear-gradient(145deg, rgba(16, 24, 39, 0.96), rgba(27, 38, 61, 0.94));
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.media-fallback .mine-icon {
  width: 28px;
  height: 28px;
  color: rgba(184, 196, 220, 0.95);
}

.media-fallback small {
  width: min(260px, 100%);
  color: rgba(226, 233, 246, 0.88);
  font-size: 12px;
  font-weight: 600;
}

.message-media.is-broken img,
.post-media-frame.is-broken .post-media-item,
.profile-media-tile.is-broken img,
.story-media-shell.is-broken img,
.story-media-shell.is-broken video,
.video-shell.is-broken video,
.viewer-stage.is-broken > img {
  opacity: 0;
}

.message-media.is-broken .media-fallback,
.message-video.is-broken .media-fallback,
.post-media-frame.is-broken .media-fallback,
.profile-media-tile.is-broken .media-fallback,
.profile-video-tile.is-broken .media-fallback,
.story-media-shell.is-broken .media-fallback,
.video-shell.is-broken .media-fallback,
.viewer-stage.is-broken .media-fallback {
  display: flex;
}

.video-shell.is-broken .video-controls {
  display: none;
}

.mine-media {
  width: 100%;
  min-width: 0;
  background: #101827;
  contain: layout paint;
}

.mine-media-message {
  max-width: min(420px, 76vw);
  min-height: 96px;
  border-radius: 14px;
}

.mine-media-post {
  min-height: 160px;
}

.mine-media-profile {
  min-height: 128px;
}

.mine-media .post-media-item {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mine-media.is-loading .post-media-item {
  opacity: 0;
}

.mine-media.is-loaded .post-media-item,
.mine-media.is-uploading .post-media-item,
.mine-media.is-processing .post-media-item {
  opacity: 1;
}

.mine-media.is-loading .media-fallback,
.mine-media.is-uploading .media-fallback,
.mine-media.is-processing .media-fallback,
.mine-media.is-failed .media-fallback,
.mine-media.is-unavailable .media-fallback,
.mine-media.is-deleted .media-fallback,
.mine-media.is-access_denied .media-fallback,
.story-media-shell.is-loading .media-fallback,
.story-media-shell.is-uploading .media-fallback,
.story-media-shell.is-processing .media-fallback,
.story-media-shell.is-failed .media-fallback,
.story-media-shell.is-unavailable .media-fallback,
.story-media-shell.is-deleted .media-fallback,
.story-media-shell.is-access_denied .media-fallback {
  display: flex;
}

.mine-media.is-uploading .media-fallback,
.mine-media.is-processing .media-fallback {
  background: linear-gradient(145deg, rgba(16, 24, 39, 0.72), rgba(27, 38, 61, 0.82));
}

.media-progress {
  width: min(180px, 80%);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.media-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mine-blue), var(--mine-teal));
}

.media-retry-btn {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(93, 156, 255, 0.24);
  cursor: pointer;
}

.shared-post-card {
  width: min(420px, 100%);
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.shared-post-card strong,
.shared-post-card p,
.shared-post-card small {
  min-width: 0;
}

.shared-post-card strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 13px;
}

.shared-post-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.35;
}

.shared-post-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.shared-post-kicker .mine-icon {
  width: 15px;
  height: 15px;
}

.shared-post-media .post-media {
  margin-top: 0;
}

.shared-post-media .post-media-single .mine-media-message {
  max-width: 100%;
}

.shared-post-open {
  width: fit-content;
  color: #9ddcff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.shared-post-card.is-unavailable {
  background: rgba(255, 255, 255, 0.05);
}

.shared-post-note {
  color: rgba(255, 255, 255, 0.68);
}

.share-message {
  width: calc(100% - 32px);
  min-height: 46px;
  max-height: 120px;
  display: block;
  margin: 12px 16px 0;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid var(--mine-border, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--mine-text, #eef3fb);
}

.report-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2700;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 8, 14, 0.66);
}

.report-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  background: rgba(15, 20, 34, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.report-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.report-object-preview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-right: 34px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.report-object-preview > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(124, 104, 255, 0.2);
}

.report-object-preview p,
.report-dialog h2 {
  margin-top: 8px;
}

.report-dialog h2 {
  font-size: 20px;
}

.report-choice-grid,
.report-subcategory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.report-choice-grid button,
.report-subcategory-list button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.report-choice-grid button.active,
.report-subcategory-list button.active {
  border-color: rgba(124, 104, 255, 0.62);
  background: rgba(124, 104, 255, 0.22);
}

.report-dialog .field-label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.report-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.story-privacy-overlay {
  position: fixed;
  inset: 0;
  z-index: 2700;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 8, 14, 0.66);
}

.story-privacy-sheet {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  background: rgba(15, 20, 34, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.story-privacy-sheet h2 {
  margin-bottom: 12px;
  font-size: 20px;
}

.story-privacy-sheet button:not(.soft-btn) {
  display: grid;
  width: 100%;
  gap: 3px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.story-privacy-sheet small {
  color: var(--muted);
}

.admin-report-modal {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 14, 0.68);
}

.admin-report-card {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  background: rgba(15, 20, 34, 0.98);
}

.admin-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 14px;
  margin: 14px 0;
}

.admin-report-object,
.admin-report-info {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.admin-report-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-system-settings {
  display: grid;
  gap: 14px;
}

.system-settings-form {
  display: grid;
  gap: 12px;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.profile-avatar-open.has-accessible-stories {
  box-shadow: 0 0 0 3px rgba(124, 104, 255, 0.42), 0 0 0 7px rgba(51, 214, 194, 0.16);
}

.profile-story-ring {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(124, 104, 255, 0.86);
  border-radius: inherit;
  pointer-events: none;
}

.verified-badge[data-badge-type="system"] {
  background: #14b8a6;
}

.verified-badge[data-badge-type="support"] {
  background: #38bdf8;
  color: #07111f;
}

@media (max-width: 820px) {
  .chat-menu-overlay {
    background: rgba(7, 10, 18, 0.24);
  }

  .chat-menu-overlay .chat-menu-sheet {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(68dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 96px));
    border-radius: 18px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  body[data-view="messages"].chat-open .bottom-nav {
    pointer-events: none;
  }

  .report-choice-grid,
  .report-subcategory-list {
    grid-template-columns: 1fr;
  }

  .admin-report-grid,
  .settings-toggle-grid {
    grid-template-columns: 1fr;
  }
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

[data-guest-only] {
  display: none !important;
}

.is-guest [data-auth-only] {
  display: none !important;
}

.is-guest [data-guest-only] {
  display: inline-flex !important;
}

.social-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 24px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.brand-mark {
  color: var(--teal);
}

.top-actions,
.header-actions,
.composer-actions,
.post-actions,
.comments-head,
.comment-meta {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 8px;
}

.icon-btn,
.soft-btn,
.primary-btn,
.danger-btn,
.menu-btn,
.action-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.icon-btn {
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel-soft);
}

.soft-btn,
.danger-btn,
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-soft);
}

.soft-btn.active,
.action-btn.active {
  color: var(--accent);
  border-color: rgba(37,99,235,0.28);
  background: rgba(37,99,235,0.10);
}

.danger-btn {
  color: var(--danger);
  border-color: rgba(248,113,113,0.34);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(37,99,235,0.18);
}

.icon-btn:hover,
.soft-btn:hover,
.danger-btn:hover,
.action-btn:hover,
.menu-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: #1d4ed8;
}

.social-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}

.is-guest .social-shell {
  width: min(860px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.profile-panel,
.wall-panel,
.people-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 50px var(--soft-shadow);
}

.profile-panel,
.people-panel {
  padding: 18px;
  position: sticky;
  top: 82px;
}

.wall-panel {
  min-height: calc(100vh - 112px);
  overflow: hidden;
}

.profile-head,
.wall-header,
.post-head,
.person,
.blocked-user,
.comment {
  display: flex;
  align-items: center;
}

.profile-head {
  gap: 12px;
  margin-bottom: 16px;
}

.avatar,
.person-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
  overflow: hidden;
}

.avatar img,
.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.person-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.avatar-button {
  cursor: pointer;
}

.profile-title,
.post-author,
.person-copy,
.comment-body {
  min-width: 0;
}

.profile-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-username,
.wall-header p,
.post-head small,
.person-copy small,
.person-copy em,
.empty-line,
.empty-wall,
.notice-bar,
.comment-meta small,
.guest-box {
  color: var(--muted);
}

.app-menu {
  display: grid;
  gap: 8px;
}

.menu-btn {
  width: 100%;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn.active {
  color: var(--accent);
  border-color: rgba(37,99,235,0.22);
  background: rgba(37,99,235,0.09);
}

.menu-btn::before,
.side-link::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: currentColor;
  opacity: 0.82;
  mask-size: 18px 18px;
  mask-repeat: no-repeat;
  mask-position: center;
}

.menu-btn[data-menu-icon="feed"]::before { mask-image: radial-gradient(circle at 50% 50%, #000 0 42%, transparent 44%), linear-gradient(#000 0 0); }
.menu-btn[data-menu-icon="popular"]::before { mask-image: linear-gradient(45deg, transparent 35%, #000 36% 62%, transparent 63%), radial-gradient(circle at 50% 78%, #000 0 34%, transparent 35%); }
.menu-btn[data-menu-icon="friends"]::before { mask-image: radial-gradient(circle at 35% 32%, #000 0 18%, transparent 19%), radial-gradient(circle at 65% 32%, #000 0 18%, transparent 19%), radial-gradient(ellipse at 50% 78%, #000 0 42%, transparent 43%); }
.menu-btn[data-menu-icon="messages"]::before { mask-image: linear-gradient(#000 0 0); border-radius: 4px; }
.menu-btn[data-menu-icon="notifications"]::before { mask-image: radial-gradient(circle at 50% 78%, #000 0 12%, transparent 13%), radial-gradient(ellipse at 50% 42%, #000 0 44%, transparent 45%); }
.menu-btn[data-menu-icon="groups"]::before { mask-image: radial-gradient(circle at 50% 28%, #000 0 18%, transparent 19%), radial-gradient(ellipse at 50% 78%, #000 0 45%, transparent 46%); }
.menu-btn[data-menu-icon="wall"]::before { mask-image: linear-gradient(#000 0 0); border-radius: 3px; }
.menu-btn[data-menu-icon="settings"]::before { mask-image: radial-gradient(circle at 50% 50%, transparent 0 21%, #000 22% 40%, transparent 41%), radial-gradient(circle at 50% 50%, #000 0 56%, transparent 57%); }

.side-link {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.wall-header {
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.wall-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.header-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.composer {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.composer textarea,
.comment-form textarea,
.field-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.composer textarea {
  min-height: 116px;
  padding: 14px;
  resize: vertical;
}

.composer-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.media-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.media-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.media-preview {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.selected-media {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.selected-media img,
.selected-media video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #05070a;
}

.selected-media span,
.selected-media small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-media span {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text);
}

.selected-media small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.field-input {
  min-height: 42px;
  padding: 10px 12px;
}

.field-area {
  min-height: 118px;
  resize: vertical;
}

.field-input:focus,
.composer textarea:focus,
.comment-form textarea:focus {
  border-color: rgba(99,102,241,0.7);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

.color-input {
  width: 44px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.notice-bar {
  min-height: 0;
  padding: 0 20px;
  font-size: 14px;
}

.notice-bar:not(:empty) {
  min-height: 34px;
  padding-top: 10px;
}

.notice-bar.is-error {
  color: var(--danger);
}

.view-body {
  padding: 0 20px;
}

.feed-list {
  padding: 0 20px 20px;
}

.post {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.post-detail {
  border-bottom: 0;
}

.post-head {
  gap: 10px;
  margin-bottom: 12px;
}

.post-author {
  flex: 1;
}

.author-link {
  display: block;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

.author-link:hover {
  color: var(--teal);
}

.post-head small {
  display: block;
  margin-top: 2px;
}

.post-content {
  white-space: pre-wrap;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.post-media {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.post-media-single {
  grid-template-columns: minmax(0, 1fr);
}

.post-media-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-media-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-media-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #05070a;
}

.post-media-single .post-media-item {
  max-height: 620px;
  aspect-ratio: 16 / 10;
  object-fit: contain;
}

.post-media-double .post-media-item {
  aspect-ratio: 4 / 3;
}

.post-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-action {
  min-width: 64px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: transform 0.18s, color 0.18s, background 0.18s, border-color 0.18s, opacity 0.18s;
}

.post-action:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(20,184,166,0.34);
  background: #eef6ff;
}

.post-action:disabled {
  opacity: 0.65;
  cursor: wait;
}

.post-action-static,
.post-action-static:hover {
  cursor: default;
  transform: none;
  color: var(--muted);
  border-color: var(--border);
  background: #f8fafc;
}

.post-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  overflow: visible;
}

.heart-shape {
  fill: transparent;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.like-btn.active,
.comment-like-btn.active {
  color: #fb7185;
  border-color: rgba(251,113,133,0.36);
  background: rgba(251,113,133,0.11);
}

.share-btn.active,
.share-btn.shared-flash {
  color: #0f9f7a;
  border-color: rgba(15,159,122,0.34);
  background: rgba(15,159,122,0.12);
}

.like-btn.active .heart-shape,
.comment-like-btn.active .heart-shape {
  fill: currentColor;
}

.like-btn.just-liked .post-icon {
  animation: like-bounce 0.48s cubic-bezier(0.2, 1.35, 0.35, 1);
}

@keyframes like-bounce {
  0% { transform: scale(1); }
  38% { transform: scale(1.34) rotate(-7deg); }
  62% { transform: scale(0.92) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.comment-jump-btn.active {
  color: var(--teal);
  border-color: rgba(20,184,166,0.38);
  background: rgba(20,184,166,0.12);
}

.comments-box {
  margin-bottom: 20px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.inline-comments {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.comment-sort {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.comment-sort button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.comment-sort button.active {
  color: var(--accent);
  background: rgba(37,99,235,0.10);
}

.inline-comments.expanded {
  animation: comments-open 0.2s ease-out;
}

@keyframes comments-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.comments-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.comment-list {
  display: grid;
  gap: 14px;
}

.comment {
  align-items: flex-start;
  gap: 10px;
}

.comment-meta {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comment-body p {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.comment-delete {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.comment-like-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.comment-like-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: #eef4ff;
}

.comment-reply-btn {
  min-height: 30px;
  margin-top: 8px;
  margin-left: 6px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.comment-replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.popular-comment {
  padding: 10px;
  border-radius: 8px;
  background: rgba(37,99,235,0.055);
}

.popular-comments-preview {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(37,99,235,0.14);
  border-radius: 8px;
  background: rgba(37,99,235,0.055);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.popular-comment-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.popular-comment-chip > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-like-btn .post-icon {
  width: 16px;
  height: 16px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.comment-form textarea {
  min-height: 86px;
  padding: 12px;
  resize: vertical;
}

.guest-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.empty-wall,
.empty-line {
  padding: 16px 0;
  font-size: 14px;
}

.search-wrap {
  margin-bottom: 14px;
}

.people-list,
.blocks-list {
  display: grid;
  gap: 10px;
}

.people-list.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 20px;
}

.directory-tools,
.profile-editor {
  padding: 6px 0 18px;
}

.address-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-input span {
  color: var(--muted);
  font-weight: 700;
}

.address-input .field-input {
  flex: 1;
  min-width: 0;
}

.person {
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.person-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.person-main:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.person-copy {
  display: grid;
  gap: 2px;
}

.person-copy strong,
.person-copy small,
.person-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy em {
  font-size: 12px;
  font-style: normal;
}

.person .soft-btn,
.person .danger-btn,
.blocked-user .soft-btn {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.block-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.block-title {
  margin-bottom: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.blocked-user {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.blocked-wide {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.feature-hub {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.notification-row {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23,32,51,0.045);
}

.primary-feature,
.notification-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-card h3,
.notification-row strong {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
}

.feature-card p,
.notification-row p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.feature-icon,
.notification-row > span {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(15,159,122,0.16));
  border: 1px solid rgba(37,99,235,0.12);
}

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

.profile-editor {
  max-width: 560px;
}

.profile-hero {
  margin: 0 0 18px;
  border-bottom: 1px solid var(--border);
}

.profile-cover {
  min-height: 170px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20,184,166,0.34), rgba(99,102,241,0.28)),
    rgba(255,255,255,0.04);
  background-size: cover;
  background-position: center;
}

.profile-hero-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 0 16px;
  margin-top: -34px;
}

.profile-hero-avatar {
  width: 76px;
  height: 76px;
  font-size: 24px;
  border: 4px solid var(--panel);
}

.profile-hero-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0 0 6px;
}

.profile-hero-copy strong {
  font-size: 22px;
}

.profile-hero-copy span,
.profile-hero-copy p,
.readonly-line,
.field-status {
  color: var(--muted);
}

.profile-hero-copy p {
  margin-top: 4px;
}

.profile-editor-preview {
  position: relative;
  margin-bottom: 18px;
  padding-bottom: 28px;
}

.preview-cover {
  min-height: 150px;
}

.profile-editor-avatar {
  position: absolute;
  left: 16px;
  bottom: -22px;
  width: 74px;
  height: 74px;
  font-size: 24px;
  border: 4px solid var(--panel);
}

.readonly-line {
  margin-bottom: 14px;
  font-weight: 700;
}

.file-input {
  padding-top: 11px;
}

.field-status {
  min-height: 18px;
  margin-top: -8px;
  margin-bottom: 12px;
  font-size: 12px;
}

.field-status.is-error {
  color: var(--danger);
}

.public-id-link {
  width: fit-content;
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.profile-editor .primary-btn {
  margin-top: 16px;
}

.identity-hero {
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.identity-cover {
  min-height: 220px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20,184,166,0.38), rgba(99,102,241,0.26)),
    radial-gradient(circle at 18% 22%, rgba(245,158,11,0.22), transparent 32%),
    rgba(255,255,255,0.04);
  background-size: cover;
  background-position: center;
}

.group-cover {
  background:
    linear-gradient(135deg, var(--group-accent), rgba(20,184,166,0.25)),
    radial-gradient(circle at 78% 24%, rgba(255,255,255,0.24), transparent 28%),
    rgba(255,255,255,0.04);
}

.identity-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 0 18px;
  margin-top: -48px;
}

.identity-avatar {
  width: 104px;
  height: 104px;
  font-size: 30px;
  border: 5px solid var(--panel);
  box-shadow: 0 12px 28px rgba(0,0,0,0.26), inset 0 0 0 1px rgba(255,255,255,0.16);
}

.group-avatar.identity-avatar {
  width: 104px;
  height: 104px;
  font-size: 30px;
  flex: 0 0 auto;
  border-radius: 22px;
}

.identity-copy {
  min-width: 0;
  padding-bottom: 8px;
}

.identity-copy h2 {
  font-family: 'Syne', sans-serif;
  font-size: 30px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.identity-address,
.identity-actions,
.identity-grid,
.members-head,
.members-preview,
.member-chip {
  display: flex;
  align-items: center;
}

.identity-address {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.identity-address span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
}

.identity-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-bottom: 10px;
}

.identity-action:disabled {
  opacity: 0.7;
  cursor: default;
}

.identity-grid {
  align-items: stretch;
  gap: 14px;
  margin-top: 18px;
}

.group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.8fr);
}

.group-grid .identity-wall-card {
  grid-column: 1 / -1;
}

.identity-info,
.identity-wall-card,
.identity-members {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.identity-info h3,
.identity-wall-card h3,
.identity-members h3 {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  line-height: 1.2;
}

.identity-info p,
.identity-wall-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.identity-info dl {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.identity-info dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.identity-info dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.identity-info dd,
.identity-info a,
.text-link {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.identity-info a,
.text-link {
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.text-link:hover,
.identity-info a:hover {
  color: var(--teal);
}

.identity-wall-card {
  flex: 0 0 260px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.identity-wall-card > span {
  align-self: flex-start;
  color: var(--teal);
  font-weight: 800;
  white-space: nowrap;
}

.identity-members {
  display: grid;
  gap: 12px;
}

.members-head {
  justify-content: space-between;
  gap: 12px;
}

.members-head span {
  min-width: 34px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(20,184,166,0.18);
}

.members-preview {
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  max-width: 100%;
  gap: 8px;
  padding: 7px 9px 7px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
}

.member-chip span:last-child {
  min-width: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer {
  background: rgba(255,255,255,0.018);
}

.composer-group {
  border-color: rgba(20,184,166,0.24);
}

.feed-list {
  display: grid;
  gap: 12px;
}

.post {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23,32,51,0.055);
}

.post-detail {
  border: 1px solid var(--border);
}

.group-profile {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 8px 0 18px;
}

.group-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
}

.group-info {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.group-info strong {
  font-size: 20px;
}

.group-info span,
.group-info p {
  color: var(--muted);
}

.group-info p {
  margin: 0;
  line-height: 1.5;
}

.group-owner-link {
  width: fit-content;
}

@media (max-width: 1180px) {
  .social-shell {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  }

  .people-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .people-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .social-topbar {
    min-height: 58px;
    padding: 0 14px;
  }

  .social-shell {
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-panel,
  .people-panel {
    position: static;
    padding: 14px;
  }

  .app-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-btn {
    min-height: 42px;
    text-align: center;
  }

  .wall-panel {
    min-height: auto;
  }

  .wall-header {
    align-items: flex-start;
    padding: 16px;
  }

  .wall-header h1 {
    font-size: 22px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .composer,
  .feed-list,
  .view-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .people-list.wide,
  .people-list.compact,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .post-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .identity-cover {
    min-height: 180px;
  }

  .identity-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .identity-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 0;
  }

  .identity-grid,
  .group-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .identity-wall-card {
    flex-basis: auto;
  }
}

@media (max-width: 820px) {
  .admin-columns,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .chat-back-btn {
    display: inline-flex;
  }

  .message-actions {
    opacity: 1;
    transform: none;
    overflow-x: auto;
  }

  .story-viewer {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .guest-action {
    padding: 0 10px;
  }

  .wall-header,
  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .post-actions {
    width: 100%;
  }

  .post-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .post-action {
    min-width: 0;
    min-height: 42px;
    padding: 0 8px;
  }

  .header-actions .soft-btn,
  .media-picker .soft-btn,
  .composer-actions .primary-btn {
    width: 100%;
  }

  .comments-box,
  .inline-comments {
    padding: 14px;
  }

  .media-hint {
    width: 100%;
  }

  .media-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-menu {
    grid-template-columns: 1fr;
  }

  .person {
    align-items: stretch;
    flex-direction: column;
  }

  .person .soft-btn,
  .person .danger-btn {
    width: 100%;
  }

  .comments-box {
    padding: 14px;
  }

  .identity-main {
    grid-template-columns: 1fr;
    justify-items: start;
    margin-top: -42px;
    padding: 0 14px;
  }

  .identity-avatar {
    width: 92px;
    height: 92px;
    font-size: 26px;
  }

  .group-avatar.identity-avatar {
    width: 92px;
    height: 92px;
    font-size: 26px;
  }

  .identity-copy h2 {
    font-size: 24px;
  }

  .identity-actions,
  .identity-actions .identity-action {
    width: 100%;
  }

  .identity-info dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .identity-wall-card {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .post-media-double,
  .post-media-grid,
  .media-preview {
    grid-template-columns: 1fr;
  }

  .post-actions {
    gap: 5px;
  }

  .post-action {
    min-height: 38px;
    gap: 4px;
    padding: 0 6px;
  }

  .post-icon {
    width: 18px;
    height: 18px;
  }
}

/* Messenger */
body[data-view="messages"] {
  overflow: hidden;
}

body[data-view="messages"] .profile-panel,
body[data-view="messages"] .people-panel,
body[data-view="messages"] .wall-header,
body[data-view="messages"] .composer,
body[data-view="messages"] .feed-list {
  display: none !important;
}

body[data-view="messages"] .social-shell {
  width: min(1180px, calc(100vw - 28px));
  min-height: calc(100dvh - 78px);
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 0;
  margin: 0 auto;
}

body[data-view="messages"] .wall-panel {
  min-height: calc(100dvh - 106px);
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #0a0d14;
}

body[data-view="messages"] .view-body {
  height: 100%;
  min-height: calc(100dvh - 106px);
  padding: 0;
}

.messenger-shell {
  height: min(820px, calc(100dvh - 106px));
  min-height: 620px;
  display: grid;
  grid-template-columns: 342px minmax(0, 1fr);
  overflow: hidden;
  color: #eef3fb;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)),
    #090c13;
}

.messenger-shell .chat-list-panel,
.messenger-shell .chat-thread-panel,
.messenger-shell .chat-empty {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.messenger-shell .chat-list-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: #0d111a;
}

.messenger-head,
.messenger-head-actions,
.chat-thread-head,
.composer-row,
.message-meta-line,
.reaction-pills,
.quick-reactions,
.chat-info-actions {
  display: flex;
  align-items: center;
}

.messenger-head {
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
}

.messenger-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.messenger-head small,
.chat-row-copy small,
.chat-row-meta,
.chat-thread-head small,
.chat-info-panel p,
.voice-duration {
  color: #8f9bad;
}

.messenger-head-actions {
  gap: 6px;
}

.messenger-shell .icon-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.055);
  color: #c9d4e4;
}

.messenger-shell .icon-action:hover {
  background: rgba(75, 132, 255, 0.18);
  color: #fff;
}

.messenger-search {
  height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}

.messenger-search svg {
  width: 17px;
  height: 17px;
  color: #8f9bad;
}

.messenger-search input,
.chat-search-bar input,
.emoji-search,
.chat-composer textarea {
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #eef3fb;
}

.messenger-filters {
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.messenger-filters button,
.messenger-unread-toggle {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: #b7c1d0;
}

.messenger-filters button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
}

.messenger-filters button.active {
  color: #fff;
  background: rgba(75,132,255,0.22);
  border-color: rgba(96,165,250,0.36);
}

.messenger-unread-toggle {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 0 10px;
  font-size: 12px;
}

.messenger-unread-toggle input {
  accent-color: #4b84ff;
}

.messenger-shell .chat-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: auto;
}

.messenger-shell .chat-row {
  min-height: 62px;
  padding: 8px;
  border-radius: 10px;
  gap: 9px;
}

.messenger-shell .chat-row:hover,
.messenger-shell .chat-row.active {
  border-color: transparent;
  background: rgba(255,255,255,0.075);
}

.messenger-shell .chat-row.unread .chat-row-copy strong {
  color: #fff;
}

.messenger-shell .chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.chat-avatar.large {
  width: 82px;
  height: 82px;
  font-size: 24px;
}

.chat-avatar.tiny,
.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.chat-avatar i {
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 3px #0d111a;
}

.chat-row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-row-title strong,
.chat-row-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-title em,
.tick {
  display: inline-grid;
  place-items: center;
  color: #7f8da1;
}

.chat-row-title em svg,
.tick svg {
  width: 14px;
  height: 14px;
}

.tick.read {
  color: #5fb3ff;
}

.chat-row-meta {
  align-self: stretch;
  display: grid;
  justify-items: end;
  align-content: space-between;
  font-size: 11px;
}

.verified-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  background: #4b84ff;
  position: relative;
}

.verified-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 5px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.messenger-shell .unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #4b84ff;
  box-shadow: none;
}

.messenger-shell .chat-suggestions {
  margin: 0;
  padding: 10px 0 0;
}

.messenger-shell .suggestion-row {
  min-height: 46px;
  padding: 6px;
  border-radius: 10px;
}

.messenger-shell .chat-thread-panel {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #090c13;
}

.chat-thread-head {
  min-height: 58px;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(13,17,26,0.96);
}

.chat-head-person {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-head-person > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-head-person strong {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0d111a;
}

.chat-search-bar input,
.emoji-search {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.06);
}

.messenger-shell .chat-messages {
  min-height: 0;
  gap: 2px;
  padding: 14px 14px 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent),
    #090c13;
}

.message-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.message-row.mine {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.message-row.grouped .message-avatar:not(.spacer) {
  visibility: hidden;
}

.message-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-avatar.spacer {
  opacity: 0;
}

.message-row.search-active .message-bubble {
  box-shadow: 0 0 0 2px rgba(95,179,255,0.45);
}

.message-row.selected .message-bubble {
  box-shadow: 0 0 0 2px rgba(116,215,196,0.48);
}

.messenger-shell .message-bubble {
  position: relative;
  width: fit-content;
  max-width: min(68ch, 72%);
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: #1a202c;
  color: #eef3fb;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.messenger-shell .message-bubble.mine {
  background: #2b6fdd;
  border-bottom-right-radius: 5px;
}

.messenger-shell .message-bubble.theirs {
  border-bottom-left-radius: 5px;
}

.message-bubble.deleted {
  color: #8f9bad;
  font-style: italic;
}

.message-bubble p {
  margin: 0;
  line-height: 1.42;
}

.message-bubble mark {
  padding: 0 2px;
  border-radius: 3px;
  color: #07101f;
  background: #facc15;
}

.message-author,
.message-forwarded,
.message-reply {
  font-size: 12px;
  font-weight: 700;
}

.message-author {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #74d7c4;
}

.message-reply,
.message-forwarded {
  padding-left: 8px;
  border-left: 2px solid rgba(255,255,255,0.32);
  color: rgba(255,255,255,0.78);
}

.message-meta-line {
  justify-content: flex-end;
  gap: 5px;
  min-height: 14px;
  color: rgba(255,255,255,0.68);
  font-size: 11px;
}

.message-more {
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  opacity: 0;
  transform: translateY(-50%);
  cursor: pointer;
}

.message-bubble.mine .message-more {
  right: auto;
  left: calc(100% + 6px);
}

.message-bubble:hover .message-more,
.message-bubble:focus-within .message-more {
  opacity: 1;
}

.message-system,
.chat-day {
  justify-self: center;
  align-self: center;
  margin: 8px 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: #9aa6b8;
  font-size: 12px;
}

.message-media {
  max-width: 280px;
  border-radius: 12px;
}

.message-media img {
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
}

.message-video {
  width: min(320px, 68vw);
  border-radius: 12px;
  overflow: hidden;
}

.message-video video {
  width: 100%;
  display: block;
}

.message-file {
  min-width: 220px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  background: rgba(0,0,0,0.18);
}

.message-file span {
  grid-row: span 2;
}

.message-file strong,
.message-file small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-message {
  min-width: 210px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.voice-play {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.voice-waveform {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.voice-waveform span {
  width: 3px;
  min-height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.reaction-pills {
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.reaction-pills button {
  height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #eaf1fb;
  font-size: 12px;
}

.reaction-pills button.mine {
  border-color: rgba(95,179,255,0.55);
  background: rgba(95,179,255,0.2);
}

.chat-composer {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(13,17,26,0.98);
}

.composer-row {
  gap: 8px;
}

.chat-composer textarea {
  min-height: 38px;
  max-height: 112px;
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.065);
}

.attachment-preview,
.voice-recorder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.attachment-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,0.22);
}

.attachment-thumb img,
.attachment-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview strong,
.attachment-preview small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-menu,
.emoji-panel,
.chat-menu-sheet,
.message-context-menu,
.chat-info-panel {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(17,22,33,0.98);
  box-shadow: 0 18px 50px rgba(0,0,0,0.36);
}

.attachment-menu {
  position: absolute;
  left: 12px;
  bottom: calc(100% - 2px);
  z-index: 8;
  width: 250px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
}

.attachment-menu button,
.chat-menu-sheet button,
.message-context-menu button,
.forward-picker button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #dbe5f3;
  cursor: pointer;
  text-align: left;
}

.attachment-menu button:hover,
.chat-menu-sheet button:hover,
.message-context-menu button:hover,
.forward-picker button:hover {
  background: rgba(255,255,255,0.07);
}

.danger {
  color: #ff6b7a !important;
}

.emoji-panel {
  position: absolute;
  right: 64px;
  bottom: calc(100% - 2px);
  z-index: 9;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
}

.emoji-tabs,
.emoji-categories {
  display: flex;
  gap: 6px;
}

.emoji-tabs button,
.emoji-categories button,
.emoji-grid button {
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,0.055);
  color: #fff;
  cursor: pointer;
}

.emoji-tabs button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.emoji-tabs button.active {
  background: rgba(75,132,255,0.26);
}

.emoji-categories {
  overflow-x: auto;
}

.emoji-categories button {
  min-width: 32px;
  height: 30px;
}

.emoji-grid {
  max-height: 218px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  overflow: auto;
}

.emoji-grid button {
  height: 34px;
  font-size: 20px;
}

.sticker-grid {
  min-height: 180px;
}

.voice-recorder {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.voice-recorder.preview {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.voice-recorder audio {
  width: 100%;
  min-width: 0;
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d61;
  animation: pulse-record 1s ease-in-out infinite;
}

@keyframes pulse-record {
  50% { opacity: 0.35; transform: scale(0.75); }
}

.upload-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.upload-progress span {
  display: block;
  height: 100%;
  background: #5fb3ff;
}

.chat-menu-sheet {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 12;
  width: 270px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
}

.message-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2,6,14,0.38);
}

.message-context-menu {
  position: fixed;
  left: min(var(--ctx-x, 50vw), calc(100vw - 292px));
  top: min(var(--ctx-y, 50vh), calc(100vh - 420px));
  width: 280px;
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 14px;
}

.message-context-focus {
  position: fixed;
  z-index: 81;
  left: clamp(8px, var(--ctx-x, 50vw), calc(100vw - 320px));
  top: clamp(72px, calc(var(--ctx-y, 50vh) - 86px), calc(100vh - 520px));
  width: min(320px, calc(100vw - 16px));
  display: grid;
  pointer-events: none;
}

.message-context-focus.mine {
  justify-items: end;
}

.message-context-focus .message-bubble {
  box-shadow: 0 18px 46px rgba(0,0,0,0.38), 0 0 0 1px rgba(255,255,255,0.12);
}

.quick-reactions {
  justify-content: space-between;
  gap: 4px;
  padding: 4px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
}

.quick-reactions button {
  min-height: 34px;
  justify-content: center;
  padding: 0 7px;
  font-size: 18px;
}

.quick-reactions button:last-child {
  font-size: 12px;
}

.forward-picker {
  display: grid;
  gap: 2px;
}

.chat-info-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  width: min(320px, 100%);
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  overflow: auto;
}

.chat-info-close {
  justify-self: end;
}

.chat-info-panel h3,
.chat-info-panel p {
  margin: 0;
  text-align: center;
}

.chat-info-section {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.chat-info-section > span,
.chat-info-section > a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #dbe5f3;
  text-decoration: none;
}

@media (max-width: 820px) {
  body[data-view="messages"] .social-topbar,
  body[data-view="messages"] .bottom-nav {
    display: none !important;
  }

  body[data-view="messages"] .social-shell,
  body[data-view="messages"] .wall-panel,
  body[data-view="messages"] .view-body {
    width: 100vw;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
  }

  .messenger-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .messenger-shell .chat-list-panel,
  .messenger-shell .chat-thread-panel {
    grid-area: 1 / 1;
  }

  .messenger-shell .chat-thread-panel {
    display: none;
  }

  .messenger-shell.is-chat-open .chat-list-panel {
    display: none;
  }

  .messenger-shell.is-chat-open .chat-thread-panel {
    display: grid;
  }

  .messenger-shell .chat-list-panel {
    border-right: 0;
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  }

  .chat-thread-head {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .chat-back-btn {
    display: inline-grid;
  }

  .messenger-shell .message-bubble {
    max-width: min(82vw, 560px);
  }

  .message-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
  }

  .message-avatar {
    width: 26px;
    height: 26px;
  }

  .message-more {
    opacity: 1;
    width: 26px;
    height: 26px;
  }

  .chat-composer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .composer-row {
    gap: 6px;
  }

  .messenger-shell .icon-action {
    width: 36px;
    height: 36px;
  }

  .emoji-panel,
  .attachment-menu {
    left: 8px;
    right: 8px;
    bottom: calc(100% - 2px);
    width: auto;
  }

  .chat-menu-sheet {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    border-radius: 16px;
  }

  .message-context-menu {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
  }
}

/* Dark mobile app shell */
.social-topbar {
  background: rgba(7, 10, 18, 0.72);
  border-bottom-color: var(--border);
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
}

.brand,
.author-link,
.person-main,
.popular-comments-preview,
.side-link {
  color: var(--text);
}

.brand-mark {
  color: var(--teal);
  filter: drop-shadow(0 0 14px rgba(45,212,191,0.45));
}

.icon-btn,
.soft-btn,
.danger-btn,
.action-btn,
.menu-btn,
.side-link {
  background: var(--panel-soft);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(16px);
}

.primary-btn {
  min-height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  box-shadow: 0 12px 30px var(--glow);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #8b6cff, #2dd4bf);
}

.soft-btn.active,
.action-btn.active,
.menu-btn.active {
  color: #fff;
  border-color: rgba(124,92,255,0.48);
  background: rgba(124,92,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.social-shell {
  width: min(1320px, 100%);
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

.profile-panel,
.wall-panel,
.people-panel,
.feature-card,
.notification-row,
.comments-box,
.inline-comments,
.identity-info,
.identity-wall-card,
.identity-members,
.profile-editor {
  background: var(--glass);
  border-color: var(--border);
  box-shadow: 0 22px 60px rgba(0,0,0,0.26);
  backdrop-filter: blur(22px);
}

.wall-panel {
  border-radius: 22px;
}

.wall-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), transparent);
}

.wall-header h1,
.profile-name,
.feature-card h3,
.notification-row strong,
.identity-copy h2,
.identity-info h3,
.identity-wall-card h3,
.identity-members h3,
.block-title,
.section-head h3 {
  font-family: 'Syne', 'Inter', sans-serif;
  letter-spacing: 0;
}

.composer,
.post {
  border-color: var(--border);
}

.composer {
  background:
    linear-gradient(135deg, rgba(124,92,255,0.12), rgba(45,212,191,0.065)),
    rgba(255,255,255,0.025);
}

.composer-focus {
  animation: composer-pulse 0.8s ease;
}

@keyframes composer-pulse {
  0% { box-shadow: inset 0 0 0 1px rgba(124,92,255,0); }
  45% { box-shadow: inset 0 0 0 1px rgba(124,92,255,0.7), 0 0 42px rgba(124,92,255,0.18); }
  100% { box-shadow: inset 0 0 0 1px rgba(124,92,255,0); }
}

.composer textarea,
.comment-form textarea,
.field-input {
  background: rgba(255,255,255,0.065);
  color: var(--text);
  border-color: var(--border);
}

.composer textarea::placeholder,
.comment-form textarea::placeholder,
.field-input::placeholder {
  color: rgba(147,160,184,0.78);
}

.selected-media,
.person,
.guest-box,
.popular-comments-preview {
  background: rgba(255,255,255,0.052);
  border-color: var(--border);
}

.post {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    rgba(12,16,26,0.72);
  box-shadow: 0 18px 46px rgba(0,0,0,0.22);
  animation: post-enter 0.34s ease both;
}

@keyframes post-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.post-content {
  color: #e8edf7;
}

.post-media-frame {
  position: relative;
  width: 100%;
  display: block;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #05070d;
  cursor: zoom-in;
}

.post-media-item {
  border-color: rgba(255,255,255,0.08);
  border-radius: 16px;
}

.post-media-frame .post-media-item {
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.post-media-frame:hover .post-media-item {
  transform: scale(1.018);
  opacity: 0.92;
}

.post-action {
  min-width: 58px;
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.09);
  color: var(--muted);
}

.post-action:hover,
.comment-like-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.095);
  border-color: rgba(45,212,191,0.32);
}

.post-action-static,
.post-action-static:hover {
  background: rgba(255,255,255,0.035);
}

.comments-box,
.inline-comments {
  background: rgba(255,255,255,0.045);
}

.comment-sort {
  background: rgba(255,255,255,0.052);
}

.comment-sort button.active {
  color: #fff;
  background: rgba(124,92,255,0.24);
}

.popular-comment {
  background: rgba(124,92,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(124,92,255,0.16);
}

.identity-cover,
.profile-cover {
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(124,92,255,0.46), rgba(45,212,191,0.20)),
    radial-gradient(circle at 76% 20%, rgba(244,114,182,0.22), transparent 28%),
    #101827;
}

.identity-avatar,
.profile-editor-avatar {
  border-color: rgba(17,22,34,0.95);
}

.identity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.identity-stats span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--muted);
  font-size: 13px;
}

.identity-stats strong {
  color: var(--text);
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 18px 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  overflow-x: auto;
}

.profile-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.profile-tabs button.active,
.profile-tabs button:hover {
  color: #fff;
  background: rgba(124,92,255,0.2);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: min(560px, calc(100% - 22px));
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr 1fr 76px 1fr 1fr;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 26px;
  background: rgba(10,14,24,0.72);
  box-shadow: 0 22px 70px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(26px);
  transform: translateX(-50%);
}

.bottom-nav-item,
.bottom-nav-fab,
.icon-action {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.bottom-nav-item {
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 700;
}

.bottom-nav-item svg,
.bottom-nav-fab svg,
.icon-action svg,
.video-play svg,
.video-fullscreen svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: #fff;
  background: rgba(255,255,255,0.085);
}

.bottom-nav-item.active svg {
  filter: drop-shadow(0 0 10px rgba(124,92,255,0.65));
}

.bottom-nav-item:active,
.bottom-nav-fab:active,
.icon-action:active {
  transform: scale(0.94);
}

.bottom-nav-fab {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  justify-self: center;
  margin-top: -26px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,0.55), transparent 20%),
    linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 0 0 8px rgba(124,92,255,0.12), 0 18px 34px rgba(34,211,238,0.22), 0 0 42px rgba(124,92,255,0.5);
}

.social-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.social-dashboard article,
.friend-card,
.chat-list-panel,
.chat-thread-panel,
.chat-empty {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.052);
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  backdrop-filter: blur(18px);
}

.social-dashboard article {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 18px;
}

.social-dashboard strong {
  font-size: 25px;
}

.social-dashboard span,
.section-head span {
  color: var(--muted);
  font-size: 12px;
}

.friends-hub,
.friend-section {
  display: grid;
  gap: 14px;
}

.friend-section {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friend-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
}

.friend-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.friend-main > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.friend-main small,
.friend-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.friend-actions,
.person-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-action {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.055);
}

.icon-action:hover {
  color: #fff;
  background: rgba(124,92,255,0.2);
}

.chat-layout {
  min-height: min(740px, calc(100vh - 180px));
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 20px;
}

.chat-list-panel,
.chat-thread-panel {
  min-width: 0;
  border-radius: 22px;
  overflow: hidden;
}

.chat-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.chat-search {
  margin-bottom: 10px;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
}

.chat-row,
.suggestion-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chat-row {
  min-height: 68px;
  padding: 10px;
}

.chat-row:hover,
.chat-row.active,
.suggestion-row:hover {
  background: rgba(255,255,255,0.075);
  border-color: var(--border);
}

.chat-row:active,
.suggestion-row:active {
  transform: scale(0.98);
}

.chat-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar i {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px #111622;
}

.chat-row-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.chat-row-copy strong,
.chat-row-copy small,
.suggestion-row strong,
.suggestion-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-copy small,
.suggestion-row small {
  color: var(--muted);
  font-size: 12px;
}

.unread-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.chat-suggestions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.suggestion-row {
  min-height: 48px;
  padding: 6px;
}

.suggestion-row > span:last-child {
  min-width: 0;
  display: grid;
}

.chat-thread-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}

.chat-thread-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-thread-head small {
  color: var(--teal);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  overflow: auto;
  background:
    radial-gradient(circle at 14% 20%, rgba(124,92,255,0.10), transparent 28%),
    radial-gradient(circle at 88% 70%, rgba(45,212,191,0.08), transparent 30%);
}

.chat-day {
  align-self: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
}

.message-bubble {
  max-width: min(76%, 520px);
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  animation: message-in 0.22s ease both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message-bubble.mine {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, rgba(124,92,255,0.88), rgba(34,211,238,0.62));
  color: #fff;
}

.message-bubble.theirs {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgba(255,255,255,0.075);
}

.message-author {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.message-bubble p {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message-bubble time {
  justify-self: end;
  color: rgba(255,255,255,0.68);
  font-size: 11px;
}

.message-media {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #05070d;
  cursor: zoom-in;
}

.message-media img {
  display: block;
  width: min(260px, 100%);
  max-height: 260px;
  object-fit: cover;
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 120px;
}

.voice-wave span {
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
  animation: wave 1s ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-delay: 0.12s; }
.voice-wave span:nth-child(3) { animation-delay: 0.24s; }
.voice-wave span:nth-child(4) { animation-delay: 0.36s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.chat-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(7,10,18,0.44);
}

.chat-composer textarea {
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  outline: none;
}

.chat-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
}

.chat-empty p {
  max-width: 320px;
  color: var(--muted);
}

.notification-row {
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.video-shell {
  cursor: default;
}

.video-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(7,10,18,0.56);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-shell:hover .video-controls,
.video-shell:focus-within .video-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-play,
.video-fullscreen {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.13);
  color: #fff;
  cursor: pointer;
}

.video-progress {
  width: 100%;
  accent-color: var(--teal);
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2,4,10,0.72);
  backdrop-filter: blur(26px);
}

.media-modal[hidden] {
  display: none;
}

.modal-card,
.viewer-shell {
  width: min(920px, 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(12,16,26,0.88);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  overflow: hidden;
}

.modal-head,
.modal-actions,
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.crop-stage {
  position: relative;
  width: min(680px, calc(100vw - 52px));
  aspect-ratio: 1 / 1;
  margin: 18px auto;
  border-radius: 24px;
  overflow: hidden;
  background: #05070d;
  touch-action: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12);
}

.cover-crop {
  aspect-ratio: 1440 / 520;
}

.crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  transform-origin: center;
  cursor: grab;
}

.crop-stage img:active {
  cursor: grabbing;
}

.range-label {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
  color: var(--muted);
  font-weight: 700;
}

.range-label input {
  width: 100%;
  accent-color: var(--accent);
}

.editor-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.viewer-shell {
  position: relative;
  width: min(1180px, 100%);
  height: min(820px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.viewer-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.viewer-stage img,
.viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  touch-action: none;
  transition: transform 0.12s ease;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(7,10,18,0.62);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.viewer-nav svg {
  width: 24px;
  height: 24px;
}

.viewer-nav.prev { left: 14px; }
.viewer-nav.next { right: 14px; }

.skeleton-post {
  pointer-events: none;
}

.skeleton-head {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.skeleton-head span,
.skeleton-head i,
.skeleton-post p,
.skeleton-media {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.13), rgba(255,255,255,0.055));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.25s linear infinite;
}

.skeleton-head span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-head div {
  flex: 1;
  display: grid;
  gap: 8px;
  align-content: center;
}

.skeleton-head i:first-child { width: 42%; height: 14px; }
.skeleton-head i:last-child { width: 26%; height: 11px; }
.skeleton-post p { width: 88%; height: 12px; margin: 9px 0; }
.skeleton-post p:nth-of-type(2) { width: 64%; }
.skeleton-media { height: 220px; margin-top: 16px; border-radius: 18px; }

@keyframes skeleton-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (max-width: 1100px) {
  .social-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-panel,
  .people-panel {
    display: none;
  }
}

@media (min-width: 1100px) {
  .bottom-nav {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .social-topbar {
    position: fixed;
    left: 0;
    right: 0;
    min-height: 56px;
  }

  .social-shell {
    padding: 70px 10px calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .wall-panel {
    min-height: calc(100vh - 190px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    background: transparent;
    box-shadow: none;
  }

  .wall-header {
    padding: 14px 10px;
    border: 0;
  }

  .wall-header h1 {
    font-size: 24px;
  }

  .composer,
  .feed-list,
  .view-body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .post {
    border-radius: 20px;
    padding: 15px;
  }

  .friend-grid,
  .people-list.wide,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    min-height: auto;
  }

  .chat-list-panel {
    max-height: 360px;
  }

  .chat-thread-panel {
    min-height: 560px;
  }

  .chat-composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .chat-composer .primary-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .social-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .social-dashboard article {
    min-height: 68px;
    border-radius: 16px;
  }

  .social-dashboard strong {
    font-size: 20px;
  }

  .bottom-nav {
    width: calc(100% - 16px);
    min-height: 70px;
    grid-template-columns: 1fr 1fr 70px 1fr 1fr;
    border-radius: 24px;
    padding: 8px;
  }

  .bottom-nav-fab {
    width: 60px;
    height: 60px;
  }

  .bottom-nav-item span {
    font-size: 10px;
  }

  .person-actions,
  .friend-actions {
    width: 100%;
  }

  .person-actions .soft-btn,
  .person-actions .danger-btn,
  .person-actions .primary-btn,
  .friend-actions .soft-btn,
  .friend-actions .danger-btn,
  .friend-actions .primary-btn {
    flex: 1 1 auto;
  }

  .message-bubble {
    max-width: 88%;
  }

  .viewer-nav {
    width: 40px;
    height: 40px;
  }

  .modal-card,
  .viewer-shell {
    border-radius: 20px;
  }
}

/* Mine liquid glass design system */
html {
  color-scheme: dark;
  background: var(--bg-main);
}

body {
  background:
    radial-gradient(circle at 50% -18%, rgba(46, 211, 255, 0.10), transparent 34%),
    linear-gradient(180deg, var(--bg-main) 0%, var(--bg-soft) 48%, var(--bg-main) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 70%);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(46,211,255,0.72);
  outline-offset: 3px;
}

.social-topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 72px;
  padding: 0 max(24px, env(safe-area-inset-left));
  background: rgba(5, 10, 18, 0.72);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  backdrop-filter: var(--blur-glass);
}

.brand {
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-medium);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(123,97,255,0.32), rgba(46,211,255,0.14));
  color: #fff;
  font-weight: 800;
  box-shadow: none;
  filter: none;
}

.top-search {
  min-width: 280px;
  width: min(360px, 32vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
}

.top-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.top-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
}

.top-nav-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.top-nav-btn:hover,
.top-nav-btn.active {
  color: var(--text-main);
  background: rgba(255,255,255,0.07);
  border-color: var(--border-soft);
}

.icon-btn,
.soft-btn,
.danger-btn,
.action-btn,
.menu-btn,
.side-link,
.ghost-btn {
  min-height: 40px;
  border-radius: var(--radius-md);
  border-color: var(--border-soft);
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
  box-shadow: none;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.icon-btn:hover,
.soft-btn:hover,
.danger-btn:hover,
.action-btn:hover,
.menu-btn:hover,
.side-link:hover,
.ghost-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.primary-btn {
  min-height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  box-shadow: 0 10px 24px rgba(46,211,255,0.12);
}

.primary-btn:hover {
  background: var(--accent-gradient);
  box-shadow: 0 12px 28px rgba(123,97,255,0.16);
}

.compact-primary {
  min-height: 36px;
  padding: 0 14px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: pointer;
}

.danger-btn {
  color: var(--danger);
  border-color: rgba(255,107,138,0.16);
  background: rgba(255,107,138,0.07);
}

.social-shell {
  width: min(1380px, 100%);
  padding: 24px;
  grid-template-columns: minmax(220px, 260px) minmax(0, 720px) minmax(260px, 330px);
  justify-content: center;
  gap: 20px;
}

.profile-panel,
.wall-panel,
.people-panel,
.post,
.feature-card,
.notification-row,
.comments-box,
.inline-comments,
.identity-info,
.identity-wall-card,
.identity-members,
.profile-editor,
.friend-card,
.chat-list-panel,
.chat-thread-panel,
.chat-empty,
.settings-card {
  border: 1px solid var(--border-soft);
  background: var(--bg-card-subtle);
  box-shadow: 0 18px 48px rgba(0,0,0,0.22);
  backdrop-filter: var(--blur-glass);
}

.profile-panel,
.people-panel {
  border-radius: var(--radius-lg);
  top: 92px;
}

.wall-panel {
  border-radius: var(--radius-xl);
  overflow: visible;
}

.wall-header {
  padding: 22px;
  border-bottom: 0;
  background: transparent;
}

.wall-header h1 {
  font-size: 27px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
}

.header-actions {
  align-items: center;
}

.header-actions .soft-btn {
  border-radius: 999px;
  min-height: 36px;
}

.feed-prelude {
  padding: 0 20px 12px;
}

.story-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.story-rail::-webkit-scrollbar {
  display: none;
}

.story-item {
  width: 68px;
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.story-item small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.story-avatar,
.story-add span {
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.story-avatar {
  padding: 2px;
  border: 2px solid rgba(123,97,255,0.7);
  box-shadow: 0 0 0 3px rgba(46,211,255,0.08);
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.story-add span {
  border: 1px solid var(--border-medium);
  background: rgba(255,255,255,0.055);
  font-size: 26px;
}

.story-item.has-unviewed .story-avatar {
  box-shadow: 0 0 0 2px rgba(123,97,255,0.95), 0 0 0 5px rgba(46,211,255,0.24);
}

.story-viewer {
  position: relative;
  width: min(460px, calc(100vw - 24px));
  height: min(820px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-medium);
  border-radius: 28px;
  background: rgba(5,10,18,0.92);
  box-shadow: 0 32px 90px rgba(0,0,0,0.5);
  backdrop-filter: var(--blur-glass);
}

.story-progress {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
}

.story-progress span {
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,0.18);
}

.story-progress span.active {
  background: var(--accent-gradient);
}

.story-viewer-head,
.story-viewer-actions,
.message-meta-line,
.message-actions {
  display: flex;
  align-items: center;
}

.story-viewer-head {
  gap: 10px;
}

.story-viewer-head div {
  min-width: 0;
  flex: 1;
}

.story-viewer-head small {
  display: block;
  color: var(--text-secondary);
}

.story-media-shell {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
}

.story-media-shell img,
.story-media-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-media-shell p {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 82px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.38);
  color: #fff;
}

.story-nav {
  position: absolute;
  top: 78px;
  bottom: 78px;
  width: 36%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.story-prev { left: 0; }
.story-next { right: 0; }

.story-viewer-actions {
  gap: 8px;
}

.story-viewer-actions .field-input {
  flex: 1;
}

.search-page,
.admin-client-page {
  display: grid;
  gap: 16px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-result-list,
.search-results,
.admin-columns {
  display: grid;
  gap: 12px;
}

.search-result-row,
.admin-mini-row,
.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  text-align: left;
}

.search-result-row {
  cursor: pointer;
}

.search-result-row:hover {
  background: var(--bg-card-hover);
}

.result-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-weight: 800;
}

.search-result-row span:last-child,
.admin-mini-row {
  min-width: 0;
}

.search-result-row small,
.admin-mini-row small,
.admin-stat-card small {
  display: block;
  color: var(--text-secondary);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.admin-stat-card {
  display: grid;
}

.admin-stat-card strong {
  font-size: 24px;
}

.admin-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chat-back-btn {
  display: none;
}

.message-meta-line {
  gap: 8px;
  justify-content: flex-end;
  color: rgba(255,255,255,0.62);
  font-size: 11px;
}

.message-status,
.message-reaction-count {
  color: rgba(255,255,255,0.72);
}

.message-reaction-count {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.message-actions {
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.message-bubble:hover .message-actions,
.message-bubble:focus-within .message-actions {
  opacity: 1;
  transform: none;
}

.message-actions button {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  font-size: 11px;
}

.send-message-btn {
  background: var(--accent-gradient) !important;
  color: #fff !important;
}

.composer {
  margin: 0 20px 18px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.045);
}

.composer textarea {
  min-height: 78px;
  border: 0;
  background: transparent;
  padding: 6px;
}

.media-picker {
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.media-hint {
  color: var(--text-muted);
}

.feed-list {
  display: grid;
  gap: 18px;
}

.post {
  position: relative;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.05);
}

.post-head {
  align-items: flex-start;
}

.post-author small {
  color: var(--text-muted);
}

.post-content {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.62;
}

.post-menu {
  position: relative;
  z-index: 6;
  margin-left: auto;
}

.post-menu-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.post-menu-btn span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.post-menu-btn:hover {
  background: rgba(255,255,255,0.07);
}

.post-menu-popover,
.share-popover {
  position: absolute;
  z-index: 5000;
  right: 0;
  min-width: 190px;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(9,17,31,0.92);
  box-shadow: 0 18px 44px rgba(0,0,0,0.32);
  backdrop-filter: var(--blur-glass);
}

.post.menu-open {
  position: relative;
  z-index: 120;
}

.post:has(.post-menu-popover:not([hidden])),
.post:has(.share-popover:not([hidden])) {
  position: relative;
  z-index: 120;
}

.post-menu-popover {
  top: 38px;
}

.share-popover {
  top: auto;
  margin-top: 8px;
}

.post-menu-popover[hidden],
.share-popover[hidden] {
  display: none;
}

.post-menu-popover button,
.share-popover button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  padding: 0 10px;
}

.post-menu-popover button:hover,
.share-popover button:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.07);
}

.danger-menu-item {
  color: var(--danger) !important;
}

.post-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.post-action {
  min-width: 0;
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  border-color: transparent;
}

.like-btn.active,
.comment-like-btn.active {
  color: var(--like);
  border-color: rgba(255,92,138,0.20);
  background: rgba(255,92,138,0.09);
}

.comment-jump-btn.active,
.share-btn.active,
.share-btn.shared-flash {
  color: var(--success);
  border-color: rgba(41,230,167,0.18);
  background: rgba(41,230,167,0.08);
}

.post-media-frame,
.post-media-item {
  border-radius: var(--radius-md);
}

.comments-box,
.inline-comments {
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
}

.comment-sort {
  border-color: var(--border-soft);
  background: rgba(255,255,255,0.045);
}

.comment-sort button.active,
.profile-tabs button.active,
.notification-tabs button.active {
  color: #fff;
  background: rgba(123,97,255,0.20);
}

.comment-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.comment-form textarea {
  min-height: 46px;
  border-radius: var(--radius-md);
}

.identity-hero {
  padding: 0 0 18px;
  border-bottom: 0;
}

.identity-cover {
  min-height: 260px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(5,10,18,0.08), rgba(5,10,18,0.72)),
    radial-gradient(circle at 68% 12%, rgba(46,211,255,0.18), transparent 24%),
    linear-gradient(135deg, #101b31, #09111f);
}

.identity-main {
  align-items: center;
  min-height: 116px;
  margin: -58px 18px 0;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(7,17,31,0.68);
  backdrop-filter: var(--blur-glass);
}

.identity-avatar {
  width: 106px;
  height: 106px;
  border-color: var(--bg-soft);
}

.identity-copy h2 {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
}

.identity-state-label {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
}

.profile-tabs {
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
}

.identity-grid {
  padding: 0 18px;
}

.settings-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-lg);
}

.settings-card-head {
  display: grid;
  gap: 3px;
}

.settings-card-head span,
.settings-row small {
  color: var(--text-muted);
  font-size: 12px;
}

.settings-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 190px);
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.settings-row > span {
  display: grid;
  gap: 3px;
}

select.field-input {
  appearance: none;
  background-color: rgba(255,255,255,0.055);
}

.switch-input {
  appearance: none;
  justify-self: end;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  position: relative;
  transition: background var(--transition-normal);
}

.switch-input::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--transition-normal), background var(--transition-normal);
}

.switch-input:checked {
  background: rgba(46,211,255,0.26);
}

.switch-input:checked::before {
  transform: translateX(20px);
  background: #fff;
}

.chat-layout {
  min-height: min(760px, calc(100vh - 168px));
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.chat-list-panel,
.chat-thread-panel {
  border-radius: var(--radius-lg);
}

.chat-row.active,
.chat-row:hover,
.suggestion-row:hover {
  background: rgba(255,255,255,0.065);
}

.message-bubble.mine {
  background: linear-gradient(135deg, rgba(123,97,255,0.92), rgba(46,211,255,0.78));
}

.notification-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.notification-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.notification-tabs span {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
}

.compose-modal {
  width: min(620px, 100%);
}

.compose-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.compose-author {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.compose-author div {
  display: grid;
  gap: 2px;
}

.compose-author small,
.compose-counter {
  color: var(--text-muted);
  font-size: 12px;
}

.visibility-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
}

.visibility-pill svg {
  width: 16px;
  height: 16px;
}

.compose-body textarea {
  min-height: 210px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 18px;
}

.compose-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.compose-tool {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
  cursor: pointer;
}

.compose-tool svg {
  width: 22px;
  height: 22px;
}

.compose-tool:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .social-topbar {
    min-height: calc(58px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0;
  }

  .top-search,
  .top-nav-btn,
  .desktop-create-btn {
    display: none !important;
  }

  .social-shell {
    padding: calc(74px + env(safe-area-inset-top, 0px)) 10px calc(104px + env(safe-area-inset-bottom, 0px));
    display: block;
  }

  .wall-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .profile-panel,
  .people-panel {
    display: none;
  }

  .wall-header {
    padding: 4px 10px 16px;
  }

  .wall-header h1 {
    font-size: 25px;
  }

  .header-actions .soft-btn {
    display: none;
  }

  .feed-prelude,
  .composer,
  .feed-list,
  .view-body {
    padding-left: 8px;
    padding-right: 8px;
  }

  .composer {
    margin: 0 8px 16px;
  }

  .post {
    border-radius: var(--radius-lg);
  }

  .bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 80;
    width: min(430px, calc(100% - 20px));
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr 1fr 74px 1fr 1fr;
    align-items: center;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 25px;
    background: rgba(8, 16, 29, 0.74);
    box-shadow: 0 18px 42px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: var(--blur-glass);
    transform: translateX(-50%);
  }

  .bottom-nav-fab {
    width: 60px;
    height: 60px;
    margin-top: -22px;
    box-shadow: 0 8px 22px rgba(46,211,255,0.18);
  }

  .bottom-nav-item.active {
    background: rgba(255,255,255,0.07);
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-list-panel {
    max-height: 350px;
  }

  .chat-thread-panel {
    min-height: 560px;
  }

  .identity-cover {
    min-height: 210px;
  }

  .identity-main {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .identity-actions,
  .identity-actions .identity-action {
    width: 100%;
  }

  .settings-fields-grid,
  .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-row .switch-input {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .compose-modal {
    width: 100%;
    align-self: end;
    border-radius: 24px 24px 0 0;
  }

  .media-modal {
    place-items: end center;
    padding: 14px 10px 0;
  }

  .media-modal:has(.viewer-shell),
  .media-modal:has(.image-editor-card) {
    place-items: center;
    padding: 14px;
  }

  .compose-tools {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
  }

  .compose-tool {
    min-width: 58px;
  }

  .post-actions {
    gap: 6px;
  }

  .post-action {
    padding: 0 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

body[data-view="messages"] .messenger-shell .chat-list-panel {
  max-height: none;
}

body[data-view="messages"] .messenger-shell .chat-thread-panel {
  min-height: 0;
}

body[data-view="messages"] .messenger-shell .chat-composer {
  display: grid;
  grid-template-columns: none;
  align-items: stretch;
  gap: 8px;
  resize: none;
}

body[data-view="messages"] .messenger-shell .chat-composer textarea {
  resize: none;
}

body[data-view="messages"] .chat-back-btn {
  display: none;
}

@media (max-width: 820px) {
  body[data-view="messages"] .social-topbar,
  body[data-view="messages"] .bottom-nav {
    display: none !important;
  }

  body[data-view="messages"] .social-shell,
  body[data-view="messages"] .wall-panel,
  body[data-view="messages"] .view-body {
    width: 100vw;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
  }

  body[data-view="messages"] .chat-back-btn {
    display: inline-grid;
  }
}

/* Messenger stability, PWA viewport and mobile safe-area fixes */
html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #050a12;
  color-scheme: dark;
}

body {
  overscroll-behavior-x: none;
}

.social-shell,
.wall-panel,
.view-body,
.messenger-shell,
.chat-list-panel,
.chat-thread-panel,
.chat-messages,
.message-row,
.message-bubble,
.message-text,
.message-media,
.message-video,
.voice-message,
.attachment-preview,
.composer-row {
  max-width: 100%;
  min-width: 0;
}

body[data-view="messages"] .wall-panel,
body[data-view="messages"] .view-body,
body[data-view="messages"] .messenger-shell {
  overflow: hidden;
}

body[data-view="messages"] .chat-thread-panel {
  overflow: hidden;
  contain: layout paint;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body[data-view="messages"] .chat-thread-panel.has-search {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

body[data-view="messages"] .chat-messages {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

body[data-view="messages"] .message-row {
  width: 100%;
}

body[data-view="messages"] .message-bubble {
  max-width: min(76vw, 560px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-view="messages"] .message-text,
body[data-view="messages"] .message-reply,
body[data-view="messages"] .message-forwarded {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

body[data-view="messages"] .message-media,
body[data-view="messages"] .message-file,
body[data-view="messages"] .message-video,
body[data-view="messages"] .voice-message {
  width: 100%;
  max-width: 100%;
}

body[data-view="messages"] .message-media img,
body[data-view="messages"] .message-media video,
body[data-view="messages"] .message-video video {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

body[data-view="messages"] .message-file {
  min-width: 0;
}

body[data-view="messages"] .voice-message {
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

body[data-view="messages"] .voice-waveform {
  min-width: 0;
}

.send-message-btn {
  display: none !important;
}

.send-message-btn.is-visible {
  display: inline-grid !important;
  color: #fff;
  background: #2b6fdd;
}

.voice-action.is-hidden {
  display: none !important;
}

.composer-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(95,179,255,0.12);
  color: #dbeafe;
}

.composer-preview div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-preview small {
  min-width: 0;
  overflow: hidden;
  color: #9fb6d4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-older-messages,
.new-messages-jump {
  justify-self: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  color: #cbd5e1;
  cursor: pointer;
}

.load-older-messages {
  margin: 6px auto 10px;
  padding: 7px 12px;
}

.new-messages-jump {
  position: absolute;
  right: 18px;
  bottom: 82px;
  z-index: 9;
  padding: 8px 13px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.32);
}

@media (min-width: 821px) {
  body[data-view="messages"] .message-more {
    opacity: 0;
    pointer-events: none;
  }

  body[data-view="messages"] .message-bubble:hover .message-more,
  body[data-view="messages"] .message-bubble:focus-within .message-more {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 820px) {
  body[data-view="messages"] {
    overflow: hidden;
    min-height: var(--app-height, 100dvh);
    background: #050a12;
  }

  body[data-view="messages"] .social-topbar {
    display: none !important;
  }

  body[data-view="messages"]:not(.chat-open) .bottom-nav {
    display: grid !important;
  }

  body[data-view="messages"].chat-open .bottom-nav {
    display: none !important;
  }

  body[data-view="messages"] .social-shell,
  body[data-view="messages"] .wall-panel,
  body[data-view="messages"] .view-body,
  body[data-view="messages"] .messenger-shell {
    width: 100%;
    max-width: 100%;
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  body[data-view="messages"] .messenger-shell {
    height: var(--app-height, 100dvh);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="messages"]:not(.chat-open) .messenger-shell .chat-list-panel {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(108px + env(safe-area-inset-bottom, 0px));
  }

  body[data-view="messages"].chat-open .messenger-shell .chat-thread-panel {
    height: var(--app-height, 100dvh);
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body[data-view="messages"].chat-open .messenger-shell .chat-thread-panel.has-search {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body[data-view="messages"] .chat-thread-head {
    min-width: 0;
    min-height: calc(58px + env(safe-area-inset-top, 0px));
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  }

  body[data-view="messages"] .chat-head-person .chat-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  body[data-view="messages"] .chat-head-person strong,
  body[data-view="messages"] .chat-head-person small {
    max-width: 42vw;
  }

  body[data-view="messages"] .chat-thread-head .icon-action {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  body[data-view="messages"] .chat-messages {
    padding: 12px 8px 14px;
  }

  body[data-view="messages"] .message-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  body[data-view="messages"] .message-row.mine {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 14vw;
  }

  body[data-view="messages"] .message-row.theirs {
    padding-right: 14vw;
  }

  body[data-view="messages"] .message-bubble {
    max-width: min(78vw, 560px);
  }

  body[data-view="messages"] .message-more {
    display: none !important;
  }

  body[data-view="messages"] .message-context-backdrop {
    inset: 0;
    overflow: hidden;
    background: rgba(2,6,14,0.58);
  }

  body[data-view="messages"] .message-context-menu {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: calc(100vw - 16px);
  }

  body[data-view="messages"] .message-context-focus {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(292px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: calc(100vw - 16px);
  }

  body[data-view="messages"] .quick-reactions {
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-view="messages"] .chat-composer {
    position: sticky;
    bottom: 0;
    z-index: 15;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  body[data-view="messages"] .composer-row {
    align-items: end;
    gap: 6px;
  }

  body[data-view="messages"] .chat-composer textarea {
    min-height: 38px;
    max-height: 116px;
    overflow-y: auto;
    line-height: 1.35;
  }

  body[data-view="messages"] .emoji-panel,
  body[data-view="messages"] .attachment-menu {
    left: 8px;
    right: 8px;
    bottom: calc(100% + 8px);
    width: auto;
    max-width: calc(100vw - 16px);
  }

  body[data-view="messages"] .emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  body[data-view="messages"] .attachment-preview {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  body[data-view="messages"] .message-video {
    width: min(100%, 78vw);
  }

  body[data-view="messages"] .new-messages-jump {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mine social redesign: VK-like structure, Mine visual language */
input,
textarea,
select {
  font-size: 16px;
}

.top-nav-btn,
.menu-btn,
.bottom-nav-item {
  position: relative;
}

.top-nav-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.top-nav-btn .ui-icon {
  width: 19px;
  height: 19px;
}

.top-nav-btn.active {
  color: #fff;
  border-color: rgba(46,211,255,0.22);
  background: rgba(46,211,255,0.09);
}

.nav-badge {
  position: absolute;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3d6e;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(5,10,18,0.92);
}

.bottom-nav-item .nav-badge {
  top: 5px;
  right: 18%;
}

.top-nav-btn .nav-badge,
.menu-btn .nav-badge {
  top: -5px;
  right: -5px;
}

.menu-btn {
  justify-content: flex-start;
}

.menu-btn::before,
.side-link::before {
  display: none;
}

.menu-btn .ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.menu-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .bottom-nav {
    width: min(500px, calc(100% - 16px));
    min-height: 68px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .bottom-nav-item {
    min-height: 52px;
    gap: 2px;
    border-radius: 16px;
  }

  .bottom-nav-fab {
    display: none !important;
  }

  .bottom-nav-item svg {
    width: 21px;
    height: 21px;
  }

  .bottom-nav-item span {
    max-width: 100%;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .social-shell {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

.section-toolbar,
.video-hero,
.settings-user-card,
.more-profile-card,
.security-summary,
.privacy-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.052);
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
}

.section-toolbar h2,
.video-hero h2 {
  margin: 0;
  font-size: 21px;
}

.section-toolbar p,
.video-hero p,
.privacy-alert p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.more-hub,
.settings-hub,
.privacy-page,
.security-page,
.video-hub,
.prepared-section,
.notifications-hub {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.more-profile-card {
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.more-profile-card > span:nth-child(2),
.settings-user-card > div {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.more-profile-card strong,
.settings-user-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-profile-card small,
.settings-user-card small {
  color: var(--muted);
}

.more-grid,
.settings-list {
  display: grid;
  gap: 8px;
}

.section-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.section-row:hover {
  border-color: rgba(46,211,255,0.28);
  background: rgba(46,211,255,0.07);
}

.section-row-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(46,211,255,0.10);
}

.section-row svg {
  width: 20px;
  height: 20px;
}

.section-row strong,
.section-row small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.section-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.settings-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.046);
}

.settings-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.privacy-alert {
  justify-content: flex-start;
}

.privacy-alert > svg,
.privacy-alert > span svg {
  color: var(--accent);
}

.privacy-row {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 230px);
  align-items: center;
  gap: 14px;
}

.privacy-row select {
  min-height: 40px;
}

.security-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.session-row > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(46,211,255,0.1);
}

.session-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.session-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  color: var(--muted);
  text-align: center;
}

.empty-state-card > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--accent);
  background: rgba(46,211,255,0.11);
}

.empty-state-card strong {
  color: var(--text);
  font-size: 18px;
}

.notification-filter-sheet {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.notification-filter-sheet[hidden] {
  display: none;
}

.notification-filter-sheet button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.notification-filter-sheet button.active {
  color: #fff;
  border-color: rgba(46,211,255,0.3);
  background: rgba(46,211,255,0.12);
}

.notification-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.notification-row.is-read {
  opacity: 0.7;
}

.notification-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(46,211,255,0.10);
}

.notification-row time {
  color: var(--muted);
  font-size: 12px;
}

.video-hub + .feed-list {
  padding-top: 0;
}

.reels-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reel-tile {
  min-height: 170px;
  display: grid;
  align-content: end;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: #fff;
  text-align: left;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,0.58)),
    linear-gradient(135deg, rgba(46,211,255,0.22), rgba(123,97,255,0.20)),
    #0b1324;
  cursor: pointer;
}

.reel-tile > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

.reel-tile small {
  color: rgba(255,255,255,0.72);
}

.identity-cover {
  position: relative;
}

.profile-back-action,
.profile-menu-action {
  position: absolute;
  top: 12px;
  background: rgba(5,10,18,0.52);
  backdrop-filter: blur(16px);
}

.profile-back-action {
  left: 12px;
}

.profile-menu-action {
  right: 12px;
}

.identity-copy h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-verified {
  width: 17px;
  height: 17px;
}

.profile-short-bio {
  max-width: 680px;
  margin-top: 10px;
  color: #dfe7f4;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.profile-read-more {
  width: fit-content;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 700;
}

.identity-stats button,
.identity-stats span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--muted);
  cursor: pointer;
}

.identity-stats button strong,
.identity-stats span strong {
  color: var(--text);
}

.profile-private-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 18px 0;
  padding: 12px;
  border: 1px solid rgba(46,211,255,0.18);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(46,211,255,0.07);
}

.profile-media-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 18px 0;
}

.profile-media-preview span {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  overflow: hidden;
}

.profile-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details-list {
  display: grid;
  gap: 2px;
  padding: 10px;
}

.profile-details-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
}

.profile-details-list div:hover {
  background: rgba(255,255,255,0.045);
}

.profile-details-list span {
  color: var(--muted);
}

.profile-details-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.video-shell.viewer-video {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.viewer-video video {
  max-width: 100%;
  max-height: 100%;
}

.video-mute {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.13);
  color: #fff;
  cursor: pointer;
}

.story-progress span {
  overflow: hidden;
  background: rgba(255,255,255,0.2);
}

.story-progress span i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.story-progress span.done i {
  width: 100%;
}

@keyframes story-progress {
  from { width: 0; }
  to { width: 100%; }
}

.story-viewer-actions button,
.story-viewer-actions input,
.story-viewer-head button {
  touch-action: manipulation;
}

.story-viewer-actions .icon-action.active {
  color: #ff5c8a;
  background: rgba(255,92,138,0.14);
}

.live-status-text {
  color: #64d9ff !important;
}

.typing-dots {
  display: inline-flex;
  gap: 2px;
  margin-left: 5px;
  vertical-align: middle;
}

.typing-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: typing-dot 1s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.typing-dots i:nth-child(3) { animation-delay: 0.28s; }

@keyframes typing-dot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 680px) {
  .section-toolbar,
  .video-hero,
  .settings-user-card,
  .more-profile-card,
  .security-summary,
  .privacy-alert {
    align-items: stretch;
  }

  .video-hero,
  .security-summary {
    flex-direction: column;
  }

  .reels-strip {
    grid-template-columns: repeat(3, minmax(118px, 1fr));
    overflow-x: auto;
  }

  .privacy-row,
  .session-row,
  .notification-row,
  .profile-details-list div {
    grid-template-columns: 1fr;
  }

  .session-row > button {
    width: 100%;
  }

  .identity-main {
    margin-top: -34px;
  }

  .profile-media-preview {
    margin-left: 14px;
    margin-right: 14px;
  }
}

/* Mobile shell contract: header owns safe-area once, content starts below it once. */
:root {
  --mine-mobile-header: 58px;
  --mine-mobile-bottom-nav: 72px;
}

.section-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(115, 176, 255, 0.2);
  border-radius: 10px;
  background: rgba(12, 20, 32, 0.72);
  color: #d8ebff;
  font: inherit;
}

.section-back-btn svg {
  width: 18px;
  height: 18px;
  color: #5eb3ff;
}

.section-toolbar {
  gap: 10px;
}

.section-toolbar > .section-back-btn + div {
  min-width: 0;
}

.connected-section,
.profile-tab-section {
  display: grid;
  gap: 14px;
}

.section-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dcecff;
}

.section-mini-head h3 {
  margin: 0;
  font-size: 17px;
}

.section-mini-head span,
.settings-row em {
  color: #75b7ff;
  font-style: normal;
  font-size: 13px;
}

.profile-media-grid,
.profile-video-grid,
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.profile-media-tile,
.album-card,
.profile-video-tile {
  min-height: 128px;
  border: 1px solid rgba(130, 170, 220, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(13, 22, 34, 0.78);
}

.profile-media-tile img,
.profile-video-tile video {
  width: 100%;
  height: 100%;
  min-height: 128px;
  object-fit: cover;
  display: block;
}

.album-card {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 14px;
  color: #eaf4ff;
  text-align: left;
}

.album-card svg {
  width: 24px;
  height: 24px;
  color: #4da7ff;
}

.album-card small {
  color: #91a8bf;
}

.group-list {
  display: grid;
  gap: 8px;
}

.privacy-row {
  width: 100%;
  text-align: left;
}

.privacy-row svg {
  width: 18px;
  height: 18px;
  color: #5eb3ff;
}

.privacy-choice-list {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.privacy-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(130, 170, 220, 0.14);
  border-radius: 8px;
  background: rgba(13, 22, 34, 0.82);
  color: #e7f2ff;
  font: inherit;
}

.privacy-choice.active {
  border-color: rgba(74, 163, 255, 0.54);
  background: rgba(47, 126, 225, 0.16);
}

.privacy-choice svg {
  width: 18px;
  height: 18px;
  color: #63b3ff;
}

.sheet-note {
  margin: 6px 0 0;
  color: #8fa6bd;
  font-size: 13px;
}

.password-sheet .settings-fields-grid {
  display: grid;
  gap: 10px;
}

.password-check {
  margin-top: 2px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  body:not([data-view="messages"]) .social-topbar {
    height: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px)) !important;
    padding: env(safe-area-inset-top, 0px) 12px 0 !important;
    align-items: center;
  }

  body:not([data-view="messages"]) .social-shell {
    padding-top: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px) + 8px) !important;
    padding-bottom: calc(var(--mine-mobile-bottom-nav) + env(safe-area-inset-bottom, 0px) + 16px) !important;
    min-height: var(--app-height);
  }

  body:not([data-view="messages"]) .wall-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body:not([data-view="messages"]) .feed-prelude,
  body:not([data-view="messages"]) .identity-hero,
  body:not([data-view="messages"]) .more-hub,
  body:not([data-view="messages"]) .settings-hub,
  body:not([data-view="messages"]) .privacy-page,
  body:not([data-view="messages"]) .security-page,
  body:not([data-view="messages"]) .connected-section,
  body:not([data-view="messages"]) .prepared-section,
  body:not([data-view="messages"]) .feature-hub,
  body:not([data-view="messages"]) .profile-editor {
    margin-top: 0 !important;
  }

  .bottom-nav {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-view="messages"].chat-open .bottom-nav {
    display: none !important;
  }

  .section-toolbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .section-back-btn span {
    display: none;
  }

  .profile-media-grid,
  .profile-video-grid,
  .album-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-media-tile,
  .album-card,
  .profile-video-tile,
  .profile-media-tile img,
  .profile-video-tile video {
    min-height: 108px;
  }
}

/* Desktop/tablet stabilization */
:root {
  --mine-header-height: 58px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.social-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  min-height: var(--mine-header-height) !important;
  height: var(--mine-header-height) !important;
  padding: 0 clamp(14px, 2vw, 24px) !important;
  gap: clamp(10px, 1.6vw, 22px) !important;
}

.brand {
  flex: 0 0 auto;
  white-space: nowrap;
}

.top-search {
  flex: 1 1 340px;
  max-width: 480px;
  min-width: 190px;
  margin: 0 auto;
}

.top-actions {
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
  gap: clamp(6px, 1vw, 12px);
}

.top-nav-btn {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.top-nav-btn.dropdown-open {
  color: #fff;
  border-color: rgba(46,211,255,0.34);
  background: rgba(46,211,255,0.12);
}

.nav-badge[hidden] {
  display: none !important;
}

.social-shell,
.app-shell,
.main-content,
.profile-content,
.notifications-page,
.notifications-hub,
.messenger-page,
.wall-panel,
.view-body,
.feed-list,
.identity-hero,
.identity-main,
.identity-copy {
  min-width: 0;
  max-width: 100%;
}

.social-shell {
  width: min(1380px, 100%) !important;
  display: grid;
  grid-template-columns: minmax(214px, 236px) minmax(0, 700px) minmax(258px, 320px) !important;
  gap: 18px !important;
  align-items: start;
  padding: 20px clamp(12px, 2vw, 24px) 28px !important;
  margin: 0 auto;
}

.profile-panel,
.people-panel {
  position: sticky;
  top: calc(var(--mine-header-height) + 18px) !important;
  z-index: 20;
  min-width: 0;
}

.wall-panel {
  min-width: 0;
  overflow: visible;
}

.identity-main {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  min-width: 0;
}

.identity-copy h2,
.profile-hero-copy strong {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none;
  letter-spacing: 0;
}

.identity-address {
  min-width: 0;
}

.identity-address > span:first-child,
.profile-hero-copy span {
  min-width: 0;
  max-width: min(100%, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-actions {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.identity-action {
  min-width: 0;
  max-width: 100%;
}

.identity-stats {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.profile-short-bio {
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.notifications-popover {
  position: fixed;
  top: calc(var(--mine-header-height) + 8px);
  right: clamp(10px, 2vw, 24px);
  width: min(390px, calc(100vw - 20px));
  max-height: min(620px, calc(100vh - var(--mine-header-height) - 20px));
  overflow: hidden;
  z-index: 1200;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(12, 18, 30, 0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
  backdrop-filter: var(--blur-glass);
}

.notifications-popover[hidden] {
  display: none !important;
}

.notifications-popover-head,
.notifications-popover-footer {
  display: flex;
  align-items: center;
}

.notifications-popover-head {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.notifications-popover-head strong {
  display: block;
  font-size: 16px;
}

.notifications-popover-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.notifications-popover-list {
  display: grid;
  gap: 6px;
  max-height: min(470px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 8px;
}

.notification-popover-item,
.notification-row {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.notification-popover-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
}

.notification-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  min-height: 82px;
  padding: 14px;
  border-radius: 16px;
}

.notification-popover-item:hover,
.notification-row:hover {
  border-color: rgba(46,211,255,0.28);
  background: rgba(46,211,255,0.075);
}

.notification-popover-item.is-unread,
.notification-row.is-unread {
  border-color: rgba(124,92,255,0.28);
  background: rgba(124,92,255,0.10);
}

.notification-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
}

.notification-row .notification-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.notification-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-avatar-system {
  color: var(--accent);
  background: rgba(46,211,255,0.12);
  border: 1px solid rgba(46,211,255,0.18);
}

.notification-avatar svg {
  width: 22px;
  height: 22px;
}

.notification-copy,
.notification-popover-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-copy-head,
.notification-popover-copy > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.notification-copy strong,
.notification-copy b,
.notification-copy p,
.notification-popover-copy strong,
.notification-popover-copy b,
.notification-popover-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-copy strong,
.notification-popover-copy strong {
  white-space: nowrap;
}

.notification-copy b,
.notification-popover-copy b {
  color: #eef4ff;
  font-size: 14px;
  font-weight: 800;
}

.notification-copy p,
.notification-popover-copy small {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.notification-popover-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-row time,
.notification-popover-item time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.notification-check {
  width: fit-content;
  margin-top: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.notification-unread-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ff3d6e;
  box-shadow: 0 0 0 4px rgba(255,61,110,0.12);
}

.notifications-popover-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.notifications-popover-empty span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent);
  background: rgba(46,211,255,0.10);
}

.notifications-popover-empty svg {
  width: 24px;
  height: 24px;
}

.notifications-popover-empty strong {
  color: var(--text);
}

.notifications-popover-empty p {
  margin: 0;
  line-height: 1.4;
}

.notifications-popover-footer {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.035);
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.notification-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.soft-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.soft-action:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 1199px) and (min-width: 901px) {
  .social-shell {
    width: min(1060px, 100%) !important;
    grid-template-columns: minmax(206px, 236px) minmax(0, 1fr) !important;
  }

  .people-panel {
    display: none !important;
  }

  .identity-main {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center;
  }

  .identity-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 0;
  }

  .top-search {
    max-width: 360px;
  }

  .top-nav-btn span {
    display: none;
  }
}

@media (max-width: 1023px) and (min-width: 901px) {
  .social-shell {
    grid-template-columns: 208px minmax(0, 1fr) !important;
    gap: 14px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .top-search {
    max-width: 300px;
    min-width: 160px;
  }

  .desktop-create-btn {
    display: none !important;
  }
}

@media (min-width: 901px) {
  body[data-view="messages"] {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body[data-view="messages"] .profile-panel {
    display: block !important;
  }

  body[data-view="messages"] .people-panel,
  body[data-view="messages"] .wall-header,
  body[data-view="messages"] .composer,
  body[data-view="messages"] .feed-list {
    display: none !important;
  }

  body[data-view="messages"] .social-shell {
    width: min(1280px, 100%) !important;
    min-height: calc(100vh - var(--mine-header-height)) !important;
    grid-template-columns: minmax(214px, 236px) minmax(0, 980px) !important;
    gap: 18px !important;
    padding: 18px clamp(12px, 2vw, 24px) !important;
  }

  body[data-view="messages"] .wall-panel {
    min-height: calc(100vh - var(--mine-header-height) - 36px) !important;
    max-width: 100%;
  }

  body[data-view="messages"] .view-body,
  body[data-view="messages"] .messenger-shell {
    min-height: calc(100vh - var(--mine-header-height) - 38px) !important;
    height: calc(100vh - var(--mine-header-height) - 38px) !important;
  }
}

@media (max-width: 900px) {
  .notifications-popover {
    top: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px) + 8px);
    right: 10px;
    left: 10px;
    width: auto;
  }

  .notification-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .notification-row time {
    grid-column: 2;
  }

  .notification-toolbar-actions {
    justify-content: flex-end;
  }
}

/* Desktop notification popover refinement */
.top-actions {
  overflow: visible;
}

.notifications-anchor {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.notifications-anchor .top-nav-btn {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.notifications-popover {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  width: 390px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: min(640px, calc(100vh - 90px)) !important;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 16px;
  background: #242424;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 26px 80px rgba(0,0,0,0.48);
}

.notifications-popover__top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.notifications-popover__profile {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notifications-popover__profile strong {
  min-width: 0;
  overflow: hidden;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-popover__profile span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255,255,255,0.52);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-source-btn,
.notifications-settings-btn {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.86);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.notifications-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
}

.notifications-source-btn svg {
  transform: rotate(90deg);
}

.notifications-settings-btn {
  width: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.notifications-popover__filters {
  display: flex;
  gap: 6px;
  padding: 9px 12px 0;
}

.notifications-popover__filters button {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255,255,255,0.58);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.notifications-popover__filters button.active {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.notifications-popover__filters i {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,61,110,0.90);
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.notifications-popover__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}

.notifications-popover__status span {
  color: rgba(255,255,255,0.44);
  font-size: 11px;
  font-weight: 900;
}

.notifications-popover__status button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.notifications-popover__status button:disabled {
  opacity: 0.35;
  cursor: default;
}

.notifications-popover__list {
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.notification-popover-item {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 28px !important;
  gap: 6px 8px !important;
  align-items: start;
  min-width: 0;
  padding: 9px 8px 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
}

.notification-popover-item:hover,
.notification-popover-item.menu-open {
  background: rgba(255,255,255,0.055) !important;
}

.notification-popover-item.is-unread {
  background: rgba(46, 211, 255, 0.055) !important;
}

.notification-popover-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.notifications-popover .notification-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
}

.notifications-popover .notification-avatar-system {
  background: linear-gradient(145deg, #2f73ff, #2dd4bf);
  color: #fff;
}

.notification-popover-copy {
  gap: 3px;
}

.notification-popover-copy > span {
  gap: 6px;
}

.notification-popover-copy strong,
.notification-popover-copy b,
.notification-popover-copy small {
  max-width: 100%;
}

.notification-popover-copy strong {
  color: #f3f3f3;
  font-size: 13px;
  font-weight: 900;
}

.notification-popover-copy b {
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.notification-popover-copy small {
  color: rgba(255,255,255,0.72);
  font-size: 12px;
}

.notification-popover-action {
  grid-column: 1 / 2;
  width: fit-content;
  min-height: 28px;
  margin-left: 52px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.notification-popover-item time {
  grid-column: 2;
  grid-row: 1;
  padding-top: 2px;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}

.notification-popover-dots {
  grid-column: 3;
  grid-row: 1;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.46);
  cursor: pointer;
}

.notification-popover-dots:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.notification-popover-menu {
  position: absolute;
  top: 34px;
  right: 8px;
  display: none;
  min-width: 176px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: #303030;
  box-shadow: 0 18px 40px rgba(0,0,0,0.38);
  z-index: 2;
}

.notification-popover-item.menu-open .notification-popover-menu {
  display: grid;
}

.notification-popover-menu button,
.notification-popover-menu span {
  min-height: 30px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  background: transparent;
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  text-align: left;
}

.notification-popover-menu button {
  cursor: pointer;
}

.notification-popover-menu button:hover {
  background: rgba(255,255,255,0.10);
}

.notifications-popover__footer {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(255,255,255,0.84);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.notifications-popover-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: rgba(255,255,255,0.78);
}

.notifications-popover-loading span {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.16);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mine-spin 0.8s linear infinite;
}

@keyframes mine-spin {
  to { transform: rotate(360deg); }
}

.notifications-popover .notifications-popover-empty {
  min-height: 220px;
  padding: 34px 22px;
}

.notifications-popover .notifications-popover-empty.is-error span {
  color: #ff6b8a;
  background: rgba(255,107,138,0.10);
}

.social-topbar svg,
.top-nav-btn svg,
.icon-btn svg,
.menu-btn svg,
.side-link svg,
.notifications-popover svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .social-shell {
    width: min(1420px, 100%) !important;
    grid-template-columns: minmax(220px, 260px) minmax(520px, 760px) minmax(280px, 340px) !important;
  }

  .wall-panel {
    min-width: 520px;
  }

  .profile-panel,
  .left-sidebar {
    min-width: 220px;
    max-width: 260px;
  }

  .people-panel,
  .right-sidebar {
    min-width: 280px;
    max-width: 340px;
  }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .social-shell {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
  }

  .wall-panel {
    min-width: 0;
  }

  .people-panel,
  .right-sidebar {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .notifications-popover {
    position: fixed !important;
    top: auto !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(72vh, 620px) !important;
    border-radius: 18px;
  }
}

/* Floating portal + icon containment */
.notifications-anchor {
  position: static !important;
}

.notifications-popover.notifications-floating-popover {
  position: fixed !important;
  top: var(--notification-popover-top, 68px) !important;
  left: var(--notification-popover-left, auto) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--notification-popover-width, 390px) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: var(--notification-popover-max-height, min(640px, calc(100vh - 90px))) !important;
  z-index: 2147483000 !important;
  contain: layout paint style;
}

.notifications-popover.notifications-floating-popover[hidden] {
  display: none !important;
}

.notifications-popover.notifications-floating-popover.is-mobile-sheet {
  top: auto !important;
  right: 10px !important;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  left: 10px !important;
  width: auto !important;
  max-width: none !important;
  max-height: min(72vh, 620px) !important;
}

.notifications-popover.notifications-floating-popover .notifications-popover__list {
  min-height: 0;
  max-height: min(480px, calc(var(--notification-popover-max-height, 640px) - 150px));
}

:root {
  --mine-icon-size: 24px;
  --mine-icon-size-sm: 18px;
}

.ui-icon,
.mine-icon {
  width: var(--mine-icon-size) !important;
  height: var(--mine-icon-size) !important;
  min-width: var(--mine-icon-size) !important;
  min-height: var(--mine-icon-size) !important;
  max-width: var(--mine-icon-size) !important;
  max-height: var(--mine-icon-size) !important;
  flex: 0 0 var(--mine-icon-size) !important;
  object-fit: contain;
}

:where(
  .social-topbar,
  .profile-panel,
  .people-panel,
  .bottom-nav,
  .more-hub,
  .settings-hub,
  .privacy-page,
  .security-page,
  .notifications-hub,
  .notifications-popover,
  .messenger-shell,
  .section-row,
  .icon-btn,
  .icon-action,
  .soft-action,
  .primary-btn,
  .menu-btn,
  .side-link,
  .dropdown-menu
) svg {
  width: var(--mine-icon-size) !important;
  height: var(--mine-icon-size) !important;
  min-width: var(--mine-icon-size) !important;
  min-height: var(--mine-icon-size) !important;
  max-width: var(--mine-icon-size) !important;
  max-height: var(--mine-icon-size) !important;
  flex: 0 0 var(--mine-icon-size) !important;
}

.top-nav-btn,
.icon-btn,
.icon-action,
.menu-btn,
.side-link,
.notifications-settings-btn,
.notification-popover-dots {
  flex-shrink: 0;
}

.top-nav-btn .nav-badge,
.menu-btn .nav-badge,
.bottom-nav-item .nav-badge {
  width: auto !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
}

.notifications-popover .notification-avatar,
.notifications-popover .notification-avatar img {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
}

.notification-row .notification-avatar,
.notification-row .notification-avatar img {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

.mine-icon {
  max-width: 24px !important;
}

/* Immediate icon clamp for desktop and mobile UI */
:root {
  --mine-icon-size: 18px;
  --mine-icon-size-sm: 16px;
}

svg.ui-icon,
svg.mine-icon,
svg.post-icon,
button svg,
a svg,
[class*="icon"] svg,
.menu-btn svg,
.side-link svg,
.section-row svg,
.bottom-nav-item svg,
.top-nav-btn svg,
.notifications-popover svg,
.notification-avatar svg,
.empty-state-card > span svg {
  width: var(--mine-icon-size) !important;
  height: var(--mine-icon-size) !important;
  min-width: var(--mine-icon-size) !important;
  min-height: var(--mine-icon-size) !important;
  max-width: var(--mine-icon-size) !important;
  max-height: var(--mine-icon-size) !important;
  flex: 0 0 var(--mine-icon-size) !important;
  inline-size: var(--mine-icon-size) !important;
  block-size: var(--mine-icon-size) !important;
  object-fit: contain !important;
}

.brand-mark,
.person-avatar,
.chat-avatar,
.notification-avatar,
.identity-avatar {
  flex-shrink: 0;
}

.top-search svg,
.chat-row-title em svg,
.tick svg,
.post-action svg,
.comment-like-btn svg {
  width: var(--mine-icon-size-sm) !important;
  height: var(--mine-icon-size-sm) !important;
  min-width: var(--mine-icon-size-sm) !important;
  min-height: var(--mine-icon-size-sm) !important;
  max-width: var(--mine-icon-size-sm) !important;
  max-height: var(--mine-icon-size-sm) !important;
  flex-basis: var(--mine-icon-size-sm) !important;
}

/* Final responsive shell guard.
   Earlier desktop stabilization uses !important grid columns, so mobile/tablet
   needs a later explicit reset to keep small screens out of desktop layout. */
@media (max-width: 900px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body:not([data-view="messages"]) .social-topbar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px)) !important;
    padding: env(safe-area-inset-top, 0px) 12px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  body:not([data-view="messages"]) .brand {
    min-width: 0 !important;
    max-width: calc(100vw - 88px) !important;
  }

  body:not([data-view="messages"]) .top-search,
  body:not([data-view="messages"]) .top-actions > .top-nav-btn,
  body:not([data-view="messages"]) .desktop-create-btn {
    display: none !important;
  }

  body:not([data-view="messages"]) .top-actions {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  body:not([data-view="messages"]) .top-actions .icon-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  body:not([data-view="messages"]) .social-shell {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    display: block !important;
    grid-template-columns: none !important;
    grid-auto-columns: auto !important;
    justify-content: stretch !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: calc(var(--mine-mobile-header) + env(safe-area-inset-top, 0px) + 8px) 0 calc(var(--mine-mobile-bottom-nav) + env(safe-area-inset-bottom, 0px) + 16px) !important;
    overflow-x: hidden !important;
  }

  body:not([data-view="messages"]) .profile-panel,
  body:not([data-view="messages"]) .left-sidebar,
  body:not([data-view="messages"]) .people-panel,
  body:not([data-view="messages"]) .right-sidebar {
    display: none !important;
  }

  body:not([data-view="messages"]) .wall-panel,
  body:not([data-view="messages"]) .view-body,
  body:not([data-view="messages"]) .feed-list,
  body:not([data-view="messages"]) .notifications-hub,
  body:not([data-view="messages"]) .more-hub,
  body:not([data-view="messages"]) .settings-hub,
  body:not([data-view="messages"]) .privacy-page,
  body:not([data-view="messages"]) .security-page,
  body:not([data-view="messages"]) .feature-hub,
  body:not([data-view="messages"]) .identity-hero,
  body:not([data-view="messages"]) .identity-grid,
  body:not([data-view="messages"]) .profile-editor,
  body:not([data-view="messages"]) .profile-tab-section,
  body:not([data-view="messages"]) .prepared-section {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden !important;
  }

  body:not([data-view="messages"]) .wall-panel {
    min-height: auto !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:not([data-view="messages"]) .view-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body:not([data-view="messages"]) .wall-header {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    margin: 0 !important;
  }

  body:not([data-view="messages"]) .wall-header h1,
  body:not([data-view="messages"]) .wall-header p,
  body:not([data-view="messages"]) .profile-name,
  body:not([data-view="messages"]) .identity-copy h2,
  body:not([data-view="messages"]) .notification-copy,
  body:not([data-view="messages"]) .notification-text {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  body:not([data-view="messages"]) .profile-username,
  body:not([data-view="messages"]) .identity-address,
  body:not([data-view="messages"]) .notification-meta {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not([data-view="messages"]) .header-actions {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  body:not([data-view="messages"]) .feed-prelude,
  body:not([data-view="messages"]) .composer,
  body:not([data-view="messages"]) .post,
  body:not([data-view="messages"]) .empty-state-card,
  body:not([data-view="messages"]) .section-row,
  body:not([data-view="messages"]) .notification-row,
  body:not([data-view="messages"]) .settings-card,
  body:not([data-view="messages"]) .identity-info,
  body:not([data-view="messages"]) .identity-wall-card,
  body:not([data-view="messages"]) .identity-members {
    width: calc(100% - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
  }

  body:not([data-view="messages"]) .feed-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 0 0 12px !important;
  }

  body:not([data-view="messages"]) .story-rail,
  body:not([data-view="messages"]) .profile-tabs,
  body:not([data-view="messages"]) .messenger-filters,
  body:not([data-view="messages"]) .notification-filter-sheet,
  body:not([data-view="messages"]) .identity-actions {
    max-width: 100vw !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  body:not([data-view="messages"]) .post-head,
  body:not([data-view="messages"]) .post-actions,
  body:not([data-view="messages"]) .composer-actions,
  body:not([data-view="messages"]) .identity-main,
  body:not([data-view="messages"]) .identity-stats {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not([data-view="messages"]) .post-actions,
  body:not([data-view="messages"]) .composer-actions,
  body:not([data-view="messages"]) .identity-actions {
    flex-wrap: wrap !important;
  }

  body:not([data-view="messages"]) img,
  body:not([data-view="messages"]) video,
  body:not([data-view="messages"]) canvas,
  body:not([data-view="messages"]) iframe,
  body:not([data-view="messages"]) .post-media,
  body:not([data-view="messages"]) .post-media-frame,
  body:not([data-view="messages"]) .mine-media-player {
    max-width: 100% !important;
  }

  body[data-view="messages"] .social-topbar {
    display: none !important;
  }

  body[data-view="messages"] .social-shell,
  body[data-view="messages"] .wall-panel,
  body[data-view="messages"] .view-body,
  body[data-view="messages"] .messenger-shell {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  body[data-view="messages"] .social-shell {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 0 calc(var(--mine-mobile-bottom-nav) + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-view="messages"] .profile-panel,
  body[data-view="messages"] .left-sidebar,
  body[data-view="messages"] .people-panel,
  body[data-view="messages"] .right-sidebar {
    display: none !important;
  }

  body[data-view="messages"] .wall-panel {
    min-height: 100vh !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    z-index: 950 !important;
  }

  body[data-view="messages"].chat-open .bottom-nav {
    display: none !important;
  }

  .bottom-nav-item {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .bottom-nav-item span {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 480px) {
  body:not([data-view="messages"]) .brand > span:not(.brand-mark) {
    display: none !important;
  }

  body:not([data-view="messages"]) .wall-header h1 {
    font-size: 24px !important;
    line-height: 1.08 !important;
  }

  body:not([data-view="messages"]) .header-actions .soft-btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body:not([data-view="messages"]) .header-actions .icon-btn {
    width: 38px !important;
    min-width: 38px !important;
  }

  body:not([data-view="messages"]) .post {
    border-radius: 16px !important;
    padding: 12px !important;
  }

  .bottom-nav-item span {
    font-size: 9px !important;
  }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .social-shell {
    width: min(100%, 1120px) !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
    gap: 16px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .people-panel,
  .right-sidebar {
    display: none !important;
  }

  .wall-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

.account-switcher {
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
}

.account-switcher__head,
.account-switcher__row,
.account-switcher__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-switcher__head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.account-switcher__head h3,
.account-switcher__head p {
  margin: 0;
}

.account-switcher__head p,
.account-switcher__row small,
.account-switcher__empty,
.account-switcher__loading {
  color: var(--muted);
}

.account-switcher__list {
  display: grid;
  gap: 8px;
}

.account-switcher__row {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}

.account-switcher__row.active {
  border-color: rgba(124,92,255,0.42);
  background: rgba(124,92,255,0.12);
}

.account-switcher__row > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.account-switcher__row strong,
.account-switcher__row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switcher__row .soft-btn {
  min-width: max-content;
}

.account-switcher__row .icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.account-switcher__actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.system-message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.system-message-actions .soft-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .account-switcher {
    width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
  }

  .account-switcher__head,
  .account-switcher__row,
  .account-switcher__actions {
    align-items: stretch;
  }

  .account-switcher__head,
  .account-switcher__row {
    flex-wrap: wrap;
  }

  .account-switcher__row .soft-btn {
    flex: 1 1 140px;
  }
}

/* Unified Twemoji rendering */
.twemoji {
  display: inline-block;
  width: 1.18em;
  height: 1.18em;
  max-width: 1.18em;
  max-height: 1.18em;
  margin: 0 .035em;
  object-fit: contain;
  vertical-align: -0.22em;
  flex: 0 0 auto;
}

.emoji-panel .twemoji,
.emoji-grid .twemoji,
.emoji-categories .twemoji,
.quick-reactions .twemoji,
.reaction-pills .twemoji {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  margin: 0;
  vertical-align: middle;
}

.quick-reactions .twemoji,
.reaction-pills .twemoji {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
}

.emoji-grid button,
.emoji-categories button,
.quick-reactions button {
  line-height: 1;
}

.emoji-panel.compose-emoji-picker,
.emoji-panel.comment-emoji-picker {
  width: min(390px, 100%);
  max-width: 100%;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: rgba(17, 24, 39, .96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .34);
}

.emoji-panel.compose-emoji-picker[hidden],
.emoji-panel.comment-emoji-picker[hidden] {
  display: none;
}

.comment-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.comment-form-actions .soft-btn,
.comment-form-actions .primary-btn {
  min-height: 36px;
}

@media (max-width: 640px) {
  .emoji-panel.compose-emoji-picker,
  .emoji-panel.comment-emoji-picker {
    width: 100%;
  }

  .emoji-grid {
    grid-template-columns: repeat(7, minmax(32px, 1fr));
  }
}

.system-codes-card .settings-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.system-codes-card .settings-card-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.security-code-warning {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: rgba(14, 165, 233, .08);
}

.security-code-test {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.system-code-recent {
  margin-top: 4px;
}

.system-code-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 720px) {
  .system-codes-card .settings-card-head,
  .security-code-test {
    grid-template-columns: minmax(0, 1fr);
  }
}

.header-account-menu {
  position: fixed;
  top: calc(var(--mine-header-height, 58px) + 8px);
  right: clamp(12px, 2vw, 24px);
  z-index: 2147482500;
  width: min(380px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 82px));
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  border-radius: 18px;
  background: rgba(9, 14, 26, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px);
}

.header-account-menu[hidden] {
  display: none !important;
}

.header-account-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.header-account-card strong,
.header-account-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-account-card small,
.header-account-loading {
  color: var(--muted);
}

.header-account-profile {
  min-height: 48px;
}

.header-account-list,
.header-account-actions,
.profile-action-list {
  display: grid;
  gap: 8px;
}

.header-account-actions {
  grid-template-columns: 1fr;
}

.header-account-actions .soft-btn,
.header-account-actions .danger-btn {
  width: 100%;
  justify-content: flex-start;
}

.profile-online-dot {
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(9, 14, 26, 0.96);
  border-radius: 999px;
  background: #35d46d;
  box-shadow: 0 0 0 2px rgba(53, 212, 109, 0.28);
}

.profile-privacy-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.profile-privacy-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-privacy-line svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
}

.profile-action-sheet,
.account-switcher-sheet {
  width: min(420px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 86px));
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  border-radius: 20px;
  background: rgba(9, 14, 26, 0.97);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(22px);
}

.profile-action-row {
  min-height: 48px;
}

.profile-action-row.danger-menu-item {
  color: var(--danger, #ff3d6e);
}

.profile-action-row.danger-menu-item .section-row-icon {
  color: var(--danger, #ff3d6e);
  background: rgba(255, 61, 110, 0.12);
}

.account-switcher-overlay,
.profile-menu-overlay {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: calc(var(--mine-header-height, 58px) + 10px) clamp(12px, 2vw, 24px) 16px;
}

@media (max-width: 720px) {
  .account-switcher-overlay,
  .profile-menu-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 12px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .profile-action-sheet,
  .account-switcher-sheet {
    width: 100%;
    max-height: min(82vh, 720px);
    border-radius: 22px 22px 0 0;
  }

  .header-account-menu {
    top: calc(var(--mine-header-height, 66px) + env(safe-area-inset-top, 0px) + 6px);
    right: 10px;
    left: 10px;
    width: auto;
  }
}
