:root {
  /* Значения по умолчанию — переопределяются из window.WebApp.themeParams внутри MAX */
  --bg-color: #0f1115;
  --secondary-bg: #181b22;
  --card-bg: #1c2028;
  --text-color: #f2f3f5;
  --hint-color: #8a8f98;
  --link-color: #6aa9ff;
  --accent-color: #6c5ce7;
  --border-color: #2a2e38;
  --danger-color: #ff5c5c;
  --like-color: #ff5c8a;
  --repost-color: #2ecc71;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--link-color); text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

/* ===================== APP SHELL ===================== */
.app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header > .icon-btn {
  display: none;
}

.app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 36px;
  border: none;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  color: #fff;
  transition: transform 160ms ease, opacity 160ms ease, background-color 160ms ease;
}

.app-brand:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.08);
}

.app-logo {
  display: block;
  width: 18px;
  height: 24px;
  background-color: #36c8ff;
  background-image: linear-gradient(180deg, #73e6ff 0%, #22a7ff 100%);
  -webkit-mask-image: url("../assets/logominisimi.png?v=28");
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("../assets/logominisimi.png?v=28");
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  transform-origin: center;
}

.app-brand--refreshing .app-logo {
  animation: logoRefreshBlink 620ms ease-in-out infinite;
}

@keyframes logoRefreshBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.38;
    transform: scale(0.86);
  }
}

.app-title {
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, #6c5ce7, #6aa9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tabs {
  flex: 1;
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  overflow: hidden;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--hint-color);
  padding: 8px 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease, transform 180ms ease;
}

.tab--active {
  color: #fff;
  transform: translateY(-0.5px);
}

.tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transform: scaleX(0.92);
  background-size: 220% 220%;
  transition: opacity 220ms ease, transform 220ms ease;
}

.tab--active::before {
  opacity: 1;
  transform: scaleX(1);
  animation: tabGradientFlow 5s ease-in-out infinite;
}

.tab[data-tab="friends"].tab--active::before {
  background-image: linear-gradient(110deg, #071a4a 0%, #15245f 45%, #5a071b 100%);
}

.tab[data-tab="vibe"].tab--active::before {
  background-image: linear-gradient(115deg, #120111 0%, #6c25ff 36%, #ff3159 72%, #050008 100%);
}

@keyframes tabGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.icon-btn {
  border: none;
  background: var(--card-bg);
  color: var(--text-color);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#profile-btn {
  background: linear-gradient(145deg, #252b38, #151923);
}

.screen-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

/* ============ Screen title bar (Сообщения, Уведомления) ============ */
.screen-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-color);
}

.screen-title-text {
  font-size: 22px;
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.auth-error {
  margin: 22px 16px;
  padding: 18px;
  border: 1px solid rgba(255, 91, 91, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 91, 91, 0.08), rgba(54, 200, 255, 0.04));
}

.auth-error-title {
  font-size: 18px;
  font-weight: 850;
  margin-bottom: 8px;
}

.auth-error-text {
  color: var(--hint-color);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.auth-debug {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(0,0,0,0.18);
  font-size: 11px;
}

.auth-debug-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--hint-color);
}

.auth-debug-row b {
  color: var(--text-color);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.direct-requests-btn {
  border: 1px solid var(--border-color);
  background: rgba(106,169,255,0.1);
  color: var(--link-color);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  font-family: inherit;
  transition: background 180ms ease;
}

.direct-requests-btn:active {
  background: rgba(106,169,255,0.2);
}

.feed-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

.feed-composer-main {
  flex: 1;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--hint-color);
  background: var(--secondary-bg);
  font-size: 14px;
  text-align: left;
}

.feed-composer-main:active {
  transform: scale(0.99);
}

.feed-composer-media {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== POST CARD ===================== */
.post-card {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.post-card.skeleton .skel {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--border-color) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--hint-color);
}

.post-body { flex: 1; min-width: 0; }

.repost-label {
  font-size: 12px;
  color: var(--hint-color);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.post-author { font-weight: 700; font-size: 14px; }
.post-username, .post-time { font-size: 13px; color: var(--hint-color); }

.post-text {
  font-size: 15.5px;
  line-height: 1.52;
  margin: 6px 0 8px;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(242, 243, 245, 0.96);
}

.post-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}

.post-media.single { grid-template-columns: 1fr; }

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--card-bg);
  aspect-ratio: 1 / 1;
}

