:root {
  color-scheme: dark;
  --bg: #060606;
  --bg-soft: #101010;
  --panel: #141414;
  --panel-strong: #202020;
  --panel-glass: rgba(20, 20, 20, 0.82);
  --line: rgba(244, 240, 232, 0.14);
  --text: #f4f0e8;
  --muted: #9c978e;
  --muted-strong: #c7c0b4;
  --primary: #f4f0e8;
  --primary-2: #b2aba0;
  --mint: #d8d2c6;
  --amber: #d7c197;
  --berry: #d7a7a7;
  --danger: #ff6a73;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(216, 210, 198, 0.1), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.boot-screen {
  --boot-logo-size: clamp(168px, 18vw, 216px);
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.boot-screen .brand-mark {
  width: var(--boot-logo-size);
  height: var(--boot-logo-size);
  border-radius: calc(var(--boot-logo-size) * 0.24);
  border-color: rgba(244, 240, 232, 0.18);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.62),
    0 0 80px rgba(244, 240, 232, 0.08);
}

.boot-screen .brand-ring {
  border-width: calc(var(--boot-logo-size) * 0.028);
  padding-top: calc(var(--boot-logo-size) * 0.02);
}

.boot-screen .brand-ring strong {
  margin-top: calc(var(--boot-logo-size) * 0.07);
  font-size: calc(var(--boot-logo-size) * 0.28);
}

.boot-screen .brand-ring span {
  margin-top: calc(var(--boot-logo-size) * -0.11);
  font-size: calc(var(--boot-logo-size) * 0.105);
}

.privacy-body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(216, 210, 198, 0.12), transparent 28%),
    #050505;
}

.privacy-page {
  display: grid;
  gap: 34px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 70px) 0 56px;
}

.privacy-hero {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 3.5vw, 42px) 0 4px;
}

.privacy-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.privacy-brand .brand-mark {
  width: 46px;
  height: 46px;
}

.privacy-kicker {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.privacy-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.04;
  text-wrap: balance;
}

.privacy-hero > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.48;
}

.privacy-shell {
  display: grid;
  grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.privacy-summary,
.privacy-doc {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.84);
  box-shadow: var(--shadow);
}

.privacy-summary {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.privacy-summary h2,
.privacy-doc h2 {
  margin: 0;
  color: var(--text);
}

.privacy-summary h2 {
  font-size: 20px;
}

.privacy-summary ul,
.privacy-doc ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.privacy-summary li,
.privacy-doc li {
  margin: 8px 0;
  color: var(--muted-strong);
  line-height: 1.55;
}

.privacy-doc {
  padding: clamp(22px, 4vw, 46px);
}

.privacy-doc section + section {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.privacy-doc h2 {
  font-size: clamp(20px, 2.4vw, 28px);
}

.privacy-doc p {
  margin: 14px 0 0;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.7;
}

.privacy-doc a {
  color: var(--text);
  font-weight: 850;
  text-decoration-color: rgba(244, 240, 232, 0.38);
  text-underline-offset: 3px;
}

.privacy-doc a:hover {
  text-decoration-color: var(--text);
}

.support-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(circle at 84% 14%, rgba(216, 210, 198, 0.12), transparent 28%),
    #050505;
}

.support-landing {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  overflow: hidden;
}

.support-visual {
  min-height: 100vh;
}

.support-brand-block {
  animation: auth-content-in 0.7s ease both;
}

.support-card-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
}

.support-help-card {
  display: grid;
  width: min(620px, 100%);
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 38px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 44%),
    rgba(18, 18, 18, 0.94);
  box-shadow: var(--shadow);
  animation: auth-content-in 0.78s ease 0.08s both;
}

.support-help-card h1 {
  max-width: 540px;
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4.7vw, 56px);
  line-height: 1.04;
  text-wrap: balance;
}

.support-help-card > p:not(.privacy-kicker) {
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 720;
  line-height: 1.48;
}

.support-email-card {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 20px;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.support-email-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.support-email-card a {
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 950;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.support-button {
  display: inline-flex;
  min-height: 58px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #050505;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 18px 52px rgba(244, 240, 232, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.support-button:hover {
  box-shadow: 0 22px 58px rgba(244, 240, 232, 0.2);
  transform: translateY(-1px);
}

.support-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.support-info-grid section {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.support-info-grid h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.support-info-grid p,
.support-info-grid li {
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.support-info-grid p,
.support-info-grid ul {
  margin: 0;
}

.support-info-grid ul {
  padding-left: 20px;
}

.support-info-grid li + li {
  margin-top: 6px;
}

.support-link {
  width: fit-content;
  color: var(--text);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(244, 240, 232, 0.38);
  text-underline-offset: 4px;
}

.support-link:hover {
  text-decoration-color: var(--text);
}

.support-inline-link {
  width: fit-content;
  margin-top: -4px;
}

.sticker-page {
  display: grid;
  gap: 28px;
  width: min(1160px, calc(100% - 34px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.sticker-hero {
  display: grid;
  gap: 14px;
}

.sticker-hero.compact {
  gap: 10px;
}

.sticker-hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: 56px;
  line-height: 1.04;
  text-wrap: balance;
}

.sticker-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 20px;
  font-weight: 750;
  line-height: 1.48;
}

.sticker-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.sticker-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 48%),
    rgba(18, 18, 18, 0.94);
  box-shadow: var(--shadow);
}

.sticker-card h2,
.sticker-review-main h3 {
  margin: 0;
  color: var(--text);
}

.sticker-card h2 {
  font-size: 30px;
}

.sticker-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.sticker-steps li,
.sticker-muted,
.sticker-review-main p,
.sticker-review-main small {
  color: var(--muted-strong);
  font-weight: 720;
  line-height: 1.52;
}

.sticker-steps span,
.sticker-review-main a {
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.sticker-note {
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 8px;
  padding: 16px;
  background: rgba(96, 165, 250, 0.08);
  color: var(--muted-strong);
  font-weight: 760;
  line-height: 1.5;
}

.sticker-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.sticker-form input,
.sticker-form textarea {
  width: 100%;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(5, 5, 5, 0.72);
  color: var(--text);
  font: inherit;
  font-weight: 760;
  outline: none;
}

.sticker-form textarea {
  resize: vertical;
}

.sticker-form input:focus,
.sticker-form textarea:focus {
  border-color: rgba(244, 240, 232, 0.42);
}

.sticker-submit {
  border: 0;
  cursor: pointer;
}

.sticker-status {
  min-height: 24px;
  color: var(--muted-strong);
  font-weight: 850;
}

.sticker-status.success {
  color: #86efac;
}

.sticker-status.error {
  color: #fb7185;
}

.review-shell {
  grid-template-columns: minmax(260px, 0.45fr) minmax(420px, 1fr);
}

.review-shell.authorized {
  grid-template-columns: 1fr;
}

.review-shell.authorized #sticker-review-login,
#sticker-review-login[hidden] {
  display: none;
}

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

.sticker-review-section-head {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(244, 240, 232, 0.12);
}

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

.sticker-review-item {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(244, 240, 232, 0.13);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.sticker-review-main {
  display: grid;
  gap: 8px;
}

.sticker-review-main a {
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: rgba(244, 240, 232, 0.34);
  text-underline-offset: 3px;
}

.sticker-badge {
  width: fit-content;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.sticker-badge.approved {
  border-color: rgba(134, 239, 172, 0.45);
  color: #86efac;
}

.sticker-badge.rejected {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fb7185;
}

.sticker-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sticker-pack-list {
  margin-top: 12px;
}

.small-btn.outline {
  background: transparent;
  border: 1px solid rgba(251, 113, 133, 0.36);
}

.sticker-empty {
  border: 1px dashed rgba(244, 240, 232, 0.16);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted-strong);
  font-weight: 820;
  text-align: center;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 13px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.13), transparent 34%),
    linear-gradient(145deg, #242424, #040404);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  color: var(--text);
}

.brand-ring {
  display: grid;
  width: 82%;
  height: 82%;
  place-items: center;
  border: 2px solid var(--text);
  border-radius: 50%;
  padding-top: 1px;
  text-align: center;
}

.brand-ring strong {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 0.9;
  letter-spacing: 1px;
}

.brand-ring span {
  margin-top: -6px;
  font-size: 6px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.auth-page {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  overflow: hidden;
}

.fitness-fall {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fitness-flake {
  position: absolute;
  top: -110px;
  left: calc(var(--x) * 1%);
  width: var(--size);
  height: var(--size);
  color: rgba(244, 240, 232, 0.16);
  filter:
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 22px rgba(244, 240, 232, 0.08));
  opacity: 0;
  transform: translate3d(0, -12vh, 0) rotate(0deg);
  animation: fitness-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}

.fitness-flake.kettlebell {
  color: rgba(216, 210, 198, 0.18);
}

.fitness-flake.barbell {
  color: rgba(244, 240, 232, 0.14);
}

.fitness-flake svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes fitness-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }

  12% {
    opacity: 0.9;
  }

  84% {
    opacity: 0.65;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 112vh, 0) rotate(var(--spin));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fitness-fall {
    display: none;
  }

  .auth-brand-block,
  .auth-brand-block .brand-mark {
    animation: none;
  }
}

.auth-visual {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(46px, 5vw, 86px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 46%),
    linear-gradient(0deg, rgba(216, 210, 198, 0.08), transparent 44%),
    #0b0b0b;
  border-right: 1px solid var(--line);
}

.auth-brand-block {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(660px, 100%);
  min-height: min(650px, 76vh);
  align-content: center;
  justify-items: center;
  padding: clamp(34px, 4.5vw, 72px) clamp(14px, 2vw, 34px);
  text-align: center;
  animation: auth-content-in 0.7s ease both;
}

.auth-brand-block .brand-mark {
  position: relative;
  z-index: 1;
  width: clamp(220px, 17vw, 300px);
  height: clamp(220px, 17vw, 300px);
  border-radius: clamp(48px, 3.6vw, 64px);
  border-color: rgba(244, 240, 232, 0.18);
  box-shadow:
    0 42px 120px rgba(0, 0, 0, 0.64),
    0 0 96px rgba(244, 240, 232, 0.1);
  animation: auth-logo-float 5.8s ease-in-out infinite;
}

.auth-brand-block .brand-ring {
  border-width: clamp(6px, 0.42vw, 8px);
  padding-top: clamp(2px, 0.16vw, 4px);
}

.auth-brand-block .brand-ring strong {
  margin-top: clamp(12px, 0.95vw, 18px);
  font-size: clamp(58px, 4.7vw, 82px);
}

.auth-brand-block .brand-ring span {
  margin-top: clamp(-30px, -1.85vw, -22px);
  font-size: clamp(21px, 1.55vw, 29px);
}

.auth-title {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin-top: clamp(34px, 3.1vw, 52px);
}

.auth-title p {
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(21px, 1.55vw, 28px);
  font-weight: 760;
  line-height: 1.46;
  text-wrap: balance;
}

@keyframes auth-content-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-logo-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg);
  }

  50% {
    transform: translateY(-12px) rotate(0.4deg);
  }
}

