: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);
  --input-bg: #0b0b0b;
  --control-bg: #1c1c1c;
  --control-bg-hover: #272727;
  --secondary-bg: #2a2a2a;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --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"] {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f1f4f8;
  --panel-3: #e6ebf2;
  --text: #111111;
  --muted: #5f6675;
  --border: rgba(22, 28, 40, 0.12);
  --shadow: 0 18px 52px rgba(37, 49, 73, 0.14);
  --input-bg: #ffffff;
  --control-bg: #eef2f7;
  --control-bg-hover: #e4eaf2;
  --secondary-bg: #edf1f7;
  --surface-soft: rgba(24, 36, 56, 0.055);
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #eef2f8 100%);
  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);
}

.source-guard-page {
  min-height: 100dvh;
  padding: 24px;
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(225, 29, 46, 0.32), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(255, 118, 20, 0.2), transparent 30%),
    #030303;
}

.source-guard-shell {
  width: min(720px, 100%);
  margin: auto;
}

.source-guard-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(8, 8, 8, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  text-align: center;
}

.source-guard-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 120deg, transparent, rgba(225, 29, 46, 0.25), transparent 35%);
  animation: sourceGuardSpin 8s linear infinite;
}

.source-guard-card > * {
  position: relative;
  z-index: 1;
}

.source-guard-mark {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #e11d2e, #ff7a18);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.source-guard-card h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 64px);
  line-height: 0.95;
}

.source-guard-card p {
  max-width: 560px;
  margin: 22px auto 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  line-height: 1.6;
}

.source-guard-status {
  margin: 28px auto 0;
  padding: 13px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

@keyframes sourceGuardSpin {
  to {
    transform: rotate(360deg);
  }
}

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

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

button,
.btn,
.icon-btn,
.post-menu-btn,
.nav-item,
.emoji-item,
.emoji-tab,
.sticker-item-btn,
.reaction-picker-btn,
.attach-btn,
.mini-link,
.settings-version-trigger,
.pinned-close-btn,
.scroll-fab {
  transition:
    transform 170ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 170ms ease,
    background 170ms ease,
    border-color 170ms ease,
    opacity 170ms ease,
    filter 170ms ease;
}

button:not(:disabled):hover,
.btn:not(:disabled):hover,
.icon-btn:not(:disabled):hover,
.post-menu-btn:not(:disabled):hover,
.nav-item:hover,
.emoji-item:not(:disabled):hover,
.emoji-tab:not(:disabled):hover,
.sticker-item-btn:not(:disabled):hover,
.reaction-picker-btn:not(:disabled):hover,
.attach-btn:not(:disabled):hover,
.mini-link:not(:disabled):hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.06);
}

button:not(:disabled):active,
.btn:not(:disabled):active,
.icon-btn:not(:disabled):active,
.post-menu-btn:not(:disabled):active,
.nav-item:active,
.emoji-item:not(:disabled):active,
.emoji-tab:not(:disabled):active,
.sticker-item-btn:not(:disabled):active,
.reaction-picker-btn:not(:disabled):active,
.attach-btn:not(:disabled):active {
  transform: translateY(0) scale(0.97);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
}

.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;
}

body[data-light-mode="1"] .desktop-backdrop {
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(42, 120, 255, 0.10), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
}

.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 {
  position: relative;
  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;
}

body[data-light-mode="1"] .topbar,
body[data-light-mode="1"] .bottom-nav {
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 34px rgba(32, 45, 68, 0.08);
}

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

.back-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 16px;
  background: var(--control-bg);
  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;
}

.ghost-timer-btn {
  min-width: 72px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, #111);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
}

.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);
}

body[data-light-mode="1"] .card,
body[data-light-mode="1"] .profile-header-card,
body[data-light-mode="1"] .info-card,
body[data-light-mode="1"] .adult-compose-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 253, 0.96));
  border-color: rgba(31, 43, 63, 0.10);
  box-shadow: 0 10px 30px rgba(35, 48, 72, 0.10);
}

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

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  text-align: center;
}

.btn:hover,
.btn:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

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

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-secondary {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
}

.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: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.input:focus {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.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);
}

.download-app-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.download-app-icon {
  display: none;
}

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

.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);
}

.guest-bottom-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.guest-bottom-nav .nav-item {
  flex: 0 0 74px;
  width: 74px;
}

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

body[data-client-platform="desktop"] .guest-bottom-nav {
  width: 100%;
}

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

body[data-nav-labels="1"] .nav-item {
  grid-template-rows: 22px auto;
  align-content: center;
  gap: 2px;
  padding: 5px 4px 4px;
}

.nav-label {
  display: none;
  max-width: 100%;
  overflow: hidden;
  color: currentColor;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-nav-labels="1"] .nav-label {
  display: block;
}

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

body[data-light-mode="1"] .nav-item {
  color: #6a7280;
}

body[data-light-mode="1"] .nav-item.active {
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.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;
}

.beta-entry {
  position: relative;
}

.auth-ghost-entry {
  margin-top: 18px;
}

.field-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.help-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.beta-entry-btn {
  padding-right: 96px;
}

.beta-entry-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, #202020);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  color: #fff;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

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

.auth-landing-screen {
  position: relative;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.auth-landing-screen::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: -2;
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(225, 29, 46, 0.18) 35%, transparent 52%),
    linear-gradient(245deg, transparent 0 24%, rgba(255, 122, 24, 0.14) 42%, transparent 62%);
  filter: blur(18px);
  animation: landingSweep 7s ease-in-out infinite alternate;
}

.auth-landing-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.auth-landing-glow span {
  position: absolute;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: rotate(-16deg);
  animation: landingLine 4.8s linear infinite;
}

.auth-landing-glow span:nth-child(1) { top: 14%; left: -28%; animation-delay: 0s; }
.auth-landing-glow span:nth-child(2) { top: 34%; left: -34%; animation-delay: 1.1s; }
.auth-landing-glow span:nth-child(3) { top: 62%; left: -30%; animation-delay: 2.2s; }
.auth-landing-glow span:nth-child(4) { top: 82%; left: -24%; animation-delay: 3.2s; }

.auth-landing-screen .auth-logo {
  animation: landingLogoFloat 3.4s ease-in-out infinite;
  box-shadow: 0 18px 54px rgba(225, 29, 46, 0.26);
}

.auth-landing-title {
  display: flex;
  justify-content: center;
  gap: 1px;
  font-size: clamp(42px, 13vw, 78px);
  line-height: 0.96;
  font-weight: 950;
  color: #fff;
  background: linear-gradient(92deg, #fff, #ff7a18, var(--accent), #fff);
  background-size: 240% 100%;
  animation: landingTitleShine 2.8s linear infinite;
  text-shadow: 0 16px 50px rgba(225, 29, 46, 0.28);
}

.auth-landing-title span {
  display: inline-block;
  animation: landingLetter 1.8s cubic-bezier(0.2, 0.9, 0.2, 1) infinite;
}

.auth-landing-title span:nth-child(2) { animation-delay: 0.06s; }
.auth-landing-title span:nth-child(3) { animation-delay: 0.12s; }
.auth-landing-title span:nth-child(4) { animation-delay: 0.18s; }
.auth-landing-title span:nth-child(5) { animation-delay: 0.24s; }
.auth-landing-title span:nth-child(6) { animation-delay: 0.30s; }
.auth-landing-title span:nth-child(7) { animation-delay: 0.36s; }

.auth-landing-subtitle {
  width: min(100%, 420px);
  margin: -8px auto 2px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  animation: softRise 620ms ease both 120ms;
}

.auth-landing-screen .auth-choice-row .btn,
.auth-landing-screen .auth-meta-links a,
.auth-landing-screen .auth-meta-links button {
  animation: softRise 620ms ease both;
}

.auth-landing-screen .auth-choice-row .btn:nth-child(1) { animation-delay: 180ms; }
.auth-landing-screen .auth-choice-row .btn:nth-child(2) { animation-delay: 260ms; }
.auth-landing-screen .auth-meta-links a:nth-child(1) { animation-delay: 340ms; }
.auth-landing-screen .auth-meta-links button { animation-delay: 420ms; }
.auth-landing-screen .auth-meta-links a:nth-child(3) { animation-delay: 500ms; }

@keyframes landingTitleShine {
  from { background-position: 0% 50%; }
  to { background-position: 240% 50%; }
}

@keyframes landingLetter {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-5px) scale(1.04); }
}