.post-media.single img { aspect-ratio: 16 / 10; }

.quote-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.quote-card .post-header { margin-bottom: 2px; }
.quote-card .post-text { font-size: 14px; margin: 0; }
.quote-unavailable { color: var(--hint-color); font-size: 13px; font-style: italic; }

.post-actions {
  display: flex;
  justify-content: flex-start;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--hint-color);
}

.post-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  font-size: 13.5px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}

.post-action:active {
  transform: scale(0.92);
}

.post-action.active--like {
  color: var(--like-color);
  background: rgba(255, 92, 138, 0.12);
  border-color: rgba(255, 92, 138, 0.22);
}

.post-action.active--repost {
  color: var(--repost-color);
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.22);
}

.post-action svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.post-action--like.action-pop {
  animation: likePop 520ms cubic-bezier(.2, 1.7, .35, 1);
}

.post-action--repost.action-pop {
  animation: repostSpin 560ms cubic-bezier(.2, 1.35, .35, 1);
}

.post-action--reply.action-pop,
.post-action--quote.action-pop,
.post-action--share.action-pop {
  animation: actionBounce 420ms cubic-bezier(.2, 1.45, .35, 1);
}

@keyframes likePop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 92, 138, 0); }
  38% { transform: scale(1.24); box-shadow: 0 0 0 8px rgba(255, 92, 138, 0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(255, 92, 138, 0); }
}

@keyframes repostSpin {
  0% { transform: rotate(0deg) scale(1); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
  45% { transform: rotate(13deg) scale(1.16); box-shadow: 0 0 0 8px rgba(46, 204, 113, 0.13); }
  100% { transform: rotate(0deg) scale(1); box-shadow: 0 0 0 14px rgba(46, 204, 113, 0); }
}

@keyframes actionBounce {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-3px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

/* ===================== THREAD ===================== */
.thread-context {
  border-bottom: 1px solid var(--border-color);
}

.thread-back {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--secondary-bg);
  border-radius: 20px;
  margin: 12px 14px;
  width: max-content;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 150ms ease;
}

.thread-back:active {
  transform: scale(0.96);
}

.thread-root .post-text { font-size: 17px; }

.reply-banner {
  padding: 6px 14px 0;
  font-size: 13px;
  color: var(--hint-color);
}

/* ===================== PROFILE ===================== */
.profile-header {
  padding: 20px 16px 0;
  background: var(--bg-color);
}

.profile-cover {
  display: none;
}

.profile-info-block {
  padding: 0;
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.profile-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.profile-text-info {
  flex: 1;
  margin-top: 4px;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-color);
  letter-spacing: -0.4px;
  margin: 0 0 3px 0;
  line-height: 1.2;
}

.profile-username {
  font-size: 15px;
  color: var(--hint-color);
  margin-top: 2px;
}

.profile-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
  box-shadow: none;
}

.profile-avatar {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12) !important;
  object-fit: cover;
}

.profile-bio {
  font-size: 14px;
  color: var(--text-color);
  margin-top: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--hint-color);
  flex-wrap: wrap;
}

.profile-stat-item {
  cursor: pointer;
  padding: 2px 4px 2px 0;
  border-radius: 6px;
  transition: opacity 120ms;
}

.profile-stat-item:active {
  opacity: 0.65;
}

.profile-stat-item b {
  color: var(--text-color);
  font-weight: 700;
}

.profile-stat-bullet {
  color: var(--hint-color);
  opacity: 0.4;
  font-size: 15px;
  margin: 0 2px;
}

.profile-actions-row {
  margin-top: 16px;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-profile-btn-premium,
.friend-btn-premium {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease, transform 150ms ease;
  letter-spacing: -0.1px;
}

.edit-profile-btn-premium {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.edit-profile-btn-premium:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.98);
}

.friend-btn-premium {
  background: var(--text-color);
  color: var(--bg-color);
  border: 1px solid var(--text-color);
}

.friend-btn-premium:active {
  opacity: 0.82;
  transform: scale(0.98);
}

.friend-btn-premium.outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  box-shadow: none;
}

.friend-btn-premium.outline:active {
  background: rgba(255, 255, 255, 0.05);
  transform: scale(0.98);
}