.auth-card-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 30px;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: rgba(18, 18, 18, 0.92);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 26px;
}

.auth-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.privacy-consent-page {
  position: relative;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(216, 210, 198, 0.12), transparent 30%),
    #050505;
}

.privacy-consent-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: rgba(18, 18, 18, 0.94);
  box-shadow: var(--shadow);
}

.privacy-consent-card .brand-mark {
  width: 76px;
  height: 76px;
}

.privacy-consent-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
}

.privacy-consent-card p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.48;
}

.privacy-consent-link {
  width: fit-content;
  color: var(--text);
  font-weight: 850;
  text-decoration-color: rgba(244, 240, 232, 0.38);
  text-underline-offset: 3px;
}

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090909;
}

.segment button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
}

.segment button.active {
  background: var(--primary);
  color: #070707;
  box-shadow: 0 10px 22px rgba(244, 240, 232, 0.12);
}

.form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

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

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: 0;
  background: #0b0b0b;
  color: var(--text);
}

.select {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  padding-right: 54px;
  background-color: #0b0b0b;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23f4f0e8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 24px center;
  background-size: 18px 18px;
}

.textarea {
  min-height: 78px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(244, 240, 232, 0.72);
  box-shadow: 0 0 0 3px rgba(244, 240, 232, 0.12);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.small-btn {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-btn {
  min-height: 46px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #070707;
  font-weight: 760;
  box-shadow: 0 16px 38px rgba(244, 240, 232, 0.12);
}

.auth-link {
  justify-self: center;
  padding: 4px 8px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 760;
}

.auth-link:hover {
  color: var(--text);
}

.reset-mail-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.ghost-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
}

.small-btn {
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-strong);
}

.icon-btn {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 20px;
}

.icon-btn.active,
.ghost-btn.active {
  background: rgba(244, 240, 232, 0.13);
  color: var(--text);
  border-color: rgba(244, 240, 232, 0.38);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.small-btn:hover {
  transform: translateY(-1px);
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.success {
  color: var(--mint);
  font-size: 14px;
  text-align: center;
}

.error:empty,
.success:empty {
  display: none;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.35;
}

.check-field input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.check-field a {
  color: var(--text);
  font-weight: 850;
  text-decoration-color: rgba(244, 240, 232, 0.38);
  text-underline-offset: 3px;
}

.check-field a:hover {
  text-decoration-color: var(--text);
}

.privacy-consent-field {
  margin-top: 2px;
}

.remember-field {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 760;
}

.remember-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.app-shell {
  display: grid;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  grid-template-columns: 108px minmax(0, 1fr) 342px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(216, 210, 198, 0.05), transparent 42%),
    #050505;
}

.app-shell.no-tools {
  grid-template-columns: 108px minmax(0, 1fr);
}

.rail {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  padding: 22px 8px;
  background: rgba(8, 8, 8, 0.86);
}

.rail-spacer {
  display: none;
}

.rail .brand-mark {
  width: 48px;
  height: 48px;
}

.rail .brand-ring strong {
  font-size: 13px;
}

.rail .brand-ring span {
  font-size: 5px;
}

.rail-profile {
  display: grid;
  width: 86px;
  justify-items: center;
  gap: 5px;
  padding: 4px 3px;
  border-radius: 8px;
  background: transparent;
}

.rail-profile:hover,
.rail-chat:hover,
.rail-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rail-avatar {
  width: 58px;
  height: 58px;
  font-size: 14px;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.profile-avatar-wrap.large {
  width: 68px;
  height: 68px;
}

.profile-warning-badge {
  position: absolute;
  right: -2px;
  bottom: -1px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #101010;
  border-radius: 50%;
  background: #ffcf5a;
  color: #070707;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.rail-chats {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-y: auto;
  padding: 2px 0;
}

.rail,
.rail-chats,
.groups,
.timeline {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.rail::-webkit-scrollbar,
.rail-chats::-webkit-scrollbar,
.groups::-webkit-scrollbar,
.timeline::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.rail-chat,
.rail-action {
  display: grid;
  width: 86px;
  justify-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 4px 3px;
  background: transparent;
}

.rail-chat-icon,
.rail-action-icon {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  color: var(--text);
  font-size: 23px;
  font-weight: 850;
}

.rail-chat .group-icon {
  width: 58px;
  height: 58px;
  border: 0;
  background: transparent;
  font-size: 23px;
}

.rail-chat.active .rail-chat-icon,
.rail-chat.active .group-icon {
  border-color: rgba(244, 240, 232, 0.42);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #070707;
  box-shadow: 0 14px 28px rgba(244, 240, 232, 0.14);
}

.rail-chat.has-unread:not(.active) .rail-chat-icon {
  border-color: rgba(244, 240, 232, 0.46);
  box-shadow:
    0 0 0 1px rgba(244, 240, 232, 0.12),
    0 14px 36px rgba(244, 240, 232, 0.16);
}

.rail-chat.has-unread:not(.active) .rail-label {
  color: var(--text);
}

.rail-chat.active .rail-label {
  color: var(--text);
}

.rail-chat.is-private .rail-chat-icon {
  border-color: rgba(245, 158, 11, 0.72);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(251, 191, 36, 0.12));
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.12),
    0 14px 32px rgba(245, 158, 11, 0.14);
}

.rail-chat.is-private.active .rail-chat-icon {
  border-color: rgba(251, 191, 36, 0.92);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.28),
    0 14px 34px rgba(245, 158, 11, 0.24);
}