@keyframes landingLogoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.5deg); }
}

@keyframes landingLine {
  from { transform: translateX(0) rotate(-16deg); opacity: 0; }
  12%, 72% { opacity: 1; }
  to { transform: translateX(170vw) rotate(-16deg); opacity: 0; }
}

@keyframes landingSweep {
  from { transform: translateX(-2%) translateY(1%) scale(0.98); opacity: 0.76; }
  to { transform: translateX(2%) translateY(-1%) scale(1.04); opacity: 1; }
}

@keyframes softRise {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 420px);
  margin: 0 auto;
}

.auth-choice-row .btn {
  min-width: 0;
  width: 100%;
}

.auth-meta-links {
  width: min(100%, 420px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  text-align: center;
  font-size: 13px;
}

.auth-meta-links a,
.auth-meta-links button {
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 6px 2px;
}

.auth-about-card {
  line-height: 1.5;
}

.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;
  background:
    radial-gradient(circle at top center, color-mix(in srgb, var(--profile-accent-soft, rgba(225, 29, 46, 0.18)) 80%, transparent), transparent 62%);
}

.profile-page-has-bg {
  padding: 12px;
  border-radius: 28px;
  background-color: color-mix(in srgb, var(--profile-accent, var(--accent)) 16%, #0b0b0d);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.72)),
    var(--profile-background);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.profile-page-has-bg .profile-header-card,
.profile-page-has-bg .info-card,
.profile-page-has-bg .stat-card,
.profile-page-has-bg .post-card,
.profile-page-has-bg .profile-music-track,
.profile-page-has-bg .story-card,
.profile-page-has-bg .gift-card-mini,
.profile-page-has-bg .gallery-item {
  background-color: color-mix(in srgb, var(--profile-accent, var(--accent)) 14%, rgba(14, 14, 14, 0.95));
  background-image: linear-gradient(rgba(8, 8, 8, 0.76), rgba(8, 8, 8, 0.8));
  backdrop-filter: blur(4px);
}

.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);
}

.guest-profile-actions .btn {
  min-height: 46px;
}

.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;
  position: relative;
}

.profile-music-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.profile-music-expand {
  width: 44px;
  height: 44px;
  margin-left: auto;
  display: grid;
  place-items: center;
  list-style: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--profile-accent-strong, var(--accent-strong)), var(--profile-accent-soft, var(--accent-soft)));
  color: #fff;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--profile-accent, var(--accent)) 24%, transparent);
  cursor: pointer;
}

.profile-music-expand-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.profile-music-expand::-webkit-details-marker {
  display: none;
}

.profile-music-list[open] .profile-music-expand {
  transform: rotate(180deg);
}

.profile-music-tracks {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.profile-music-track {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--track-accent, var(--accent)) 10%, rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--track-accent, var(--accent)) 28%, rgba(255, 255, 255, 0.1));
}

.profile-music-track.is-primary {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--track-accent, var(--accent)) 42%, transparent);
}

.profile-music-track-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-music-track-actions,
.profile-music-track-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-music-track-player {
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.music-track-action,
.music-track-chip {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--track-accent, var(--accent)) 44%, transparent);
  background: color-mix(in srgb, var(--track-accent-soft, var(--accent-soft)) 62%, rgba(255, 255, 255, 0.04));
  color: #fff;
}

.music-track-action {
  min-width: 34px;
  padding: 0 10px;
  font-weight: 900;
}

.music-track-chip-danger {
  border-color: rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.14);
}

.avatar-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 12px;
}

.avatar-history-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.avatar-history-preview {
  width: 96px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
}

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

.story-text-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.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 {
  width: 100%;
}

.music-volume {
  width: 84px;
  max-width: 84px;
}

.music-main-row,
.music-time-row,
.music-controls,
.profile-relation-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-main-row {
  justify-content: space-between;
  flex-wrap: wrap;
}

.profile-music-meta {
  flex: 1;
  min-width: 0;
}

.music-time-row {
  width: 100%;
}

.music-controls {
  justify-content: flex-start;
}

.music-time-row .music-slider {
  flex: 1;
}

.profile-relation-row {
  margin-top: 14px;
}

.profile-relation-row .btn {
  flex: 1;
}

.profile-relation-row.has-contact-slot .profile-contact-inline-btn {
  max-width: 46%;
}

.contact-label-mobile {
  display: none;
}

.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;
}

.stat-card-link {
  color: var(--text);
}

.stat-card-link small {
  color: var(--accent-2);
  font-weight: 700;
}

.stats-list {
  display: grid;
  gap: 8px;
}

.stats-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.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-card {
  animation: postCardIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.post-card[data-feed-index] {
  animation-delay: var(--feed-delay, 0ms);
}

.post-card.post-reveal,
.comment-card.comment-enter {
  animation: postReveal 620ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.feed-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px auto 18px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feed-loader span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 760ms linear infinite;
}

.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: normal;
  line-height: 1.45;
  word-break: break-word;
}

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

.post-circle-video {
  width: min(320px, 82vw) !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.media-loading-wrap {
  position: relative;
}

.media-loading-indicator {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 150px;
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.24));
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 220ms ease;
}

.media-loading-indicator.hidden {
  opacity: 0;
}

.media-loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 760ms linear infinite;
}

.media-loading-title {
  font-size: 14px;
  font-weight: 900;
}

.media-loading-bytes {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.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-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.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%;
  max-width: 100%;
  border-radius: 22px;
  max-height: 360px;
  object-fit: cover;
}

.voice-message-card {
  width: min(360px, 72vw);
  padding: 10px 12px;
}

.voice-message-card .music-main-row {
  gap: 10px;
}

.voice-message-card .profile-music-head {
  min-width: 0;
}

.voice-message-card .profile-music-meta {
  min-width: 0;
}

.voice-message-card .section-title {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

body[data-light-mode="1"] .icon-btn,
body[data-light-mode="1"] .passive-icon,
body[data-light-mode="1"] .post-menu-btn {
  color: #2f3848;
  box-shadow: 0 8px 18px rgba(35, 48, 72, 0.10);
}

.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-tabs {
  justify-content: flex-start;
}

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

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

.clicker-grid .stat-card {
  min-height: 78px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  align-content: center;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff8a1c);
  transition: width 0.2s ease;
}

.clicker-actions .btn-wide {
  flex: 1;
}

.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;
}

@media (max-width: 720px) {
  .contact-label-desktop {
    display: none;
  }

  .contact-label-mobile {
    display: inline;
  }

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

.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.message-enter-in {
  animation: messageInLeft 540ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.message.message-enter-out {
  animation: messageInRight 540ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.message.message-enter-history {
  animation: messageHistoryIn 420ms ease both;
}

.message.message-refresh .message-bubble {
  animation: messageRefresh 520ms ease both;
}

.message.message-sending .message-bubble {
  position: relative;
  overflow: hidden;
}

.message.message-sending .message-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.12) 42%, transparent 74%);
  transform: translateX(-120%);
  animation: shimmer 1.1s ease-in-out infinite;
  pointer-events: none;
}

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

