:root {
  --bg: #050505;
  --panel: #101010;
  --panel-2: #171717;
  --panel-3: #202020;
  --text: #f7f7f7;
  --muted: #8f8f8f;
  --accent: #e11d2e;
  --accent-2: #ff3547;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #1b0005 0%, #050505 48%, #000000 100%);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

body[data-light-mode="1"] {
  --text: #111111;
  --muted: #51545c;
  --border: rgba(0, 0, 0, 0.12);
  background: #f2f3f7;
  color: var(--text);
}

body[data-light-mode="1"] .phone-shell,
body[data-light-mode="1"] .card,
body[data-light-mode="1"] .sheet-panel,
body[data-light-mode="1"] .sheet-content {
  background: #ffffff;
  color: #111111;
}

body[data-light-mode="1"] .muted {
  color: #5f6472;
}

body {
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) 14px env(safe-area-inset-bottom, 0);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.desktop-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(225, 29, 46, 0.18), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(255, 53, 71, 0.14), transparent 22%),
    radial-gradient(circle at 50% 80%, rgba(225, 29, 46, 0.1), transparent 28%);
  pointer-events: none;
}

.phone-shell {
  position: relative;
  width: 100%;
  max-width: min(460px, 100vw);
  min-width: min(320px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.98), rgba(7, 7, 7, 0.98));
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.back-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 16px;
  background: #161616;
  color: var(--text);
  flex-shrink: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-link {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #55070f);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img,
.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.topbar-action,
.topbar-spacer {
  min-width: 36px;
  display: flex;
  justify-content: center;
}

.screen-content {
  flex: 1;
  min-height: 0;
  padding: 16px 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.card {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(12, 12, 12, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.stack-gap {
  display: grid;
  gap: 14px;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  cursor: pointer;
  text-align: center;
}

.btn:hover,
.btn:active {
  transform: translateY(-1px);
}

.btn:disabled {
  background: #454545 !important;
  color: #b0b0b0;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.btn-secondary {
  background: #2a2a2a;
}

.btn-danger {
  background: linear-gradient(180deg, #b31522, #7f0914);
}

.btn-wide {
  width: 100%;
}

.mini-btn,
.call-control {
  padding: 10px 12px;
  border-radius: 14px;
}

.emoji-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.field select,
.search-input,
.input {
  width: 100%;
  background: #0b0b0b;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

.field textarea,
.textarea {
  min-height: 110px;
  resize: vertical;
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: #ff7580;
}

.accent {
  color: var(--accent-2);
}

.text-link,
.mini-link {
  color: var(--accent-2);
}

.danger-link {
  color: #ff7580;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
}

.flash-success {
  background: rgba(35, 160, 85, 0.16);
  border: 1px solid rgba(35, 160, 85, 0.35);
}

.flash-error {
  background: rgba(225, 29, 46, 0.16);
  border: 1px solid rgba(225, 29, 46, 0.35);
}

.bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(8, 8, 8, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

body[data-client-platform="desktop"] .bottom-nav {
  width: min(560px, calc(100% - 28px));
  margin: 0 auto;
}

.nav-item {
  min-height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  position: relative;
}

.nav-item.active {
  background: rgba(225, 29, 46, 0.14);
  color: var(--text);
}

.nav-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.auth-screen {
  min-height: calc(100dvh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-logo {
  width: 108px;
  height: 108px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #460007);
}

.logo-fallback-big {
  width: 108px;
  height: 108px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #460007);
  font-weight: 700;
}

.auth-card {
  padding: 18px;
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.upload-drop {
  display: grid;
  place-items: center;
  min-height: 148px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.upload-drop input {
  display: none;
}

.avatar-preview {
  margin-top: 12px;
}

.avatar-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-page {
  display: grid;
  gap: 14px;
}

.profile-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 32px;
  overflow: hidden;
  background: #0e0e0e;
  border: 1px solid var(--border);
}

.cover-image,
.cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  background:
    linear-gradient(135deg, rgba(225, 29, 46, 0.36), transparent 60%),
    radial-gradient(circle at top right, rgba(255, 53, 71, 0.24), transparent 26%),
    linear-gradient(180deg, #141414, #090909);
}

.profile-avatar-on-cover {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.avatar-wrap {
  position: relative;
  border-radius: 50%;
  overflow: visible;
  background: linear-gradient(135deg, #2d0a0f, #0c0c0c);
  border: 2px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.avatar-wrap.avatar-sm {
  width: 38px;
  height: 38px;
}

.avatar-wrap.avatar-md {
  width: 52px;
  height: 52px;
}

.avatar-wrap.avatar-xl {
  width: 128px;
  height: 128px;
}

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

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  border-radius: inherit;
}

.avatar-wrap:not(.avatar-fallback-active) .avatar-fallback {
  opacity: 0;
}

.avatar-wrap.avatar-blocked {
  background: #050505;
  border-color: rgba(255, 255, 255, 0.04);
}

.avatar-presence {
  position: absolute;
  left: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #090909;
  background: #d0d4d9;
  z-index: 5;
}

.avatar-wrap.avatar-xl .avatar-presence {
  width: 18px;
  height: 18px;
  left: 4px;
  bottom: 4px;
  border-width: 3px;
}

.avatar-presence-online {
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 72%, transparent);
}

.avatar-presence-offline {
  background: #d0d4d9;
}

.avatar-presence-blocked {
  background: #000;
}

.profile-header-card,
.info-card {
  background: rgba(14, 14, 14, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.profile-name-row,
.post-author,
.report-head,
.chat-row-top,
.kv,
.profile-music-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.name-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  vertical-align: middle;
}

.verify-badge-inline {
  flex-shrink: 0;
  margin-right: 4px;
}

.profile-name-row h1,
.section-header h2,
.call-title {
  margin: 0;
  font-size: 24px;
}

.profile-name-row {
  align-items: center;
  flex-wrap: wrap;
}

.profile-actions-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-actions-grid-two {
  grid-template-columns: repeat(2, 1fr);
}

.profile-actions-grid-three {
  grid-template-columns: repeat(3, 1fr);
}

.profile-actions-icon-grid .btn {
  min-height: 52px;
}

.profile-icon-action {
  display: inline-grid;
  place-items: center;
  padding: 10px;
}

.profile-icon-action .ui-icon {
  width: 30px;
  height: 30px;
}

.profile-actions-grid-four {
  grid-template-columns: repeat(4, 1fr);
}

.profile-follow-btn {
  margin-top: 14px;
}

.profile-music-card {
  display: grid;
  gap: 12px;
}

.music-logo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(225, 29, 46, 0.35), rgba(225, 29, 46, 0.12));
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.music-slider,
.music-volume {
  width: 100%;
}

.music-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
  text-align: center;
}

.menu-fab {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.44);
  color: white;
  z-index: 2;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gallery-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #0d0d0d;
  min-height: 90px;
}

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

.compose-card {
  display: block;
}

.compose-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.post-card,
.comment-card {
  display: grid;
  gap: 12px;
}

.post-head,
.post-user,
.post-actions,
.inline-actions,
.chat-row-bottom,
.section-header,
.chat-top,
.call-actions,
.admin-row,
.log-row,
.list-row,
.simple-row,
.chat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-row {
  padding: 14px 16px;
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.post-text {
  white-space: pre-wrap;
  line-height: 1.45;
}

.post-media img,
.post-media video {
  width: 100%;
  border-radius: 22px;
  max-height: min(72dvh, 680px);
  object-fit: contain;
  background: #090909;
  display: block;
  margin: 0 auto;
}

.post-media-carousel {
  position: relative;
}

.post-media-track {
  display: flex;
  gap: 0;
}

.post-media-carousel .post-media-track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 22px;
}

.post-media-carousel .post-media-track::-webkit-scrollbar {
  display: none;
}

.post-media-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: center;
}

.media-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.72);
  color: #fff;
}

.media-carousel-btn[disabled] {
  opacity: 0.35;
}

.media-carousel-btn-prev {
  left: 10px;
}

.media-carousel-btn-next {
  right: 10px;
}

.media-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.media-carousel-dot {
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  padding: 0;
}

.media-carousel-dot.active {
  background: #fff;
}

.message-media img,
.message-media video {
  width: 100%;
  border-radius: 22px;
  max-height: 360px;
  object-fit: cover;
}

.post-actions {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.icon-btn,
.passive-icon {
  border: none;
  background: #1c1c1c;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #bdbdbd;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-btn.active {
  color: white;
  background: rgba(225, 29, 46, 0.28);
}

.beta-lang-btn.active {
  border-color: color-mix(in srgb, var(--accent) 56%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, #131313);
}

.beta-lang-flag {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
  align-items: center;
  justify-items: center;
}

.beta-lang-flag .emoji-image {
  width: 18px;
  height: 18px;
}

.like-btn .like-heart {
  color: #ffffff;
  line-height: 1;
}

.like-btn.active .like-heart {
  color: #ff2b3c;
}

.like-btn .like-heart-icon {
  width: 18px;
  height: 18px;
  filter: none;
}

.like-btn.active .like-heart-icon {
  filter: none;
}

.passive-icon {
  cursor: default;
}

.file-card {
  display: block;
  padding: 14px;
  background: #131313;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.inline-freeze-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.chat-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.chat-screen-with-wallpaper {
  position: relative;
}

.chat-screen-with-wallpaper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.72)), var(--chat-wallpaper);
  background-size: cover;
  background-position: center;
  border-radius: 24px;
  pointer-events: none;
  z-index: 0;
}

.chat-screen-with-wallpaper > * {
  position: relative;
  z-index: 1;
}

.chat-top {
  padding: 10px 12px;
}

.chat-row {
  padding: 12px 14px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chat-row-unread {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.chat-unread-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-row-bottom {
  align-items: flex-start;
  min-width: 0;
}

.chat-row-top,
.chat-row-bottom,
.chat-row strong,
.chat-row .muted,
.chat-top .post-user,
.chat-top .post-author,
#chat-peer-status {
  min-width: 0;
}

.chat-row-top strong,
.chat-preview-text,
.chat-top .post-author,
#chat-peer-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview-text {
  flex: 0 1 50%;
  max-width: 50%;
}

.chat-preview-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.chat-delivery-mark {
  font-size: 11px;
  line-height: 1;
  opacity: 0.9;
  flex-shrink: 0;
}

.chat-row-top {
  gap: 8px;
}

.chat-row-top .muted,
.chat-row-bottom .muted {
  flex-shrink: 0;
}

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

.notification-card-unread {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent), 0 8px 22px rgba(0, 0, 0, 0.24);
}

.chat-pin-emoji {
  font-size: 18px;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding-right: 2px;
}

.message {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.message.own {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 76%;
  min-width: 92px;
  min-height: 42px;
  border: none;
  background: #131313;
  color: var(--text);
  border-radius: 18px 18px 18px 10px;
  padding: 10px 12px;
  text-align: left;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.message.own .message-bubble {
  background: linear-gradient(180deg, rgba(225, 29, 46, 0.24), rgba(225, 29, 46, 0.12));
  border-radius: 18px 18px 10px 18px;
}

.message-bubble.sticker-only {
  background: transparent !important;
  border: none;
  min-width: 0;
  padding: 0;
  gap: 6px;
  max-width: min(220px, 70vw);
}

.message-bubble.sticker-only .message-reactions,
.message-bubble.sticker-only .message-meta {
  width: 100%;
}

.message-text {
  line-height: 1.35;
}

.group-message-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  max-width: 100%;
  cursor: pointer;
}

.group-message-author-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-premium-name {
  min-height: 22px;
  padding: 1px 8px;
  font-size: 13px;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.message-status {
  color: #fff;
  letter-spacing: -1px;
}

.reply-pill,
.reply-preview {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-radius: 14px;
  padding: 8px 12px;
  border: none;
}

.reply-link {
  display: grid;
  gap: 3px;
  text-align: left;
}

.reply-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview {
  display: grid;
  gap: 4px;
  margin-bottom: 0;
}

.reply-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-input-bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.attachment-preview {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

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

.attachment-preview-thumb {
  width: 100%;
  max-height: 180px;
  border-radius: 18px;
  object-fit: cover;
  background: #0f0f0f;
}

.chat-input-bar input[type="text"] {
  background: #101010;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 18px;
  padding: 12px 14px;
  min-width: 0;
}

.attach-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #191919;
  cursor: pointer;
  border: none;
  color: var(--text);
}

.attach-btn input {
  display: none;
}

.post-form-tools {
  display: flex;
  gap: 10px;
}

.chat-action-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
}

#record-mode-btn {
  display: none !important;
}

.emoji-picker {
  display: grid;
  gap: 10px;
  max-height: 250px;
  overflow: hidden;
}

.emoji-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.emoji-switch-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.emoji-tab {
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
  border-radius: 10px;
  min-height: 34px;
  font-size: 16px;
  line-height: 1;
}

.emoji-tab.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, #121212);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  max-height: 178px;
  padding-right: 2px;
}

.emoji-item {
  border: 1px solid var(--border);
  background: #131313;
  color: var(--text);
  border-radius: 12px;
  min-height: 42px;
  font-size: 24px;
  line-height: 1;
}

.emoji-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

.emoji-image.emoji-image-lg {
  width: 20px;
  height: 20px;
}

.emoji-item .emoji-image {
  width: 20px;
  height: 20px;
}

.emoji-tab .emoji-image {
  width: 16px;
  height: 16px;
}

.emoji-switch-tabs .emoji-tab {
  display: grid;
  place-items: center;
}

.emoji-switch-tabs .ui-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  max-height: 176px;
  padding-right: 2px;
}

.sticker-item-btn {
  border: 1px solid var(--border);
  background: #111;
  border-radius: 12px;
  min-height: 64px;
  padding: 4px;
}

.sticker-item-media {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.sticker-pack-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  color: #f4f4f4;
}

.sticker-pack-row .muted {
  color: #d8d8d8;
}

.sticker-message-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.sticker-media {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 12px;
}

.voice-recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(225, 29, 46, 0.12);
  border: 1px solid rgba(225, 29, 46, 0.2);
}

.voice-recording-bar.circle-mode-active {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 28px));
  min-height: 320px;
  z-index: 80;
  flex-direction: column;
  justify-content: center;
  padding: 22px 18px;
  border-radius: 28px;
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.circle-recording-preview {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #0d0d0d;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.voice-recording-bar.circle-mode-active .circle-recording-preview {
  width: 220px;
  height: 220px;
  margin: 0 auto 6px;
  border-width: 3px;
}