.rail-chat.is-private .rail-label {
  color: #fbbf24;
}

.rail-chat.is-direct .rail-chat-icon,
.rail-direct-chat .rail-chat-icon {
  border-color: rgba(60, 213, 164, 0.45);
  background: linear-gradient(135deg, rgba(60, 213, 164, 0.22), rgba(56, 189, 248, 0.18));
  color: #f8fffb;
}

.rail-chat.is-direct.active .rail-chat-icon {
  border-color: rgba(143, 255, 214, 0.72);
  background: linear-gradient(135deg, #3cd5a4, #38bdf8);
  color: #06130f;
}

.rail-chat.is-direct .rail-label,
.rail-direct-chat .rail-label {
  color: #a8f7da;
}

.rail-label {
  display: block;
  width: 82px;
  overflow: visible;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.08;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rail-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #080808;
  border-radius: 999px;
  padding: 0 5px;
  background: var(--primary);
  color: #070707;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(244, 240, 232, 0.08);
}

.chat-list {
  display: none;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.78);
}

.list-head {
  display: grid;
  gap: 20px;
  padding: 28px 28px 18px;
}

.list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.list-title h1 {
  margin: 0;
  font-size: 27px;
}

.search-wrap {
  position: relative;
}

.search-wrap .input {
  padding-left: 42px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.groups {
  overflow: auto;
}

.group-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
  min-height: 104px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 15px 22px;
  background: transparent;
  text-align: left;
}

.group-row.active {
  background: linear-gradient(90deg, rgba(244, 240, 232, 0.12), rgba(216, 210, 198, 0.04));
}

.group-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.group-row.is-direct {
  background: linear-gradient(90deg, rgba(60, 213, 164, 0.13), rgba(56, 189, 248, 0.05));
}

.group-row.is-direct.active,
.group-row.is-direct:hover {
  background: linear-gradient(90deg, rgba(60, 213, 164, 0.2), rgba(56, 189, 248, 0.08));
}

.group-row.is-direct .group-icon {
  border-color: rgba(60, 213, 164, 0.5);
  background: linear-gradient(135deg, rgba(60, 213, 164, 0.24), rgba(56, 189, 248, 0.16));
}

.group-row.is-private .group-icon {
  border-color: rgba(245, 158, 11, 0.72);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(251, 191, 36, 0.12));
}

.group-icon.direct-peer-avatar {
  border: 1px solid rgba(60, 213, 164, 0.45);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(60, 213, 164, 0.24), rgba(56, 189, 248, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.group-icon.direct-peer-avatar.has-image img {
  object-fit: cover;
  object-position: 50% 64%;
}

.group-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  font-size: 24px;
  font-weight: 800;
}

.group-icon.group-icon-challenge {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(255, 185, 64, 0.78);
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 246, 173, 0.98), rgba(255, 167, 38, 0.8) 26%, transparent 42%),
    radial-gradient(circle at 66% 72%, rgba(239, 68, 68, 0.9), transparent 50%),
    linear-gradient(145deg, #7f1d1d, #f97316 48%, #1f1028);
  color: #fff7ad;
  text-shadow: 0 2px 12px rgba(74, 19, 0, 0.86);
  box-shadow:
    0 0 0 1px rgba(255, 237, 213, 0.16),
    0 14px 30px rgba(249, 115, 22, 0.24),
    0 0 28px rgba(239, 68, 68, 0.2);
  animation: challengeFireGlow 2.4s ease-in-out infinite;
}

.group-icon.group-icon-challenge::before {
  position: absolute;
  inset: 20% -12% -18%;
  z-index: -1;
  border-radius: 42% 48% 18% 22%;
  background:
    radial-gradient(circle at 28% 72%, rgba(255, 237, 160, 0.92), transparent 31%),
    radial-gradient(circle at 56% 46%, rgba(251, 146, 60, 0.88), transparent 38%),
    radial-gradient(circle at 76% 68%, rgba(220, 38, 38, 0.78), transparent 36%);
  content: "";
  filter: blur(2px);
  transform-origin: 50% 100%;
  animation: challengeFireFlicker 1.55s ease-in-out infinite alternate;
}

.group-icon.group-icon-challenge::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 42%, rgba(0, 0, 0, 0.24));
  content: "";
  pointer-events: none;
}

.rail-chat .group-icon.group-icon-challenge {
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 246, 173, 0.98), rgba(255, 167, 38, 0.8) 26%, transparent 42%),
    radial-gradient(circle at 66% 72%, rgba(239, 68, 68, 0.9), transparent 50%),
    linear-gradient(145deg, #7f1d1d, #f97316 48%, #1f1028);
}

.rail-chat.active .group-icon.group-icon-challenge {
  border-color: rgba(255, 247, 173, 0.9);
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 246, 173, 1), rgba(255, 167, 38, 0.86) 26%, transparent 42%),
    radial-gradient(circle at 66% 72%, rgba(239, 68, 68, 0.95), transparent 50%),
    linear-gradient(145deg, #991b1b, #fb923c 50%, #1f1028);
  color: #fff7ad;
  box-shadow:
    0 0 0 1px rgba(255, 237, 213, 0.22),
    0 16px 34px rgba(249, 115, 22, 0.34),
    0 0 34px rgba(239, 68, 68, 0.3);
}

@keyframes challengeFireGlow {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.18) brightness(1.08);
  }
}

@keyframes challengeFireFlicker {
  from {
    transform: translate3d(-4%, 3%, 0) scale(1.02) rotate(-3deg);
  }
  to {
    transform: translate3d(4%, -4%, 0) scale(1.12) rotate(4deg);
  }
}

.group-icon-button {
  display: grid;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.group-icon-button:hover .group-icon {
  border-color: rgba(244, 240, 232, 0.48);
  background: linear-gradient(145deg, rgba(244, 240, 232, 0.2), rgba(255, 255, 255, 0.06));
}

.group-main {
  min-width: 0;
}

.group-name-line,
.message-meta,
.room-actions,
.info-grid,
.key-head {
  display: flex;
  align-items: center;
}

.group-name-line {
  justify-content: space-between;
  gap: 12px;
}

.group-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-time {
  color: var(--muted);
  font-size: 13px;
}

.last-author {
  margin-top: 6px;
  color: var(--text);
  font-weight: 640;
}

.last-message {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #070707;
  font-size: 13px;
  font-weight: 780;
}

.room {
  display: grid;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(7, 10, 15, 0.8);
}

.room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  padding: 22px 34px;
}

.stories-strip {
  display: flex;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  background: rgba(10, 14, 22, 0.72);
  scrollbar-width: none;
}

.stories-strip::-webkit-scrollbar {
  display: none;
}

.stories-strip-empty {
  height: 0;
  overflow: hidden;
  border-bottom: 0;
  padding: 0;
}

.story-pill {
  display: grid;
  width: 72px;
  flex: 0 0 72px;
  justify-items: center;
  gap: 6px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: center;
}

.story-pill:hover {
  color: var(--text);
}

.story-pill strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-ring {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #34d399, #f59e0b);
  padding: 2px;
}

.story-ring .avatar {
  width: 54px;
  height: 54px;
  border: 2px solid #0a0e16;
  box-shadow: none;
}

.story-ring-add span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
}

.stories-loading {
  align-self: center;
  color: var(--muted);
  font-weight: 750;
}