.message-bubble {
  max-width: 76%;
  min-width: 92px;
  min-height: 42px;
  border: none;
  background: var(--control-bg);
  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;
}

body[data-light-mode="1"] .message-bubble {
  background: #ffffff;
  color: #151922;
  border: 1px solid rgba(24, 36, 56, 0.08);
  box-shadow: 0 8px 22px rgba(35, 48, 72, 0.10);
}

body[data-light-mode="1"] .message.own .message-bubble {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, #ffffff), color-mix(in srgb, var(--accent) 8%, #ffffff));
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

body[data-light-mode="1"] .chat-screen,
body[data-light-mode="1"] .chat-shell,
body[data-light-mode="1"] .chat-composer,
body[data-light-mode="1"] .profile-music-card,
body[data-light-mode="1"] .file-card,
body[data-light-mode="1"] .reply-pill,
body[data-light-mode="1"] .pinned-banner,
body[data-light-mode="1"] .emoji-picker,
body[data-light-mode="1"] .attachment-preview,
body[data-light-mode="1"] .compact-card,
body[data-light-mode="1"] .clicker-grid .stat-card,
body[data-light-mode="1"] .settings-version-card {
  background: #ffffff;
  border-color: rgba(31, 43, 63, 0.10);
  color: #151922;
  box-shadow: 0 8px 24px rgba(35, 48, 72, 0.08);
}

body[data-light-mode="1"] .upload-drop,
body[data-light-mode="1"] .emoji-tab,
body[data-light-mode="1"] .emoji-item,
body[data-light-mode="1"] .sticker-item-btn,
body[data-light-mode="1"] .bot-inline-btn,
body[data-light-mode="1"] .reaction-picker-btn {
  background: #f3f6fa;
  border-color: rgba(31, 43, 63, 0.12);
  color: #151922;
}

body[data-light-mode="1"] .post-media img,
body[data-light-mode="1"] .post-media video,
body[data-light-mode="1"] .message-media img,
body[data-light-mode="1"] .message-media video,
body[data-light-mode="1"] .gallery-item,
body[data-light-mode="1"] .story-card video,
body[data-light-mode="1"] .story-video-large {
  background: #e9eef5;
}

body[data-light-mode="1"] .flash-success {
  background: rgba(28, 145, 86, 0.12);
  border-color: rgba(28, 145, 86, 0.28);
  color: #145c38;
}

body[data-light-mode="1"] .flash-error,
body[data-light-mode="1"] .danger-text {
  color: #9d1d2b;
}

body[data-light-mode="1"] .flash-error {
  background: rgba(225, 29, 46, 0.10);
  border-color: rgba(225, 29, 46, 0.24);
}

.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;
}

.forwarded-label {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.forward-target-row > span {
  display: grid;
  gap: 2px;
}

.text-type-in {
  animation: textMaterialize 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: left center;
}

.text-input-materialize {
  animation: inputTextMaterialize 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.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);
}

.file-drop-active {
  position: relative;
  outline: 2px dashed color-mix(in srgb, var(--accent) 78%, white 12%);
  outline-offset: 4px;
}

.file-drop-active::after {
  content: attr(data-file-drop-label);
  position: absolute;
  inset: 8px;
  z-index: 40;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 36%, transparent), transparent 36%),
    rgba(0, 0, 0, 0.72);
  color: #fff;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.echonet-file-drop-global {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.echonet-file-drop-card {
  width: min(420px, 92vw);
  padding: 24px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent) 24%, transparent), transparent 48%),
    rgba(10, 10, 10, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  text-align: center;
  backdrop-filter: blur(14px);
}

.echonet-file-drop-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.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"],
.chat-input-bar textarea {
  background: #101010;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 18px;
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
}

.chat-input-bar textarea {
  min-height: 44px;
  max-height: 132px;
  resize: none;
  overflow-y: auto;
  line-height: 1.25;
}

.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;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

#comment-form .composer-tools {
  flex-wrap: nowrap;
  width: max-content;
}

.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: var(--control-bg);
  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: var(--control-bg);
  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(8, minmax(0, 1fr));
  gap: 6px;
  overflow-y: auto;
  max-height: 176px;
  padding-right: 2px;
}

.sticker-item-btn {
  border: 1px solid var(--border);
  background: var(--control-bg);
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 3px;
}

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

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

.account-chart {
  display: grid;
  gap: 10px;
}

.account-chart-row {
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.account-chart-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.account-chart-bar i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4d2e, #ff8a1f);
}

.ai-compose-panel {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: linear-gradient(135deg, rgba(255, 77, 46, 0.12), rgba(255, 255, 255, 0.04));
}

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

.ai-result-grid {
  display: grid;
  gap: 8px;
}

.ai-result-box {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
  background: var(--surface-soft);
}

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

.sticker-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.sticker-edit-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--control-bg);
  font-size: 12px;
}

.sticker-edit-item img,
.sticker-edit-item video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.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: visible;
  flex-shrink: 0;
  background: #0d0d0d;
}

.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: none;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.circle-recording-preview video.circle-video-mirrored,
.message-media-circle video.circle-video-mirrored {
  transform: scaleX(-1);
}

.circle-camera-switch {
  position: absolute;
  right: -4px;
  bottom: 14px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.82);
  color: #fff;
  padding: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

.voice-recording-bar.circle-mode-active .circle-camera-switch {
  width: 48px;
  height: 48px;
  right: -10px;
  bottom: 22px;
  font-size: 22px;
}

.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;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.message-media-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  cursor: pointer;
}

.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;
}

.settings-link-button {
  display: block;
    width: 100%;
  padding: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.settings-link-button:hover,
.settings-link-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  background: rgba(255, 255, 255, 0.04);
}

.telegram-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.telegram-link-clear-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.telegram-link-clear-btn:hover,
.telegram-link-clear-btn:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: rgba(255, 255, 255, 0.1);
}

.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);
}

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

.device-row {
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.rules-text {
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

.rules-card {
  padding: 24px;
}

.adult-media-blur {
  filter: blur(26px) saturate(0.5) brightness(0.55);
  transform: scale(1.03);
}

.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;
  cursor: zoom-in;
}

.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;
  cursor: zoom-in;
}

.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-duration {
  min-height: 18px;
  font-variant-numeric: tabular-nums;
}

.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;
}

body[data-light-mode="1"] .sheet-backdrop {
  background: rgba(24, 32, 48, 0.28);
  backdrop-filter: blur(4px);
}

body[data-light-mode="1"] .sheet-panel {
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  box-shadow: 0 -18px 48px rgba(34, 47, 70, 0.16);
}

.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: 0;
}

.media-viewer-card {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  background: #000;
  border: none;
  border-radius: 0;
  padding: 14px;
}

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

.media-viewer-content {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  background: #050505;
  object-fit: contain;
}

.media-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  transition: transform 120ms ease, background 120ms ease;
}

.media-viewer-nav:hover {
  background: rgba(237, 38, 63, 0.86);
}

.media-viewer-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.media-viewer-nav-prev {
  left: 18px;
}

.media-viewer-nav-next {
  right: 18px;
}

.transfer-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(12px);
  animation: fadeIn 180ms ease both;
}

.transfer-card {
  width: min(340px, calc(100vw - 44px));
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(225, 29, 46, 0.22), transparent 56%),
    rgba(12, 12, 12, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  text-align: center;
}

.transfer-ring {
  width: 74px;
  height: 74px;
  margin: 0 auto 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 820ms linear infinite;
}