.circle-recording-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.circle-camera-switch {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  padding: 0;
}

.voice-recording-bar.circle-mode-active .circle-camera-switch {
  width: 42px;
  height: 42px;
  right: 8px;
  bottom: 8px;
}

.voice-recording-bar.circle-mode-active .circle-camera-switch .ui-icon {
  width: 22px;
  height: 22px;
}

.circle-camera-switch .ui-icon {
  width: 18px;
  height: 18px;
}

.message-media-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: #0d0d0d;
}

.message-media-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-highlight {
  animation: messageFlash 1.2s ease;
}

@keyframes messageFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 53, 71, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(255, 53, 71, 0); }
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.search-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 14px;
  min-height: 42px;
  padding: 10px 12px;
  background: #171717;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.search-tab.active {
  background: rgba(225, 29, 46, 0.18);
  color: var(--text);
}

.section-block {
  display: none;
  gap: 10px;
}

.section-block.active {
  display: grid;
}

.settings-link {
  display: block;
  font-weight: 600;
}

.compact-stack {
  gap: 10px;
}

.compact-card {
  padding: 0;
}

.data-memory-hero,
.data-memory-actions-grid {
  display: grid;
  gap: 12px;
}

.data-memory-actions-grid {
  grid-template-columns: repeat(2, 1fr);
}