.room-identity {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.room-title-area {
  min-width: 0;
}

.room-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.room-title-button {
  min-width: 0;
  border-radius: 6px;
  padding: 2px 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.room-title-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.room-identity h2 {
  overflow: hidden;
  margin: 0;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-action-btn {
  min-height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.title-action-btn:hover {
  background: rgba(244, 240, 232, 0.12);
  color: var(--text);
}

.room-title-editor {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto auto;
  gap: 8px;
  align-items: center;
}

.room-title-editor input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: 0;
}

.room-title-editor input:focus {
  border-color: rgba(244, 240, 232, 0.72);
  box-shadow: 0 0 0 3px rgba(244, 240, 232, 0.12);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--mint);
  font-size: 14px;
}

.status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.room-actions {
  gap: 10px;
}

.story-header-preview {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
}

.story-header-preview .story-ring {
  width: 46px;
  height: 46px;
  padding: 2px;
}

.story-header-preview .story-ring .avatar {
  width: 42px;
  height: 42px;
  border-color: #080b11;
}

.story-count {
  position: absolute;
  right: -4px;
  bottom: -3px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #080b11;
  border-radius: 999px;
  padding: 0 5px;
  background: var(--primary);
  color: #070707;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.chat-menu-wrap {
  position: relative;
}

.chat-action-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 14;
  display: grid;
  width: min(310px, calc(100vw - 32px));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(18, 18, 18, 0.98);
  box-shadow: var(--shadow);
}

.chat-action-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  background: transparent;
  text-align: left;
}

.chat-action-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chat-action-item strong {
  font-size: 14px;
}

.chat-action-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chat-action-item.danger strong,
.small-btn.danger {
  color: var(--danger);
}

.group-info {
  margin: 28px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.035);
}

.info-grid {
  flex-wrap: wrap;
  gap: 20px;
}

.info-item {
  min-width: 160px;
  flex: 1;
}

.info-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.info-item strong {
  font-size: 16px;
}

.timeline {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 20px 34px 84px;
}

.challenge-card {
  display: grid;
  gap: 14px;
  margin: 0 34px 12px;
  border: 1px solid rgba(105, 150, 255, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: rgba(13, 20, 34, 0.78);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.challenge-head,
.challenge-leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.challenge-head strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.challenge-head span,
.challenge-metrics span,
.challenge-empty {
  color: var(--muted);
  font-size: 12px;
}

.challenge-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe !important;
  font-weight: 900;
}

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

.challenge-metrics div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.challenge-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-leaderboard {
  display: grid;
  gap: 8px;
}

.challenge-leader-row {
  color: var(--text);
  font-size: 14px;
}

.challenge-leader-row span {
  width: 34px;
  color: #93c5fd;
  font-weight: 900;
}

.challenge-leader-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-leader-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.older-messages {
  display: flex;
  justify-content: center;
  min-height: 36px;
}

.date-divider {
  display: grid;
  grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.date-divider::before,
.date-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.unread-divider {
  display: grid;
  grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
  gap: 14px;
  align-items: center;
  color: #cbbcff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.unread-divider::before,
.unread-divider::after {
  height: 1px;
  background: rgba(139, 109, 255, 0.55);
  content: "";
}

.unread-divider span {
  border: 1px solid rgba(139, 109, 255, 0.45);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(139, 109, 255, 0.16);
}

.message-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 560px);
  gap: 12px;
  align-items: end;
}

.message-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  color: currentColor;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease;
}

.message-row:hover .message-delete-btn,
.message-delete-btn:focus-visible {
  opacity: 1;
}

.message-delete-btn:hover {
  background: rgb(255 87 115 / 0.24);
}

.message-row.mine {
  grid-template-columns: minmax(0, 560px);
  justify-content: end;
}

.message-row.mine .avatar {
  display: none;
}

.message-avatar-button {
  display: grid;
  width: 42px;
  height: 42px;
  align-self: end;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  background: transparent;
}

.message-avatar-button:hover {
  opacity: 0.82;
}

.bubble {
  position: relative;
  border-radius: 8px;
  padding: 16px 18px;
  background: linear-gradient(160deg, #242424, #111111);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.16);
}

.message-row.mine .bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #070707;
}

.message-row.pending .bubble {
  opacity: 0.78;
}

.message-row.failed .bubble {
  border: 1px solid rgba(255, 106, 115, 0.42);
  background: rgba(255, 106, 115, 0.12);
  color: var(--text);
}

.message-row.mine.failed .message-meta {
  color: var(--danger);
}

.bubble.media-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.bubble.sticker-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.message-row.mine .bubble.media-bubble,
.message-row.mine .bubble.sticker-bubble {
  background: transparent;
  color: var(--text);
}

.message-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 13px;
}

.message-meta strong {
  min-width: 0;
}

.media-bubble .message-meta {
  padding: 0 2px;
}

.sticker-bubble .message-meta {
  min-width: 154px;
  padding: 0 2px;
}

.message-row.mine .message-meta {
  color: rgba(7, 7, 7, 0.62);
}

.message-status.is-pending::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.55;
  vertical-align: middle;
}

.message-row.mine .media-bubble .message-meta {
  color: var(--muted-strong);
}

.message-row.mine .sticker-bubble .message-meta {
  color: var(--muted-strong);
}