.transfer-ring span {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ff7a18);
  animation: transferPulse 980ms ease-in-out infinite;
}

.transfer-title {
  font-size: 18px;
  font-weight: 900;
}

.transfer-subtitle,
.transfer-bytes {
  color: var(--muted);
  font-size: 13px;
}

.transfer-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.transfer-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff7a18);
  transition: width 160ms ease;
}

.transfer-file-progress {
  display: grid;
  gap: 6px;
  text-align: left;
}

.transfer-file-progress.hidden {
  display: none;
}

.transfer-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.transfer-overlay.transfer-done {
  animation: fadeOut 280ms ease both;
}

.transfer-overlay.transfer-failed .transfer-ring {
  border-top-color: #ff4d4d;
  animation-duration: 420ms;
}

.transfer-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.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;
  }
}

body[data-client-platform="android"],
body[data-client-kind="android"] {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 0 !important;
  overflow: hidden;
  background: #050505;
}

body[data-client-platform="android"] .phone-shell,
body[data-client-kind="android"] .phone-shell {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  border-left: none;
  border-right: none;
  box-shadow: none;
}

body[data-client-platform="android"] .topbar,
body[data-client-kind="android"] .topbar {
  padding: 10px 16px 10px;
}

body[data-client-platform="android"] .bottom-nav,
body[data-client-kind="android"] .bottom-nav {
  padding: 10px 14px;
}

.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;
}

body[data-nav-labels="1"] .nav-item {
  flex-direction: column;
  gap: 2px;
  padding: 5px 4px 4px;
}

body[data-nav-labels="1"] .nav-icon {
  width: 26px;
  height: 26px;
}

.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; }
.premium-name-sky { color: #38bdf8; }
.premium-name-pistachio { color: #9ccc65; }
.premium-name-green { color: #1fa95b; }
.premium-name-teal { color: #00a6a6; }
.premium-name-lavender { color: #a78bfa; }
.premium-name-cranberry { color: #b91c4b; }
.premium-name-purple { color: #7c3aed; }

.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;
}

.profile-color-field {
  display: grid;
  gap: 12px;
}

.profile-color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 14px 12px;
}

.profile-color-choice {
  min-height: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  transition: transform 160ms ease, filter 160ms ease;
}

.profile-color-choice span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--choice-color);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.04),
    0 0 0 6px color-mix(in srgb, var(--choice-color) 16%, transparent);
}

.profile-color-choice strong {
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  font-weight: 700;
}

.profile-color-choice.active {
  transform: translateY(-2px);
}

.profile-color-choice.active span {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.06),
    0 0 0 7px color-mix(in srgb, var(--choice-color) 78%, white),
    0 14px 30px color-mix(in srgb, var(--choice-color) 28%, transparent);
}

.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"] {
  appearance: none;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #2a2a2a;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-toggle-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #f4f4f4;
  transition: transform 0.2s ease;
}

.settings-toggle-row input[type="checkbox"]:checked {
  background: color-mix(in srgb, var(--accent) 50%, #1e1e1e);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.settings-toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(22px);
}

.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;
  position: relative;
  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;
}

.media-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.media-remove-form {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

.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 .profile-music-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-has-bg .cover-fallback {
  background-color: color-mix(in srgb, var(--profile-accent, var(--accent)) 16%, #0b0b0d);
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--profile-accent, var(--accent)) 28%, transparent), transparent 68%),
    linear-gradient(rgba(10, 10, 10, 0.38), rgba(10, 10, 10, 0.62));
}

.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;
}

.scheduled-message-list {
  display: grid;
  gap: 8px;
}

.scheduled-message-row {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  width: 100%;
}

.scheduled-message-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scheduled-message-row small {
  color: var(--muted);
}

.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: none;
  width: min(100%, 1280px);
  margin: 0 auto;
}

body[data-desktop-mode="1"][data-page="post-form"] #post-text-input {
  min-height: min(52dvh, 560px);
}

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;
  }
}

.error-shell {
  position: relative;
  min-height: calc(100dvh - 220px);
  display: grid;
  place-items: center;
  padding: 28px 0 12px;
  overflow: hidden;
}

.error-card {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: 28px 24px;
  text-align: center;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 76, 76, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(28, 28, 30, 0.96), rgba(14, 14, 16, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.error-code {
  font-size: clamp(88px, 18vw, 148px);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #fff4f4;
  text-shadow: 0 0 36px rgba(255, 82, 82, 0.22);
}

.error-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.05;
}

.error-text {
  max-width: 460px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

.error-actions {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  margin: 0 auto;
}

.error-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.error-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-orbit {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.72;
  pointer-events: none;
}

.error-orbit-a {
  width: 220px;
  height: 220px;
  top: 30px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 98, 98, 0.3), rgba(255, 98, 98, 0));
}

.error-orbit-b {
  width: 280px;
  height: 280px;
  right: -110px;
  bottom: 10px;
  background: radial-gradient(circle, rgba(255, 173, 77, 0.2), rgba(255, 173, 77, 0));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes postCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes postReveal {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
    filter: blur(8px);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px) translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes messageInRight {
  from {
    opacity: 0;
    transform: translateX(24px) translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes messageHistoryIn {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageRefresh {
  0% {
    box-shadow: 0 0 0 rgba(225, 29, 46, 0);
  }
  45% {
    box-shadow: 0 0 0 5px rgba(225, 29, 46, 0.14);
  }
  100% {
    box-shadow: 0 0 0 rgba(225, 29, 46, 0);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(120%);
  }
}

@keyframes transferPulse {
  0%, 100% {
    transform: scale(0.82);
    opacity: 0.74;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  gap: 12px;
  align-content: center;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--page-loader-accent-soft, var(--accent-soft)) 90%, transparent), transparent 28%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.98), rgba(0, 0, 0, 0.96));
  opacity: 1;
  pointer-events: all;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.page-loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--page-loader-accent, var(--accent));
  border-right-color: color-mix(in srgb, var(--page-loader-accent, var(--accent)) 78%, white);
  box-shadow: 0 0 42px color-mix(in srgb, var(--page-loader-accent, var(--accent)) 42%, transparent);
  animation: spin 780ms linear infinite;
}

.page-loader-text {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body[data-light-mode="1"] .page-loader {
  background: #ffffff;
}

body[data-light-mode="1"] .page-loader-text {
  color: #111827;
}

.page-enter-item {
  animation: pageEnter 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: var(--page-stagger, 0ms);
}

body[data-page="my-profile"] .profile-page > *,
body[data-page="user-profile"] .profile-page > * {
  animation: profilePartIn 620ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

body[data-page="my-profile"] .profile-page > *:nth-child(2),
body[data-page="user-profile"] .profile-page > *:nth-child(2) { animation-delay: 70ms; }
body[data-page="my-profile"] .profile-page > *:nth-child(3),
body[data-page="user-profile"] .profile-page > *:nth-child(3) { animation-delay: 120ms; }
body[data-page="my-profile"] .profile-page > *:nth-child(4),
body[data-page="user-profile"] .profile-page > *:nth-child(4) { animation-delay: 170ms; }

body[data-page="chat-list"] .list-row,
body[data-page="chat-list"] .simple-row,
.chat-list-stack > * {
  animation: chatListIn 480ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

body[data-page="chat-list"] .list-row:nth-child(2n),
.chat-list-stack > *:nth-child(2n) {
  animation-delay: 45ms;
}

body[data-page="chat-view"] .chat-shell,
body[data-page="call"] .call-card {
  animation: chatOpenIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.search-result-enter {
  animation: searchResultIn 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: var(--search-stagger, 0ms);
}

.form-sending {
  position: relative;
  overflow: hidden;
}

.form-sending::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.10) 42%, transparent 74%);
  transform: translateX(-100%);
  animation: shimmer 900ms linear infinite;
}

.ai-result-loading {
  min-height: 86px;
  display: grid;
  place-items: center;
}

.ai-generating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.ai-generating span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff7a18);
  animation: aiDot 860ms ease-in-out infinite;
}