.rules-text {
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
}

.captcha-question {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  padding: 12px 0;
}

.admin-row,
.log-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
}

.admin-row:last-child,
.log-row:last-child {
  border-bottom: none;
}

.admin-actions {
  display: grid;
  gap: 8px;
}

.group-member-manage-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 12px 0;
  text-align: left;
}

.group-member-role {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.group-member-prefix,
.group-member-pill-role {
  font-size: 12px;
  color: var(--muted);
}

.invite-link-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.compact-invite-box {
  margin: 10px 0 14px;
}

.group-selected-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-selected-user {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-freeze {
  display: grid;
  gap: 6px;
}

.inline-freeze input {
  background: #111;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.report-card {
  display: grid;
  gap: 8px;
}

.call-screen {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.call-card {
  width: 100%;
  text-align: center;
  display: grid;
  gap: 14px;
}

.call-video-stack {
  position: relative;
  width: 100%;
}

.call-video {
  width: 100%;
  height: 240px;
  border-radius: 22px;
  background: #0e0e0e;
  object-fit: cover;
  display: block;
}

.call-video:not(.has-stream) {
  background:
    linear-gradient(135deg, rgba(225, 29, 46, 0.18), transparent 55%),
    linear-gradient(180deg, #101010, #050505);
}

.call-video-small {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 124px;
  height: 86px;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

.group-call-members {
  margin-top: 4px;
}

.group-call-tile {
  position: relative;
  min-height: 180px;
}

.group-call-tile-active {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 0;
}

.group-call-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-call-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.call-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.call-volume-field {
  margin-bottom: 0;
}

.incoming-call {
  margin: 0 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(225, 29, 46, 0.18);
  border: 1px solid rgba(225, 29, 46, 0.35);
}

.offline-banner {
  margin: 10px 14px 0;
  padding: 12px 14px;
  border-radius: 18px;
  display: grid;
  gap: 4px;
  background: rgba(255, 184, 0, 0.16);
  border: 1px solid rgba(255, 184, 0, 0.28);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
}

.sheet-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(460px, 100vw);
  background: linear-gradient(180deg, #181818, #0d0d0d);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--border);
  padding: 18px 14px calc(22px + env(safe-area-inset-bottom, 0));
  z-index: 100;
  max-height: 56vh;
  overflow-y: auto;
}

.sheet-panel[data-mode="center"] {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 28px));
  max-height: min(78vh, 820px);
  border-radius: 28px;
  padding: 18px;
}

.sheet-content {
  display: grid;
  gap: 10px;
}

.media-viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 110;
}

.media-viewer-panel {
  position: fixed;
  inset: 0;
  z-index: 111;
  display: grid;
  place-items: center;
  padding: 20px 14px;
}

.media-viewer-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  display: grid;
  gap: 12px;
  background: #090909;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 14px;
}

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

.media-viewer-content {
  width: 100%;
  max-height: calc(100dvh - 180px);
  border-radius: 22px;
  background: #050505;
  object-fit: contain;
}

.verify-badge,
.freeze-badge {
  border: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  align-self: center;
}

.verify-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.verify-fallback {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .profile-actions-grid-four {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .data-memory-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 860px) {
  body {
    padding: 24px;
  }

  .phone-shell {
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  body[data-client-platform="desktop"] .phone-shell {
    max-width: min(1120px, calc(100vw - 48px));
  }
}

@media (max-width: 520px) {
  body {
    padding: max(6px, env(safe-area-inset-top, 0)) 0 max(6px, env(safe-area-inset-bottom, 0));
  }

  .phone-shell {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    border-right: none;
  }
}

.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), var(--accent));
}