.bubble-text {
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message-attachments:first-child {
  margin-top: 0;
}

.link-preview-card {
  display: grid;
  width: min(100%, 430px);
  margin-top: 12px;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
  color: inherit;
  cursor: pointer;
  outline: none;
}

.link-preview-card:hover,
.link-preview-card:focus-visible {
  border-color: rgba(244, 240, 232, 0.28);
  border-left-color: #ef4444;
  background: rgba(255, 255, 255, 0.08);
}

.link-preview-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

.link-preview-card.is-tiktok {
  border-left-color: #2dd4bf;
}

.link-preview-card.is-instagram {
  border-left-color: #ec4899;
}

.link-preview-card.is-telegram {
  border-left-color: #38bdf8;
}

.link-preview-card.is-tiktok:hover,
.link-preview-card.is-tiktok:focus-visible {
  border-left-color: #2dd4bf;
}

.link-preview-card.is-instagram:hover,
.link-preview-card.is-instagram:focus-visible {
  border-left-color: #ec4899;
}

.link-preview-card.is-telegram:hover,
.link-preview-card.is-telegram:focus-visible {
  border-left-color: #38bdf8;
}

.message-row.mine .link-preview-card {
  border-color: rgba(7, 7, 7, 0.14);
  border-left-color: #ef4444;
  background: rgba(0, 0, 0, 0.07);
}

.message-row.mine .link-preview-card.is-tiktok {
  border-left-color: #0f766e;
}

.message-row.mine .link-preview-card.is-instagram {
  border-left-color: #be185d;
}

.message-row.mine .link-preview-card.is-telegram {
  border-left-color: #0284c7;
}

.link-preview-body {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px 12px;
}

.link-preview-provider {
  color: #f87171;
  font-size: 13px;
  font-weight: 900;
}

.link-preview-card.is-tiktok .link-preview-provider {
  color: #2dd4bf;
}

.link-preview-card.is-instagram .link-preview-provider {
  color: #f472b6;
}

.link-preview-card.is-telegram .link-preview-provider {
  color: #38bdf8;
}

.message-row.mine .link-preview-provider {
  color: #b91c1c;
}

.message-row.mine .link-preview-card.is-tiktok .link-preview-provider {
  color: #0f766e;
}

.message-row.mine .link-preview-card.is-instagram .link-preview-provider {
  color: #be185d;
}

.message-row.mine .link-preview-card.is-telegram .link-preview-provider {
  color: #0284c7;
}

.link-preview-body strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.25;
  font-size: 15px;
  font-weight: 900;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.link-preview-body small {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row.mine .link-preview-body small {
  color: rgba(7, 7, 7, 0.62);
}

.link-preview-media {
  position: relative;
  display: grid;
  min-height: 120px;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background: #05070b;
}

.link-preview-media img,
.link-preview-media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.link-preview-media img {
  object-fit: cover;
}

.link-preview-placeholder {
  color: rgba(244, 240, 232, 0.76);
  font-weight: 900;
}

.link-preview-play {
  position: absolute;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 22px;
  text-indent: 3px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

.link-preview-card.is-tiktok .link-preview-play {
  background: rgba(20, 184, 166, 0.9);
}

.link-preview-card.is-instagram .link-preview-play {
  background: rgba(236, 72, 153, 0.9);
}

.link-preview-card.is-telegram .link-preview-play {
  background: rgba(56, 189, 248, 0.9);
}

.link-preview-card.is-playing {
  cursor: default;
}

.link-preview-card.is-playing .link-preview-media {
  min-height: 220px;
}

.link-preview-card.is-playing .link-preview-play {
  display: none;
}

.sticker-bubble .message-attachments {
  width: fit-content;
  margin-top: 6px;
}

.media-bubble .message-attachments {
  width: fit-content;
  max-width: 100%;
}

.media-bubble .attachment-image,
.media-bubble .attachment-image .attachment-preview {
  max-width: 100%;
}

.media-bubble .attachment-image {
  width: fit-content;
  max-width: min(100%, var(--image-display-width, 380px), 380px, calc(100vw - 160px));
}

.media-bubble .attachment-image .attachment-preview {
  width: 100%;
}

.media-bubble .attachment-image img {
  width: 100%;
  max-width: 100%;
}

.message-row.mine .media-bubble .attachment-download {
  background: rgba(0, 0, 0, 0.62);
  color: var(--text);
}

.message-attachments.media-album {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  width: min(560px, 100%);
  overflow: hidden;
  border-radius: 8px;
}

.media-album-2,
.media-album-3,
.media-album-4 {
  max-width: min(560px, 100%);
}

.media-album-tile {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  padding: 0;
  overflow: hidden;
  appearance: none;
  background: #050505;
  color: var(--text);
  cursor: pointer;
}

.media-album-tile:first-child:nth-last-child(3) {
  grid-row: span 2;
}

.media-album-tile img,
.media-album-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.media-album-placeholder {
  color: var(--muted-strong);
  font-weight: 800;
}

.media-album-play,
.media-album-more {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.media-album-play {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.media-album-more {
  inset: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.54);
  font-size: 28px;
  font-weight: 900;
}

.poll-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.poll-card > strong {
  font-size: 15px;
}

.poll-card > span {
  color: var(--muted);
  font-size: 12px;
}

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

.poll-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}

.poll-option.selected {
  border-color: rgba(244, 240, 232, 0.46);
  background: rgba(244, 240, 232, 0.14);
}

.poll-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-option small {
  flex: none;
  color: var(--muted-strong);
  font-weight: 800;
}

.message-row.mine .poll-card {
  border-color: rgba(7, 7, 7, 0.16);
  background: rgba(7, 7, 7, 0.07);
}

.message-row.mine .poll-card > span,
.message-row.mine .poll-option small {
  color: rgba(7, 7, 7, 0.62);
}

.message-row.mine .poll-option {
  border-color: rgba(7, 7, 7, 0.15);
  background: rgba(7, 7, 7, 0.06);
}

.attachment-image {
  position: relative;
  width: fit-content;
  max-width: min(100%, var(--image-display-width, 380px), 380px, calc(100vw - 160px));
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.attachment-image .attachment-preview {
  display: block;
  width: fit-content;
  max-width: 100%;
  max-height: 520px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  appearance: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.attachment-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}

.attachment-image-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.attachment-image-actions .attachment-download,
.message-row.mine .attachment-image-actions .attachment-download {
  background: rgba(0, 0, 0, 0.62);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.attachment-card {
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.13);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.message-row.mine .attachment-card {
  border-color: rgba(7, 7, 7, 0.16);
  background: rgba(7, 7, 7, 0.07);
}

.attachment-sticker {
  display: grid;
  width: 154px;
  height: 154px;
  place-items: center;
}

.sticker-media-stack {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.attachment-sticker img,
.attachment-sticker video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sticker-media-stack img,
.sticker-media-stack video {
  grid-area: 1 / 1;
}

.sticker-media-stack video {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.sticker-media-stack video.is-ready {
  opacity: 1;
}

.attachment-sticker span {
  font-size: 92px;
  line-height: 1;
}

.attachment-media {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
}

.attachment-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  padding: 0;
  overflow: hidden;
  background: #050505;
}

.attachment-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #050505;
}

.attachment-video {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  aspect-ratio: var(--video-ratio, 9 / 16);
  place-items: center;
  gap: 10px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 18px;
  appearance: none;
  background:
    radial-gradient(circle at center, rgba(244, 240, 232, 0.11), transparent 36%),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.attachment-video-thumb {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #050505;
  object-fit: cover;
  pointer-events: none;
}

.attachment-video-wrap {
  position: relative;
  width: var(--video-display-width, 380px);
  max-width: min(100%, calc(100vw - 160px));
  margin: 0 auto;
}

.attachment-video-play {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.92);
  color: #070707;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.video-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.attachment-video:fullscreen,
.attachment-video:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: contain;
  background: #000;
}

.attachment-image .attachment-preview img {
  max-height: 520px;
  background: transparent;
}

.attachment-placeholder {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
}

.attachment-footer,
.attachment-file {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.attachment-footer {
  justify-content: space-between;
}

.attachment-footer.download-only {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  justify-content: flex-end;
  padding: 0;
}

.attachment-footer span,
.attachment-file-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-footer strong,
.attachment-file-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-footer small,
.attachment-file-main span {
  color: var(--muted);
  font-size: 12px;
}

.message-row.mine .attachment-footer small,
.message-row.mine .attachment-file-main span {
  color: rgba(7, 7, 7, 0.58);
}

.attachment-download {
  flex: none;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(244, 240, 232, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.message-row.mine .attachment-download {
  background: rgba(7, 7, 7, 0.1);
  color: #070707;
}

.attachment-audio {
  display: flex;
  width: min(330px, 100%);
  min-width: min(260px, 100%);
  align-items: center;
  gap: 12px;
}

.attachment-audio-play {
  display: grid;
  width: 54px;
  height: 54px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: rgba(244, 240, 232, 0.94);
  color: #070707;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.attachment-audio-play:disabled {
  opacity: 0.5;
}

.message-row.mine .attachment-audio-play {
  background: rgba(7, 7, 7, 0.82);
  color: var(--text);
}

.attachment-audio-main {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.attachment-audio-wave {
  display: flex;
  width: 100%;
  height: 34px;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 0;
  background: transparent;
}

.attachment-audio-wave span {
  display: block;
  width: 3px;
  height: var(--wave-height, 50%);
  min-height: 6px;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.28);
  transition: background 0.12s ease;
}

.attachment-audio-wave span.active {
  background: rgba(96, 165, 250, 0.96);
}

.message-row.mine .attachment-audio-wave span {
  background: rgba(7, 7, 7, 0.22);
}

.message-row.mine .attachment-audio-wave span.active {
  background: rgba(7, 7, 7, 0.88);
}

.attachment-audio-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.message-row.mine .attachment-audio-meta {
  color: rgba(7, 7, 7, 0.62);
}

.attachment-audio-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.attachment-audio-native {
  display: none;
}

.attachment-file-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.1);
  font-size: 20px;
}

.attachment-file-main {
  flex: 1;
}

.composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 34px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 18, 18, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.sticker-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  max-height: min(340px, 42vh);
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 10, 18, 0.92);
}

.sticker-pack-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.sticker-pack-tabs::-webkit-scrollbar {
  display: none;
}

.sticker-pack-tab,
.sticker-btn {
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.08);
  color: var(--text);
}

.sticker-pack-tab {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
}

.sticker-pack-tab.active {
  border-color: var(--primary);
  background: rgba(35, 197, 255, 0.16);
}

.sticker-pack-tab img,
.sticker-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-pack-tab span {
  font-size: 24px;
}

.sticker-grid {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  padding-right: 2px;
}

.sticker-btn {
  aspect-ratio: 1;
  padding: 8px;
  cursor: pointer;
}

.sticker-btn:hover {
  border-color: rgba(35, 197, 255, 0.72);
  background: rgba(35, 197, 255, 0.12);
}

.sticker-btn span {
  font-size: 38px;
}

.sticker-picker-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.composer-stickers.active {
  border-color: var(--primary);
  background: rgba(35, 197, 255, 0.16);
  color: var(--primary-2);
}

.composer-attachments-drafts {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.composer-attachment-draft {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 9px;
  background: rgba(244, 240, 232, 0.07);
}

.composer-attachment-draft span {
  min-width: 0;
}

.composer-attachment-draft strong,
.composer-attachment-draft small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment-draft small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.composer-attachment-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.1);
  font-size: 18px;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 160px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  font: inherit;
  white-space: pre-wrap;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.send-btn {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  padding: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #070707;
  line-height: 0;
}

.send-btn svg {
  display: block;
  width: 22px;
  height: 22px;
  transform: none;
}

.composer-locked {
  grid-template-columns: 1fr;
  justify-items: center;
  color: var(--muted-strong);
  font-weight: 760;
  text-align: center;
}

.tools {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  padding: 24px;
  background: rgba(12, 12, 12, 0.98);
}

.tools h2,
.tools h3 {
  margin: 0;
}

.tools h2 {
  font-size: 22px;
}

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

.tool-close {
  display: inline-grid;
}

.tools p {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-menu {
  display: grid;
  gap: 10px;
}

.profile-menu-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.profile-menu-item span {
  color: var(--text);
  font-weight: 850;
}

.profile-menu-item small {
  color: var(--muted);
  font-size: 13px;
}

.admin-profile-panel {
  align-content: start;
}

.tool-section {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.key-list,
.user-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.key-list {
  max-height: 260px;
}

.key-list + .tool-section {
  margin-top: 22px;
}

.user-list {
  flex: 1;
  min-height: 180px;
}

.key-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.key-head {
  justify-content: space-between;
  gap: 10px;
}

.key-code {
  overflow-wrap: anywhere;
  font-weight: 820;
}

.key-meta {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(216, 210, 198, 0.14);
  color: var(--mint);
  font-size: 12px;
  font-weight: 760;
}

.pill.off {
  background: rgba(255, 106, 115, 0.14);
  color: var(--danger);
}

.admin-user-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-avatar,
.admin-user-main {
  min-width: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.admin-user-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
}

.admin-user-avatar:hover,
.admin-user-main:hover {
  opacity: 0.82;
}

.admin-list-avatar {
  width: 50px;
  height: 50px;
  font-size: 15px;
}

.admin-user-main {
  display: grid;
  gap: 4px;
}

.admin-user-main strong,
.admin-user-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-user-card > .small-btn {
  justify-self: end;
  white-space: nowrap;
}

.avatar {
  display: grid;
  position: relative;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4f0e8, #a9a39a);
  color: #070707;
  font-weight: 850;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.avatar-initials {
  grid-area: 1 / 1;
}

.avatar.has-image .avatar-initials {
  opacity: 0;
}

.avatar.has-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 64%;
}

.message-avatar {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow-y: auto;
  padding: 22px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
  overscroll-behavior: contain;
}

.notification-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(18px);
}

.notification-prompt {
  display: grid;
  width: min(440px, 100%);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(18, 18, 18, 0.97);
  box-shadow: var(--shadow);
}

.notification-prompt h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.notification-prompt p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.45;
}

.notification-prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.story-overlay {
  z-index: 55;
  align-items: end;
}

.story-composer-panel {
  display: grid;
  width: min(520px, 100%);
  max-height: calc(100dvh - 28px);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  background: rgba(18, 22, 30, 0.98);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.story-panel-head,
.story-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.story-panel-head h2 {
  margin: 0;
  font-size: 30px;
}

.story-form {
  display: grid;
  gap: 14px;
}

.story-form textarea,
.story-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.story-media-row,
.story-target-mode,
.story-target-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.story-media-row .small-btn {
  min-height: 42px;
  padding: 0 14px;
}

.story-media-preview {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.story-media-preview img,
.story-media-preview video,
.story-media-fallback {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.story-media-fallback {
  display: grid;
  place-items: center;
  font-size: 26px;
}

.story-media-preview strong,
.story-media-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-media-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.story-targets {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.story-targets legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.story-target-mode label,
.story-target-groups label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.story-target-empty {
  color: var(--muted);
  font-size: 13px;
}

.story-bg-options {
  display: flex;
  gap: 10px;
}

.story-bg-choice {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.story-bg-choice input {
  position: absolute;
  opacity: 0;
}

.story-bg-choice span {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.story-bg-choice:has(input:checked) {
  border-color: var(--primary);
}

.story-bg-choice.story-bg-blue span,
.story-bg-choice.story-bg-blue {
  background: linear-gradient(145deg, #1d4ed8, #38bdf8);
}

.story-bg-choice.story-bg-green span,
.story-bg-choice.story-bg-green {
  background: linear-gradient(145deg, #047857, #34d399);
}

.story-bg-choice.story-bg-violet span,
.story-bg-choice.story-bg-violet {
  background: linear-gradient(145deg, #6d28d9, #f472b6);
}

.story-bg-choice.story-bg-orange span,
.story-bg-choice.story-bg-orange {
  background: linear-gradient(145deg, #b45309, #facc15);
}

.story-bg-choice.story-bg-dark span,
.story-bg-choice.story-bg-dark {
  background: linear-gradient(145deg, #111827, #334155);
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
}

.story-viewer-card {
  position: relative;
  display: grid;
  width: min(440px, 100%);
  height: min(760px, calc(100dvh - 40px));
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  box-shadow: var(--shadow);
}

.story-viewer.story-bg-blue .story-viewer-card {
  background: linear-gradient(145deg, #1d4ed8, #38bdf8);
}

.story-viewer.story-bg-green .story-viewer-card {
  background: linear-gradient(145deg, #047857, #34d399);
}

.story-viewer.story-bg-violet .story-viewer-card {
  background: linear-gradient(145deg, #6d28d9, #f472b6);
}

.story-viewer.story-bg-orange .story-viewer-card {
  background: linear-gradient(145deg, #b45309, #facc15);
}

.story-viewer.story-bg-dark .story-viewer-card {
  background: linear-gradient(145deg, #111827, #334155);
}

.story-viewer .story-viewer-card.has-media {
  background: #050505;
}

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

.story-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
}

.story-viewer-author {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.story-viewer-author strong,
.story-viewer-author span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-viewer-author span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.story-viewer-avatar {
  width: 42px;
  height: 42px;
}

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

.story-viewer-body {
  display: grid;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 12px;
  text-align: center;
}

.story-viewer-body.has-media {
  position: relative;
  align-content: stretch;
  justify-items: stretch;
  overflow: hidden;
  border-radius: 8px;
  padding: 0;
  background: #050505;
}

.story-viewer-body p {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Times New Roman", Georgia, "Nimbus Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.18;
  white-space: pre-wrap;
}

.story-viewer-body.has-media p {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  text-align: left;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75), 0 1px 4px rgba(0, 0, 0, 0.92);
}

.story-viewer-media {
  max-width: 100%;
  max-height: 58vh;
  border-radius: 8px;
  object-fit: contain;
}

.story-viewer-body.has-media .story-viewer-media {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 8px;
  object-fit: cover;
}

.story-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 42px;
  height: 64px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  font-size: 46px;
}

.story-nav.prev {
  left: 8px;
}

.story-nav.next {
  right: 8px;
}

.profile-panel {
  display: grid;
  width: min(460px, 100%);
  max-height: calc(100dvh - 44px);
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(18, 18, 18, 0.96);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.profile-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.profile-head h2 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-head p {
  margin: 0;
  color: var(--muted);
}

.profile-avatar {
  width: 68px;
  height: 68px;
  font-size: 20px;
}

.profile-warning-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 207, 90, 0.42);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 207, 90, 0.1);
  color: var(--text);
}

.profile-warning-card strong {
  color: #ffcf5a;
  font-weight: 850;
}

.profile-warning-card span {
  color: var(--muted-strong);
  line-height: 1.35;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.avatar-editor-preview {
  display: grid;
  place-items: center;
}

.avatar-editor-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.avatar-editor-main > span {
  color: var(--muted);
  font-weight: 760;
}

.avatar-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-editor-actions .small-btn {
  min-height: 38px;
  padding: 0 16px;
  white-space: nowrap;
}

.profile-avatar-input {
  display: none;
}

.avatar-cropper-overlay {
  z-index: 42;
  place-items: center;
}

.avatar-cropper-panel {
  display: grid;
  width: min(460px, 100%);
  max-height: calc(100dvh - 44px);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  overflow: auto;
  background: rgba(18, 18, 18, 0.98);
  box-shadow: var(--shadow);
}

.avatar-cropper-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.avatar-cropper-head h2 {
  margin: 0;
  font-size: 22px;
}

.avatar-cropper-stage {
  position: relative;
  width: min(320px, calc(100vw - 96px));
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  border-radius: 50%;
  background: #080808;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(244, 240, 232, 0.16);
}

.avatar-cropper-stage.dragging {
  cursor: grabbing;
}

.avatar-cropper-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.avatar-cropper-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(244, 240, 232, 0.9);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.avatar-cropper-zoom {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 760;
}

.avatar-cropper-zoom input {
  width: 100%;
  accent-color: var(--primary);
}

.avatar-cropper-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-danger-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(11, 15, 22, 0), var(--panel) 34%);
}

.profile-logout,
.profile-delete {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.profile-logout {
  border: 1px solid rgba(255, 106, 115, 0.32);
  background: rgba(255, 106, 115, 0.1);
  color: var(--danger);
}

.profile-delete {
  border: 1px solid rgba(255, 106, 115, 0.58);
  background: rgba(255, 106, 115, 0.18);
  color: var(--danger);
}

.user-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.user-details-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.user-details-grid span {
  color: var(--muted);
  font-size: 12px;
}

.user-details-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-form {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.role-form-head {
  display: grid;
  gap: 4px;
}

.role-form-head strong {
  font-size: 18px;
}

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

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.84);
}

.media-viewer-frame {
  position: relative;
  display: grid;
  max-width: min(980px, 100%);
  max-height: 100%;
  gap: 12px;
  margin: 0;
}

.media-viewer-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 8px;
  object-fit: contain;
}

.media-viewer-video {
  display: block;
  width: min(100vw - 44px, 1100px);
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.media-viewer.is-video {
  padding: 0;
  background: #000;
}

.media-viewer.is-video .media-viewer-frame {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
}

.media-viewer.is-video .media-viewer-video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  object-fit: contain;
}

.media-viewer.is-video .media-close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 3;
}

.media-viewer.is-video .media-viewer-frame figcaption {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 3;
}

.media-viewer-frame figcaption {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  color: var(--text);
}

.media-counter {
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.media-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.62);
}

.media-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 72px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  appearance: none;
  background: rgba(0, 0, 0, 0.54);
  color: var(--text);
  cursor: pointer;
  font-size: 54px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.media-nav:hover {
  background: rgba(244, 240, 232, 0.18);
}

.media-prev {
  left: max(18px, env(safe-area-inset-left));
}

.media-next {
  right: max(18px, env(safe-area-inset-right));
}

.action-panel {
  display: grid;
  width: min(540px, 100%);
  max-height: calc(100vh - 44px);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  overflow: auto;
  background: rgba(18, 18, 18, 0.98);
  box-shadow: var(--shadow);
}

.upload-panel {
  width: min(620px, 100%);
}

.upload-drop-zone {
  display: grid;
  min-height: 190px;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(244, 240, 232, 0.28);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.upload-drop-zone.dragover {
  border-color: rgba(244, 240, 232, 0.78);
  background: rgba(244, 240, 232, 0.08);
  transform: scale(0.99);
}

.upload-drop-zone strong {
  font-size: 20px;
}

.upload-drop-zone span,
.upload-status {
  color: var(--muted);
  line-height: 1.45;
}

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

.upload-actions .small-btn {
  min-height: 42px;
}

.upload-choice {
  display: grid;
  min-height: 96px;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.upload-choice span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.1);
  font-size: 24px;
}

.upload-choice strong {
  font-size: 15px;
}

.upload-file-input {
  display: none;
}

.upload-grabber {
  display: none;
}

.action-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.action-panel-head h2,
.action-panel-head p {
  margin: 0;
}

.action-panel-head h2 {
  font-size: 22px;
}

.action-panel-head p {
  margin-top: 4px;
  color: var(--muted);
}

.panel-search {
  width: 100%;
}

.icon-picker-panel {
  max-width: 720px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.icon-picker-option {
  display: grid;
  min-height: 92px;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.icon-picker-option:hover,
.icon-picker-option.active {
  border-color: rgba(244, 240, 232, 0.5);
  background: rgba(244, 240, 232, 0.12);
}

.icon-picker-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 24px;
}

.icon-picker-option strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-list,
.user-check-list,
.poll-options,
.deletion-list {
  display: grid;
  gap: 10px;
}

.attachment-list-item,
.member-row,
.user-check {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.user-check {
  cursor: pointer;
}

.deletion-tabs {
  margin-bottom: 12px;
}

.deletion-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.deletion-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.deletion-card strong,
.deletion-card span,
.deletion-card small {
  display: block;
}

.deletion-card strong {
  color: var(--text);
  font-size: 16px;
}

.deletion-card span,
.deletion-card small {
  color: var(--muted);
  line-height: 1.4;
}

.deletion-card p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.45;
  white-space: pre-wrap;
}

.user-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.user-check {
  grid-template-columns: 22px 50px minmax(0, 1fr);
}

.attachment-list-preview {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.1);
  color: var(--text);
  font-size: 20px;
}

.attachment-list-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-list-main,
.member-row span,
.user-check span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attachment-list-main strong,
.member-row strong,
.user-check strong,
.attachment-list-main span,
.member-row small,
.user-check small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list-main span,
.member-row small,
.user-check small {
  color: var(--muted);
  font-size: 12px;
}

.compact-empty {
  min-height: 140px;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.thread-empty {
  align-content: center;
  gap: 8px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.68);
}

.thread-empty strong {
  color: var(--text);
  font-size: 20px;
}

.thread-empty span {
  max-width: 360px;
  line-height: 1.45;
}

.join-gate-wrap {
  align-content: center;
  justify-items: center;
  padding-bottom: 34px;
}

.join-gate {
  display: grid;
  width: min(360px, 100%);
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(18, 18, 18, 0.72);
  text-align: center;
}

.join-gate .group-icon {
  width: 58px;
  height: 58px;
  font-size: 26px;
}

.join-gate strong {
  font-size: 20px;
}

.join-gate span {
  color: var(--muted);
  line-height: 1.45;
}

.mobile-tools-toggle {
  display: none;
}

.mobile-back {
  display: none;
}

@media (max-width: 1180px) {
  .privacy-shell {
    grid-template-columns: 1fr;
  }

  .privacy-summary {
    position: static;
  }

  .support-shell {
    grid-template-columns: 1fr;
  }

  .sticker-shell,
  .review-shell {
    grid-template-columns: 1fr;
  }

  .support-card-primary {
    grid-row: auto;
  }

  .app-shell,
  .app-shell.no-tools {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .tools {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 10;
    width: min(360px, 100vw);
    transform: translateX(100%);
    transition: transform 0.22s ease;
  }

  .tools.open {
    transform: translateX(0);
  }

  .tool-close {
    display: inline-grid;
  }

  .mobile-tools-toggle {
    display: inline-grid;
  }
}

@media (max-width: 840px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .sticker-hero h1 {
    font-size: 42px;
  }

  .sticker-hero p:last-child {
    font-size: 18px;
  }

  html,
  body,
  #app,
  .rail,
  .rail-chats,
  .chat-list,
  .groups,
  .timeline,
  .tools,
  .profile-panel,
  .action-panel,
  .key-list,
  .user-list,
  .attachments-list,
  .icon-picker-grid {
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  #app::-webkit-scrollbar,
  .rail::-webkit-scrollbar,
  .rail-chats::-webkit-scrollbar,
  .chat-list::-webkit-scrollbar,
  .groups::-webkit-scrollbar,
  .timeline::-webkit-scrollbar,
  .tools::-webkit-scrollbar,
  .profile-panel::-webkit-scrollbar,
  .action-panel::-webkit-scrollbar,
  .key-list::-webkit-scrollbar,
  .user-list::-webkit-scrollbar,
  .attachments-list::-webkit-scrollbar,
  .icon-picker-grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .app-shell,
  .app-shell.no-tools {
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    padding-bottom: 78px;
  }

  .chat-list {
    display: none;
  }

  .rail {
    position: fixed;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom));
    z-index: 9;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: rgba(9, 9, 9, 0.94);
    backdrop-filter: blur(18px);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .rail.is-dragging {
    cursor: grabbing;
  }

  .rail .brand-mark,
  .rail-spacer {
    display: none;
  }

  .rail-profile,
  .rail-chat,
  .rail-action {
    width: 56px;
    flex: 0 0 56px;
    padding: 3px 2px;
  }

  .rail-avatar,
  .rail-chat-icon,
  .rail-action-icon,
  .rail-chat .group-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .rail-label {
    width: 54px;
    font-size: 9px;
  }

  .rail-chats {
    width: auto;
    flex: none;
    flex-direction: row;
    gap: 10px;
    overflow: visible;
    padding: 0;
  }

  .chat-list {
    min-height: 100dvh;
    border-right: 0;
    padding-bottom: 94px;
  }

  .list-head {
    gap: 14px;
    padding: 24px 18px 14px;
  }

  .list-title h1 {
    font-size: 30px;
  }

  .search-wrap .input {
    min-height: 48px;
  }

  .select {
    padding-right: 60px;
    background-position: right 26px center;
  }

  .groups {
    padding-bottom: 110px;
  }

  .group-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 82px;
    padding: 12px 16px;
  }

  .group-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .group-name {
    font-size: 16px;
  }

  .last-author {
    margin-top: 4px;
  }

  .badge {
    min-width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .room {
    height: 100dvh;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .room-top,
  .stories-strip,
  .group-info,
  .timeline,
  .composer {
    margin-left: 0;
    margin-right: 0;
  }

  .room-top {
    position: sticky;
    top: 0;
    z-index: 7;
    min-height: 72px;
    padding: 12px 14px;
    background: rgba(8, 8, 8, 0.92);
    backdrop-filter: blur(18px);
  }

  .stories-strip {
    padding: 9px 14px;
  }

  .room-identity {
    min-width: 0;
    flex: 1;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
  }

  .room-identity .group-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .mobile-back {
    display: none;
  }

  .room-identity h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.12;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .room-title-wrap {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .room-title-button {
    max-width: 100%;
  }

  .title-action-btn {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .room-title-editor {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .room-title-editor .small-btn {
    min-height: 30px;
  }

  .status {
    margin-top: 3px;
    font-size: 12px;
  }

  .room-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .chat-menu-wrap {
    display: block;
    flex: 0 0 auto;
  }

  .chat-menu-wrap > .icon-btn {
    display: inline-grid;
  }

  .chat-action-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }

  .group-info {
    display: none;
  }

  .timeline {
    gap: 12px;
    padding: 14px 12px 240px;
  }

  .date-divider {
    gap: 10px;
    font-size: 12px;
  }

  .composer {
    position: fixed;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 8;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0;
    padding: 9px 10px;
  }

  .composer .composer-attach,
  .composer .composer-stickers {
    display: inline-grid;
    width: 44px;
    height: 44px;
    align-self: center;
  }

  .sticker-picker {
    max-height: min(290px, 34vh);
    padding: 10px;
  }

  .sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
  }

  .composer .send-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    align-self: center;
    border-radius: 8px;
  }

  .composer .send-btn svg {
    width: 27px;
    height: 27px;
    transform: none;
  }

  .message-row,
  .message-row.mine {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

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

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

  .message-avatar-button,
  .message-row .avatar {
    display: grid;
  }

  .message-avatar-button,
  .message-avatar {
    width: 34px;
    height: 34px;
  }

  .message-avatar {
    font-size: 12px;
  }

  .message-row.mine .avatar {
    display: none;
  }

  .bubble {
    max-width: 88%;
    padding: 12px 14px;
  }

  .message-row.mine .bubble {
    justify-self: end;
  }

  .message-meta {
    gap: 10px;
    font-size: 12px;
  }

  .attachment-preview,
  .attachment-preview img {
    max-height: 260px;
  }

  .attachment-video {
    width: 100%;
  }

  .attachment-video-wrap {
    width: min(300px, 100%);
  }

  .attachment-audio {
    width: min(300px, 100%);
    min-width: min(220px, 100%);
  }

  .attachment-audio-play {
    width: 48px;
    height: 48px;
  }

  .attachment-audio-wave {
    gap: 2px;
  }

  .attachment-footer,
  .attachment-file {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .attachment-download {
    white-space: nowrap;
  }

  .tools {
    inset: 0;
    z-index: 24;
    width: 100vw;
    border-left: 0;
    padding: 20px 18px calc(102px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .profile-overlay {
    align-items: end;
    padding: 14px;
  }

  .notification-prompt-overlay {
    align-items: end;
    padding: 14px;
  }

  .notification-prompt {
    padding: 18px;
  }

  .notification-prompt-actions {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: 18px;
  }

  .action-panel {
    width: 100%;
    max-height: calc(100dvh - 28px);
    padding: 18px;
  }

  .upload-overlay {
    align-items: end;
  }

  .upload-mobile-panel {
    border-radius: 8px 8px 0 0;
    padding-top: 12px;
  }

  .upload-grabber {
    display: block;
    width: 42px;
    height: 4px;
    justify-self: center;
    border-radius: 999px;
    background: rgba(244, 240, 232, 0.24);
  }

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

  .upload-choice {
    min-height: 86px;
    padding: 10px 6px;
  }

  .upload-choice span {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .icon-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    max-height: 58vh;
  }

  .icon-picker-option {
    min-height: 82px;
  }

  .attachment-list-item,
  .member-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .attachment-list-item .attachment-download,
  .member-row .small-btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .profile-head {
    grid-template-columns: 58px minmax(0, 1fr) 42px;
    gap: 12px;
  }

  .profile-head h2 {
    font-size: 19px;
  }

  .profile-avatar {
    width: 54px;
    height: 54px;
    font-size: 17px;
  }

  .profile-avatar-wrap.large {
    width: 54px;
    height: 54px;
  }

  .avatar-editor {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .avatar-cropper-overlay {
    align-items: end;
  }

  .avatar-cropper-panel {
    max-height: calc(100dvh - 28px);
    padding: 18px;
  }

  .avatar-cropper-stage {
    width: min(300px, calc(100vw - 64px));
  }

  .user-details-grid {
    grid-template-columns: 1fr;
  }

  .media-viewer {
    padding: 12px;
  }

  .media-viewer-frame img {
    max-height: calc(100dvh - 116px);
  }

  .media-viewer-video {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 116px);
  }

  .media-viewer.is-video .media-viewer-video {
    width: 100%;
    max-height: none;
  }

  .media-viewer-frame figcaption {
    flex-wrap: wrap;
  }

  .media-nav {
    width: 44px;
    height: 56px;
    font-size: 42px;
  }

  .media-prev {
    left: max(8px, env(safe-area-inset-left));
  }

  .media-next {
    right: max(8px, env(safe-area-inset-right));
  }
}

@media (max-width: 560px) {
  .privacy-page {
    width: min(100% - 28px, 1180px);
    gap: 22px;
    padding-bottom: 34px;
  }

  .privacy-hero h1 {
    font-size: 33px;
  }

  .privacy-summary,
  .privacy-doc {
    padding: 18px;
  }

  .support-card {
    min-height: 0;
    padding: 20px;
  }

  .support-card h2 {
    font-size: 26px;
    overflow-wrap: anywhere;
  }

  .support-button {
    width: 100%;
  }

  .support-inline-link {
    width: 100%;
  }

  .sticker-page {
    width: min(100% - 28px, 1180px);
    gap: 22px;
    padding: 24px 0 34px;
  }

  .sticker-hero h1 {
    font-size: 33px;
  }

  .sticker-card {
    padding: 18px;
  }

  .sticker-review-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sticker-review-head .small-btn,
  .sticker-review-actions .small-btn {
    width: 100%;
  }

  .sticker-review-actions {
    flex-direction: column;
  }

  .boot-screen {
    --boot-logo-size: clamp(156px, 38vw, 190px);
  }

  .auth-card-wrap {
    padding: 16px;
  }

  .auth-card {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .room-actions > .icon-btn:not(.mobile-tools-toggle):not(.story-create-action) {
    display: none;
  }

  .room-actions .chat-menu-wrap > .icon-btn {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  .challenge-card {
    margin: 0 16px 10px;
    padding: 14px;
  }

  .challenge-head {
    align-items: flex-start;
    flex-direction: column;
  }

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