.ai-generating span:nth-child(2) { animation-delay: 120ms; }
.ai-generating span:nth-child(3) { animation-delay: 240ms; }

.call-card {
  position: relative;
  overflow: hidden;
}

.call-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(225, 29, 46, 0.16), transparent 34%);
  animation: spin 9s linear infinite;
  pointer-events: none;
}

.call-card > * {
  position: relative;
  z-index: 1;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes profilePartIn {
  from { opacity: 0; transform: translateY(18px) scale(0.975); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes chatListIn {
  from { opacity: 0; transform: translateX(-18px) scale(0.98); filter: blur(8px); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes chatOpenIn {
  from { opacity: 0; transform: translateY(24px) scale(0.965); filter: blur(12px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes searchResultIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aiDot {
  0%, 80%, 100% { transform: translateY(0) scale(0.82); opacity: 0.45; }
  38% { transform: translateY(-7px) scale(1); opacity: 1; }
}

@keyframes textMaterialize {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    filter: blur(8px);
  }
  55% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes inputTextMaterialize {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
  42% {
    transform: scale(1.006);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent);
  }
  100% {
    transform: scale(1);
  }
}

body[data-page='chat-view'] .chat-screen,
body[data-page='chat-view'] .desktop-chat-layout { animation: chatOpenIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both; }

.message-media-circle {
  width: 180px !important;
  min-width: 180px;
  max-width: 180px;
  height: 180px !important;
  margin: 4px 0;
  flex: 0 0 180px;
  display: block;
}

.message-media-circle .media-loading-indicator {
  border-radius: 50%;
}

.message-media-circle video {
  max-width: 180px;
  max-height: 180px;
}

.message-media-circle + .profile-music-card,
.message-media-circle .profile-music-card {
  display: none;
}

.voice-message-card .music-volume {
  max-width: 72px;
}

body[data-page="chat-view"] .message-media-circle {
  align-self: flex-end;
}

body[data-page="chat-view"] .message:not(.own) .message-media-circle {
  align-self: flex-start;
}

body[data-page="chat-view"] .message-bubble {
  cursor: default;
}

body[data-page="chat-view"] .message-media {
  max-width: 100%;
}

body[data-page="chat-view"] .voice-message-card {
  width: min(340px, 68vw);
  max-width: 100%;
  gap: 8px;
  padding: 10px;
}

body[data-page="chat-view"] .voice-message-card .music-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

body[data-page="chat-view"] .voice-message-card .profile-music-head {
  min-width: 0;
}

body[data-page="chat-view"] .voice-message-card .profile-music-meta {
  min-width: 0;
}

body[data-page="chat-view"] .voice-message-card .section-title {
  max-width: 100%;
}

body[data-page="chat-view"] .voice-message-card .music-controls {
  flex: 0 0 auto;
  gap: 8px;
}

body[data-page="chat-view"] .voice-message-card .music-volume {
  display: none;
}

body[data-page="chat-view"] .voice-message-card .music-time-row {
  display: grid;
  grid-template-columns: auto minmax(88px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

body[data-page="chat-view"] .voice-message-card .music-slider {
  min-width: 88px;
}

body[data-page="chat-view"] .message-media-circle {
  overflow: hidden;
  border-radius: 50%;
}

body[data-page="chat-view"] .message-media-circle video {
  width: 180px;
  height: 180px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.ai-compose-panel {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
  background:
    radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  animation: chatOpenIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-compose-panel::before {
  content: "";
  position: absolute;
  inset: -60% -20%;
  background: conic-gradient(from 120deg, transparent, color-mix(in srgb, var(--accent) 20%, transparent), transparent 36%);
  animation: spin 12s linear infinite;
  pointer-events: none;
}

.ai-compose-panel > * {
  position: relative;
  z-index: 1;
}

.ai-compose-actions .btn {
  border-radius: 999px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ai-compose-actions .btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

#post-ai-btn,
.ai-summary-btn {
  border: none;
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, white), #ff8a1c);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

#post-ai-btn:hover,
.ai-summary-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.ai-result-ready {
  animation: aiResultIn 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-typewriter::after {
  content: "|";
  color: var(--accent);
  animation: aiCursor 760ms steps(2, start) infinite;
}

@keyframes aiResultIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes aiCursor {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

/* Final Android WebView sizing guard. Keep this at the end so later layout modes cannot override it. */
html:has(body[data-client-platform="android"]),
html:has(body[data-client-kind="android"]) {
  width: 100% !important;
  height: var(--echonet-app-height, 100svh) !important;
  min-height: var(--echonet-app-height, 100svh) !important;
  max-height: var(--echonet-app-height, 100svh) !important;
  overflow: hidden !important;
}

body[data-client-platform="android"],
body[data-client-kind="android"] {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: var(--echonet-app-height, 100svh) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  background: #050505 !important;
}

body[data-client-platform="android"] .phone-shell,
body[data-client-kind="android"] .phone-shell,
body[data-client-platform="android"][data-desktop-mode="1"] .phone-shell,
body[data-client-kind="android"][data-desktop-mode="1"] .phone-shell {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: var(--echonet-app-height, 100svh) !important;
  min-height: 0 !important;
  max-height: var(--echonet-app-height, 100svh) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-client-platform="android"] .topbar,
body[data-client-kind="android"] .topbar {
  padding: 14px 16px 12px !important;
  min-height: auto !important;
}

body[data-client-platform="android"] .screen-content,
body[data-client-kind="android"] .screen-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

body[data-client-platform="android"] .bottom-nav,
body[data-client-kind="android"] .bottom-nav {
  padding: 12px 14px !important;
  min-height: auto !important;
  width: 100% !important;
}

.admin-console-shell {
  display: grid;
  gap: 16px;
  border-color: color-mix(in srgb, var(--console-accent, var(--accent)) 40%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.admin-console-head {
  display: grid;
  gap: 10px;
}

.admin-console-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-console-badge {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text-muted);
}

.admin-console-badge.accent {
  color: #fff;
  border-color: color-mix(in srgb, var(--console-accent, var(--accent)) 58%, transparent);
  background: color-mix(in srgb, var(--console-accent-soft, rgba(95, 140, 255, 0.18)) 85%, rgba(10, 12, 18, 0.92));
}

.admin-console-history {
  min-height: 280px;
  max-height: 58vh;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--console-accent-soft, rgba(95, 140, 255, 0.18)) 82%, transparent), transparent 38%),
    linear-gradient(180deg, rgba(10, 12, 18, 0.94), rgba(6, 8, 14, 0.98));
}

.admin-console-entry {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.admin-console-entry.ok {
  border-color: color-mix(in srgb, var(--console-accent, var(--accent)) 42%, transparent);
}

.admin-console-entry.error {
  border-color: rgba(255, 94, 129, 0.42);
  background: rgba(255, 94, 129, 0.06);
}

.admin-console-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.admin-console-entry-head strong {
  font-family: "Consolas", "Fira Code", monospace;
  color: color-mix(in srgb, var(--console-accent, var(--accent)) 68%, white);
  word-break: break-word;
}

.admin-console-output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #edf2ff;
}

.admin-console-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.admin-console-form textarea {
  min-height: 110px;
  resize: vertical;
  font-family: "Consolas", "Fira Code", monospace;
  border-color: color-mix(in srgb, var(--console-accent, var(--accent)) 28%, rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.01);
}

.admin-console-form textarea:focus {
  border-color: color-mix(in srgb, var(--console-accent, var(--accent)) 62%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--console-accent-soft, rgba(95, 140, 255, 0.18)) 88%, transparent);
}

.admin-console-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.games-header-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(circle at 14% 15%, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 86%, #f8ce4e), var(--accent));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 24%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.topbar {
  gap: 9px;
}

.topbar-main {
  flex: 1 1 auto;
}

.topbar-games-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
}

.topbar-feature-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-action.inline-actions {
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
  z-index: 2;
}

.games-header-icon {
  font-size: 15px;
  line-height: 1;
}

.games-header-text {
  display: none;
}

body[data-desktop-mode="1"] .games-header-short {
  display: none;
}

body[data-desktop-mode="1"] .games-header-text {
  display: inline;
}

.games-header-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 34%, transparent);
}

.games-header-exit {
  padding-inline: 14px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.quests-header-link {
  border-color: color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--accent) 13%, rgba(255, 255, 255, 0.055));
  box-shadow: none;
}

.games-page {
  padding-bottom: 20px;
}

.games-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 13px;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.06));
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 4%, color-mix(in srgb, var(--accent) 36%, transparent), transparent 40%),
    linear-gradient(150deg, #121d22, #071014 74%);
}

.games-hero::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 148px;
  height: 148px;
  border-radius: 48px;
  border: 18px solid color-mix(in srgb, var(--accent) 20%, transparent);
  transform: rotate(18deg);
}

.games-kicker {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 60%, #fff);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.games-hero h1,
.snake-lobby h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 38px);
}

.games-hero p {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0;
  color: rgba(236, 246, 245, 0.75);
}

.games-resource-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.games-resource {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.games-resource strong {
  color: #f7fbfa;
  font-size: 22px;
}

.games-resource span,
.games-regen {
  color: rgba(227, 238, 237, 0.62);
  font-size: 13px;
}

.game-tile {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 28px;
  background: linear-gradient(155deg, #111b20, #090e12);
}

.game-tile-preview {
  position: relative;
  height: 146px;
  background:
    linear-gradient(rgba(117, 236, 177, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 236, 177, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 26% 38%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 33%),
    #071214;
  background-size: 29px 29px, 29px 29px, auto, auto;
}

.pixel-apple,
.pixel-snake {
  position: absolute;
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 9px;
}

.pixel-apple {
  top: 39px;
  right: 26%;
  background: #ff4058;
  box-shadow: 0 0 20px rgba(255, 64, 88, 0.34);
}

.pixel-snake {
  top: 87px;
  background: var(--accent);
}

.pixel-snake-a {
  left: 29%;
  background: #e9fff3;
}

.pixel-snake-b {
  left: calc(29% - 29px);
}

.pixel-snake-c {
  left: calc(29% - 58px);
}

.minesweeper-preview {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  place-content: center;
  gap: 7px;
  background:
    radial-gradient(circle at 53% 54%, color-mix(in srgb, var(--accent) 21%, transparent), transparent 46%),
    linear-gradient(140deg, #121e22, #071014);
}

.mine-preview-cell {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
}

.mine-preview-cell.revealed {
  color: #50b5ff;
  background: rgba(255, 255, 255, 0.035);
}

.mine-preview-cell.mine-number-two {
  color: var(--accent);
}

.mine-preview-cell.flagged {
  color: #ffd462;
  background: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.045));
}

.mine-preview-cell.mine-bomb {
  color: #ff5969;
  box-shadow: 0 0 22px rgba(255, 69, 91, 0.14);
}

.game-tile-copy {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.game-tile-copy h2 {
  margin: 0 0 5px;
}

.game-tile-rules {
  margin: 0;
  color: rgba(227, 238, 237, 0.72);
  line-height: 1.5;
}

.games-play-btn {
  min-height: 50px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(130deg, color-mix(in srgb, var(--accent) 90%, #ffe477), var(--accent));
}

.games-share-btn {
  border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.18), transparent 34%),
    color-mix(in srgb, var(--accent) 22%, #10181c);
}

.game-share-draft {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, 0.035));
}

.game-share-draft strong {
  color: #fff;
}

.game-share-draft span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.game-post-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, 0.05));
  border-radius: 16px;
  color: rgba(242, 250, 248, 0.78);
  background:
    radial-gradient(circle at 96% 20%, color-mix(in srgb, var(--accent) 19%, transparent), transparent 42%),
    rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.game-post-cta strong {
  color: #fff;
  white-space: nowrap;
}

.quests-page {
  padding-bottom: 20px;
}

.quests-hero {
  overflow: hidden;
  display: grid;
  gap: 13px;
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, 0.05));
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 3%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 38%),
    linear-gradient(146deg, #121d21, #070e12);
}