.accent {
  color: var(--accent);
}

.back-btn img,
.ui-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.nav-item {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 4px;
}

.nav-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-item.active {
  background: var(--accent-soft, rgba(225, 29, 46, 0.14));
}

.mini-icon-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.mini-icon-btn .ui-icon {
  width: 24px;
  height: 24px;
}

.feed-follow-inline-btn .ui-icon {
  width: 27px;
  height: 27px;
}

.bot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.premium-badge {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  border: none;
  vertical-align: middle;
}

.premium-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.identity-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.premium-badge-image {
  background: transparent;
  border: none;
}

.premium-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}

.premium-badge-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.premium-badge-option-box {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.premium-badge-option-box img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.premium-badge-option input:checked + .premium-badge-option-box {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.premium-name {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}

.premium-name-gradient {
  color: transparent;
  background-image: linear-gradient(135deg, var(--premium-name-start, #ffffff), var(--premium-name-end, #ff5ca8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
}

.compact-badge {
  margin-left: 2px;
  align-self: center;
  flex-shrink: 0;
}

.premium-badge.compact-badge {
  margin-left: -4px;
}

.verify-badge.compact-badge,
.identity-badge.compact-badge {
  width: 20px;
  height: 20px;
}

.verify-badge.compact-badge img,
.identity-badge.compact-badge img {
  width: 20px;
  height: 20px;
}

.status-chart {
  width: 100%;
  height: 220px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.premium-name-red { color: #e11d2e; }
.premium-name-burgundy { color: #8b1e3f; }
.premium-name-pink { color: #ff4f8b; }
.premium-name-orange { color: #ff7a18; }

.profile-share-qr-wrap {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-share-qr-image {
  width: min(100%, 320px);
  aspect-ratio: 24 / 29.5;
  object-fit: contain;
  border-radius: 20px;
  background: #fff;
}

.profile-share-qr-caption {
  word-break: break-all;
  text-align: center;
}

.premium-gradient-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.premium-gradient-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.premium-gradient-preview {
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
}

.premium-gradient-preview.is-ready {
  color: transparent;
  background-image: linear-gradient(135deg, var(--premium-name-start, #ffffff), var(--premium-name-end, #ff5ca8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-color: rgba(255, 255, 255, 0.14);
}

.premium-gradient-slots {
  display: flex;
  gap: 10px;
}

.premium-gradient-slot {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 50% 50%, var(--slot-color, transparent) 0 62%, rgba(255, 255, 255, 0.05) 63% 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  cursor: pointer;
}

.premium-gradient-slot.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.premium-gradient-slot.filled {
  border-color: rgba(255, 255, 255, 0.32);
}

.premium-gradient-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.premium-gradient-choice {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.premium-gradient-choice span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.premium-gradient-choice.selected-start {
  border-color: #ff8a1c;
}

.premium-gradient-choice.selected-end {
  border-color: #62b0ff;
}

.icon-link-btn {
  display: inline-grid;
  place-items: center;
}

.feed-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: stretch;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-toggle-row:last-of-type {
  border-bottom: none;
}

.settings-toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.rules-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  margin: 14px 0;
}

.rules-consent input {
  margin-top: 2px;
}

.rules-consent a {
  color: var(--accent);
}

.preview-grid {
  display: grid;
  gap: 14px;
}

.upload-preview-box {
  min-height: 110px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b0b0b;
}

.cover-preview-box {
  min-height: 0;
  aspect-ratio: 16 / 10;
}

.avatar-preview-box {
  width: 132px;
  height: 132px;
  min-height: 132px;
  border-radius: 999px;
  margin: 0 auto;
}

.upload-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.username-change-btn {
  text-align: left;
  justify-content: flex-start;
}

.birthday-editor {
  display: grid;
  gap: 12px;
}

.birthday-banner {
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.2), rgba(255, 102, 0, 0.16));
  border: 1px solid rgba(255, 184, 0, 0.2);
  animation: birthdayGlow 2.2s ease-in-out infinite;
  text-align: center;
  font-weight: 600;
}

.birthday-inline {
  display: inline-block;
  animation: birthdayFloat 1.8s ease-in-out infinite;
}

@keyframes birthdayGlow {
  0% { box-shadow: 0 0 0 rgba(255, 184, 0, 0.16); }
  50% { box-shadow: 0 0 24px rgba(255, 184, 0, 0.18); }
  100% { box-shadow: 0 0 0 rgba(255, 184, 0, 0.16); }
}

@keyframes birthdayFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.profile-page .profile-header-card .btn-primary,
.profile-page .profile-header-card .btn-secondary,
.profile-page .profile-music-card .btn-primary,
.profile-page .stat-card strong,
.profile-page .section-title.accent {
  color: var(--profile-accent, var(--accent));
}

.profile-page .profile-header-card .btn-primary {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 86%, white), var(--profile-accent, var(--accent)));
}

.profile-page .cover-fallback {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 36%, transparent), transparent 60%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--profile-accent, var(--accent)) 24%, transparent), transparent 26%),
    linear-gradient(180deg, #141414, #090909);
}

.profile-page .music-logo {
  background: linear-gradient(135deg, var(--profile-accent-strong, var(--accent-strong, rgba(225, 29, 46, 0.35))), var(--profile-accent-soft, var(--accent-soft, rgba(225, 29, 46, 0.12))));
}

.profile-page .accent {
  color: var(--profile-accent, var(--accent));
}

.pinned-title {
  gap: 8px;
}

.older-messages-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.older-messages-btn.loading {
  opacity: 0.6;
}

.sheet-message-preview {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.35;
}

.edited-flag .ui-icon,
.message-meta .ui-icon,
.post-actions .ui-icon,
.chat-pin-emoji .ui-icon {
  width: 24px;
  height: 24px;
}

.post-actions .icon-btn,
.post-actions .passive-icon {
  padding: 0;
}

.captcha-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.captcha-option {
  border: 1px solid var(--border);
  background: #111;
  color: var(--text);
  border-radius: 18px;
  padding: 14px 12px;
  display: grid;
  gap: 8px;
  place-items: center;
}

.captcha-option-emoji {
  font-size: 28px;
}

.captcha-option-name {
  color: var(--muted);
  font-size: 13px;
}

.call-control .ui-icon {
  width: 28px;
  height: 28px;
}

.chat-action-label {
  font-size: 18px;
  line-height: 1;
}

.post-edited-flag {
  margin-left: auto;
}

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

.attachment-preview-item {
  display: grid;
  gap: 8px;
}

.attachment-choice-grid {
  display: grid;
  gap: 10px;
}

.bot-empty-card {
  display: grid;
  gap: 12px;
}

.echo-balance-card {
  display: grid;
  gap: 10px;
  text-align: center;
}

.echo-balance-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.echo-balance-icon .ui-icon {
  width: 34px;
  height: 34px;
}

.echo-balance-value {
  font-size: 28px;
  font-weight: 800;
}

.echo-pack-card,
.echo-transaction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.premium-plan-card + .premium-plan-card {
  margin-top: 6px;
}

.premium-accordion summary {
  list-style: none;
  cursor: pointer;
}

.premium-accordion summary::-webkit-details-marker {
  display: none;
}

.premium-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.premium-accordion-arrow {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.premium-accordion[open] .premium-accordion-arrow {
  transform: rotate(180deg);
}

.echo-qr-box {
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  padding: 16px;
}

.echo-qr-box img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.message-reactions,
.reaction-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.reaction-pill,
.reaction-picker-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 16px;
}

.reaction-pill .emoji-image,
.reaction-picker-btn .emoji-image {
  width: 18px;
  height: 18px;
  margin-right: 4px;
}

.reaction-pill.mine {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.reaction-picker-btn {
  min-width: 46px;
  min-height: 38px;
}

.gift-message-card,
.gift-card-mini,
.gift-card-large {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.gift-message-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
}

.gift-message-body,
.gift-card-mini,
.gift-card-large {
  display: grid;
  gap: 6px;
}

.gift-card-mini,
.gift-card-large {
  padding: 14px;
}

.gift-card-button {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gift-card-mini.sold {
  opacity: 0.7;
}

.gift-card-select {
  display: block;
  min-width: 0;
}

.gift-card-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gift-card-select input:checked + .gift-card-large {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.gift-emoji {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 24px;
}

.gift-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gift-message-text {
  white-space: pre-wrap;
}

.gift-details-sheet {
  gap: 12px;
}

.gift-details-media {
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.gift-details-media img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(54px, 74px));
  justify-content: center;
  justify-items: center;
  gap: 12px;
}

.nav-item {
  width: 100%;
  max-width: 78px;
}

body[data-client-platform="desktop"] .phone-shell {
  max-width: min(1180px, calc(100vw - 48px));
}

body[data-client-platform="desktop"] .screen-content {
  width: min(1040px, 100%);
  margin: 0 auto;
}

body[data-client-platform="android"] .phone-shell {
  width: min(100vw, 520px);
  max-width: min(520px, 100vw);
}

body[data-client-platform="android"] .screen-content {
  width: 100%;
  margin: 0 auto;
}

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

.story-strip-card,
.story-strip {
  display: grid;
  gap: 12px;
}

.story-strip {
  grid-auto-flow: column;
  grid-auto-columns: minmax(78px, 88px);
  overflow-x: auto;
  padding-bottom: 4px;
}

.story-bubble-link {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  font-size: 12px;
}

.story-bubble-button {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.story-bubble,
.story-avatar-ring {
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.story-bubble.has-story,
.story-avatar-ring.has-story {
  background: linear-gradient(135deg, #ff4d5e, #e11d2e, #ff9764);
}

.story-bubble.seen-story,
.story-avatar-ring.seen-story {
  background: linear-gradient(135deg, #6f6f6f, #474747);
}

.profile-page .story-avatar-ring.has-story {
  background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 88%, white), var(--profile-accent, var(--accent)));
}

.profile-page .story-avatar-ring.seen-story {
  background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 42%, #7a7a7a), #4b4b4b);
}

.story-bubble.story-multi.has-story,
.story-avatar-ring.story-multi.has-story {
  background:
    repeating-conic-gradient(
      from -90deg,
      color-mix(in srgb, var(--story-ring-color, var(--accent)) 88%, white) 0 calc((360deg / var(--story-count, 2)) - 7deg),
      #090909 calc((360deg / var(--story-count, 2)) - 7deg) calc(360deg / var(--story-count, 2))
    );
}

.story-bubble.story-multi.seen-story,
.story-avatar-ring.story-multi.seen-story {
  background:
    repeating-conic-gradient(
      from -90deg,
      #6a6a6a 0 calc((360deg / var(--story-count, 2)) - 7deg),
      #090909 calc((360deg / var(--story-count, 2)) - 7deg) calc(360deg / var(--story-count, 2))
    );
}

.story-bubble .avatar-wrap,
.story-avatar-ring .avatar-wrap {
  border: 3px solid #090909;
}

.story-avatar-link {
  display: inline-grid;
}

.story-avatar-link:not(.story-avatar-enabled) {
  pointer-events: none;
}

.story-add-btn {
  position: absolute;
  right: -2px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 3px solid #090909;
}

.profile-page .story-add-btn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 86%, white), var(--profile-accent, var(--accent)));
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.story-feed-add-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  flex-shrink: 0;
  margin-top: 8px;
}

.story-feed-add-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.post-menu-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  padding: 0;
}

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

.story-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.story-card video,
.story-video-large {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  background: #0d0d0d;
}

.story-view-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  touch-action: manipulation;
}

.story-view-header,
.story-view-user,
.profile-head-meta,
.announcement-head,
.announcement-nav,
.story-meta-line,
.story-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-head-meta {
  justify-content: flex-start;
  color: var(--muted);
}

.username-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.45;
}

.username-link {
  color: #4d8dff;
  font-weight: 600;
}

.kv-bio {
  align-items: flex-start;
}

.kv-bio span {
  flex: 0 0 auto;
}

.kv-bio strong {
  flex: 1;
  text-align: left;
}

.group-member-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.group-member-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.profile-sections-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.announcement-sheet {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  width: min(400px, calc(100vw - 24px));
}

.status-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.status-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: 260px;
  white-space: pre-wrap;
  pointer-events: none;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.story-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.story-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mini-story-menu-btn {
  min-width: 38px;
  min-height: 38px;
}

.pinned-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.pinned-banner-main {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  gap: 4px;
  padding: 0;
}

.pinned-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinned-preview {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.pinned-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  flex-shrink: 0;
}

.scroll-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0));
  bottom: calc(84px + env(safe-area-inset-bottom, 0));
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 50;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

#chat-scroll-bottom {
  position: absolute;
  right: 8px;
  bottom: 74px;
}