/* ===================== FRIENDS MANAGE ===================== */
.section-title {
  padding: 14px 14px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hint-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-wrap {
  width: 100%;
  margin: 8px 14px;
  width: calc(100% - 28px);
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hint-color);
  pointer-events: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--secondary-bg);
  color: var(--text-color);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  background: var(--bg-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background 150ms ease;
}

.person-row:active {
  background: rgba(255, 255, 255, 0.02);
}

.person-row .person-info { flex: 1; min-width: 0; }
.person-row .person-name { font-weight: 700; font-size: 15px; color: var(--text-color); }
.person-row .person-username { font-size: 13px; color: var(--hint-color); margin-top: 1px; }
.person-row > div:last-child {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 14px 6px;
  padding: 13px 12px;
  border: 1px solid rgba(126, 87, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(54, 200, 255, 0.1), rgba(255, 49, 89, 0.08)),
    var(--card-bg);
}

.invite-card-main {
  min-width: 0;
}

.invite-card-title {
  font-size: 15px;
  font-weight: 850;
  margin-bottom: 3px;
}

.invite-card-text {
  color: var(--hint-color);
  font-size: 12px;
  line-height: 1.35;
}

.invite-card-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  background: linear-gradient(135deg, #36c8ff, #7e57ff, #ff3159);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
  flex: 0 0 auto;
}

.invited-users-block {
  margin: 8px 14px 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.invited-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.invited-users-title {
  font-size: 15px;
  font-weight: 850;
}

.invited-users-hint {
  color: var(--hint-color);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.invited-users-count {
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(54, 200, 255, 0.12);
  color: #36c8ff;
  font-weight: 900;
}

.person-row--invited:last-child {
  border-bottom: none;
}

.friend-requests-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 14px 4px;
  padding: 12px;
  border: 1px solid rgba(54, 200, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(54, 200, 255, 0.08), rgba(255, 49, 89, 0.06));
}

.friend-requests-title {
  font-size: 15px;
  font-weight: 800;
}

.friend-requests-hint,
.friend-requests-empty {
  color: var(--hint-color);
  font-size: 12px;
  line-height: 1.35;
}

.friend-requests-counts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  color: var(--text-color);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.friend-requests-empty {
  padding: 8px 14px 2px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--hint-color);
  font-size: 14px;
}

.feed-empty {
  padding: 34px 18px;
  border-bottom: 1px solid var(--border-color);
}

.feed-empty-title {
  color: var(--text-color);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 750;
  margin-bottom: 7px;
}

.feed-empty-text {
  color: var(--hint-color);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.feed-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-empty-actions .primary-btn,
.feed-empty-actions .friend-btn {
  margin-top: 0;
}

.feed-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  color: var(--hint-color);
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  line-height: 1.35;
}

.feed-note-text {
  flex: 1;
  min-width: 0;
}

.feed-note-close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--hint-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.feed-note-close:active {
  transform: scale(0.96);
}

/* ===================== ACTIVITY / DIRECT ===================== */
.section-hero {
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(145deg, rgba(106, 169, 255, 0.08), rgba(255, 49, 89, 0.06));
}

.section-hero-title {
  font-size: 22px;
  font-weight: 780;
  line-height: 1.15;
}

.section-hero-text {
  margin-top: 6px;
  color: var(--hint-color);
  font-size: 14px;
  line-height: 1.4;
}

.activity-row,
.direct-row {
  width: calc(100% - 28px);
  margin: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  position: relative;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.activity-row:active,
.direct-row:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--link-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.activity-main,
.direct-main {
  flex: 1;
  min-width: 0;
}

.activity-title,
.direct-name {
  font-size: 14px;
  font-weight: 700;
}

.activity-text,
.direct-text {
  margin-top: 3px;
  color: var(--hint-color);
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time,
.direct-time {
  color: var(--hint-color);
  font-size: 12px;
  flex-shrink: 0;
}

.direct-current,
.direct-thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--hint-color);
  font-size: 13px;
}

.direct-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.direct-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.message-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 150ms ease;
}

.message-bubble--in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 4px;
  color: var(--text-color);
}

.message-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, #6c5ce7, #8e2de2);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.25);
}

.direct-input {
  margin: 8px 14px 0;
  display: flex;
  gap: 8px;
}

.direct-input input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 13px;
  background: var(--secondary-bg);
  color: var(--text-color);
}

.direct-input button {
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--accent-color);
  color: #fff;
  font-weight: 700;
}