.quests-hero h1,
.quests-hero p {
  margin: 0;
}

.quests-hero p {
  color: rgba(229, 240, 237, 0.72);
  line-height: 1.46;
}

.quests-timer {
  color: rgba(225, 238, 234, 0.64);
  font-size: 12px;
}

.quests-timer strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

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

.quest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(20, 28, 31, 0.98), rgba(9, 12, 15, 0.98));
}

.quest-card.ready {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
}

.quest-card.claimed {
  opacity: 0.68;
}

.quest-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 7px;
}

.quest-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.quest-title-row h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
}

.quest-reward {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--accent) 60%, #fff);
  font-size: 12px;
  font-weight: 750;
}

.quest-copy p {
  margin: 0;
  color: rgba(227, 238, 235, 0.64);
  font-size: 12px;
  line-height: 1.43;
}

.quest-progress-track {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.quest-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
}

.quest-progress,
.quest-status {
  color: rgba(231, 242, 239, 0.62);
  font-size: 12px;
}

.quest-status {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--accent) 55%, #fff);
}

.quest-status.waiting {
  color: rgba(231, 242, 239, 0.48);
}

.earn-echo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.snake-lobby,
.snake-result {
  display: grid;
  gap: 17px;
  padding: clamp(18px, 5vw, 28px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background:
    radial-gradient(circle at 96% 2%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 33%),
    #0b1216;
}

.snake-lobby-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.snake-energy {
  display: grid;
  min-width: 88px;
  padding: 11px;
  text-align: center;
  border-radius: 16px;
  color: #eefbf5;
  background: color-mix(in srgb, var(--accent) 12%, rgba(255, 255, 255, 0.035));
}

.snake-energy strong {
  font-size: 22px;
}

.snake-energy span {
  font-size: 11px;
  color: rgba(237, 245, 244, 0.64);
}

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

.snake-rule {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.037);
}

.snake-rule strong {
  font-size: 13px;
  color: #edf8f4;
}

.snake-rule span {
  color: rgba(225, 237, 234, 0.63);
  font-size: 12px;
  line-height: 1.45;
}

.snake-wait {
  margin: 0;
  text-align: center;
}

.snake-stage {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(10px, 2.4vh, 20px);
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 6%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 31%),
    linear-gradient(180deg, #071013, #030709);
}

.snake-stage.hidden {
  display: none;
}