.collapsible-text {
  overflow: hidden;
  transition: max-height 0.18s ease;
}

.collapsible-text.is-collapsed {
  max-height: 10.6em;
}

.collapsible-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.announcement-media {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 20px;
  background: #090909;
}

.announcement-body {
  white-space: pre-wrap;
  line-height: 1.45;
}

[data-music-toggle] {
  color: #fff !important;
}

.bot-inline-buttons {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  width: min(100%, 320px);
}

.bot-inline-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
}

.bot-link-arrow {
  opacity: 0.8;
  font-size: 14px;
}

@media (max-width: 420px) {
  .settings-mini-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }
}

.settings-version-card {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
}

.settings-version-trigger {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 6px 4px;
  cursor: pointer;
}

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

.switch-row:last-of-type {
  border-bottom: none;
}

.switch-label {
  display: grid;
  gap: 4px;
}

.switch-control {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #f4f4f4;
  transition: transform 0.2s ease;
}

.switch-control input:checked + .switch-slider {
  background: color-mix(in srgb, var(--accent) 50%, #1e1e1e);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.switch-control input:checked + .switch-slider::before {
  transform: translateX(22px);
}

.bottom-nav.bottom-nav-desktop-mode {
  grid-template-columns: repeat(4, minmax(54px, 74px));
}

body[data-desktop-mode="1"] .phone-shell {
  width: calc(100vw - 24px);
  max-width: calc(100vw - 24px);
}

body[data-desktop-mode="1"] .screen-content {
  width: 100%;
  margin: 0;
}

body[data-desktop-mode="1"]:not([data-page="chat-list"]):not([data-page="chat-view"]) .screen-content {
  max-width: 1320px;
  margin: 0 auto;
}

body[data-desktop-mode="1"] .bottom-nav {
  width: min(560px, calc(100% - 20px));
  margin: 0 auto;
}

.feed-desktop-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.feed-desktop-search .btn {
  white-space: nowrap;
  min-width: 124px;
}

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

.feed-toolbar .feed-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.feed-toolbar .search-tab {
  width: auto;
  min-width: 104px;
  padding: 10px 12px;
}

body[data-desktop-mode="1"][data-page="feed"] .post-card {
  padding: 18px 20px;
}

body[data-desktop-mode="1"][data-page="feed"] .post-media img,
body[data-desktop-mode="1"][data-page="feed"] .post-media video {
  max-width: min(100%, 920px);
  max-height: min(74dvh, 760px);
  margin: 0 auto;
  display: block;
}

body[data-desktop-mode="1"][data-page="post-form"] .form-card {
  max-width: 980px;
  margin: 0 auto;
}

body[data-desktop-mode="1"][data-page="post-form"] .form-card .btn-wide {
  width: min(320px, 100%);
}

body[data-desktop-mode="1"][data-page="my-profile"] .profile-page,
body[data-desktop-mode="1"][data-page="user-profile"] .profile-page {
  max-width: 1100px;
  margin: 0 auto;
}

body[data-desktop-mode="1"][data-page="my-profile"] .profile-cover,
body[data-desktop-mode="1"][data-page="user-profile"] .profile-cover {
  aspect-ratio: auto;
  height: clamp(220px, 34vh, 340px);
}

body[data-desktop-mode="1"][data-page="my-profile"] .profile-actions-grid .btn,
body[data-desktop-mode="1"][data-page="user-profile"] .profile-actions-grid .btn {
  min-height: 44px;
}

.desktop-chat-layout {
  display: grid;
  gap: 14px;
}

.desktop-chat-sidebar,
.desktop-chat-main {
  min-width: 0;
}

.chat-list-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.chat-list-search-clear {
  min-width: 80px;
}

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

.chat-row.active {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.desktop-chat-placeholder {
  height: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}

body[data-desktop-mode="1"][data-page="chat-list"] .desktop-chat-layout,
body[data-desktop-mode="1"][data-page="chat-view"] .desktop-chat-layout {
  grid-template-columns: minmax(280px, 34%) minmax(0, 66%);
  align-items: stretch;
  min-height: calc(100dvh - 224px);
}

body[data-desktop-mode="1"] .desktop-chat-sidebar .chat-list-scroll {
  max-height: calc(100dvh - 320px);
  overflow-y: auto;
  padding-right: 4px;
}

body[data-desktop-mode="1"][data-page="chat-view"] .desktop-chat-main {
  min-height: 0;
}

body[data-desktop-mode="1"][data-page="chat-view"] .desktop-chat-main .chat-screen {
  height: calc(100dvh - 242px);
}

@media (max-width: 980px) {
  body[data-desktop-mode="1"][data-page="chat-list"] .desktop-chat-layout,
  body[data-desktop-mode="1"][data-page="chat-view"] .desktop-chat-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body[data-desktop-mode="1"][data-page="chat-view"] .desktop-chat-main .chat-screen {
    height: auto;
    min-height: 68dvh;
  }
}