/* ===== CHAT (переписка) ===== */
.screen-container--chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  height: 100%;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--secondary-bg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.chat-back {
  display: none;
  border: none;
  background: none;
  color: var(--link-color);
  align-items: center;
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-status {
  font-size: 12px;
  color: var(--hint-color);
  margin-top: 1px;
}

.screen-container--chat .message-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 88px calc(10px + var(--safe-area-bottom)) 12px;
  border-top: 1px solid var(--border-color);
  background: var(--secondary-bg);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 10px 16px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease;
}

.chat-input:focus {
  border-color: var(--accent-color);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 150ms ease, background 150ms ease;
}

.chat-send-btn:active {
  transform: scale(0.92);
  background: #5a4ad1;
}

.message-bubble--new {
  animation: bubbleIn 200ms cubic-bezier(.34,1.56,.64,1);
}

@keyframes bubbleIn {
  from { transform: scale(0.8) translateY(6px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===================== ADMIN ===================== */
.admin-screen {
  background: #0b0d12;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(145deg, rgba(34, 167, 255, 0.12), rgba(255, 49, 89, 0.08));
}

.admin-title {
  font-size: 22px;
  font-weight: 800;
}

.admin-subtitle,
.admin-row-meta,
.admin-metric-hint {
  color: var(--hint-color);
  font-size: 12px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-tab,
.admin-action {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-tab--active {
  background: linear-gradient(135deg, #14356f, #6d1530);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-content {
  padding: 12px;
}

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

.admin-metric,
.admin-section,
.admin-card,
.admin-media-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
}

.admin-metric {
  padding: 12px;
}

.admin-metric-label {
  color: var(--hint-color);
  font-size: 12px;
  font-weight: 700;
}

.admin-metric-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 850;
}

.admin-section {
  margin-top: 12px;
  padding: 12px;
}

.admin-section-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-row,
.admin-card {
  padding: 10px;
  margin-top: 8px;
}

.admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-row-main,
.admin-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-row-main span,
.admin-card-title span {
  color: var(--hint-color);
}

.admin-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color);
  font: inherit;
}

.admin-select {
  max-width: 112px;
}

.admin-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-card-title {
  font-size: 14px;
  font-weight: 800;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-action--danger {
  color: #ff6b8d;
  border-color: rgba(255, 91, 120, 0.35);
}

.admin-action--ok {
  color: #72f2b2;
  border-color: rgba(114, 242, 178, 0.3);
}

.admin-post-text {
  margin: 7px 0;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

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

.admin-media-card {
  overflow: hidden;
}

.admin-media-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  background: var(--secondary-bg);
}

.admin-media-card .admin-row-meta {
  padding: 8px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--hint-color);
  font-size: 12px;
  font-weight: 700;
}

.admin-empty {
  color: var(--hint-color);
  padding: 12px 0;
  font-size: 14px;
}

/* ===== УВЕДОМЛЕНИЯ: красивые карточки ===== */
.notif-row {
  width: calc(100% - 28px);
  margin: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  position: relative;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.notif-row:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.notif-row--unread {
  background: rgba(108, 92, 231, 0.06);
  border-color: rgba(108, 92, 231, 0.15);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.06);
}

.notif-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
  flex-shrink: 0;
}

/* ===================== TAP FAB / MENU ===================== */
.tap-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.composer-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-area-bottom));
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6c5ce7, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.55), 0 2px 8px rgba(0,0,0,0.3);
  z-index: 21;
  transition: right 240ms ease, bottom 240ms ease, transform 225ms cubic-bezier(.34,1.56,.64,1), background 200ms ease;
}

.composer-fab:active {
  transform: scale(0.94);
}

/* Рисуем плюс по умолчанию */
.composer-fab::before,
.composer-fab::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 220ms cubic-bezier(.34,1.56,.64,1);
}
.composer-fab::before {
  width: 20px;
  height: 2.5px;
}
.composer-fab::after {
  width: 2.5px;
  height: 20px;
}