.mines-stage {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(9px, 2.2vh, 17px);
  padding: max(13px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(13px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 5%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 32%),
    radial-gradient(circle at 82% 88%, rgba(45, 113, 130, 0.16), transparent 37%),
    linear-gradient(180deg, #091217, #030709);
}

.mines-stage.hidden {
  display: none;
}

.mines-hud {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.mines-hud-stat,
.mines-earned {
  display: grid;
  min-width: 67px;
  gap: 2px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.mines-hud-stat span,
.mines-earned span {
  color: rgba(238, 247, 245, 0.6);
  font-size: 11px;
}

.mines-hud-stat strong,
.mines-earned strong {
  font-size: 19px;
}

.mines-earned {
  min-width: 100px;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 17%, rgba(255, 255, 255, 0.04));
}

.mines-quit {
  min-height: 48px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.065);
  font-weight: 700;
}

.mines-quit.reward-ready {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  color: #fff;
  background:
    radial-gradient(circle at 13% 16%, rgba(255, 255, 255, 0.2), transparent 27%),
    color-mix(in srgb, var(--accent) 23%, #101a1e);
  box-shadow: 0 9px 25px color-mix(in srgb, var(--accent) 19%, transparent);
}

.mines-tip {
  justify-self: center;
  max-width: min(590px, 96vw);
  padding: 9px 13px;
  border-radius: 999px;
  color: rgba(231, 243, 239, 0.72);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
  text-align: center;
}

.mines-board-viewport {
  overflow: auto;
  display: grid;
  place-items: start center;
  min-height: 0;
  padding: clamp(9px, 2vh, 20px);
  touch-action: none;
}

.mines-board {
  display: grid;
  grid-template-columns: repeat(var(--mines-columns), minmax(0, 1fr));
  gap: clamp(3px, 0.9vw, 5px);
  padding: 7px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  transform-origin: center top;
  transition: transform 80ms linear;
  user-select: none;
  -webkit-user-select: none;
}

.mines-cell {
  display: grid;
  width: clamp(32px, 8.9vw, 46px);
  height: clamp(32px, 8.9vw, 46px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: clamp(8px, 2.4vw, 12px);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.09);
}

.mines-cell:not(:disabled):active {
  transform: scale(0.96);
}

.mines-cell.revealed {
  border-color: rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: none;
}

.mines-cell.flagged {
  color: #ffd45a;
  border-color: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.1));
}

.mines-number-1 {
  color: #53b5ff;
}

.mines-number-2 {
  color: #39de9b;
}

.mines-number-3 {
  color: #ff6679;
}

.mines-number-4,
.mines-number-5,
.mines-number-6,
.mines-number-7,
.mines-number-8 {
  color: #e586ff;
}

.mines-footer {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 5vw, 34px);
  color: rgba(232, 242, 240, 0.57);
  font-size: 12px;
  text-align: center;
}

.snake-hud {
  display: flex;
  align-items: center;
  gap: 10px;
}

.snake-score-live {
  display: grid;
  min-width: 68px;
  padding: 7px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
}

.snake-score-live span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.snake-score-live strong {
  color: #fff;
  font-size: 21px;
}

.snake-effect {
  flex: 1;
  overflow: hidden;
  padding: 10px;
  color: rgba(231, 243, 239, 0.64);
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 14px;
  transition: color 160ms ease, background 160ms ease;
}

.snake-effect.active {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
}

.snake-exit {
  min-height: 43px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

@media (max-width: 540px) {
  .mines-hud {
    flex-wrap: wrap;
  }

  .mines-quit {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .mines-footer {
    flex-direction: column;
    gap: 4px;
  }
}

.snake-canvas {
  align-self: center;
  justify-self: center;
  width: min(100%, calc(100vh - 235px), 660px);
  height: auto;
  max-height: 100%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, rgba(255, 255, 255, 0.08));
  border-radius: clamp(18px, 5vw, 28px);
  background: #071214;
  touch-action: none;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.38),
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent) inset;
}

.snake-fire {
  justify-self: center;
  min-width: min(230px, 65vw);
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #111517;
  font-weight: 800;
  background: linear-gradient(120deg, #ffe274, #ff974c);
  box-shadow: 0 9px 30px rgba(255, 178, 71, 0.3);
}

.snake-touch-controls {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(4, 55px);
  gap: 8px;
}

.snake-touch-controls button {
  width: 55px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 15px;
  color: #ebfff7;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.snake-touch-controls button:active {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.06));
}

@media (max-width: 620px) {
  .topbar {
    padding-inline: 11px;
    gap: 6px;
  }

  .topbar-main {
    gap: 6px;
  }

  .brand-row {
    gap: 7px;
  }

  .brand-subtitle {
    display: none;
  }

  .topbar-action.inline-actions {
    gap: 5px;
  }

  .topbar-games-center {
    position: static;
    transform: none;
    margin-left: auto;
  }

  .topbar-feature-actions {
    gap: 4px;
  }

  .games-header-link {
    min-width: 38px;
    min-height: 38px;
    padding: 8px 10px;
  }

  .games-header-short,
  .games-header-text,
  body[data-desktop-mode="1"] .games-header-text {
    display: none;
  }

  .download-app-link {
    min-width: 38px;
    min-height: 38px;
    justify-content: center;
    font-size: 18px;
  }

  .download-app-label {
    display: none;
  }

  .download-app-icon {
    display: inline;
    line-height: 1;
  }

  .snake-rule-grid {
    grid-template-columns: 1fr;
  }

  .snake-hud {
    gap: 6px;
  }

  .snake-effect {
    font-size: 11px;
  }

  .snake-canvas {
    width: min(100%, calc(100vh - 228px));
  }
}

@media (max-width: 410px) {
  .games-header-short,
  body[data-desktop-mode="1"] .games-header-text {
    display: none;
  }

  .game-post-cta {
    align-items: start;
    flex-direction: column;
  }
}

.brand-row > div:last-child {
  min-width: 0;
}

.brand-title,
.brand-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-wrap.avatar-xs {
  width: 24px;
  height: 24px;
}

.avatar-wrap.avatar-lg {
  width: 78px;
  height: 78px;
}

.chat-peer-status.is-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8bf5ae;
  font-size: 12px;
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #19d661;
  box-shadow: 0 0 0 3px rgba(25, 214, 97, 0.12);
  flex-shrink: 0;
}

.chat-call-action {
  color: #ff3045;
  text-decoration: none;
}

.chat-call-action .ui-icon {
  width: 24px;
  height: 24px;
}

.voice-message-modern {
  position: relative;
  width: min(265px, 68vw);
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px 13px;
  border-radius: 11px;
  background: linear-gradient(180deg, #1c1c1e, #111113);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.voice-play-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.voice-wave {
  display: grid;
  grid-template-columns: repeat(18, 3px);
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 28px;
  overflow: hidden;
}

.voice-wave span {
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.voice-wave span:nth-child(3n) { height: 18px; }
.voice-wave span:nth-child(4n) { height: 24px; }
.voice-wave span:nth-child(5n) { height: 14px; }
.voice-wave span:nth-child(7n) { height: 22px; }

.voice-message-times {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.voice-progress {
  position: absolute;
  left: 54px;
  right: 38px;
  bottom: 5px;
  width: auto;
  height: 3px;
  opacity: 0.55;
}

.message-media .file-card {
  text-decoration: none;
}

.message-media > .file-card:not(.file-card-modern),
.file-card-modern {
  min-width: min(270px, 70vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(150, 24, 35, 0.92), rgba(92, 15, 24, 0.94));
  border: 1px solid rgba(255, 78, 92, 0.18);
  color: #fff;
  box-shadow: 0 10px 26px rgba(80, 0, 8, 0.24);
}

.message-media > .file-card:not(.file-card-modern)::before,
.file-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(180deg, #ff3b4f, #bd1829);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.message-media > .file-card:not(.file-card-modern)::before {
  content: "FILE";
}

.file-card-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-card-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.file-card-meta small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
}

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

.story-feed-live-btn {
  width: auto;
  min-width: 68px;
  padding: 0 12px;
  gap: 4px;
  background: linear-gradient(120deg, #ff1f48, #ff5aa6, #e11d2e);
  background-size: 220% 100%;
  box-shadow: 0 10px 26px rgba(255, 38, 91, 0.32);
  animation: liveGradient 2.4s ease-in-out infinite alternate;
  text-decoration: none;
}

.story-feed-live-btn strong {
  font-size: 11px;
  line-height: 1;
}

.live-bubble-link {
  color: var(--text);
  text-decoration: none;
}

.live-story-bubble,
.live-ring-active {
  position: relative;
  background: conic-gradient(from 0deg, #ff1f48, #ff5aa6, #ff2d55, #e11d2e, #ff1f48);
  animation: liveRingSpin 3s linear infinite;
}

.live-story-label,
.profile-live-label {
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff1f48, #ff5aa6);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 5px 14px rgba(255, 45, 85, 0.32);
}

.story-create-choice-btn {
  background: linear-gradient(120deg, #ff1f48, #ff5aa6, #e11d2e);
  background-size: 220% 100%;
  animation: liveGradient 2.6s ease-in-out infinite alternate;
}

.story-create-choice-sheet {
  gap: 12px;
}

.story-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

.story-choice-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.08));
  color: #fff;
  font-weight: 900;
}

.story-choice-live {
  border: 1px solid rgba(255, 76, 126, 0.28);
  background: linear-gradient(120deg, rgba(255, 31, 72, 0.18), rgba(255, 90, 166, 0.14));
}

.story-choice-live .story-choice-icon {
  background: linear-gradient(120deg, #ff1f48, #ff5aa6);
  font-size: 11px;
}

.story-choice-live em {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 47, 96, 0.22);
  color: #ffb9cf;
  font-size: 10px;
  font-style: normal;
}

.live-profile-card {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(120deg, rgba(255, 31, 72, 0.28), rgba(255, 90, 166, 0.14));
  border: 1px solid rgba(255, 76, 126, 0.22);
}

.live-setup-page,
.live-room {
  display: grid;
  gap: 12px;
}

.live-setup-hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 90, 166, 0.24), transparent 32%),
    linear-gradient(145deg, #16070d, #030303 64%);
}

.live-preview-video,
.live-owner-video {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  background: #050505;
}

.live-preview-empty,
.live-viewer-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 90, 166, 0.25), transparent 34%),
    linear-gradient(145deg, #19070d, #020202 68%);
}

.live-preview-empty.hidden,
.live-viewer-backdrop.hidden {
  display: none;
}

.live-setup-form {
  display: grid;
  gap: 12px;
}

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

.live-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.live-start-btn {
  background: linear-gradient(120deg, #ff1f48, #ff5aa6, #e11d2e);
  background-size: 220% 100%;
  animation: liveGradient 2.2s ease-in-out infinite alternate;
}

.live-active-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-stage {
  position: relative;
  min-height: min(720px, calc(100dvh - 150px));
  overflow: hidden;
  border-radius: 24px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-stage .live-owner-video {
  min-height: min(720px, calc(100dvh - 150px));
}

.live-top-info {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.live-owner-chip {
  max-width: min(62vw, 360px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 5px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

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

.live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: linear-gradient(120deg, #ff1f48, #ff5aa6);
  box-shadow: 0 8px 20px rgba(255, 45, 85, 0.28);
}

.live-counter {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.live-viewer-avatar {
  padding: 4px;
  border-radius: 50%;
}

.live-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(8px);
}

.live-pause-overlay.hidden {
  display: none;
}

.live-chat-overlay {
  position: absolute;
  left: 12px;
  bottom: 82px;
  z-index: 5;
  width: min(330px, 67%);
  max-height: 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: none;
}

.live-chat-overlay::-webkit-scrollbar {
  display: none;
}

.live-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 15px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.86);
  color: #111;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.live-chat-message-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.live-chat-message-body strong {
  font-size: 11px;
}

.live-chat-message-body span {
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.live-chat-form {
  position: absolute;
  left: 12px;
  bottom: 18px;
  z-index: 6;
  width: min(360px, calc(100% - 96px));
  display: flex;
  gap: 8px;
}

.live-chat-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.88);
  color: #111;
}

.live-chat-form button {
  border: none;
  border-radius: 999px;
  padding: 0 13px;
  color: #fff;
  background: linear-gradient(120deg, #ff1f48, #ff5aa6);
  font-weight: 800;
}

.live-chat-disabled {
  position: absolute;
  left: 12px;
  bottom: 18px;
  z-index: 6;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #111;
}

.live-like-btn {
  position: absolute;
  right: 16px;
  bottom: 20px;
  z-index: 8;
  width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #ff1f48, #ff5aa6);
  box-shadow: 0 14px 34px rgba(255, 45, 85, 0.36);
}

.live-like-btn span {
  font-size: 23px;
  line-height: 1;
}

.live-like-btn strong {
  font-size: 10px;
}

.live-like-btn.active {
  filter: saturate(1.18);
}

.live-heart-layer {
  position: absolute;
  right: 14px;
  bottom: 76px;
  width: 90px;
  height: 52%;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}

.live-flying-heart {
  position: absolute;
  bottom: 0;
  color: #ff3d72;
  font-size: 26px;
  text-shadow: 0 5px 16px rgba(0, 0, 0, 0.34);
  animation: liveHeartFloat 1.45s ease-out forwards;
}

.live-owner-controls {
  position: absolute;
  right: 12px;
  bottom: 88px;
  z-index: 8;
  width: min(220px, 42%);
  display: grid;
  gap: 7px;
}

.live-control-btn {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
}

.live-danger {
  background: linear-gradient(120deg, rgba(255, 31, 72, 0.88), rgba(225, 29, 46, 0.82));
}

.live-user-sheet {
  overflow: hidden;
  border-radius: 24px;
  background: #101010;
}

.live-user-cover {
  min-height: 112px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 90, 166, 0.28), transparent 35%),
    linear-gradient(135deg, #2b0710, #090909);
  background-size: cover;
  background-position: center;
}

.live-user-card {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
  margin-top: -34px;
}

.live-user-name {
  font-weight: 900;
  font-size: 18px;
}

.live-user-verified {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #29b7ff;
  color: #fff;
  font-size: 11px;
}

.live-user-actions,
.live-mute-grid {
  display: grid;
  gap: 8px;
}

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

@media (max-width: 620px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .topbar-main {
    min-width: 0;
    overflow: hidden;
  }

  .topbar-main-has-back .brand-mark {
    display: none;
  }

  .topbar-main-has-back .brand-title {
    max-width: clamp(82px, 28vw, 142px);
  }

  .topbar-games-center {
    justify-self: end;
    min-width: 38px;
    margin-left: 0;
  }

  .topbar-action.inline-actions {
    justify-self: end;
  }

  .live-stage,
  .live-stage .live-owner-video {
    min-height: calc(100dvh - 136px);
  }

  .live-owner-controls {
    left: 12px;
    right: 82px;
    bottom: 72px;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-control-btn {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .live-chat-overlay {
    bottom: 154px;
    width: min(330px, calc(100% - 104px));
    max-height: 44%;
  }
}

@media (max-width: 380px) {
  .topbar-main-has-back .brand-title {
    max-width: 76px;
  }

  .live-chat-form button {
    display: none;
  }

  .voice-message-modern,
  .message-media > .file-card:not(.file-card-modern),
  .file-card-modern {
    min-width: min(240px, 72vw);
  }
}

@keyframes liveGradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes liveRingSpin {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(18deg); }
}

@keyframes liveHeartFloat {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translateY(-220px) scale(1.25);
    opacity: 0;
  }
}