/* При открытии меню плюс превращается в крестик и вращается на 135 градусов */
.composer-fab--menu-open {
  background: linear-gradient(135deg, #ff3159, #ff6b35) !important;
  transform: rotate(135deg);
}

.composer-fab--chat {
  right: 14px;
  bottom: calc(144px + var(--safe-area-bottom));
}

/* Tap-menu — выплывающий снизу список иконок */
.tap-menu {
  position: fixed;
  right: 25px; /* Выравнивание ровно по центру кнопки composer-fab (62px width, right 18px => center is 49px. 49 - 25 = 24px width, so right 25px center matches perfectly!) */
  bottom: calc(92px + var(--safe-area-bottom));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  transition: opacity 240ms cubic-bezier(.4,0,.2,1), transform 240ms cubic-bezier(.34,1.56,.64,1);
}

.tap-menu--chat {
  right: 21px;
  bottom: calc(218px + var(--safe-area-bottom));
}

.tap-menu--open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Элементы меню - круглые иконки */
.tap-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(28, 32, 40, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background 150ms ease, transform 150ms ease, display 150ms ease;
  padding: 0;
  min-width: unset;
  align-self: center;
}

.tap-menu-item:active {
  background: var(--accent-color);
  color: #fff;
  transform: scale(0.9);
}

.tap-menu-item[data-nav="direct"] {
  display: none !important;
}

/* Специальный стиль для кнопки нового поста: белый переливающийся с голубым */
.tap-menu-item--new-post {
  background: linear-gradient(135deg, #ffffff, #dff0ff) !important;
  color: #1a73e8 !important;
  border: 1px solid rgba(106, 169, 255, 0.4) !important;
  box-shadow: 0 4px 16px rgba(106, 169, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  animation: shimmerGlow 3s ease-in-out infinite alternate;
}

@keyframes shimmerGlow {
  0% {
    box-shadow: 0 4px 14px rgba(106, 169, 255, 0.4);
    background: linear-gradient(135deg, #ffffff, #dff0ff) !important;
  }
  100% {
    box-shadow: 0 4px 22px rgba(106, 169, 255, 0.7), 0 0 8px rgba(108, 92, 231, 0.3);
    background: linear-gradient(135deg, #eef7ff, #ffffff) !important;
  }
}

.tap-menu-item--new-post:active {
  transform: scale(0.9) !important;
  background: #cce7ff !important;
}

/* Анимация пунктов — каждый с задержкой */
.tap-menu--open .tap-menu-item:nth-child(1) { transition-delay: 0ms; }
.tap-menu--open .tap-menu-item:nth-child(2) { transition-delay: 30ms; }
.tap-menu--open .tap-menu-item:nth-child(3) { transition-delay: 60ms; }
.tap-menu--open .tap-menu-item:nth-child(4) { transition-delay: 90ms; }
.tap-menu--open .tap-menu-item:nth-child(5) { transition-delay: 120ms; }
.tap-menu--open .tap-menu-item:nth-child(6) { transition-delay: 150ms; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-height: 85vh;
  background: var(--secondary-bg);
  border-radius: 16px 16px 0 0;
  padding: 12px 14px calc(14px + var(--safe-area-bottom));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title { font-weight: 700; font-size: 15px; }

.link-btn {
  border: none;
  background: none;
  color: var(--link-color);
  font-size: 14px;
}

.primary-btn {
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 10px;
}

.primary-btn:disabled { opacity: 0.4; }

.composer-context, .composer-quote {
  font-size: 13px;
  color: var(--hint-color);
}

/* ============ Онбординг: выбор никнейма при первом входе ============ */
.username-modal .modal-sheet {
  border-radius: 16px;
  margin: auto;
  max-width: 380px;
  align-self: center;
  overflow: hidden;
  position: relative;
}

.onboarding-step {
  animation: onboardingIn 260ms ease both;
}

.onboarding-step[hidden] {
  display: none;
}

.onboarding-kicker {
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(54, 200, 255, 0.12);
  color: #36c8ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-title {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 8px;
}

.onboarding-hint {
  font-size: 13px;
  color: var(--hint-color);
  line-height: 1.45;
  margin-bottom: 16px;
}

.onboarding-cards {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.onboarding-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  background: var(--card-bg);
  position: relative;
  overflow: hidden;
}

.onboarding-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
}

.onboarding-card--friends::before {
  background: linear-gradient(135deg, #0b2a6f, #6f1422);
}

.onboarding-card--vibe::before {
  background: linear-gradient(135deg, #4920ff, #ff2b5f, #07070c);
}

.onboarding-card-title {
  position: relative;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 5px;
}

.onboarding-card-text {
  position: relative;
  color: var(--hint-color);
  font-size: 12px;
  line-height: 1.4;
}

.username-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.username-input-wrap--checking {
  border-color: rgba(54, 200, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(54, 200, 255, 0.12);
}

.username-input-wrap--good {
  border-color: rgba(34, 197, 94, 0.75);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.username-input-wrap--taken,
.username-input-wrap--bad {
  border-color: rgba(255, 91, 91, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.12);
  animation: usernameNudge 180ms ease;
}

.username-prefix {
  color: var(--hint-color);
  margin-right: 2px;
  font-size: 15px;
}

.username-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  color: var(--text-color);
  font-size: 15px;
  font-family: inherit;
}

.username-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--hint-color);
  opacity: 0.55;
  flex: 0 0 auto;
}

.username-status-dot--checking {
  background: #36c8ff;
  animation: usernamePulse 780ms ease-in-out infinite;
}

.username-status-dot--good {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
}

.username-status-dot--taken,
.username-status-dot--bad {
  background: #ff5b5b;
}

.username-rules {
  color: var(--hint-color);
  font-size: 11px;
  line-height: 1.35;
  margin: -1px 0 8px;
}

.username-live-status {
  min-height: 20px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: color 160ms ease;
}

.username-live-status--idle {
  color: var(--hint-color);
}

.username-live-status--checking {
  color: #36c8ff;
}

.username-live-status--good {
  color: #22c55e;
  animation: usernamePop 220ms ease;
}

.username-live-status--taken,
.username-live-status--bad {
  color: var(--danger-color, #ff5b5b);
}

.username-error {
  color: var(--danger-color, #ff5b5b);
  font-size: 13px;
  margin-bottom: 10px;
}

.username-error[hidden] { display: none; }

.username-submit {
  width: 100%;
  padding: 11px 16px;
  text-align: center;
}

@keyframes onboardingIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes usernamePulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.35); opacity: 1; }
}

@keyframes usernamePop {
  0% { transform: scale(0.98); }
  65% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes usernameNudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

.composer-quote .quote-card { margin-top: 6px; }

.composer-textarea {
  width: 100%;
  min-height: 110px;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  padding: 6px 0;
}

.composer-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--accent-color);
}

.media-preview {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.media-preview img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.char-counter {
  font-size: 13px;
  color: var(--hint-color);
  min-width: 36px;
  text-align: right;
}

.char-counter.over { color: var(--danger-color); }

/* ===================== PROFILE TABS & EDIT PROFILE MODAL ===================== */
.profile-tabs {
  display: flex;
  margin: 16px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.profile-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--hint-color);
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 150ms ease, border-color 150ms ease;
  cursor: pointer;
  outline: none;
}

.profile-tab:active {
  transform: none;
}

.profile-tab--active {
  color: #fff;
  border-bottom: 2px solid #fff;
  background: transparent;
}

.edit-profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  gap: 8px;
}

.edit-avatar-preview-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: border-color 180ms ease, transform 180ms ease;
}

.edit-avatar-preview-wrap:active {
  transform: scale(0.96);
}

.edit-avatar-preview-wrap:hover .edit-avatar-overlay {
  opacity: 1;
}

.edit-avatar-preview-wrap #edit-avatar-preview {
  width: 100% !important;
  height: 100% !important;
  font-size: 36px;
}

.edit-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.7;
  transition: opacity 180ms ease;
}

.edit-profile-field {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-profile-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--hint-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.edit-bio-textarea {
  min-height: 80px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-color);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.edit-bio-textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.edit-profile-select {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-color);
  color: var(--text-color);
}

.max-message-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #36c8ff, #2962ff);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
}

/* ===================== CROPPER MODAL ===================== */
.cropper-sheet {
  max-width: 400px;
  margin: auto;
  border-radius: 20px 20px 0 0;
  align-self: flex-end;
}

.cropper-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-top: 12px;
}

.cropper-crop-area {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cropper-image {
  position: absolute;
  max-width: none;
  max-height: none;
  cursor: move;
  user-select: none;
  -webkit-user-drag: none;
}

.cropper-mask {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.4);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.cropper-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 8px;
  color: var(--hint-color);
}

#cropper-zoom {
  flex: 1;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

#cropper-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 100ms ease;
}

#cropper-zoom::-webkit-slider-thumb:active {
  transform: scale(1.15);
}
