@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600&display=swap");

:root {
  color-scheme: dark;
  --black: #000000;
  --white: #ffffff;
  --accent-line: #e856a8;
  --accent-content: #e856a8;
  --pink: var(--accent-content);
  --gray: #7a7a7a;
  --glass-bg: rgba(18, 18, 24, 0.72);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  --tg-viewport-height: 100dvh;
  --tg-mini-top-offset: 0px;
  --tg-mini-bottom-offset: 0px;
  --browser-viewport-height: 100dvh;
  --browser-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sidebar-width: 360px;
  --folder-rail-width: 72px;
  --sidebar-topics-rail-width: 68px;
  --sidebar-compact-width: 85px;
}

* {
  box-sizing: border-box;
}

html {
  background: #000000;
}

[hidden] {
  display: none !important;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 1px solid var(--accent-line);
  outline-offset: 2px;
}

body {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #000000;
  color: var(--white);
  font-family: "Comfortaa", system-ui, sans-serif;
  font-weight: 300;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: text;
  user-select: text;
}

body::before {
  content: none;
}

.app-loading-screen {
  --app-loading-logo-size: min(425px, 88vw);
  --app-loading-line: #e856a8;
  --app-loading-content: #ffffff;
  font-family: "Comfortaa", system-ui, sans-serif;
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  align-content: center;
  background: #000;
  opacity: 1;
  transition: opacity 220ms ease;
  overflow: hidden;
}

.app-loading-screen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(82vw, 920px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 45%, rgba(255, 168, 219, 0.48) 0 10%, rgba(225, 80, 169, 0.38) 26%, rgba(132, 50, 190, 0.22) 48%, rgba(225, 80, 169, 0.08) 67%, transparent 78%);
  filter: blur(92px);
  transform: translate(-50%, -50%);
  opacity: 1;
}

.app-loading-screen > * {
  position: relative;
  z-index: 1;
}

html.app-ready .app-loading-screen,
body.app-ready .app-loading-screen {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.app-loading-logo {
  width: var(--app-loading-logo-size);
  height: var(--app-loading-logo-size);
  object-fit: contain;
  mix-blend-mode: screen;
  background: transparent;
}

.app-loading-title {
  display: block;
  justify-self: center;
  width: auto;
  max-width: calc(100% - 24px);
  padding-inline: max(12px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  margin-top: -68px;
  color: var(--app-loading-content);
  font-family: inherit;
  font-size: min(64px, calc((100vmin - 24px) / 5.2));
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 10px 34px rgba(225, 80, 169, 0.44);
}

.app-loading-spinner {
  width: 68px;
  height: 68px;
  margin-top: 24px;
  border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      rgba(255, 255, 255, 0.14) 0deg,
      rgba(255, 255, 255, 0.14) 108deg,
      var(--app-loading-line) 360deg
    );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  animation: app-loading-spin 760ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-screen,
  .app-loading-spinner {
    transition: none;
    animation-duration: 1.8s;
  }
}

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

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

@media (min-width: 901px) {
  button,
  label,
  span,
  strong,
  small,
  p,
  h1,
  h2,
  h3,
  dt,
  dd {
    -webkit-user-select: text;
    user-select: text;
  }
}

a {
  color: var(--pink);
}

body.app-locked,
body.no-telegram-session {
  overflow-y: auto;
}

.telegram-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  background: var(--black);
}

body.has-folder-rail .telegram-shell {
  grid-template-columns: var(--folder-rail-width) var(--sidebar-width) minmax(0, 1fr);
}

html:not(.app-ready) .telegram-shell,
body:not(.app-ready) .telegram-shell {
  opacity: 0;
  visibility: hidden;
}

.app-locked .telegram-shell,
.no-telegram-session .telegram-shell {
  grid-template-columns: 1fr;
  height: auto;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 86, 168, 0.22), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(124, 58, 237, 0.16), transparent 38%),
    linear-gradient(145deg, #050505 0%, #111018 48%, #000000 100%);
}

.app-locked .sidebar,
.no-telegram-session .sidebar {
  width: 100vw;
  height: auto;
  min-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-locked .sidebar-head,
.no-telegram-session .sidebar-head {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 10px;
  border-bottom: 0;
  background: transparent;
}

.app-locked .sidebar-title-row,
.no-telegram-session .sidebar-title-row {
  grid-template-columns: minmax(0, 1fr);
}

.app-locked .search-box,
.no-telegram-session .search-box {
  display: none;
}

.app-locked .sidebar-title-row .icon-button,
.no-telegram-session .sidebar-title-row .icon-button {
  display: none !important;
}

.app-locked .sidebar-list,
.no-telegram-session .sidebar-list {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 24px;
  background: transparent;
}

.app-locked .workspace,
.app-locked .bottom-nav,
.no-telegram-session .workspace,
.no-telegram-session .bottom-nav {
  display: none;
}

.sidebar {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 58px;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black);
  backdrop-filter: none;
  border-right: 1px solid var(--accent-line);
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 5;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: transparent;
  transition: background 0.15s;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle.is-dragging::after {
  background: var(--accent-line);
}

body.sidebar-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.sidebar-resizing .sidebar-resize-handle {
  cursor: ew-resize;
}

.app-locked .sidebar-resize-handle,
.no-telegram-session .sidebar-resize-handle,
body:not(.sidebar-chats-mode) .sidebar-resize-handle {
  display: none;
}

.sidebar-list .item-unread-avatar,
.sidebar-list .item-unread-group-avatar {
  display: none;
}

body.sidebar-compact .sidebar {
  grid-template-rows: auto minmax(0, 1fr);
}

body.sidebar-compact .bottom-nav {
  display: none;
}

body.sidebar-compact .sidebar-head {
  gap: 4px;
  min-width: 0;
  padding: 12px 8px 5px;
  overflow: hidden;
}

body.sidebar-compact .sidebar-title-row {
  position: static;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "voul voul voul"
    "create archive settings";
  gap: 4px;
  align-items: stretch;
}

body.sidebar-compact #listTitle {
  display: none;
}

body.sidebar-compact .session-lost-label {
  display: none;
}

body.sidebar-compact .sync-label {
  margin-left: 4px;
  font-size: 10px;
}

body.sidebar-compact .voul-functions {
  position: static;
  grid-area: voul;
  width: 100%;
  transform: none;
}

body.sidebar-compact .extensions-toggle {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
  font-size: 0;
}

body.sidebar-compact .extensions-toggle span {
  display: none;
}

body.sidebar-compact .extensions-toggle-logo {
  margin: 0 auto;
}

body.sidebar-compact .sidebar-title-row .icon-button {
  width: 100%;
  height: 36px;
  min-width: 0;
  font-size: 16px;
}

body.sidebar-compact #createToggle,
body.sidebar-compact #archiveToggle {
  justify-self: stretch;
}

body.sidebar-compact #createToggle {
  grid-area: create;
  grid-column: auto;
}

body.sidebar-compact #archiveToggle {
  grid-area: archive;
  grid-column: auto;
}

body.sidebar-compact .app-settings-toggle {
  grid-area: settings;
  grid-column: auto;
}

body.sidebar-compact .search-box {
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

body.sidebar-compact .search-box input {
  min-height: 28px;
  font-size: 11px;
}

body.sidebar-compact .search-box input::placeholder {
  font-size: 11px;
}

body.sidebar-compact .story-strip {
  gap: 6px;
  padding: 0;
}

body.sidebar-compact .story-button {
  width: 46px;
  min-width: 46px;
}

body.sidebar-compact .story-button .item-avatar {
  width: 40px;
  height: 40px;
}

body.sidebar-compact .story-button small {
  font-size: 9px;
}

body.sidebar-compact .app-settings-toggle[hidden] {
  display: none;
}

body.sidebar-compact .sidebar-title-row:has(.app-settings-toggle[hidden]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "voul voul"
    "create archive";
}

body.sidebar-compact .voul-functions-menu {
  left: 0;
  width: 220px;
  transform: translate(0, -4px);
}

body.sidebar-compact .voul-functions:hover .voul-functions-menu,
body.sidebar-compact .voul-functions.open .voul-functions-menu,
body.sidebar-compact .voul-functions:focus-within .voul-functions-menu {
  transform: translate(0, 0);
}

body.sidebar-compact .sidebar-scroll-top {
  right: 6px;
  bottom: 12px;
}

body.sidebar-compact .sidebar-list > .list-item,
body.sidebar-compact .pinned-chats-group .list-item {
  grid-template-columns: var(--chat-avatar-size);
  justify-items: start;
  gap: 0;
  min-height: 66px;
  height: 66px;
  padding-block: 0;
  contain-intrinsic-size: 66px;
}

body.sidebar-compact .sidebar-list .item-meta,
body.sidebar-compact .sidebar-list .item-time,
body.sidebar-compact .sidebar-list .list-item > .item-unread,
body.sidebar-compact .sidebar-list .list-item > .item-unread-group {
  display: none;
}

body.sidebar-compact .sidebar-list .item-pin {
  display: grid;
  top: 2px;
  left: 0;
}

body.sidebar-compact .sidebar-list .item-avatar-wrap,
body.sidebar-compact .sidebar-list .item-avatar {
  justify-self: start;
}

body.sidebar-compact .pinned-chats-group {
  margin: 0;
  border-radius: 0;
  background: transparent;
}

body.sidebar-compact .account-list-row {
  grid-template-columns: 1fr;
}

body.sidebar-compact .account-row-settings,
body.sidebar-compact .account-groups,
body.sidebar-compact .calls-tabs,
body.sidebar-compact .add-account-button,
body.sidebar-compact .empty-list {
  display: none;
}

body.sidebar-compact .sidebar-list .item-unread-avatar {
  position: absolute;
  right: 1px;
  bottom: 1px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  font-size: 10px;
  line-height: 1;
}

body.sidebar-compact .sidebar-list .item-unread-group-avatar {
  position: absolute;
  right: 1px;
  bottom: 1px;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

body.sidebar-compact .sidebar-list .item-unread-group-avatar .item-unread-avatar {
  position: static;
  flex: 0 0 auto;
}

body.sidebar-compact .sidebar-list .item-unread-ninja-avatar {
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-width: 2px;
  border-radius: 999px;
  font-size: 10px;
}

body.sidebar-compact .sidebar-list .item-unread-avatar.muted,
body.sidebar-compact .sidebar-list .list-item.muted .item-unread-avatar {
  background: var(--gray);
  color: var(--black);
}

body.forum-topics-compact .sidebar-chats {
  display: none;
}

body.forum-topics-compact .sidebar-body {
  grid-template-columns: minmax(0, 1fr);
}

body.forum-topics-visible .forum-topics-compact,
body.forum-topics-compact .forum-topics-compact {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  max-width: var(--sidebar-topics-rail-width);
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(232, 86, 168, 0.35);
  background: rgba(0, 0, 0, 0.28);
}

body.forum-topics-visible:not(.forum-topics-compact) .forum-topics-compact {
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: minmax(0, 1fr);
}

body.forum-topics-visible:not(.forum-topics-compact) .forum-topics-compact-close {
  display: none;
}

body.forum-topics-compact .forum-topics-compact-close {
  flex: 0 0 auto;
  width: 100%;
  height: 36px;
  margin: 0;
  border-radius: 0;
  font-size: 18px;
  line-height: 1;
}

body.forum-topics-visible .forum-topics-compact-list,
body.forum-topics-compact .forum-topics-compact-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
}

body.forum-topics-visible .forum-topic-emoji-item,
body.forum-topics-compact .forum-topic-emoji-item {
  --chat-avatar-size: 57px;
  position: relative;
  display: grid;
  grid-template-columns: var(--chat-avatar-size);
  justify-items: center;
  align-items: center;
  width: 100%;
  min-height: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  transition: background 0.18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 66px;
  overflow: hidden;
}

body.forum-topics-visible .forum-topic-emoji-item:hover,
body.forum-topics-compact .forum-topic-emoji-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

body.forum-topics-visible .forum-topic-emoji-item.active,
body.forum-topics-compact .forum-topic-emoji-item.active {
  background: rgba(255, 255, 255, 0.17);
}

body.forum-topics-visible .forum-topic-emoji-wrap,
body.forum-topics-compact .forum-topic-emoji-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
  justify-self: center;
}

body.forum-topics-visible .forum-topic-emoji,
body.forum-topics-compact .forum-topic-emoji {
  display: grid;
  place-items: center;
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 28px;
  line-height: 1;
}

body.forum-topics-visible .forum-topic-emoji-item .item-unread-avatar,
body.forum-topics-compact .forum-topic-emoji-item .item-unread-avatar {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  font-size: 10px;
  line-height: 1;
}

body.forum-topics-visible .forum-topic-emoji-item .item-unread-group-avatar,
body.forum-topics-compact .forum-topic-emoji-item .item-unread-group-avatar {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  max-width: calc(100% - 4px);
  overflow: hidden;
  justify-content: flex-end;
  pointer-events: none;
}

body.forum-topics-visible .forum-topic-emoji-item .item-unread-group-avatar .item-unread-avatar,
body.forum-topics-compact .forum-topic-emoji-item .item-unread-group-avatar .item-unread-avatar {
  position: static;
  flex: 0 0 auto;
}

body.forum-topics-visible .forum-topic-emoji-item .item-unread-ninja-avatar,
body.forum-topics-compact .forum-topic-emoji-item .item-unread-ninja-avatar {
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-width: 2px;
  border-radius: 999px;
  font-size: 10px;
}

body.forum-topics-visible .forum-topic-emoji-item.muted .item-unread-avatar,
body.forum-topics-visible .forum-topic-emoji-item .item-unread-avatar.muted,
body.forum-topics-compact .forum-topic-emoji-item.muted .item-unread-avatar,
body.forum-topics-compact .forum-topic-emoji-item .item-unread-avatar.muted {
  background: var(--gray);
  color: var(--black);
}

body.forum-topics-compact .sidebar-scroll-top {
  bottom: 12px;
}

body.sidebar-compact.forum-topics-visible .telegram-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

body.sidebar-compact.forum-topics-visible .sidebar-body {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar-head {
  display: grid;
  gap: 6px;
  padding: 16px 8px 5px 14px;
  background: var(--black);
  backdrop-filter: none;
  border-bottom: 0;
}

.sidebar-title-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 4px;
  align-items: center;
}

.voul-functions {
  position: absolute;
  left: calc(50% - 3px);
  z-index: 1;
  width: 132px;
  transform: translateX(-50%);
}

.voul-functions::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
}

.extensions-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
}

.extensions-toggle-logo {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.extensions-toggle:hover {
  color: var(--pink);
}

.extensions-toggle.tap-animate {
  animation: none !important;
}

.voul-functions-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  gap: 4px;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.voul-functions:hover .voul-functions-menu,
.voul-functions.open .voul-functions-menu,
.voul-functions:focus-within .voul-functions-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.voul-functions-ninja-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 0 4px 0 8px;
}

.voul-functions-ninja-label {
  color: var(--white);
  font-size: 11px;
  white-space: nowrap;
}

.voul-functions-info-btn {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--gray);
  border-radius: 50%;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}

.voul-functions-info-btn:hover,
.voul-functions-info-btn:focus-visible {
  border-color: var(--gray);
  color: var(--white);
}

.ninja-mode-info-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 20px 22px 22px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(145%);
}

.ninja-mode-info-panel > .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.ninja-mode-info-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.ninja-mode-info-panel p {
  margin: 0 0 10px;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.45;
}

.ninja-mode-info-panel p:last-child {
  margin-bottom: 0;
}

.ninja-mode-info-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.ninja-mode-info-link:hover,
.ninja-mode-info-link:focus-visible {
  color: var(--white);
}

.ninja-mode-info-subscribe {
  margin-top: 14px;
  font-size: 14px;
}

.ninja-mode-info-dismiss {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--accent-line);
  color: var(--gray);
  cursor: pointer;
  font-size: 12px;
}

.ninja-mode-info-dismiss input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.voul-functions-menu button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-align: left;
}

.voul-functions-menu button:hover,
.voul-functions-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--black);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.icon-button:hover {
  transform: translateY(-1px) scale(1.015);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button.active {
  border-color: var(--gray);
  color: var(--pink);
}

.app-settings-toggle {
  grid-column: 3;
  justify-self: end;
  border-color: transparent;
  background: transparent;
  color: var(--white);
  font-size: 20px;
}

#createToggle {
  grid-column: 2;
  color: var(--white);
}

#archiveToggle {
  grid-column: 3;
}

#listTitle {
  display: flex;
  min-width: 0;
  align-items: center;
  white-space: nowrap;
}

.app-settings-toggle:hover {
  border-color: transparent;
  color: var(--pink);
  background: rgba(255, 255, 255, 0.06);
}

h1,
h2,
p {
  margin: 0;
  font-weight: 300;
}

h1 {
  font-size: 20px;
}

.sync-label {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  align-items: center;
  margin-left: 8px;
  color: var(--gray);
  font-size: 12px;
  vertical-align: middle;
}

.session-lost-label {
  display: inline-block;
  max-width: 170px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.18);
  color: #ff8a80;
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
}

.sync-label::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid var(--gray);
  border-top-color: var(--accent-line);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes message-local-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

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

h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

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

#activeSubtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray);
  font-size: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  outline: none;
  font: inherit;
}

.search-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  overflow: hidden;
}

.search-modes[hidden] {
  display: none;
}

.search-modes button {
  min-height: 28px;
  border: 0;
  border-right: 1px solid var(--accent-line);
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
}

.search-modes button:last-child {
  border-right: 0;
}

.search-modes button.active {
  color: var(--pink);
}

.search-box input::placeholder {
  color: var(--white);
}

.sidebar-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
  background: transparent;
}

.sidebar-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

body.forum-topics-visible:not(.forum-topics-compact) .sidebar-body {
  grid-template-columns: var(--sidebar-topics-rail-width) minmax(0, 1fr);
}

body.forum-topics-visible:not(.forum-topics-compact) .sidebar-chats {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-chats {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sidebar-chats > .sidebar-list {
  min-height: 0;
  height: 100%;
}

.sidebar-topics {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}

.sidebar-topics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px 12px;
  border-bottom: 1px solid rgba(232, 86, 168, 0.22);
}

.sidebar-topics-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-topics-close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
}

.topics-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
}

.topic-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 74px;
  padding: 9px 10px 9px 8px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--white);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 74px;
}

.topic-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

.topic-item.active {
  background: rgba(255, 255, 255, 0.17);
}

.topic-item-icons {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 50px;
  align-self: stretch;
}

.topic-item-pin {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--gray);
  opacity: 0.72;
  transform: translateX(-50%) scaleX(-1);
  pointer-events: none;
}

.topic-item-emoji {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
}

.topic-item-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topic-item-meta strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-item-meta small {
  overflow: hidden;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-item-meta small.topic-item-sender {
  color: rgba(255, 255, 255, 0.72);
}

.topic-item .item-unread {
  right: 8px;
  bottom: 9px;
}

.topic-item .item-unread-group {
  right: 8px;
  bottom: 9px;
  max-width: calc(100% - 40px);
}

body.forum-topics-collapsed .list-item.forum-chat-active .item-avatar-wrap .item-unread-avatar {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  font-size: 10px;
  line-height: 1;
}

body.forum-topics-collapsed .list-item.forum-chat-active.muted .item-avatar-wrap .item-unread-avatar {
  background: var(--gray);
  color: var(--black);
}

body.forum-topics-collapsed .list-item.forum-chat-active .item-avatar-wrap .item-unread-group-avatar {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

body.forum-topics-collapsed .list-item.forum-chat-active .item-avatar-wrap .item-unread-group-avatar .item-unread-avatar {
  position: static;
  flex: 0 0 auto;
}

body.forum-topics-collapsed .list-item.forum-chat-active .item-avatar-wrap .item-unread-ninja-avatar {
  min-width: 20px;
  max-width: 56px;
  height: 20px;
  padding: 0 5px;
  border-width: 2px;
  border-radius: 999px;
  font-size: 10px;
}

body.forum-topics-collapsed .list-item.forum-chat-active > .item-unread,
body.forum-topics-collapsed .list-item.forum-chat-active > .item-unread-group {
  display: none;
}

body.forum-topics-visible .list-item.forum-chat-active .item-avatar-wrap .item-unread-avatar,
body.forum-topics-visible .list-item.forum-chat-active .item-avatar-wrap .item-unread-group-avatar {
  display: none;
}

.sidebar-scroll-top {
  position: absolute;
  right: 12px;
  bottom: 70px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--black);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 23px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sidebar-scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-scroll-top:hover {
  border-color: var(--gray);
  color: var(--gray);
}

.story-strip {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.story-strip[hidden] {
  display: none;
}

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

.story-button {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 58px;
  min-width: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.story-button small {
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray);
  font-size: 10px;
  text-align: center;
}

.story-add-button .item-avatar {
  border: 1px solid var(--accent-line);
  color: var(--pink);
}

.app-account-panel {
  display: grid;
  gap: 8px;
  margin: 8px 12px 4px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  backdrop-filter: blur(24px) saturate(140%);
}

.app-account-title {
  color: var(--white) !important;
  font-size: 13px;
}

.app-premium-offer {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.app-premium-offer strong {
  color: var(--white);
  font-size: 13px;
}

.app-premium-offer span {
  color: var(--gray);
  font-size: 11px;
}

.app-premium-offer button {
  justify-self: start;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.app-account-panel input {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--white) 8%, transparent);
  color: var(--white);
  padding: 0 12px;
  font: inherit;
}

.app-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-account-saved {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.app-account-switcher-section {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.app-account-switcher-label {
  color: var(--gray);
  font-size: 10px;
}

.app-account-switcher-row {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 0 3px;
  scrollbar-width: none;
}

.app-account-switcher-row::-webkit-scrollbar {
  display: none;
}

.app-account-saved button {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: var(--glass-border);
  color: var(--white);
  background: transparent;
}

.app-account-saved button.active {
  border-color: var(--accent-line);
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.app-account-saved button.app-account-unavailable:disabled {
  opacity: 1;
  color: var(--white);
  border-color: var(--glass-border);
  background: transparent;
}

.app-account-saved button.app-account-admin-switch {
  cursor: pointer;
}

.app-account-saved button.active:disabled {
  opacity: 1;
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.14);
}

.app-account-saved .app-account-add {
  width: 34px;
  padding: 0;
  border-color: var(--accent-line);
  color: var(--white);
  font-size: 20px;
  line-height: 1;
}

.app-account-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 22%, transparent);
  color: var(--white);
  padding: 0 12px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.auth-screen {
  position: relative;
  display: grid;
  gap: 20px;
  min-height: calc(100dvh - 112px);
  align-content: center;
  padding: 344px 0 max(30px, env(safe-area-inset-bottom));
}

.auth-screen-brand {
  position: absolute;
  top: 18px;
  left: 0;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  min-width: 0;
}

.auth-screen-logo {
  width: 266px;
  height: 266px;
  object-fit: contain;
  mix-blend-mode: screen;
  transform: translateY(16%);
}

.auth-screen-brand-title {
  padding-bottom: 0;
  color: var(--white);
  font-size: clamp(42px, 8vw, 64px);
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 10px 30px rgba(225, 80, 169, 0.42);
}

.auth-hero {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.auth-hero h2 {
  white-space: normal;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.08;
}

.auth-hero p {
  max-width: 680px;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.7;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 430px;
  padding: 18px;
  border: 0;
  border-radius: 34px;
  background: color-mix(in srgb, var(--glass-bg) 84%, transparent);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(150%);
}

.auth-card.disabled {
  opacity: 0.62;
}

.auth-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.auth-card header > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 24%, transparent);
  color: var(--pink);
}

.auth-card h3 {
  margin: 0;
  font-weight: 300;
  font-size: 18px;
}

.auth-card p,
.auth-current-account small {
  color: var(--gray);
  font-size: 12px;
}

.auth-card-body {
  display: grid;
  gap: 12px;
}

.auth-card .settings-form,
.auth-card .settings-stack {
  gap: 10px;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  min-height: 46px;
  border-radius: 23px;
}

.auth-card .attach-wrapper,
.auth-card .attach-button {
  min-height: 46px;
  border-radius: 23px;
}

.auth-card button {
  min-height: 42px;
}

.auth-recovery-field {
  min-height: 64px;
  padding: 12px 14px;
  line-height: 1.35;
  resize: none;
  white-space: normal;
}

.password-eye-wrap {
  position: relative;
  display: block;
}

.password-eye-wrap input {
  width: 100%;
  padding-right: 56px;
}

.password-eye-button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #1c1b21;
  border-radius: 8px;
  background: #1c1b22;
  color: var(--pink);
  outline: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 17px;
  transition: color 0.18s ease;
}

.password-eye-button svg {
  display: block;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.password-eye-button:hover,
.password-eye-button:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
  border-color: #1c1b21;
  background: #1c1b22;
  transform: translateY(-50%) !important;
}

.password-eye-wrap:has(input:-webkit-autofill) .password-eye-button,
.password-eye-wrap:has(input:-webkit-autofill) .password-eye-button:hover,
.password-eye-wrap:has(input:-webkit-autofill) .password-eye-button:focus-visible {
  border-color: #faffbd;
  background: #faffbd;
}

.password-eye-button.active {
  color: var(--pink);
}

.password-eye-button.tap-animate {
  animation: none !important;
}

.password-eye-wrap:has(.password-eye-button:focus-visible),
.password-eye-wrap:has(.password-eye-button:active) {
  outline: 0 !important;
  box-shadow: none !important;
}

.field-error,
.password-eye-wrap:has(.field-error) input {
  border-color: #ff453a !important;
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.14);
}

.field-error-text {
  margin-top: -4px;
  padding: 0 10px;
  color: #ff8a80;
  font-size: 11px;
  line-height: 1.35;
}

.char-counter {
  justify-self: end;
  margin-top: -8px;
  padding: 0 8px;
  color: var(--gray);
  font-size: 11px;
  text-align: right;
}

.auth-current-account {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-support-button {
  width: max-content;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 18%, transparent);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.support-badge-anchor {
  position: relative;
}

.support-admin-badge {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--black);
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.support-admin-badge.wide {
  min-width: 22px;
}

.support-admin-badge[hidden] {
  display: none;
}

.account-groups {
  position: sticky;
  top: -6px;
  z-index: 2;
  display: flex;
  gap: 7px;
  padding: 8px 10px;
  overflow-x: auto;
  background: transparent;
  backdrop-filter: blur(18px) saturate(140%);
}

.account-group-add,
.account-group-tab,
.account-group-settings,
.add-account-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.account-group-add,
.account-group-tab.active,
.account-group-settings,
.add-account-button {
  color: var(--pink);
}

.account-group-add {
  color: var(--white);
}

.account-group-tab.active {
  background: transparent;
  color: var(--pink);
  font-weight: 700;
}

.account-group-settings {
  width: 44px;
  min-height: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.chat-folder-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  padding: 8px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 8, 12, 0.92);
}

.chat-folder-rail[hidden] {
  display: none !important;
}

.chat-folder-rail-settings {
  display: grid;
  place-items: center;
  width: 48px;
  height: 44px;
  margin: 0 auto 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-size: 18px;
}

.chat-folder-rail-settings:hover,
.chat-folder-rail-settings:focus-visible {
  color: var(--pink);
  background: rgba(255, 255, 255, 0.06);
}

.chat-folder-rail-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 2px 0 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-folder-rail-item {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.chat-folder-rail-square {
  --folder-accent: var(--pink);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 5px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-folder-rail-item:hover .chat-folder-rail-square,
.chat-folder-rail-item:focus-visible .chat-folder-rail-square {
  background: rgba(255, 255, 255, 0.08);
}

.chat-folder-rail-item.active .chat-folder-rail-square {
  color: var(--folder-accent, var(--pink));
  background: rgba(232, 86, 168, 0.14);
}

.chat-folder-rail-square-add {
  color: var(--pink);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.chat-folder-rail-item-add:hover .chat-folder-rail-square-add,
.chat-folder-rail-item-add:focus-visible .chat-folder-rail-square-add {
  background: rgba(232, 86, 168, 0.1);
}

.chat-folder-icon {
  --folder-accent: var(--pink);
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 44px;
  border-radius: 12px;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chat-folder-icon-svg {
  width: 24px;
  height: 24px;
  display: block;
}

.chat-folder-icon:not(.chat-folder-icon-all) {
  color: var(--folder-accent);
}

.chat-folder-icon.active,
.chat-folder-settings-item.active .chat-folder-icon {
  background: rgba(232, 86, 168, 0.16);
  box-shadow: inset 0 0 0 1px rgba(232, 86, 168, 0.35);
}

.chat-folder-settings-item:hover .chat-folder-icon,
.chat-folder-settings-item:focus-visible .chat-folder-icon {
  background: rgba(255, 255, 255, 0.08);
}

.chat-folder-icon-glyph {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 11px;
  line-height: 1;
}

.chat-folder-settings-modal {
  width: min(980px, 96vw);
  max-height: min(90vh, 860px);
}

.chat-folder-settings-panel {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  max-height: calc(min(90vh, 860px) - 68px);
  overflow: hidden;
}

.chat-folder-settings-list {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-folder-settings-items {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
}

.chat-folder-settings-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-folder-settings-item .chat-folder-icon {
  width: 36px;
  height: 34px;
  border-radius: 10px;
}

.chat-folder-settings-item .chat-folder-icon-svg {
  width: 18px;
  height: 18px;
}

.chat-folder-settings-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-folder-settings-item.active,
.chat-folder-settings-item:hover,
.chat-folder-settings-item:focus-visible {
  background: rgba(232, 86, 168, 0.12);
}

.chat-folder-settings-add {
  margin: 8px;
  min-height: 40px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
}

.chat-folder-editor {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.chat-folder-editor-scroll {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  padding: 12px 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-folder-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.chat-folder-type-button {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}

.chat-folder-type-button:hover,
.chat-folder-type-button:focus-visible {
  border-color: var(--accent-line);
}

.chat-folder-chat-section {
  display: grid;
  gap: 8px;
}

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

.chat-folder-chat-section-head .settings-section-title {
  margin: 0;
}

.chat-folder-chat-count {
  color: var(--gray);
  font-size: 12px;
}

.chat-folder-chat-search {
  margin: 0;
}

.chat-folder-chat-list {
  display: grid;
  gap: 10px;
  min-height: 180px;
  max-height: min(34vh, 340px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.chat-folder-chat-row {
  display: grid;
  grid-template-columns: 28px 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--white);
  font-size: 13px;
  cursor: pointer;
}

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

.chat-folder-chat-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  justify-self: center;
  accent-color: var(--pink);
}

.item-avatar.chat-folder-chat-avatar {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  font-size: 16px;
}

.chat-folder-chat-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: center;
}

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

.chat-folder-chat-meta strong {
  font-weight: 400;
}

.chat-folder-chat-meta .premium-name {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-folder-chat-meta small {
  color: var(--gray);
  font-size: 11px;
  line-height: 1.3;
}

.chat-folder-chat-empty {
  padding: 18px 12px;
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.chat-folder-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-folder-color-swatch {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.chat-folder-color-swatch.active {
  border-color: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.chat-folder-invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  body.has-folder-rail .telegram-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .chat-folder-rail {
    display: none !important;
  }

  .chat-folder-settings-panel {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .chat-folder-settings-list {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .chat-folder-chat-list {
    max-height: min(42vh, 360px);
  }
}

.account-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: stretch;
  width: 100%;
  margin: 2px 0;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  transition: background 0.18s ease;
}

.account-list-row[hidden] {
  display: none;
}

.account-list-row .list-item {
  min-width: 0;
  background: transparent;
}

.account-list-row.active {
  background: rgba(255, 255, 255, 0.17);
}

.account-list-row.active .list-item,
.account-list-row.active .account-row-settings {
  background: transparent;
}

.account-row-settings {
  display: grid;
  place-items: center;
  align-self: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin-right: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  transition: color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.account-row-settings:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(1.02) rotate(4deg);
}

.add-account-button {
  position: sticky;
  bottom: 4px;
  width: calc(100% - 28px);
  margin: 10px 14px 4px;
  background: rgba(28, 27, 34, 0.94);
}

.list-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 9px 14px;
  border: 0;
  background: rgba(0, 0, 0, 0.38);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 74px;
}

.list-item-shift-animating {
  z-index: 2;
  will-change: transform;
}

.list-item-promote-pending {
  visibility: hidden;
  pointer-events: none;
}

.list-item-promote-enter {
  will-change: transform, opacity;
}

button.tap-animate {
  animation: press-pop 0.28s cubic-bezier(0.2, 1.4, 0.34, 1);
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--white);
}

.list-item.active,
.account-list-row.active {
  background: rgba(255, 255, 255, 0.17);
  color: var(--white);
}

.account-list-row .list-item.active {
  background: transparent;
}

.pinned-chats-group {
  position: relative;
  margin: 3px 0 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  overflow: visible;
}

.item-avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
}

.item-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--gray);
  opacity: 0.72;
  pointer-events: none;
  transform: rotate(30deg);
  transform-origin: center;
}

.pinned-chats-group .list-item .item-pin {
  top: 2px;
  left: 0;
  transform: rotate(30deg);
  transform-origin: center;
}

.pinned-chats-group .list-item {
  background: transparent;
}

.pinned-chats-group .list-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.045);
}

.pinned-chats-group .list-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.list-item.no-session-access,
.list-item.deleted,
.account-list-row:has(.list-item.no-session-access) {
  background: rgba(255, 0, 0, 0.28);
}

.list-item.no-session-access:hover,
.list-item.no-session-access.active,
.list-item.deleted:hover,
.list-item.deleted.active,
.account-list-row:has(.list-item.no-session-access:hover),
.account-list-row:has(.list-item.no-session-access.active) {
  background: rgba(255, 0, 0, 0.36);
}

.account-list-row:has(.list-item.no-session-access) .list-item {
  background: transparent;
}

.item-avatar,
.avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--black);
  color: var(--gray);
  font-size: 18px;
  font-weight: 400;
  position: relative;
}

.item-avatar.story-ring,
.avatar.story-ring,
.sender-avatar.story-ring {
  --story-color: var(--gray);
  --story-gap: 7deg;
  padding: 3px;
  background:
    repeating-conic-gradient(
      var(--story-color) 0 calc((360deg / var(--story-count, 1)) - var(--story-gap)),
      transparent calc((360deg / var(--story-count, 1)) - var(--story-gap)) calc(360deg / var(--story-count, 1))
    );
}

.item-avatar.story-single,
.avatar.story-single,
.sender-avatar.story-single {
  background: conic-gradient(var(--story-color) 0 360deg);
}

.item-avatar.story-unread,
.avatar.story-unread,
.sender-avatar.story-unread {
  --story-color: #7a7a7a;
}

.story-button .item-avatar.story-unread {
  --story-color: #7a7a7a;
}

.story-button .item-avatar.story-fresh,
.item-avatar.story-fresh,
.avatar.story-fresh,
.sender-avatar.story-fresh {
  --story-color: #a2ff93;
}

.list-item.active .item-avatar,
.avatar {
  color: var(--gray);
}

.avatar {
  width: 46px;
  height: 46px;
}

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

.sidebar-list > .list-item,
.pinned-chats-group .list-item {
  --chat-avatar-size: 57px;
  grid-template-columns: var(--chat-avatar-size) minmax(0, 1fr);
  min-height: 66px;
  height: 66px;
  padding-block: 0;
  contain-intrinsic-size: 66px;
}

.sidebar-list > .list-item .item-avatar,
.pinned-chats-group .list-item .item-avatar,
.sidebar-list > .list-item .item-avatar-wrap,
.pinned-chats-group .item-avatar-wrap {
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
  justify-self: start;
}

.sidebar-list > .list-item.online .item-avatar::after,
.sidebar-list > .list-item.typing .item-avatar::after,
.pinned-chats-group .list-item.online .item-avatar::after,
.pinned-chats-group .list-item.typing .item-avatar::after {
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
}

.list-item.online .item-avatar::after,
.list-item.typing .item-avatar::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: #34c759;
}

.list-item.typing .item-avatar::after {
  animation: presence-pulse 1.1s ease-in-out infinite;
}

.item-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-right: 58px;
}

.item-meta strong,
.item-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.item-meta strong {
  font-size: 15px;
}

.item-meta small {
  color: var(--white);
  font-size: 12px;
}

.item-meta small.item-preview-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.item-folder-badge {
  flex: 0 0 auto;
  max-width: 46%;
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--folder-accent, var(--pink));
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item.active .item-meta small {
  color: var(--gray);
}

.list-item.active .item-meta small .item-preview-text {
  color: var(--gray);
}

.item-unread {
  position: absolute;
  right: 14px;
  bottom: 9px;
  display: grid;
  place-items: center;
  min-width: 24px;
  max-width: 72px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  overflow: hidden;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-unread-group {
  position: absolute;
  right: 14px;
  bottom: 9px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.item-unread-group .item-unread {
  position: static;
  flex: 0 0 auto;
}

.item-unread-ninja {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-width: 24px;
  max-width: 72px;
  height: 22px;
  padding: 0 7px;
  border: 2px solid var(--pink);
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  overflow: hidden;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-unread-ninja.muted,
.list-item.muted .item-unread-ninja,
.topic-item.muted .item-unread-ninja {
  border-color: var(--gray);
  color: var(--gray);
}

.item-time {
  position: absolute;
  top: 10px;
  right: 14px;
  max-width: 54px;
  overflow: hidden;
  color: var(--gray);
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-unread.muted,
.list-item.muted .item-unread {
  background: var(--gray);
  color: var(--black);
}

.empty-list,
.empty-chat {
  padding: 18px 14px;
  color: var(--gray);
  font-size: 13px;
}

.server-error-main {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px;
}

.server-error-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 69, 58, 0.38);
  border-radius: 18px;
  background: rgba(255, 69, 58, 0.08);
  color: var(--white);
}

.server-error-card.compact {
  margin: 10px 12px;
  padding: 14px;
}

.server-error-card strong {
  color: #ff8a80;
  font-size: 15px;
}

.server-error-card p {
  color: var(--gray);
  font-size: 13px;
  line-height: 1.45;
}

.server-error-card button {
  justify-self: start;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 138, 128, 0.52);
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.14);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  border-top: 1px solid var(--accent-line);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px) saturate(140%);
}

.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
}

.bottom-nav button + button {
  border-left: 1px solid var(--accent-line);
}

.bottom-nav button.active {
  color: var(--pink);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 25px;
  line-height: 1;
}

.nav-icon-phone {
  width: 28px;
  height: 28px;
  margin: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C10.61 21 3 13.39 3 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C10.61 21 3 13.39 3 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nav-icon-chat {
  position: relative;
  width: 27px;
  height: 19px;
  margin: auto;
  border: 0;
  border-radius: 8px;
  background: currentColor;
}

.nav-icon-chat::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 0 0 0 3px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transform: none;
}

.nav-icon-lines {
  position: relative;
  width: 24px;
  height: 16px;
  margin: auto;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-icon-lines::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  border-top: 2px solid currentColor;
  transform: translateY(-50%);
}

.calls-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  margin: 6px 10px 8px;
  padding: 4px;
  border-radius: 999px;
  background: #1c1b22;
  overflow: hidden;
}

.calls-tabs::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 4px);
  border: 1px solid var(--accent-content);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-content) 24%, transparent);
  transform: translateX(calc(var(--calls-tab-index, 0) * 100%));
  transition: transform 220ms ease;
  pointer-events: none;
}

.calls-tabs button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.calls-tabs button.active {
  background: transparent;
  color: var(--white);
}

.call-list-item.missed .call-item-meta strong {
  color: #ff6b63;
}

.call-list-item {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  cursor: pointer;
}

.call-avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  justify-self: start;
}

.call-list-item .item-avatar {
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  justify-self: start;
}

.call-list-item .call-item-meta {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  padding-right: 58px;
}

.call-list-item .call-item-meta strong,
.call-list-item .call-item-meta small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-list-item .call-item-meta strong {
  font-size: 15px;
  font-weight: 500;
}

.call-list-item .call-item-meta .premium-name {
  display: flex;
  align-items: center;
  min-width: 0;
}

.call-list-item .call-meta-username,
.call-list-item .call-meta-id {
  color: var(--gray);
  font-size: 12px;
  line-height: 1.3;
}

.call-list-item .call-meta-id {
  font-size: 11px;
  opacity: 0.88;
}

.call-direction-icon {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: #1c1b22;
  color: #7dcea0;
}

.call-direction-icon svg {
  width: 14px;
  height: 14px;
  overflow: visible;
}

.call-direction-icon.outgoing {
  color: #7dcea0;
}

.call-direction-icon.incoming {
  color: #7dcea0;
}

.call-direction-icon.missed {
  color: #ff6b63;
}

.call-list-item .item-time {
  right: 42px;
  max-width: 72px;
  white-space: normal;
  line-height: 1.2;
  text-align: right;
}

.call-save-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  overflow: visible;
}

.call-save-button:hover,
.call-save-button:focus-visible {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.call-save-button-unavailable {
  opacity: 0.42;
  color: var(--gray);
}

.call-save-button-unavailable::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  border-top: 2px solid currentColor;
  transform: rotate(-38deg);
  pointer-events: none;
}

.call-save-button-unavailable:hover,
.call-save-button-unavailable:focus-visible {
  color: #ff8a84;
  background: rgba(255, 107, 99, 0.08);
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  height: 100dvh;
  min-height: 100vh;
  background: var(--black);
}

.chat-drop-overlay {
  position: absolute;
  inset: 70px 10px 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--white);
  font-size: 15px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.chat-drop-overlay.active {
  opacity: 1;
}

.chat-drop-overlay[hidden] {
  display: none !important;
}

.chat-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--accent-line);
}

.chat-head:has(.chat-profile-button:not(:disabled)) {
  cursor: pointer;
}

.chat-head:has(.chat-profile-button:not(:disabled)) .avatar {
  cursor: pointer;
}

.chat-back-button {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 30px;
}

.chat-profile-button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  text-align: left;
  cursor: pointer;
}

.chat-profile-button:disabled {
  cursor: default;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  padding: 18px 18px 6px;
  background: var(--black);
}

.message-list * {
  overflow-anchor: none;
}

.messages-older-loader {
  align-self: center;
  padding: 8px 12px 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.2;
}

.messages-older-loader.loading {
  opacity: 0.85;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.message-row.local-message-enter .message-stack {
  animation: message-local-enter 220ms cubic-bezier(0.18, 0.82, 0.28, 1) both;
  transform-origin: 100% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .message-row.local-message-enter .message-stack {
    animation: none;
  }
}

.message-row.selection-mode {
  cursor: pointer;
}

.message-row.selected .message {
  box-shadow: 0 0 0 2px rgba(232, 86, 168, 0.45);
}

.message-row.selected .message-system-action {
  box-shadow: 0 0 0 2px rgba(232, 86, 168, 0.45);
}

.message-select-check {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0 6px 6px 0;
  padding: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.message-row.out.selection-mode {
  justify-content: space-between;
}

.message-row.out.selection-mode .message-select-check {
  order: 0;
}

.message-row.out.selection-mode .message-stack {
  order: 1;
  margin-left: auto;
}

.message-row.in {
  justify-content: flex-start;
}

.message-row.out {
  justify-content: flex-end;
}

.message-list.channel-chat .message-row.out {
  justify-content: flex-start;
}

.message-list.channel-chat .message-row.out.selection-mode {
  justify-content: flex-start;
}

.message-list.channel-chat .message-row.out.selection-mode .message-stack {
  order: unset;
  margin-left: 0;
}

.message-row.system-action-row {
  justify-content: center;
}

.message-row.system-action-row.selection-mode {
  gap: 8px;
}

.message-system-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(520px, 92%);
  padding: 5px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--gray);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.message-system-action small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
}

.message-row.with-sender .message-stack {
  max-width: min(620px, calc(78% - 40px));
}

.message-stack {
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: min(620px, 78%);
  overflow: visible;
}

.message-stack:has(.message-buttons) {
  max-width: min(620px, 100%);
}

.message-stack:has(.message-buttons) > .message {
  width: 100%;
}

.message-selection-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.message-selection-toolbar strong {
  color: var(--gray);
  font-size: 12px;
  white-space: nowrap;
}

.message-selection-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.message-selection-toolbar button:disabled {
  opacity: 0.45;
  cursor: default;
}

.message-selection-toolbar .selection-forward-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  transform: rotate(-45deg);
}

.sender-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--black);
  color: var(--gray);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

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

.unread-divider {
  align-self: center;
  margin: 8px 0;
  padding: 5px 12px;
  border: 1px solid var(--gray);
  border-radius: 999px;
  color: var(--gray);
  font-size: 12px;
}

.date-divider {
  border-color: var(--glass-border);
  color: var(--text-muted);
}

.message {
  --nft-preview-width: 180px;
  max-width: 100%;
  position: relative;
  padding: 4px 8px;
  border: 1px solid var(--accent-line);
  border-top-width: 1.5px;
  border-radius: 14px;
  background: transparent;
  color: var(--white);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.32;
  cursor: pointer;
}

.message.nft-link-preview-message {
  width: min(calc(var(--nft-preview-width) + 18px), 100%);
}

.message.media-only.normal {
  padding: 0;
  border: 1px solid var(--accent-line);
  border-top-width: 1.5px;
  background: transparent;
  overflow: hidden;
}

.message.visual-media-only {
  width: fit-content;
  max-width: min(420px, 100%);
}

.message.sticker-message.normal {
  padding: 2px;
  border-color: transparent;
  background: transparent;
  overflow: visible;
}

.message.sticker-message.media-only {
  padding: 2px;
}

.message.media-caption {
  width: fit-content;
  max-width: 100%;
  padding: 0 0 4px;
  overflow: hidden;
}

.reply-marker {
  --reply-marker-gap: 7px;
  display: block;
  width: 100%;
  margin: 0 0 var(--reply-marker-gap);
  padding: 1px 0 1px 8px;
  border: 0;
  border-left: 2px solid var(--gray);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message.media-caption .reply-marker {
  width: calc(100% - 16px);
  margin: 8px 8px var(--reply-marker-gap);
}

.message > .reply-marker + * {
  margin-top: 0;
}

.message.media-caption > .reply-marker + .message-text {
  padding-top: 0;
}

.reply-marker:hover {
  color: var(--white);
  border-left-color: var(--accent-line);
}

.message-media {
  display: block;
  width: auto;
  max-width: min(420px, 100%);
  height: auto;
  max-height: 420px;
  border-radius: 10px;
  object-fit: contain;
  cursor: pointer;
  background: transparent;
}

.message-media.loading-media:not(.sticker-media) {
  width: min(420px, 100%);
  height: min(320px, 54vh);
}

.video-note-media,
.message.video-note-message .message-media.video-note-media {
  --video-note-size: min(248px, 66vw);
  width: var(--video-note-size);
  height: var(--video-note-size);
  max-width: var(--video-note-size);
  max-height: var(--video-note-size);
  border-radius: 50%;
  object-fit: cover;
  background: var(--black);
  overflow: hidden;
}

.message-media.video-note-media.loading-media {
  width: var(--video-note-size);
  height: var(--video-note-size);
}

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

.album-media-grid.count-1 {
  grid-template-columns: 1fr;
  width: min(420px, 100%);
}

.album-media-grid.count-2 {
  width: min(340px, 100%);
}

.album-media-grid.count-2.vertical-mixed {
  grid-template-columns: 1fr;
  width: min(300px, 100%);
}

.album-media-grid.count-2.vertical-mixed .album-media-tile:first-child {
  aspect-ratio: 3 / 4;
}

.album-media-grid.count-2.vertical-mixed .album-media-tile:last-child {
  aspect-ratio: 16 / 9;
}

.album-media-grid.count-3 {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.album-media-grid.count-3 .album-media-tile:first-child {
  grid-row: 1 / 3;
}

.album-media-grid.count-4 {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.album-media-grid.count-many {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(360px, 100%);
}

.album-media-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.album-media-tile.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent-content);
  pointer-events: none;
}

.album-media-check {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 2;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent-content);
  cursor: pointer;
}

.album-media-tile .message-media {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

.message-media.small-source {
  width: min(260px, 68vw);
  min-width: min(260px, 68vw);
  image-rendering: auto;
}

.sticker-media {
  width: 132px;
  max-width: min(160px, 42vw);
  max-height: 160px;
  min-height: 132px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.sticker-lottie {
  display: block;
  height: 132px;
}

.sticker-lottie svg {
  display: block;
  width: 100%;
  height: 100%;
}

.message.sticker-message .message-media {
  border-radius: 0;
}

.sticker-fallback {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid var(--gray);
  border-radius: 18px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.045);
  font-size: 34px;
}

.message.media-caption:not(.sticker-message) .message-media:not(audio) {
  width: 100%;
  max-width: 100%;
  border-radius: 0 0 10px 10px;
  object-fit: contain;
  object-position: center;
}

.message.media-only:not(.sticker-message) .message-media:not(audio) {
  border-radius: 0 0 10px 10px;
}

.visual-media-frame {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0;
}

.message:not(.sticker-message) .visual-media-frame {
  border-radius: 0 0 10px 10px;
}

.visual-media-frame .message-media {
  max-width: 100%;
  border-radius: 0;
}

.message:not(.sticker-message) .visual-media-frame .message-media {
  border-radius: 0 0 10px 10px;
}

.message.video-note-message {
  --video-note-size: min(248px, 66vw);
  width: fit-content;
  max-width: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.message.video-note-message.media-caption {
  border-radius: 14px;
}

.message.video-note-message.media-only {
  padding: 0;
}

.message.video-note-message .visual-media-frame,
.message.video-note-message .visual-media-frame .message-media.video-note-media,
.message.video-note-message.media-caption .message-media.video-note-media:not(audio),
.message.video-note-message.media-only .message-media.video-note-media:not(audio) {
  width: var(--video-note-size);
  height: var(--video-note-size);
  max-width: var(--video-note-size);
  max-height: var(--video-note-size);
  border-radius: 50%;
  object-fit: cover;
}

.message.video-note-message.media-caption .message-media {
  margin: 0 auto;
}

audio.message-media {
  width: 100%;
  height: 42px;
  min-height: 0;
  max-height: none;
  cursor: default;
}

.voice-message-player {
  display: grid;
  grid-template-columns: 42px minmax(132px, 164px);
  align-items: center;
  gap: 4px;
  width: min(218px, calc(100vw - 90px));
  min-height: 64px;
  padding: 7px 7px 11px;
  border-radius: 14px;
  background: transparent;
}

.voice-message-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-content);
  color: var(--white);
  cursor: pointer;
}

.voice-message-play::before {
  content: "▶";
  position: relative;
  z-index: 1;
  display: block;
  margin-left: 2px;
  color: currentColor;
  font-family: "Arial Rounded MT Bold", Arial, sans-serif;
  font-size: 17px;
  line-height: 1;
}

.voice-message-play.playing::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 0;
  border-radius: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 5px 16px no-repeat,
    linear-gradient(currentColor, currentColor) 11px 0 / 5px 16px no-repeat;
}

.voice-message-play.not-loaded::before {
  content: "↓";
  margin-left: 0;
  font-size: 16px;
  font-weight: 900;
  transform: scale(1.15, 0.82);
}

.voice-message-play.loading::before {
  content: "×";
  margin-left: 0;
  font-size: 25px;
  transform: translateY(-1px);
}

.voice-message-load-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  animation: voice-message-load-spin 900ms linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
}

@keyframes voice-message-load-spin {
  to {
    transform: rotate(1turn);
  }
}

.voice-message-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  grid-template-rows: 25px auto;
  column-gap: 6px;
  align-content: center;
  row-gap: 2px;
  min-width: 0;
  min-height: 42px;
}

.voice-message-waveform {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: end;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  height: 25px;
  cursor: pointer;
}

.voice-message-waveform i {
  flex: 1 1 1px;
  min-width: 1px;
  max-width: 3px;
  height: max(3px, calc(var(--voice-level) * 0.68px));
  max-height: 23px;
  border-radius: 999px;
  background: var(--gray);
}

.voice-message-waveform i.played {
  background: var(--accent-content);
}

.voice-message-duration {
  grid-column: 1;
  grid-row: 2;
  min-width: 34px;
  color: var(--accent-content);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.voice-message-transcript {
  display: grid;
  grid-column: 2;
  grid-row: 1 / -1;
  place-items: center;
  align-self: center;
  justify-self: end;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--accent-content);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.voice-message-transcript.active {
  border: 1px solid var(--accent-line);
  color: var(--white);
}

.voice-message-transcript.loading {
  animation: voice-transcript-pulse 900ms ease-in-out infinite alternate;
}

.voice-message-transcript-text {
  margin: -2px 9px 8px 57px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--accent-line) 40%, transparent);
  color: var(--white);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@keyframes voice-transcript-pulse {
  to {
    opacity: 0.42;
  }
}

.voice-message-audio {
  display: none;
}

.message:has(.voice-message-player) {
  padding: 0;
  border-color: var(--accent-line);
  border-radius: 14px;
  background: transparent;
}

.message-stack:has(audio.message-media) {
  width: min(340px, 78%);
}

.message:has(audio.message-media) {
  width: 100%;
}

.message-link-preview {
  display: block;
  width: min(180px, 100%);
  margin: 6px 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  text-align: left;
  text-decoration: none;
}

.message-link-preview img {
  display: block;
  width: 100%;
  max-height: 110px;
  object-fit: cover;
}

.message-link-preview span {
  display: block;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-link-preview.message-link-preview-nft {
  --nft-preview-inset: 8px;
  width: min(var(--nft-preview-width), 100%);
  margin: 6px 0 0;
  padding: var(--nft-preview-inset) var(--nft-preview-inset) 0;
  border: 0;
  background: transparent;
}

.message-link-preview.message-link-preview-nft img {
  width: 100%;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.message-link-preview.message-link-preview-nft span {
  padding: var(--nft-preview-inset);
}

.telegram-link-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  width: min(360px, 100%);
  margin: 7px 0 0;
  padding: 9px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--pink) 8%, var(--black));
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
  white-space: normal;
}

.telegram-link-preview-card:hover {
  background: color-mix(in srgb, var(--pink) 14%, var(--black));
}

.telegram-link-preview-card.loading,
.telegram-link-preview-card.error {
  color: var(--gray);
}

.telegram-link-preview-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.telegram-link-preview-details strong,
.telegram-link-preview-details small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telegram-link-preview-details strong {
  color: var(--white);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.telegram-link-preview-details small {
  color: var(--gray);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.telegram-link-preview-details .telegram-link-preview-about {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.telegram-link-preview-avatar {
  width: 58px;
  height: 58px;
  justify-self: end;
  font-size: 20px;
}

.message.media-caption audio.message-media,
.message.media-only audio.message-media {
  width: min(320px, 100%);
}

.file-message {
  display: block;
  max-width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-text {
  margin-top: 0;
  padding-right: 46px;
}

.message-text a {
  color: var(--pink);
  text-decoration: underline;
}

.premium-emoji {
  display: inline-grid;
  place-items: center;
  min-width: 1.1em;
  color: var(--white);
  text-shadow: 0 0 8px var(--pink);
  vertical-align: -0.08em;
}

.premium-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  vertical-align: baseline;
}

.premium-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-name-badge {
  flex: 0 0 auto;
  font-size: 0.92em;
  line-height: 1;
}

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

.message.media-caption .message-text {
  width: 100%;
  padding: 4px 6px 0;
  line-height: 1.24;
}

.message-meta {
  float: right;
  margin: 3px 0 0 8px;
  color: var(--gray);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.message.out .message-meta {
  color: var(--accent-content);
}

.message.normal:not(.media-caption):not(.media-only):not(.visual-media-only) .message-meta {
  position: absolute;
  right: 8px;
  bottom: 4px;
  float: none;
  margin: 0;
}

.message-read-icon.read {
  position: relative;
  display: inline-block;
  width: calc(1ch + 4px);
  height: 1em;
  color: inherit;
  vertical-align: baseline;
}

.message-read-icon.read::before,
.message-read-icon.read::after {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  line-height: inherit;
}

.message-read-icon.read::after {
  left: 4px;
}

.message-send-spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
  vertical-align: -1px;
}

.message-send-cancel {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: -3px 0 -3px 1px;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 42%, transparent);
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  vertical-align: -3px;
}

.message-send-cancel:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.message-send-failed {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin: -2px 0 -2px 1px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: -2px;
}

.message.out.failed-send {
  cursor: pointer;
}

.message.media-caption .message-meta {
  padding-right: 8px;
}

.message.visual-media-only .message-meta {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--white);
}

.message.channel-post.has-comments {
  padding-bottom: 0;
}

.message.channel-post.has-comments .message-comments-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: calc(100% + 16px);
  margin: 6px -8px 0;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid var(--accent-line);
  border-radius: 0 0 13px 13px;
  background: transparent;
  color: var(--gray);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  clear: both;
  text-align: left;
}

.message.channel-post.has-comments .message-comments-label {
  min-width: 0;
}

.message.channel-post.has-comments .message-comments-arrow {
  flex: 0 0 auto;
  color: var(--gray);
  font-size: 20px;
  line-height: 1;
}

.message.channel-post.has-comments.media-only,
.message.channel-post.has-comments.media-caption {
  overflow: hidden;
}

.message.channel-post.has-comments.visual-media-only .message-comments-bar {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.message.channel-post.has-comments.visual-media-only .message-meta {
  bottom: auto;
}

.message-buttons {
  display: grid;
  justify-self: stretch;
  gap: 5px;
  clear: both;
  width: 100%;
  margin-top: 0;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
  margin-top: -3px;
  clear: both;
  position: relative;
  z-index: 1;
}

.reaction-pill {
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--gray);
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.reaction-pill.mine {
  background: var(--pink);
  color: var(--white);
}

.reaction-picker {
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: 4px;
  max-width: min(310px, calc(100vw - 20px));
  padding: 4px;
}

.reaction-picker-menu {
  min-width: 0;
  padding: 8px;
}

.reaction-picker-menu-full {
  width: min(320px, calc(100vw - 20px));
  padding: 8px;
}

.reaction-picker-full {
  display: grid;
  gap: 8px;
  width: 100%;
}

.reaction-picker-search {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gray);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font: inherit;
  font-size: 14px;
}

.reaction-picker-search::placeholder {
  color: var(--gray);
}

.reaction-picker-search:focus {
  outline: none;
  border-color: var(--pink);
}

.reaction-picker-scroll {
  max-height: min(340px, calc(100vh - 120px));
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: var(--pink) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.reaction-picker-scroll::-webkit-scrollbar {
  width: 8px;
}

.reaction-picker-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.reaction-picker-scroll::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 999px;
}

.reaction-picker-all {
  max-width: none;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(34px, 34px));
  justify-content: start;
}

.reaction-picker-empty {
  grid-column: 1 / -1;
  padding: 16px 8px;
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.reaction-picker button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
}

.pinned-message {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  justify-self: stretch;
  min-height: 52px;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid var(--accent-line);
  border-right: 3px solid var(--pink);
  background: rgba(0, 0, 0, 0.9);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: right;
  backdrop-filter: blur(16px);
}

.pinned-message-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-message-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--pink);
  transform: rotate(30deg);
  transform-origin: center;
}

.message-button-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  gap: 5px;
}

.message-buttons.capped .message-button-row {
  grid-auto-columns: minmax(0, 1fr);
}

.message-button-row button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #170f0f;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-button-row button.colored {
  border-color: #170f0f;
  background: color-mix(in srgb, var(--message-button-color) 16%, var(--black));
  color: var(--message-button-text-color, var(--message-button-color));
}

.message-button-row button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.message-button-row button.loading {
  filter: saturate(0.7);
}

.message.in {
  justify-self: flex-start;
}

.message.out {
  justify-self: flex-end;
}

.message-list.channel-chat .message.out {
  justify-self: flex-start;
}

.message.deleted {
  --message-border-color: #ff3b30;
  border-color: #ff3b30;
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.3);
}

.message.edited_old {
  --message-border-color: #ff9500;
  border-color: #ff9500;
}

.message.edited_new {
  --message-border-color: #34c759;
  border-color: #34c759;
}

.message.highlight {
  box-shadow: 0 0 0 2px var(--white);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: center;
  padding: 0 14px 8px;
  border-top: 0;
  background: rgba(0, 0, 0, 0.86);
}

.chat-form:has(.mini-app-button:not([hidden])) {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
}

.chat-form .compose-state,
.chat-form .attachment-preview {
  grid-column: 1 / -1;
}

.chat-form textarea {
  grid-column: 1;
  grid-row: 2;
  padding-right: 104px;
}

.chat-form .gift-panel-button {
  grid-column: 1;
  grid-row: 2;
  z-index: 2;
  justify-self: end;
  align-self: center;
  margin-right: 54px;
}

.chat-form .chat-attach-wrapper {
  grid-column: 1;
  grid-row: 2;
  z-index: 2;
  justify-self: end;
  margin-right: 2px;
}

.chat-form > button[type="submit"],
.chat-form > #sendButton {
  grid-column: 2;
  grid-row: 2;
}

.chat-form .voice-record-button {
  grid-column: 2;
  grid-row: 2;
}

.chat-form:has(.mini-app-button:not([hidden])) .mini-app-button {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.chat-form:has(.mini-app-button:not([hidden])) textarea {
  grid-column: 2;
}

.chat-form:has(.mini-app-button:not([hidden])) .chat-attach-wrapper {
  grid-column: 2;
}

.chat-form:has(.mini-app-button:not([hidden])) .gift-panel-button {
  grid-column: 2;
}

.chat-form:has(.mini-app-button:not([hidden])) > button[type="submit"],
.chat-form:has(.mini-app-button:not([hidden])) > #sendButton {
  grid-column: 3;
}

.chat-form:has(.mini-app-button:not([hidden])) .voice-record-button {
  grid-column: 3;
}

.chat-form .blocked-unblock {
  grid-column: 1 / -1;
}

.mini-app-button {
  position: relative;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

.mini-app-button::before,
.mini-app-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  transform: translate(-50%, -50%);
}

.mini-app-button.mini-app-button-link::before {
  width: 17px;
  height: 17px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: translate(-48%, -52%);
}

.mini-app-button.mini-app-button-link::after {
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-52%, -45%) rotate(-45deg);
  transform-origin: center;
}

.mini-app-button.mini-app-button-webapp::before {
  width: 23px;
  height: 19px;
  border: 2px solid currentColor;
  border-top-width: 6px;
  border-radius: 4px;
  transform: translate(-50%, -50%);
}

.mini-app-button[hidden] {
  display: none;
}

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

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

.chat-form.blocked textarea,
.chat-form.blocked .attachment-preview,
.chat-form.blocked .attach-wrapper,
.chat-form.blocked .gift-panel-button,
.chat-form.blocked .voice-record-button,
.chat-form.blocked .mini-app-button,
.chat-form.blocked > button[type="submit"],
.chat-form.blocked > #sendButton,
.chat-form.readonly-channel textarea,
.chat-form.readonly-channel .attachment-preview,
.chat-form.readonly-channel .attach-wrapper,
.chat-form.readonly-channel .gift-panel-button,
.chat-form.readonly-channel .voice-record-button,
.chat-form.readonly-channel .mini-app-button,
.chat-form.readonly-channel > button[type="submit"],
.chat-form.readonly-channel > #sendButton {
  display: none;
}

.blocked-unblock,
.readonly-notify-button {
  width: 100%;
  transform: none;
}

.readonly-notify-button[hidden] {
  display: none;
}

.compose-state {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: var(--gray);
  font-size: 12px;
}

.compose-state[hidden] {
  display: none;
}

.compose-state span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 8px 10px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: var(--black);
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-preview-list {
  display: flex;
  gap: 6px;
  max-width: 180px;
  overflow-x: auto;
  scrollbar-width: none;
}

.attachment-preview-list::-webkit-scrollbar {
  display: none;
}

.attachment-thumb,
.attachment-file-icon {
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: var(--gray);
  font-size: 11px;
  overflow: hidden;
}

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

.attachment-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.attachment-meta strong,
.attachment-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.attachment-meta small {
  color: var(--gray);
  font-size: 12px;
}

.attachment-remove {
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
}

button,
input,
select,
textarea {
  border-radius: 18px;
  font: inherit;
  font-weight: 300;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--white);
  outline: none;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 190px;
  resize: none;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--white);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--gray);
}

.chat-form button,
.attach-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--pink);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
}

.chat-form > button[type="submit"],
.chat-form > #sendButton,
.voice-record-button,
.chat-attach-wrapper,
.chat-attach-wrapper .attach-button {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  padding: 0;
}

.chat-form > button[type="submit"],
.chat-form > #sendButton {
  font-size: 22px;
  line-height: 1;
}

.voice-record-button {
  font-size: 16px;
}

.voice-record-button.recording {
  border-color: #ff3b30;
  color: #ff3b30;
  animation: voice-record-pulse 1s ease-in-out infinite;
}

@keyframes voice-record-pulse {
  50% {
    opacity: 0.55;
  }
}

.chat-form > button[type="submit"],
.chat-form > #sendButton {
  transform: rotate(-45deg);
}

.attach-wrapper {
  position: relative;
  min-height: 48px;
}

.chat-attach-wrapper {
  overflow: hidden;
}

.attach-wrapper .attach-button {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chat-attach-wrapper .attach-button {
  font-size: 24px;
  line-height: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.attach-wrapper input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.chat-form button:hover,
.attach-button:hover,
.attach-wrapper:hover .attach-button {
  border-color: var(--gray);
  color: var(--gray);
}

.chat-form .compose-state button {
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
}

.scroll-bottom {
  position: absolute;
  right: 22px;
  bottom: 82px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--black);
  color: var(--pink);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.scroll-bottom.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-bottom:hover {
  border-color: var(--gray);
  color: var(--gray);
}

.channel-message-button {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--black);
  color: var(--pink);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.channel-message-button[hidden] {
  display: none !important;
}

.channel-message-button::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.2L4 17.2V4h16z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.2L4 17.2V4h16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.channel-message-button.channel-posts-button::before {
  width: 20px;
  height: 20px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-7-2 5-5-1.4-1.4L12 14.2 8.4 10.6 7 12z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-7-2 5-5-1.4-1.4L12 14.2 8.4 10.6 7 12z'/%3E%3C/svg%3E");
}

.channel-message-button:hover {
  border-color: var(--gray);
  color: var(--gray);
}

.workspace:has(.channel-message-button:not([hidden])) .chat-form {
  padding-left: 62px;
}

.error {
  color: var(--pink);
}

.message-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(145%);
}

.message-menu[hidden] {
  display: none;
}

.message-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  text-align: left;
  cursor: pointer;
}

.message-menu button:hover {
  color: var(--pink);
}

.message-menu button:disabled {
  color: var(--gray);
  cursor: default;
  opacity: 0.55;
}

.message-menu button:disabled:hover {
  color: var(--gray);
}

.search-popup {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: start center;
  padding: 96px 18px 18px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(18px) saturate(145%);
}

.search-popup[hidden] {
  display: none;
}

.search-popup-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(520px, 100%);
  max-height: min(520px, calc(100dvh - 130px));
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(145%);
  overflow: hidden;
}

.search-popup-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--accent-line);
}

.search-popup-head button {
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}

.legal-consent {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
}

.legal-consent-panel {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(232, 86, 168, 0.34);
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.74);
}

.legal-consent-panel p {
  color: var(--gray);
  line-height: 1.55;
}

.legal-links {
  display: grid;
  gap: 8px;
}

.legal-links a {
  color: var(--pink);
}

.legal-consent-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(232, 86, 168, 0.86);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.search-popup-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  padding: 8px 0;
  overflow-y: auto;
}

.search-popup-controls {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
}

.search-popup-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.search-popup-modes[hidden] {
  display: none;
}

.search-popup-modes button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.search-popup-modes button.active {
  background: rgba(232, 86, 168, 0.22);
  color: var(--pink);
}

.search-popup-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.search-popup-item:hover {
  color: var(--gray);
}

.search-popup-section-title {
  padding: 8px 12px 5px;
  color: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
}

.recent-search-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 4px 10px;
}

.recent-search-chat {
  grid-column: 1 / -1;
  grid-row: 1 / 3;
  align-items: start;
  min-height: 50px;
  padding: 0 4px;
}

.recent-search-chat .search-popup-meta {
  align-self: start;
  gap: 2px;
  padding-top: 1px;
}

.recent-search-chat .search-popup-meta strong,
.recent-search-chat .search-popup-meta small {
  line-height: 1.05;
}

.recent-search-chat .search-popup-meta small {
  font-size: 11px;
}

.recent-search-query {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-column: 2;
  grid-row: 2;
  align-items: center;
  gap: 8px;
  z-index: 1;
  width: 100%;
  min-height: 22px;
  padding: 0 10px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.recent-search-item:not(:has(.recent-search-chat)) .recent-search-query {
  grid-column: 1 / -1;
}

.recent-search-query:hover {
  background: rgba(255, 255, 255, 0.08);
}

.recent-search-query-icon {
  display: grid;
  place-items: center;
  color: var(--pink);
  font-size: 13px;
  line-height: 1;
}

.recent-search-query-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pink);
  font-size: 11px;
  font-weight: 500;
}

.recent-search-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--accent-content);
  font-size: 20px;
}

.search-popup-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.search-popup-meta strong,
.search-popup-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.search-popup-meta small {
  color: var(--gray);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(22px) saturate(150%);
}

.modal[hidden] {
  display: none;
}

#profileModal.profile-modal-floating {
  z-index: 80;
}

.media-viewer-modal {
  z-index: 120;
  padding: 0;
  background: var(--black);
}

.media-viewer-modal .modal-close {
  z-index: 1;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: var(--white);
}

.modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 100%);
  min-height: 0;
  max-height: min(820px, 92vh);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(145%);
  overflow: hidden;
}

#sessionSettingsModal .modal-panel {
  width: min(760px, 100%);
}

.modal-head {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 16px 58px;
  border-bottom: 1px solid var(--accent-line);
}

.profile-photo-head {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  padding-top: 46px;
}

#profilePrevPhoto {
  grid-column: 1;
}

#profilePhoto {
  grid-column: 2;
  cursor: zoom-in;
}

#profileNextPhoto {
  grid-column: 3;
}

.modal-head button,
.modal-close {
  min-height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  padding: 0;
}

.profile-photo {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(250px, 46vw);
  height: min(250px, 46vw);
  border: 0;
  border-radius: 12px;
  color: var(--gray);
  font-size: 42px;
  overflow: hidden;
  cursor: pointer;
}

.profile-photo-counter {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  min-width: 42px;
  padding: 4px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--white);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.danger-action {
  border-color: #ff3b30;
  color: #ff3b30;
}

.media-viewer-modal.story-viewer-mode .media-viewer-content {
  padding: 0;
  overflow: hidden;
}

.story-viewer {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--black);
}

.story-viewer-progress {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  gap: 4px;
}

.story-viewer-progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.story-viewer-progress-segment.done,
.story-viewer-progress-segment.active {
  background: rgba(255, 255, 255, 0.95);
}

.story-viewer-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 16px 12px;
}

.story-viewer-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.story-viewer-archive-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  font-size: 16px;
}

.story-viewer-archive-button:hover {
  color: var(--pink);
  border-color: rgba(232, 79, 174, 0.45);
}

.story-button.story-archived {
  opacity: 0.72;
}

.story-button.story-archived .item-avatar {
  position: relative;
}

.story-button.story-archived .item-avatar::after {
  content: "▱";
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: var(--white);
  font-size: 9px;
  line-height: 1;
}

.story-viewer-author-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
}

.story-viewer-author-avatar img {
  border-radius: 50%;
}

.story-viewer-author-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.story-viewer-author-text strong {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-viewer-author-text small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-viewer-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.story-viewer-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 34%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.story-viewer-zone:disabled {
  cursor: default;
}

.story-viewer-zone-prev {
  left: 0;
}

.story-viewer-zone-next {
  right: 0;
}

.story-viewer-media-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 12px;
}

.story-viewer-media {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 170px);
  object-fit: contain;
}

.story-viewer-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 100%);
  color: var(--white);
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.story-viewer-avatar {
  display: grid;
  place-items: center;
  width: min(280px, 62vw);
  height: min(280px, 62vw);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray);
  font-size: 68px;
  overflow: hidden;
}

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

.story-viewer-footer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

.story-viewer-reply-form {
  display: grid;
}

.story-viewer-reply-input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font: inherit;
  font-size: 15px;
}

.story-viewer-reply-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.story-viewer-reply-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

.story-viewer-reaction-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.story-viewer-reaction-button:active {
  transform: scale(0.96);
}

.media-viewer-modal.story-viewer-mode .modal-close {
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 10px;
  z-index: 5;
}

.profile-body {
  display: grid;
  gap: 14px;
  align-content: start;
  grid-auto-rows: max-content;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.profile-fields {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}

.profile-fields dt {
  color: var(--gray);
}

.profile-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-fields a,
.profile-body a,
.profile-tab-content a {
  color: var(--pink);
}

.profile-personal-channel {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 9px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--white);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.profile-tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 4px;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  background: #1c1b22;
  overflow: hidden;
}

.profile-tabs::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(
    (100% - 8px - (var(--profile-tab-count, 4) - 1) * 2px)
    / var(--profile-tab-count, 4)
  );
  border: 1px solid var(--accent-content);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-content) 24%, transparent);
  transform: translateX(calc(var(--profile-tab-index, 0) * (100% + 2px)));
  transition: transform 240ms ease, width 240ms ease;
  pointer-events: none;
}

.profile-tabs button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tabs button:last-child {
  border-right: 0;
}

.profile-tabs button.active {
  background: transparent;
  color: var(--white);
  box-shadow: none;
}

.profile-audience-tabs {
  margin-bottom: 12px;
}

.profile-tab-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.profile-tab-content.media-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.profile-tab-content.gift-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}

.gift-tile {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  aspect-ratio: 4 / 3;
  min-width: 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--gift-center) 68%, var(--accent-line));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, var(--gift-center), var(--gift-edge) 78%);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  animation: gift-tile-enter 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.gift-tile.ordinary-gift,
.gift-detail-panel.ordinary-gift .gift-detail-hero {
  --gift-center: #000;
  --gift-edge: #000;
  background: #000;
}

.gift-tile.ordinary-gift .gift-pattern,
.gift-detail-panel.ordinary-gift .gift-pattern {
  display: none;
}

.gift-giver-avatar {
  position: absolute;
  z-index: 4;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: #17171b;
  color: #fff;
  font-size: 10px;
  overflow: hidden;
}

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

.gift-hidden-mark {
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 7px;
  width: 20px;
  height: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50% / 60%;
  filter: drop-shadow(0 1px 4px #000);
}

.gift-hidden-mark::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.gift-hidden-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  left: -2px;
  width: 24px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-38deg);
  transform-origin: center;
}

.ordinary-gift .gift-hidden-mark {
  left: 39px;
}

.hidden-gift {
  opacity: 0.62;
}

.gift-tile:nth-child(2n) {
  animation-delay: 45ms;
}

.gift-tile:nth-child(3n) {
  animation-delay: 90ms;
}

.gift-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0.36;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, var(--gift-pattern, rgba(255,255,255,.18)) 0 6%, transparent 7%),
    radial-gradient(circle at 70% 34%, var(--gift-pattern, rgba(255,255,255,.18)) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 76%, var(--gift-pattern, rgba(255,255,255,.18)) 0 6%, transparent 7%);
  background-size: 54px 54px;
}

.gift-pattern-grid {
  position: absolute;
  inset: -7%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 4px 7px;
  opacity: 0.3;
  transform: scale(1.08);
}

.gift-pattern-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  color: var(--gift-pattern);
}

.gift-pattern-cell:nth-child(n + 5):nth-child(-n + 8) {
  transform: translateX(50%);
}

.gift-pattern-cell svg,
.gift-pattern-cell img,
.gift-pattern-cell video {
  width: 58% !important;
  height: 58% !important;
  object-fit: contain;
  opacity: 0.82;
}

.gift-pattern-cell svg {
  width: 100% !important;
  height: 100% !important;
}

.gift-lottie-model {
  display: block;
  width: 70%;
  height: 70%;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.28));
  animation: gift-art-arrive 560ms cubic-bezier(.16, .84, .28, 1) both;
}

.gift-lottie-model svg {
  width: 100% !important;
  height: 100% !important;
}

.gift-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 0;
}

.gift-art img,
.gift-art video,
.gift-detail-art img,
.gift-detail-art video {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.28));
  animation: gift-art-arrive 560ms cubic-bezier(.16, .84, .28, 1) both;
}

.gift-fallback {
  color: color-mix(in srgb, var(--gift-center) 30%, #fff);
  font-size: 54px;
  line-height: 1;
}

.gift-label {
  position: relative;
  z-index: 2;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-pin {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 7px;
  color: #fff;
  font-size: 16px;
}

.gift-pin-toggle {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(10, 9, 13, 0.54);
  color: #fff;
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.gift-detail-panel {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: #0d0c11;
  overflow-y: auto;
  animation: gift-detail-enter 360ms cubic-bezier(.18, .8, .24, 1) both;
}

.gift-detail-panel > .modal-close {
  z-index: 8;
  top: 12px;
  right: 12px;
}

.gift-detail-actions {
  position: absolute;
  z-index: 6;
  top: 14px;
  right: 58px;
  width: 28px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.gift-actions-menu {
  position: fixed;
  z-index: 100020;
  display: grid;
  min-width: 230px;
  padding: 5px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: #151419;
  box-shadow: var(--glass-shadow);
}

.gift-actions-menu button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.gift-actions-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-content);
}

.settings-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 14px;
}

.settings-profile-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.settings-profile-controls .active {
  border-color: var(--accent-content);
  color: var(--accent-content);
}

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

.settings-gift-tile {
  min-height: 118px;
}

.settings-gift-grid.reorder-mode .gift-tile.pinned {
  cursor: grab;
  animation: gift-order-shake 520ms ease-in-out infinite alternate;
}

.settings-gift-grid.reorder-mode .gift-tile.pinned:nth-child(even) {
  animation-direction: alternate-reverse;
}

.settings-gift-grid .gift-tile.dragging {
  cursor: grabbing;
  opacity: 0.48;
}

.gift-replace-panel {
  display: grid;
  gap: 12px;
  width: min(430px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: #0d0c11;
}

.gift-replace-panel h3,
.gift-replace-panel p {
  margin: 0;
}

.gift-replace-panel p {
  color: var(--gray);
  font-size: 12px;
}

.gift-replace-item {
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, #513064, #17131e 78%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  animation: gift-order-shake 520ms ease-in-out infinite alternate;
}

@keyframes gift-order-shake {
  from {
    transform: rotate(-1.5deg);
  }
  to {
    transform: rotate(1.5deg);
  }
}

.gift-detail-modal.closing .gift-detail-panel {
  animation: gift-detail-exit 220ms cubic-bezier(.55, .06, .68, .19) both;
}

.gift-detail-modal {
  z-index: 130;
}

.gift-detail-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 42%, var(--gift-center), var(--gift-edge) 78%);
  overflow: hidden;
}

.gift-detail-panel.nft-gift .gift-detail-hero {
  width: 100%;
  margin: 0;
  border-radius: 20px;
}

.gift-detail-art .gift-lottie-model,
.gift-detail-art > img,
.gift-detail-art > video {
  width: 64%;
  height: 64%;
}

.bot-start-button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.chat-form.bot-needs-start > :not(.bot-start-button):not(.compose-state) {
  display: none !important;
}

.bot-start-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 620px) {
  .profile-tab-content.gift-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .gift-tile {
    padding: 5px;
  }

  .gift-label {
    font-size: 9px;
  }
}

.gift-detail-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.gift-detail-panel h3 {
  margin: 0;
  color: var(--white);
  font-size: 19px;
  font-weight: 400;
}

.gift-owner-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.gift-owner-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: #202027;
  color: var(--accent-content);
}

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

.gift-owner-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.gift-owner-copy strong,
.gift-owner-copy span,
.gift-owner-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-owner-copy strong {
  color: var(--gray);
  font-size: 11px;
  font-weight: 300;
}

.gift-owner-copy small {
  color: var(--gray);
  font-size: 11px;
}

.gift-properties {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  color: var(--white);
  font-size: 12px;
}

.gift-properties dt {
  color: var(--gray);
}

.gift-properties dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@keyframes gift-tile-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gift-art-arrive {
  from {
    opacity: 0;
    transform: scale(.72) rotate(-7deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes gift-detail-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gift-detail-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(.96);
  }
}

.media-tile-wrap {
  display: grid;
  gap: 0;
  min-width: 0;
  background: var(--black);
}

.media-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--black);
  overflow: hidden;
  cursor: pointer;
}

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

.media-tile-duration {
  position: absolute;
  left: 5px;
  bottom: 5px;
  min-width: 0;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.profile-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 9px 0;
  color: var(--white);
  font-size: 13px;
  overflow: hidden;
}

.profile-group-item {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.profile-group-item .item-avatar {
  width: 42px;
  height: 42px;
}

.profile-item-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-item strong,
.profile-item small {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.message-sender-name {
  display: block;
  max-width: 100%;
  margin: 0 8px 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-sender-name.premium-name,
.participant-row strong.premium-name,
.forward-item strong.premium-name {
  display: inline-flex;
}

.message-sender-name:disabled {
  color: var(--accent-content);
  cursor: default;
  opacity: 1;
}

.message-forwarded-sender {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  max-width: 100%;
  margin: 6px 6px 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gray);
  cursor: default;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}

.message-forwarded-sender.clickable {
  color: var(--accent-content);
  cursor: pointer;
}

.message-forwarded-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: #1c1b22;
  color: currentColor;
  font-size: 9px;
}

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

.message-forwarded-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message:has(.voice-message-player) > .message-sender-name {
  margin: 6px 8px 0;
}

.message.visual-media-only > .message-sender-name,
.message.media-only > .message-sender-name {
  position: relative;
  z-index: 3;
  margin: 5px 7px 2px;
}

.profile-action,
.settings-form button,
.forward-item {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #1c1b22;
  border-radius: 8px;
  background: #1c1b22;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.settings-form button:disabled {
  color: var(--gray);
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-form button:not(:disabled) {
  color: var(--pink);
  opacity: 1;
  cursor: pointer;
}

.profile-action {
  justify-self: start;
}

.media-viewer-panel {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: var(--black);
  overflow: hidden;
}

.media-viewer-content {
  display: block;
  width: 100%;
  height: 100%;
  padding: 56px 16px 16px;
  overflow: auto;
}

.media-viewer-arrow {
  position: fixed;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  transform: translateY(-50%);
}

.media-viewer-arrow.tap-animate,
.media-viewer-arrow:active {
  animation: none !important;
  transform: translateY(-50%) !important;
}

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

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

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

.viewer-media-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  margin: 0;
  gap: 14px;
}

.viewer-counter {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  min-width: 46px;
  padding: 5px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--white);
  font-size: 13px;
  text-align: center;
}

.viewer-download-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--pink);
  cursor: pointer;
  font-size: 13px;
}

.viewer-action-bar {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100vw - 180px);
}

.viewer-action-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.viewer-action-button.danger {
  border-color: #ff3b30;
  color: #ff3b30;
}

.viewer-media-wrap.has-caption {
  justify-content: flex-start;
}

.viewer-sticker-wrap .viewer-media {
  max-width: min(320px, calc(100vw - 32px));
  max-height: min(320px, calc(100dvh - 72px));
}

.viewer-lottie-sticker {
  display: block;
  width: min(320px, calc(100vw - 32px));
  height: min(320px, calc(100dvh - 72px));
}

.viewer-lottie-sticker svg {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-media {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 72px);
  object-fit: contain;
  border: 0;
  border-radius: 0;
}

.viewer-media.small-source {
  width: min(480px, calc(100vw - 80px));
  min-width: min(480px, calc(100vw - 80px));
}

.message:has(.voice-message-player) .message-meta {
  position: absolute;
  right: 8px;
  bottom: 2px;
  color: var(--gray);
}

.viewer-caption {
  width: min(720px, calc(100vw - 32px));
  padding: 0 0 18px;
  color: var(--white);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .media-viewer-arrow-prev {
    left: 8px;
  }

  .media-viewer-arrow-next {
    right: 8px;
  }
}

.small-panel {
  width: min(520px, 100%);
}

.modal-panel:has(.group-settings-form) {
  width: min(430px, 100%);
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--gray);
  font-size: 12px;
}

.color-input-row input {
  width: 76px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: var(--black);
  overflow: hidden;
}

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

.group-accent-colors .color-input-row {
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.group-accent-colors .color-input-row input {
  width: 52px;
  min-height: 30px;
}

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

.saved-palette-head .settings-section-title {
  margin: 0;
}

.saved-palette-head button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.saved-palette-hint {
  margin-top: -6px;
}

.group-auto-save-status {
  min-height: 15px;
  margin-top: -6px;
  color: var(--gray);
  text-align: right;
}

.group-picker-panel {
  width: min(420px, 100%);
}

.group-picker-list {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
}

.group-picker-item {
  min-height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.group-picker-item:hover {
  border-color: var(--accent-line);
  color: var(--pink);
}

.color-input-row input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-row input::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

#supportText {
  border-radius: 18px;
}

.settings-head {
  position: relative;
  padding: 18px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-head h2 {
  max-width: calc(100% - 210px);
}

.app-auth-head {
  display: grid;
  gap: 8px;
  padding: 18px 60px 18px 18px;
}

.app-auth-brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.app-auth-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  mix-blend-mode: screen;
}

.app-auth-brand-title {
  padding-bottom: 7px;
  color: var(--white);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 8px 24px rgba(225, 80, 169, 0.38);
}

#appAuthTitle:empty {
  display: none;
}

.session-account-balances {
  position: absolute;
  top: 18px;
  right: 68px;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: min(42%, 260px);
  min-height: 38px;
  overflow: hidden;
  color: var(--accent-content);
  font-size: 13px;
  white-space: nowrap;
}

.session-account-balances:empty {
  display: none;
}

.session-account-balances span,
.session-account-balances button {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--accent-content);
  overflow: hidden;
  text-overflow: ellipsis;
  font: inherit;
}

.session-account-balances button {
  cursor: pointer;
}

.settings-form {
  display: grid;
  gap: 10px;
  padding: 18px;
  min-height: 0;
  overflow-y: auto;
}

.modal-panel > .auth-mode-toggle {
  margin: 14px 18px 0;
}

.forgot-password-button {
  min-height: 24px !important;
  width: max-content;
  justify-self: start;
  padding: 0 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--pink) !important;
  font-size: 12px;
}

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

.recovery-confirm-row[hidden] {
  display: none;
}

.app-account-settings-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
}

.app-settings-account-select {
  display: grid;
  gap: 6px;
  color: var(--gray);
  font-size: 12px;
}

.app-settings-account-select select {
  min-height: 38px;
  border-radius: 8px;
}

.app-settings-menu {
  padding: 0;
}

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

.app-settings-section h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--white);
}

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

.app-settings-row,
.app-settings-empty {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 7%, transparent);
  color: var(--white);
}

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

.app-settings-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-settings-row-main strong,
.app-settings-row-main span,
.app-settings-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-settings-row span,
.app-settings-row small,
.app-settings-empty {
  color: var(--gray);
  font-size: 12px;
}

.app-settings-finish-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.app-settings-finish-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.app-settings-empty.error {
  color: #ff8b82;
}

.settings-form[hidden] {
  display: none;
}

.settings-profile-preview {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 0 14px;
}

.settings-current-avatar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid var(--gray);
  border-radius: 50%;
  color: var(--white);
  font-size: 24px;
  overflow: hidden;
  cursor: zoom-in;
}

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

.settings-profile-preview strong,
.settings-profile-preview small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.settings-profile-preview small {
  margin-top: 4px;
  color: var(--gray);
  font-size: 12px;
}

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

.form-hint {
  min-height: 18px;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.45;
}

.form-hint.error {
  color: #ff8fbb;
}

.telegram-actions-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.35;
}

.telegram-actions-consent input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-content);
}

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

.transfer-keep-row input {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  accent-color: var(--pink);
}

.settings-stack[hidden] {
  display: none;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-right: 1px solid var(--accent-line);
  border-radius: 0;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  color: var(--white);
  background: rgba(232, 86, 168, 0.16);
}

.telegram-settings-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.telegram-settings-list h3 {
  margin: 10px 0 0;
  color: var(--gray);
  font-size: 12px;
  font-weight: 300;
  text-transform: uppercase;
}

.telegram-settings-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  text-align: left;
}

.telegram-settings-list .settings-row-value {
  color: var(--gray);
}

.settings-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  min-height: 0;
  overflow-y: auto;
}

.settings-detail[hidden] {
  display: none;
}

.settings-back {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.settings-detail h3 {
  margin: 0;
  color: var(--white);
  font-size: 20px;
  font-weight: 300;
}

.ton-balance-row .ton-balance-value {
  color: var(--accent-content);
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
}

.ton-balance-input {
  width: 138px;
  text-align: right;
}

.settings-detail-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-text-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--white);
  font: inherit;
  resize: vertical;
}

.settings-link-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.settings-link-row:disabled {
  cursor: default;
  opacity: 0.58;
}

.settings-row-actions {
  display: flex;
  gap: 6px;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: transparent;
  color: var(--accent-content);
  font: inherit;
  cursor: pointer;
}

.stars-filter {
  position: relative;
  justify-self: end;
  color: var(--white);
}

.stars-filter summary {
  min-width: 112px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  color: var(--accent-content);
  cursor: pointer;
  list-style: none;
  text-align: center;
}

.stars-filter summary::-webkit-details-marker {
  display: none;
}

.stars-filter-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: #17161c;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.stars-filter-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 7px;
  cursor: pointer;
}

.stars-filter-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stars-filter-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--gray);
  border-radius: 5px;
}

.stars-filter-option input:checked + .stars-filter-check {
  border-color: var(--accent-content);
  background: color-mix(in srgb, var(--accent-content) 28%, transparent);
}

.stars-filter-option input:checked + .stars-filter-check::before {
  content: "✓";
  color: var(--accent-content);
  font-size: 13px;
}

.stars-transaction-list {
  display: grid;
}

.stars-transaction {
  grid-template-columns: 34px 34px minmax(0, 1fr) auto;
  cursor: default;
}

.stars-transaction[tabindex] {
  cursor: pointer;
}

.stars-transaction-gift,
.stars-transaction-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #1c1b22;
  color: var(--accent-content);
  font-size: 11px;
  line-height: 1;
}

.stars-transaction-gift {
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent-line) 42%, transparent);
}

.stars-transaction-gift.clickable,
.stars-transaction-avatar.clickable {
  cursor: pointer;
}

.stars-transaction-gift.clickable:hover,
.stars-transaction-avatar.clickable:hover {
  border-color: color-mix(in srgb, var(--accent-line) 72%, transparent);
}

.stars-transaction-gift img,
.stars-transaction-gift video,
.stars-transaction-gift .gift-lottie-model,
.stars-transaction-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stars-transaction-gift .gift-lottie-model {
  transform: scale(1.25);
}

.stars-transaction-gift-fallback {
  color: var(--accent-content);
}

.stars-transaction-modal {
  backdrop-filter: blur(12px);
}

.stars-transaction-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(460px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: rgba(15, 14, 19, 0.96);
  color: var(--white);
}

.stars-transaction-detail-head {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-right: 42px;
}

.stars-transaction-detail-head .stars-transaction-gift,
.stars-transaction-detail-head .stars-transaction-avatar {
  width: 40px;
  height: 40px;
}

.stars-transaction-detail-head h3 {
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 300;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stars-transaction-details {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
}

.stars-transaction-details dt {
  color: var(--gray);
}

.stars-transaction-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.stars-transaction-meta {
  display: inline;
}

.stars-meta-action {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stars-meta-action.copy,
.stars-meta-action.gift,
.stars-meta-action.detail {
  color: var(--accent-content);
}

.stars-meta-action.profile {
  color: var(--white);
}

.stars-meta-action:hover {
  text-decoration: underline;
}

.stars-transaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stars-income {
  color: #75d59a;
  white-space: nowrap;
}

.stars-expense {
  color: #ff8fbb;
  white-space: nowrap;
}

.settings-section {
  display: grid;
  gap: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
}

.settings-section-title {
  margin: 12px 0 6px;
  color: var(--gray);
  font-size: 12px;
  font-weight: 300;
  text-transform: uppercase;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-language-row {
  cursor: pointer;
}

.settings-language-check {
  color: var(--accent-content);
  font-size: 16px;
  font-weight: 600;
}

.settings-row strong,
.settings-row small {
  display: block;
  min-width: 0;
  font-weight: 300;
}

.settings-row small {
  margin-top: 3px;
  color: var(--gray);
  font-size: 12px;
}

.settings-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-drilldown {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--black);
  color: var(--pink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.settings-drilldown:hover,
.settings-drilldown:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.privacy-exception-list {
  max-height: 320px;
  overflow-y: auto;
}

.chat-settings-panel {
  width: min(760px, 100%);
}

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

.chat-settings-toggles,
.chat-settings-rights,
.group-member-list {
  display: grid;
  gap: 4px;
}

.group-member-row {
  grid-template-columns: 28px 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 6px 0;
}

.group-member-row.current {
  padding: 6px 8px;
}

.group-member-avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.group-member-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.group-member-meta strong {
  font-weight: 400;
}

.group-member-meta small {
  color: var(--gray);
  font-size: 12px;
  line-height: 1.25;
}

.settings-note,
.unsupported-list {
  margin: 0;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.45;
}

.unsupported-list {
  padding-left: 18px;
}

.participant-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.participant-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 40px;
}

.participant-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  overflow: hidden;
}

.participant-row strong,
.participant-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.participant-row small {
  color: var(--gray);
  font-size: 12px;
}

.participant-row strong.premium-name {
  display: inline-flex;
}

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

.settings-choice {
  min-width: 112px;
  max-width: min(220px, 42vw);
  padding: 8px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  outline: none;
}

.wide-action {
  width: 100%;
  justify-content: center;
}

.settings-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--black);
  color: var(--pink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.telegram-settings-panel {
  width: min(720px, 100%);
  max-height: min(880px, 94vh);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--black);
}

.telegram-channel-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.telegram-channel-nav {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  align-items: center;
  min-height: 64px;
  padding: 0 16px;
  border-bottom: 1px solid var(--accent-line);
  background: var(--black);
}

.telegram-channel-nav h2 {
  margin: 0;
  color: var(--white);
  text-align: center;
  font-size: 20px;
  font-weight: 400;
}

.telegram-nav-back,
.telegram-nav-done {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #2ea7ff;
  font: inherit;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.telegram-nav-done {
  text-align: right;
}

.telegram-channel-body {
  min-height: 0;
  padding: 16px 20px 28px;
  overflow-y: auto;
  background: var(--black);
}

.telegram-channel-body[hidden],
.telegram-subscreen[hidden],
.telegram-card[hidden] {
  display: none;
}

.telegram-subscreen {
  min-height: 0;
  padding: 16px 20px 28px;
  overflow-y: auto;
  background: var(--black);
}

.telegram-info-card,
.telegram-card,
.telegram-delete-channel {
  border-radius: 8px;
  background: var(--black);
}

.telegram-info-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 28px;
}

.telegram-avatar-picker {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #e48dff;
  overflow: hidden;
  cursor: pointer;
}

.telegram-avatar-picker input {
  display: none;
}

.telegram-avatar-preview {
  color: var(--white);
  font-size: 34px;
  font-weight: 600;
}

.telegram-info-fields {
  display: grid;
  gap: 0;
  min-width: 0;
}

.telegram-info-fields input,
.telegram-info-fields textarea {
  border: 0;
  border-bottom: 1px solid #283848;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font-size: 17px;
}

.telegram-info-fields textarea {
  min-height: 46px;
  max-height: 120px;
  padding-left: 12px;
}

.telegram-help {
  margin: 8px 28px 22px;
  color: #b7c5d4;
  font-size: 15px;
  line-height: 1.35;
}

.telegram-card {
  display: grid;
  gap: 0;
  margin-top: 18px;
  padding: 0 28px;
  border: 1px solid rgba(232, 86, 168, 0.5);
}

.telegram-subscreen .telegram-card:first-child {
  margin-top: 0;
}

.telegram-subtitle {
  margin: 28px 28px 8px;
  color: #b7c5d4;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.telegram-subnote {
  margin-top: 10px;
}

.telegram-settings-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(232, 86, 168, 0.34);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.telegram-settings-row:last-child {
  border-bottom: 0;
}

.telegram-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--white);
  font-size: 18px;
}

.telegram-row-icon.blue { background: #168cff; }
.telegram-row-icon.purple { background: #b052d6; }
.telegram-row-icon.orange { background: #ff9500; }
.telegram-row-icon.cyan { background: #42b9e8; }
.telegram-row-icon.red { background: #ff375f; }
.telegram-row-icon.green { background: #32d74b; }

.telegram-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.telegram-row-main strong,
.telegram-row-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.telegram-row-main strong {
  font-size: 18px;
}

.telegram-row-main small,
.telegram-row-value,
.muted-row .telegram-row-main strong {
  color: #b7c5d4;
}

.telegram-settings-row input,
.telegram-settings-row select {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b7c5d4;
}

.telegram-settings-row input[type="checkbox"] {
  width: 42px;
  accent-color: var(--pink);
}

.telegram-row-with-switch {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.telegram-premium-pill {
  padding: 4px 8px;
  border-radius: 7px;
  background: #a95df2;
  color: var(--white);
  font-size: 13px;
  white-space: nowrap;
}

.telegram-color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pink);
}

.telegram-inline-check {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 52px;
  border-bottom: 1px solid #283848;
  font-size: 16px;
}

.telegram-people-card {
  padding-top: 14px;
  padding-bottom: 14px;
}

.telegram-blue-action {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #2ea7ff;
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.telegram-delete-channel {
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  padding: 0 28px;
  border: 1px solid rgba(255, 59, 48, 0.7);
  color: #ff5b57;
  font: inherit;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.telegram-picker-card {
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.telegram-picker-card input[type="search"],
.telegram-picker-card > input,
.telegram-card > input,
.telegram-card > select {
  min-height: 40px;
  border-color: var(--accent-line);
  background: var(--black);
  color: var(--white);
}

.telegram-picker-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.telegram-picker-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.telegram-picker-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--pink);
}

.telegram-color-grid,
.telegram-reaction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 10px;
  padding: 14px 0;
}

.telegram-color-grid button,
.telegram-reaction-grid button {
  min-height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.color-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 8px;
  justify-content: center;
  padding: 2px 0 4px;
}

.accent-palette-grid {
  grid-template-columns: repeat(auto-fit, 42px);
  justify-content: start;
  min-height: 42px;
}

.accent-palette-grid.empty::after {
  content: "Пока нет сохранённых сочетаний";
  grid-column: 1 / -1;
  color: var(--gray);
  font-size: 11px;
}

.color-preset {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 42%),
    var(--preset-color);
  color: transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.accent-palette-preset {
  --preset-color: var(--preset-content-color);
  position: relative;
  width: 42px;
  height: 42px;
  min-height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(
    to bottom right,
    var(--preset-content-color) 0 49%,
    var(--preset-line-color) 51% 100%
  );
}

.accent-palette-preset::after {
  content: none;
}

.accent-palette-preset:hover {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--preset-content-color) 38%, transparent);
}

@media (max-width: 520px) {
  .group-accent-colors {
    grid-template-columns: 1fr;
  }
}

.color-preset:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--preset-color) 38%, transparent);
}

.telegram-color-grid button::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--swatch);
  vertical-align: -2px;
}

.telegram-reaction-grid button.active {
  background: var(--pink);
}

.settings-switch {
  position: relative;
  width: 50px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #29333d;
  cursor: pointer;
}

.settings-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.18s ease;
}

.settings-switch.active {
  background: var(--pink);
}

.settings-switch.active::after {
  transform: translateX(22px);
}

.settings-switch.voul-ninja-switch {
  width: 50px;
  aspect-ratio: 2 / 1;
  height: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 1px solid var(--pink);
  background: #29333d;
  padding: 0;
  min-height: 0;
}

.settings-switch.voul-ninja-switch::after {
  top: 50%;
  left: 1px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
}

.settings-switch.voul-ninja-switch.active {
  border-color: var(--pink);
  background: var(--pink);
}

.settings-switch.voul-ninja-switch.active::after {
  transform: translateY(-50%) translateX(29px);
}

.settings-inline-check {
  display: grid;
  grid-template-columns: 18px max-content;
  gap: 7px;
  align-items: center;
  justify-self: end;
  color: var(--gray);
  font-size: 11px;
  white-space: nowrap;
}

.settings-inline-check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--pink);
}

#addAccountGroupCreate {
  min-height: 38px;
  color: var(--pink);
}

.check-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  color: var(--white);
  font-size: 13px;
}

.check-row.current {
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.mini-app-modal {
  padding: 20px;
  place-items: center;
}

.mini-app-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(820px, calc(100dvh - 40px));
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  background: rgba(18, 18, 24, 0.66);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(145%);
  overflow: hidden;
}

.mini-app-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--black);
}

.mini-app-fallback {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--accent-line);
  color: var(--gray);
  font-size: 12px;
}

.mini-app-fallback[hidden] {
  display: none;
}

.mini-app-fallback button {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
}

.delete-choice-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.delete-choice-body button {
  min-height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pink);
  cursor: pointer;
  font: inherit;
}

.confirm-choice-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.confirm-choice-body p {
  color: var(--gray);
  line-height: 1.45;
}

.settings-avatar {
  width: 160px;
}

.danger-button {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--gray);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

#settingsLogout.danger-button {
  border: 1px solid var(--accent-line);
}

.danger-button:hover {
  border-color: #ff3b30;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.12);
}

.device-exit-button {
  min-height: 54px;
  margin-top: 16px;
  border-color: #ff3b30;
  background: rgba(255, 59, 48, 0.16);
  color: #ff3b30;
  font-size: 16px;
}

.device-exit-button:hover {
  background: rgba(255, 59, 48, 0.26);
  color: #ffb1aa;
}

.settings-stack.collapsed input {
  display: none;
}

.support-file-picker {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--pink);
  cursor: pointer;
  font-size: 12px;
}

.support-file-picker input {
  display: none;
}

.support-file-summary {
  color: var(--gray);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.support-thread {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.support-message {
  display: grid;
  gap: 4px;
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message.user {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: color-mix(in srgb, var(--pink) 28%, rgba(255, 255, 255, 0.06));
}

.support-message.admin {
  justify-self: start;
  border-bottom-left-radius: 6px;
}

.support-message-meta {
  justify-self: end;
  color: var(--gray);
  font-size: 10px;
  line-height: 1;
}

.support-attachments {
  display: grid;
  gap: 6px;
}

.support-attachment-preview {
  display: block;
  max-width: min(220px, 100%);
  max-height: 160px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
}

.support-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--white);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.support-attachment span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-attachment small {
  color: var(--gray);
}

.support-attachment-icon {
  color: var(--pink);
}

.support-empty {
  padding: 10px;
  color: var(--gray);
  font-size: 12px;
  text-align: center;
}

.search-popup-empty {
  width: calc(100% - 24px);
  margin-left: auto;
  padding: 18px 14px;
  color: var(--gray);
  font-size: 13px;
  text-align: right;
}

.modal-panel,
.profile-panel,
.context-menu,
.search-popup {
  background-color: rgba(18, 18, 24, 0.66);
  backdrop-filter: blur(26px) saturate(145%);
}

.extensions-modal {
  z-index: 35;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.extensions-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(360px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 32px));
  min-width: 280px;
  min-height: 400px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  aspect-ratio: auto;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: rgba(12, 11, 16, 0.96);
  box-shadow: var(--glass-shadow);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.extensions-panel.paired-window-move {
  transition: left 200ms ease, top 200ms ease;
}

.subscriptions-modal {
  z-index: 36;
}

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

.extensions-head {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 6px 54px;
  border-bottom: 1px solid var(--accent-line);
  cursor: grab;
  touch-action: none;
}

.extensions-head:active {
  cursor: grabbing;
}

.extensions-head h2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
}

.extensions-head-logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 auto;
}

.extensions-window-controls {
  position: absolute;
  left: 14px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
}

.extensions-window-control {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
}

.extensions-window-close {
  background: #ff5f57;
}

.extensions-window-expand {
  background: #28c840;
}

.extensions-window-control::before,
.extensions-window-control::after {
  content: "";
  position: absolute;
  opacity: 0;
  transition: opacity 120ms ease;
}

.extensions-window-controls:hover .extensions-window-control::before,
.extensions-window-controls:hover .extensions-window-control::after {
  opacity: 1;
}

.extensions-window-close::before,
.extensions-window-close::after {
  width: 7px;
  height: 1.5px;
  border-radius: 999px;
  background: #6e1e1b;
}

.extensions-window-close::before {
  transform: rotate(45deg);
}

.extensions-window-close::after {
  transform: rotate(-45deg);
}

.extensions-window-expand::before,
.extensions-window-expand::after {
  width: 4.5px;
  height: 4.5px;
  border-color: #0b5f1d;
  border-style: solid;
}

.extensions-window-expand::before {
  top: 2px;
  right: 2px;
  border-width: 1.5px 1.5px 0 0;
}

.extensions-window-expand::after {
  bottom: 2px;
  left: 2px;
  border-width: 0 0 1.5px 1.5px;
}

.extensions-close {
  position: absolute;
  top: 11px;
  right: 12px;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 23px;
}

.extensions-billing-toggle {
  position: absolute;
  top: 5px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}

.extensions-billing-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nft-market-toggle {
  gap: 5px;
  left: calc(50% - 98px);
  width: 64px;
  max-width: 64px;
}

.gift-panel-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 0;
}

.gift-panel-button:hover,
.gift-panel-button:active,
.gift-panel-button:focus,
.gift-panel-button:focus-visible {
  border: 0;
  background: none;
  color: var(--accent-content);
  outline: 0;
  box-shadow: none;
}

#giftPanelButton,
#giftPanelButton:hover,
#giftPanelButton:active,
#giftPanelButton:focus,
#giftPanelButton:focus-visible {
  border: 0 !important;
  background: none !important;
  color: var(--accent-content) !important;
}

.gift-panel-button::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 7h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.3 0-2.32.84-3 2-.68-1.16-1.7-2-3-2-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.1 0-2 .9-2 2v2h20V9c0-1.1-.9-2-2-2ZM9 5c.6 0 1.16.63 1.58 2H9c-.55 0-1-.45-1-1s.45-1 1-1Zm6 0c.55 0 1 .45 1 1s-.45 1-1 1h-1.58C13.84 5.63 14.4 5 15 5ZM3 12v7c0 1.1.9 2 2 2h6v-9H3Zm10 9h6c1.1 0 2-.9 2-2v-7h-8v9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 7h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.3 0-2.32.84-3 2-.68-1.16-1.7-2-3-2-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.1 0-2 .9-2 2v2h20V9c0-1.1-.9-2-2-2ZM9 5c.6 0 1.16.63 1.58 2H9c-.55 0-1-.45-1-1s.45-1 1-1Zm6 0c.55 0 1 .45 1 1s-.45 1-1 1h-1.58C13.84 5.63 14.4 5 15 5ZM3 12v7c0 1.1.9 2 2 2h6v-9H3Zm10 9h6c1.1 0 2-.9 2-2v-7h-8v9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mini-app-modal .mini-app-panel {
  width: min(440px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 24px));
  aspect-ratio: auto;
}

.nft-market-panel,
.gift-panel {
  width: min(360px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 32px));
  aspect-ratio: auto;
}

.mini-app-panel iframe {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0 0 28px 28px;
  background: #000;
}

.mini-app-fallback {
  display: grid;
  gap: 10px;
  padding: 12px;
  color: var(--gray);
  font-size: 12px;
}

.mini-app-fallback button,
.nft-market-actions button,
.gift-panel-actions button {
  min-height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.nft-market-body,
.gift-panel-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.nft-market-body {
  padding-top: 0;
}

.nft-market-panel .extensions-head {
  padding-right: 118px;
}

.nft-market-head-actions {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  transform: translateY(-50%);
}

.nft-market-head-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.nft-market-head-actions #nftMarketWallet {
  font-size: 18px;
  line-height: 1;
}

.nft-market-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  margin: 0 -14px 0;
  padding: 10px 14px 8px;
  background: rgba(12, 11, 16, 0.98);
  border-bottom: 1px solid var(--glass-border);
}

.nft-market-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.nft-filter {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.nft-filter > button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  width: 100%;
  min-height: 34px;
  padding: 3px 10px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nft-filter > button span {
  color: var(--white);
  font-size: 9px;
  line-height: 1;
}

.nft-filter > button strong {
  min-width: 0;
  overflow: hidden;
  color: var(--gray);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nft-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: none;
  width: min(220px, calc(100vw - 40px));
  max-height: 260px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(18, 18, 24, 0.98);
  box-shadow: var(--glass-shadow);
}

.nft-filter.open .nft-filter-menu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.nft-filter-menu input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--glass-border);
  outline: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 12px;
  padding: 10px 12px;
}

.nft-filter-options {
  display: grid;
  overflow: auto;
  padding: 5px;
}

.nft-filter-options button {
  display: grid;
  grid-template-columns: 16px 28px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.nft-filter-options button span {
  visibility: hidden;
  color: var(--accent-content);
  font-size: 12px;
}

.nft-filter-options button i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  font-style: normal;
}

.nft-filter-options button i:empty::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-content);
  opacity: 0.75;
}

.nft-filter-options button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nft-filter-options button b {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nft-filter-options button.selected {
  color: var(--accent-content);
}

.nft-filter-options button.selected span {
  visibility: visible;
}

.nft-filter-options button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nft-market-select {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--white);
  font: inherit;
  font-size: 12px;
}

.nft-market-actions,
.gift-panel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nft-market-actions {
  grid-template-columns: 1fr 1fr;
}

.nft-market-actions [data-market-wallet] {
  grid-column: 1 / -1;
}

.gift-panel-actions {
  grid-template-columns: 1fr;
}

.nft-market-auth-status {
  color: var(--gray);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.nft-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--nft-card-size, 156px), var(--nft-card-size, 156px)));
  gap: 10px;
  justify-content: center;
}

.nft-market-grid.telegram-market-grid {
  grid-template-columns: repeat(auto-fill, minmax(var(--nft-card-size, 156px), var(--nft-card-size, 156px)));
  align-items: start;
}

.nft-market-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nft-market-card-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-content);
  font-size: 18px;
}

.nft-market-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nft-market-owner {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  max-width: calc(100% - 12px);
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  color: #fff;
  backdrop-filter: blur(10px);
}

.nft-market-owner-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: #24212b;
  color: var(--accent-content);
  font-size: 10px;
}

.nft-market-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nft-market-owner-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.nft-market-owner-copy strong,
.nft-market-owner-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nft-market-owner-copy strong {
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}

.nft-market-owner-copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
}

.nft-market-card .nft-market-owner-copy strong {
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}

.nft-market-card .nft-market-owner-copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
}

.telegram-market-card {
  gap: 8px;
  padding: 8px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #15141a;
}

.telegram-market-card-owner {
  display: block;
  min-height: 34px;
}

.telegram-market-card-owner .nft-market-owner {
  position: static;
  max-width: 100%;
  background: transparent;
  padding: 0;
  backdrop-filter: none;
}

.telegram-market-owner-placeholder {
  display: inline-grid;
  align-items: center;
  min-height: 28px;
  color: var(--gray);
  font-size: 11px;
}

.telegram-market-art {
  isolation: isolate;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 42%, var(--gift-center, #6c3bb0), var(--gift-edge, #17131e) 76%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.telegram-market-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0.36;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, var(--gift-pattern, rgba(255,255,255,.18)) 0 6%, transparent 7%),
    radial-gradient(circle at 70% 34%, var(--gift-pattern, rgba(255,255,255,.18)) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 76%, var(--gift-pattern, rgba(255,255,255,.18)) 0 6%, transparent 7%);
  background-size: 54px 54px;
}

.telegram-market-art img,
.telegram-market-fallback {
  position: relative;
  z-index: 1;
}

.telegram-market-art img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.32));
}

.telegram-market-fallback {
  color: var(--accent-content);
  font-size: 46px;
  line-height: 1;
}

.telegram-market-card-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.telegram-market-card-title strong {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.telegram-market-card-title small {
  color: var(--gray);
  font-size: 10px;
}

.telegram-market-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.telegram-market-attrs i {
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--gray);
  font-size: 9px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-market-price {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-content) 28%, transparent);
  color: var(--accent-content);
  font-size: 12px;
  font-weight: 600;
}

.nft-market-card strong,
.nft-market-card small,
.nft-market-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nft-market-card strong {
  font-size: 12px;
}

.nft-market-card small {
  color: var(--gray);
  font-size: 10px;
}

.nft-market-card em {
  color: var(--accent-content);
  font-style: normal;
  font-size: 11px;
}

.nft-market-empty {
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--gray);
  text-align: center;
}

.nft-market-empty.loading {
  border: 0;
  background: transparent;
}

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

.gift-panel-item {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 112px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.gift-panel-item span {
  font-size: 30px;
}

.gift-panel-item small {
  color: var(--accent-content);
}

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

.regular-star-gift {
  min-height: 142px;
  padding: 10px;
  align-content: center;
}

.regular-star-gift:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.regular-star-gift strong {
  max-width: 100%;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.gift-panel-regular-art {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
}

.gift-panel-regular-art img,
.gift-panel-regular-art video,
.gift-panel-regular-art .gift-lottie-model {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.gift-panel-subscription-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.gift-panel-nft-tile {
  grid-template-rows: minmax(0, 1fr) auto auto;
  aspect-ratio: auto;
  min-height: 168px;
  cursor: default;
}

.gift-panel-nft-tile .gift-label {
  position: static;
  margin-top: 4px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.gift-panel-transfer {
  display: block;
  width: calc(100% - 12px);
  margin: 6px auto 8px;
  min-height: 30px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.gift-panel-transfer:hover,
.gift-panel-transfer:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.gift-panel-transfer:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gift-panel-empty {
  padding: 18px 8px;
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.gift-panel-empty.loading {
  opacity: 0.8;
}

.gift-panel-hint {
  margin: 0;
  padding: 0 4px;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.gift-panel-content {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.gift-send-modal {
  z-index: 2200;
}

.gift-send-panel {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--panel);
  color: var(--white);
  box-shadow: var(--floating-shadow);
}

.gift-send-panel h3 {
  margin: 0;
  padding-right: 30px;
  font-size: 18px;
  line-height: 1.25;
}

.gift-caption-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font: inherit;
  resize: vertical;
}

.gift-toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--accent-content);
  font-size: 13px;
}

.gift-payment-box {
  display: grid;
  gap: 10px;
}

.extensions-billing-panel {
  position: absolute;
  top: 50px;
  right: 12px;
  bottom: 14px;
  z-index: 12;
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(280px, calc(100% - 24px));
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  background: rgba(12, 11, 16, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.subscriptions-body {
  position: static;
  inset: auto;
  z-index: auto;
  width: auto;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.subscriptions-body .extensions-billing-head {
  grid-template-columns: minmax(0, 1fr);
}

.subscriptions-body .extensions-billing-offers {
  grid-template-columns: 1fr;
}

.extensions-billing-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px 10px;
  align-items: center;
}

.extensions-billing-head strong {
  color: var(--white);
  font-size: 17px;
}

.extensions-billing-head small {
  grid-column: 1;
  color: var(--gray);
  font-size: 11px;
}

.extensions-billing-head button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}

.extensions-billing-offers,
.extensions-wallets,
.extensions-payment-actions {
  display: grid;
  gap: 8px;
}

.extensions-billing-offers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.extensions-plan-card,
.extensions-wallets button,
.extensions-payment-actions button,
.billing-currencies button,
.billing-pay-button {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.extensions-plan-card.active,
.extensions-wallets button.active,
.billing-currencies button.active {
  border-color: var(--accent-line);
  color: var(--accent-content);
}

.extensions-plan-card span,
.extensions-plan-card small,
.extensions-billing-label,
.extensions-billing-note {
  color: var(--gray);
  font-size: 11px;
}

.extensions-plan-card strong {
  font-size: 15px;
}

.extensions-plan-prices {
  display: grid;
  gap: 3px;
  color: var(--gray);
  font-size: 11px;
}

.extensions-plan-prices b {
  color: var(--white);
  font-weight: 500;
}

.extensions-plan-features {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.billing-back-button {
  justify-self: start;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.billing-plan-detail {
  display: grid;
  gap: 10px;
}

.billing-plan-detail-card {
  cursor: default;
}

.billing-checkout {
  display: grid;
  gap: 12px;
}

.billing-checkout[hidden] {
  display: none;
}

.billing-payment-method-label {
  color: var(--gray);
  font-size: 11px;
}

.billing-payment-method-button {
  flex: 1 1 0;
}

.billing-payment-method-button.active {
  color: var(--white);
}

.billing-periods {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.billing-periods::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: calc(3px + var(--billing-period-index, 0) * ((100% - 6px) / 4));
  width: calc((100% - 6px) / 4);
  border: 1px solid var(--accent-line);
  border-radius: 15px;
  transition: left 180ms ease;
}

.billing-period-button {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
}

.billing-period-button small {
  color: var(--gray);
  font-size: 10px;
}

.billing-period-button.active,
.billing-period-button.active strong,
.billing-period-button.active small {
  color: var(--accent-content);
}

.billing-add-wallet-button {
  min-height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-content);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: center;
}

.billing-amount-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.billing-amount-box span,
.billing-amount-box small {
  color: var(--gray);
  font-size: 11px;
}

.billing-amount-box strong {
  color: var(--white);
  font-size: 18px;
  font-weight: 500;
}

.billing-currency-select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--accent-content);
  font: inherit;
  font-size: 12px;
}

.billing-stars-checkout {
  display: grid;
  gap: 12px;
}

.billing-stars-summary,
.billing-stars-invoice {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.billing-stars-summary strong {
  color: var(--accent-content);
  font-size: 18px;
  font-weight: 500;
}

.billing-stars-summary small,
.billing-stars-invoice small,
.billing-stars-invoice > span {
  color: var(--gray);
  font-size: 11px;
}

.billing-stars-groups {
  margin: 0;
  padding: 0;
  border: 0;
}

.billing-stars-account-list {
  display: grid;
  gap: 8px;
}

.billing-stars-empty {
  padding: 16px;
  color: var(--gray);
  text-align: center;
  font-size: 12px;
}

.billing-stars-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(124px, 0.62fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.billing-stars-account-row.selected {
  border-color: var(--accent-line);
}

.billing-stars-account {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.billing-stars-account .item-avatar {
  width: 38px;
  height: 38px;
}

.billing-stars-amount {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 6px;
  align-items: center;
}

.billing-stars-amount input {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--white);
  font: inherit;
  font-size: 12px;
}

.billing-stars-amount span {
  color: var(--gray);
  font-size: 11px;
  white-space: nowrap;
}

.billing-stars-amount button {
  grid-column: 1 / -1;
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.billing-stars-amount button:disabled,
.billing-stars-confirm:disabled {
  opacity: 0.45;
  cursor: default;
}

.billing-stars-invoice-controls {
  display: grid;
  grid-template-columns: minmax(118px, 0.82fr) minmax(0, 1fr);
  gap: 8px;
}

.billing-stars-invoice-controls select,
.billing-stars-invoice-controls input {
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--white);
  font: inherit;
  font-size: 12px;
}

.billing-stars-invoice-controls button {
  grid-column: 1 / -1;
  min-height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.billing-connected-wallet {
  display: grid;
  grid-template-columns: 28px minmax(0, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.billing-connected-wallet[hidden] {
  display: none;
}

.billing-connected-wallet strong,
.billing-connected-wallet code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-connected-wallet strong {
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
}

.billing-connected-wallet code {
  color: var(--gray);
  font-family: inherit;
  font-size: 11px;
}

.billing-connected-wallet button {
  border: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.billing-wallet-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
}

.billing-wallet-dialog {
  position: relative;
  width: min(520px, calc(100vw - 36px));
  max-height: min(76vh, 620px);
  overflow: auto;
  padding: 42px 18px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 22px;
  background: rgba(12, 11, 16, 0.82);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
}

.billing-wallet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

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

.billing-wallet-option {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 6px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  text-align: center;
}

.billing-wallet-option:hover {
  background: rgba(255, 255, 255, 0.075);
}

.billing-wallet-option-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045));
  color: var(--accent-content);
  font-size: 18px;
  font-weight: 600;
}

.billing-wallet-option-logo img,
.wallet-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.billing-currencies {
  display: grid;
  gap: 8px;
}

.extensions-wallets button {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
}

.wallet-logo {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-content);
}

.billing-autopay {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--gray);
  font-size: 12px;
}

.billing-autopay input {
  accent-color: var(--accent-content);
}

.billing-pay-button {
  place-items: center;
  min-height: 44px;
  border-color: var(--accent-line);
  color: var(--accent-content);
  text-align: center;
}

.extensions-billing-note {
  margin: 0;
  line-height: 1.45;
}

.extensions-resize-handle {
  position: absolute;
  z-index: 8;
  touch-action: none;
}

.extensions-resize-n,
.extensions-resize-s {
  right: 18px;
  left: 18px;
  height: 10px;
}

.extensions-resize-n {
  top: 0;
  cursor: ns-resize;
}

.extensions-resize-s {
  bottom: 0;
  cursor: ns-resize;
}

.extensions-resize-e,
.extensions-resize-w {
  top: 18px;
  bottom: 18px;
  width: 10px;
}

.extensions-resize-e {
  right: 0;
  cursor: ew-resize;
}

.extensions-resize-w {
  left: 0;
  cursor: ew-resize;
}

.extensions-resize-ne,
.extensions-resize-se,
.extensions-resize-sw,
.extensions-resize-nw {
  width: 18px;
  height: 18px;
}

.extensions-resize-ne {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.extensions-resize-se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.extensions-resize-sw {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.extensions-resize-nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.extensions-tabs {
  position: relative;
  display: flex;
  min-height: 46px;
  margin: 14px 16px 8px;
  padding: 4px;
  border-radius: 999px;
  background: #1c1b22;
}

.extensions-tabs::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 4px);
  border: 1px solid var(--accent-content);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-content) 24%, transparent);
  transform: translateX(calc(var(--extension-tab-index, 0) * 100%));
  transition: transform 240ms ease;
}

.extensions-tabs button {
  position: relative;
  z-index: 1;
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.extensions-tabs button.active {
  color: var(--white);
}

.extensions-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px 16px 20px;
}

.extensions-loading,
.extensions-empty {
  padding: 28px 8px;
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.extension-list {
  display: grid;
}

.extension-list-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.extension-list-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
}

.extension-list-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

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

.extension-list-copy strong {
  font-size: 13px;
}

.extension-list-copy small {
  color: var(--gray);
  font-size: 10px;
}

.extension-list-price {
  color: var(--pink);
  font-size: 12px;
  white-space: nowrap;
}

.extension-detail {
  display: grid;
  gap: 14px;
}

.extension-back {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.extension-detail h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
}

.extension-carousel {
  display: grid;
  gap: 9px;
  overflow: hidden;
  touch-action: pan-y;
}

.extension-carousel-viewport {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.extension-carousel-track {
  display: flex;
  gap: 12px;
  width: 100%;
  min-width: 0;
  transition: transform 420ms cubic-bezier(0.22, 0.75, 0.22, 1);
}

.extension-carousel-slide {
  flex: 0 0 min(82%, 320px);
  width: min(82%, 320px);
  min-width: 0;
  max-width: 320px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.extension-carousel-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.extension-carousel-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  min-height: 12px;
}

.extension-carousel-dot {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.extension-carousel-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray);
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, background 180ms ease;
}

.extension-carousel-dot.active::before {
  width: 10px;
  height: 10px;
  background: var(--pink);
}

.extension-purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.extension-install-button {
  min-height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
}

.extension-rating-block {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.extension-rating-line {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.extension-stars {
  position: relative;
  width: 78px;
  color: #34313a;
  letter-spacing: 1px;
  white-space: nowrap;
}

.extension-stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  color: #a864ed;
  white-space: nowrap;
}

.extension-users {
  color: var(--gray);
  font-size: 10px;
}

.extension-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.extension-app {
  display: grid;
  gap: 14px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.extension-app h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}

.extension-config-form,
.extension-group-form {
  display: grid;
  gap: 9px;
}

.extension-config-form input,
.extension-group-form input,
.extension-group-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--gray);
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 11px;
}

.extension-config-form button,
.extension-group-form button,
.extension-group-actions button {
  min-height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.extension-account-picker {
  display: grid;
  gap: 5px;
  max-height: 170px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.extension-account-picker label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 30px;
  font-size: 11px;
}

.extension-account-picker input {
  min-height: 0;
  accent-color: var(--pink);
}

.extension-groups {
  display: grid;
  gap: 8px;
}

.extension-group-item {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.extension-group-item small {
  color: var(--gray);
  font-size: 10px;
  line-height: 1.4;
}

.extension-group-actions {
  display: flex;
  gap: 7px;
}

.extension-group-actions button {
  flex: 1;
}

@keyframes press-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes presence-pulse {
  0%,
  100% {
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0);
  }
}

.forward-list {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.forward-head-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.forward-select-button,
.forward-done-button {
  min-width: 82px;
  height: 38px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.forward-head-actions .modal-close {
  position: static;
  flex: 0 0 38px;
}

.forward-done-button:disabled {
  color: var(--gray);
  cursor: default;
}

.forward-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-right: 150px;
}

.forward-head-copy h2 {
  margin: 0;
}

.forward-author-toggle {
  width: max-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-content);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-align: left;
}

.forward-author-toggle.active {
  color: var(--gray);
}

#forwardModal .settings-head:has(.forward-done-button:not([hidden])) .forward-head-copy {
  padding-right: 240px;
}

@media (max-width: 520px) {
  #forwardModal .settings-head {
    min-height: 104px;
  }

  #forwardModal .forward-head-copy,
  #forwardModal .settings-head:has(.forward-done-button:not([hidden])) .forward-head-copy {
    padding-right: 0;
  }

  #forwardModal .forward-head-actions {
    left: 18px;
    top: 58px;
    justify-content: flex-end;
  }

  #forwardModal .forward-select-button,
  #forwardModal .forward-done-button {
    min-width: 74px;
    padding-inline: 12px;
  }
}

.forward-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  color: var(--white);
  text-align: left;
}

.forward-item.selection-mode {
  grid-template-columns: 20px 44px minmax(0, 1fr);
}

.forward-item.selected {
  border-color: var(--accent-line);
  background: #29282e;
}

.forward-item-check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-content);
  pointer-events: none;
}

.forward-item-copy {
  min-width: 0;
}

.forward-item .item-avatar {
  width: 42px;
  height: 42px;
}

.forward-item strong,
.forward-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

.forward-item strong.premium-name {
  display: inline-flex;
}

.profile-item small {
  color: var(--gray);
}

@media (max-width: 900px) {
  * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .message-text,
  .message-text *,
  .profile-body,
  .profile-body *,
  .profile-tab-content,
  .profile-tab-content * {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }

  body {
    overflow: hidden;
  }

  .extensions-modal {
    padding: 0;
  }

  .extensions-panel {
    inset: 0 !important;
    width: 100vw;
    height: 100dvh;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    transform: none !important;
  }

  .telegram-mini-app .extensions-panel {
    top: var(--tg-mini-top-offset) !important;
    height: calc(var(--tg-viewport-height) - var(--tg-mini-top-offset));
    padding-bottom: var(--tg-mini-bottom-offset);
  }

  .extensions-head {
    cursor: default;
  }

  .extensions-window-controls {
    display: none;
  }

  .extensions-billing-toggle {
    right: 58px;
  }

  .extensions-billing-panel {
    inset: 52px 10px 10px;
    width: auto;
    border-radius: 18px;
  }

  .subscriptions-body {
    position: static;
    inset: auto;
    width: auto;
    border: 0;
    border-radius: 0;
  }

  .extensions-close {
    display: grid;
  }

  .extensions-resize-handle {
    display: none;
  }

  .telegram-mini-app .telegram-shell {
    height: calc(var(--tg-viewport-height) - var(--tg-mini-top-offset));
    min-height: calc(var(--tg-viewport-height) - var(--tg-mini-top-offset));
    margin-top: var(--tg-mini-top-offset);
  }

  .telegram-mini-app .sidebar,
  .telegram-mini-app .workspace {
    height: calc(var(--tg-viewport-height) - var(--tg-mini-top-offset));
    min-height: 0;
  }

  .telegram-mini-app .sidebar {
    grid-template-rows: auto minmax(0, 1fr) calc(58px + var(--tg-mini-bottom-offset));
  }

  .telegram-mini-app.app-locked .sidebar,
  .telegram-mini-app.no-telegram-session .sidebar {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .telegram-mini-app .sidebar-head {
    padding-top: 16px;
  }

  .telegram-mini-app .chat-head {
    padding-top: 12px;
  }

  .telegram-mini-app .story-strip {
    margin-top: 0;
  }

  .telegram-mini-app .bottom-nav {
    align-items: center;
    padding-bottom: var(--tg-mini-bottom-offset);
  }

  .telegram-mini-app .chat-form {
    padding-bottom: calc(8px + var(--tg-mini-bottom-offset));
  }

  .telegram-mini-app .scroll-bottom {
    bottom: calc(82px + var(--tg-mini-bottom-offset));
  }

  .telegram-mini-app .channel-message-button {
    bottom: calc(8px + var(--tg-mini-bottom-offset));
  }

  .telegram-mini-app .modal {
    padding-top: calc(24px + var(--tg-mini-top-offset));
    padding-bottom: calc(24px + var(--tg-mini-bottom-offset));
  }

  .telegram-mini-app .media-viewer-modal {
    padding-top: var(--tg-mini-top-offset);
    padding-bottom: var(--tg-mini-bottom-offset);
  }

  .telegram-mini-app .media-viewer-modal .modal-close {
    top: calc(16px + var(--tg-mini-top-offset));
  }

  .telegram-mini-app .search-popup {
    padding-top: calc(96px + var(--tg-mini-top-offset));
    padding-bottom: calc(18px + var(--tg-mini-bottom-offset));
  }

  .telegram-shell {
    grid-template-columns: 1fr;
    height: var(--browser-viewport-height);
    min-height: var(--browser-viewport-height);
  }

  .sidebar {
    grid-template-rows: auto minmax(0, 1fr) calc(58px + var(--browser-safe-bottom));
    height: var(--browser-viewport-height);
    min-height: 0;
    border-right: 0;
  }

  .sidebar-resize-handle {
    display: none;
  }

  body.sidebar-compact .bottom-nav {
    display: grid;
  }

  body.sidebar-compact .sidebar {
    grid-template-rows: auto minmax(0, 1fr) calc(58px + var(--browser-safe-bottom));
  }

  body.sidebar-compact .sidebar-head,
  body.sidebar-compact .sidebar-title-row,
  body.sidebar-compact .search-box,
  body.sidebar-compact .sidebar-list .item-meta,
  body.sidebar-compact .sidebar-list .item-time,
  body.sidebar-compact .sidebar-list .list-item > .item-unread,
  body.sidebar-compact .sidebar-list .list-item > .item-unread-group {
    display: revert;
  }

  body.sidebar-compact .sidebar-list .item-unread-avatar {
    display: none;
  }

  body.sidebar-compact .sidebar-list > .list-item,
  body.sidebar-compact .pinned-chats-group .list-item {
    grid-template-columns: var(--chat-avatar-size) minmax(0, 1fr);
    justify-items: stretch;
    min-height: 66px;
    height: 66px;
    padding-block: 0;
  }

  body.sidebar-compact .account-row-settings,
  body.sidebar-compact .account-groups,
  body.sidebar-compact .calls-tabs,
  body.sidebar-compact .add-account-button,
  body.sidebar-compact .empty-list {
    display: revert;
  }

  .workspace {
    display: none;
    height: var(--browser-viewport-height);
    min-height: 0;
  }

  .bottom-nav {
    align-items: center;
    padding-bottom: var(--browser-safe-bottom);
  }

  .scroll-bottom {
    bottom: calc(82px + var(--browser-safe-bottom));
  }

  .channel-message-button {
    bottom: calc(8px + var(--browser-safe-bottom));
  }

  .chat-form {
    padding-bottom: calc(8px + var(--browser-safe-bottom));
  }

  body.chat-open .sidebar {
    display: none;
  }

  body.chat-open .workspace {
    display: grid;
  }

  body.chat-open .chat-head {
    grid-template-columns: 38px 46px minmax(0, 1fr) auto;
  }

  body.chat-open .chat-back-button {
    display: grid;
  }

  .chat-form {
    padding: 0 8px 8px;
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .workspace:has(.channel-message-button:not([hidden])) .chat-form {
    padding-left: 56px;
  }

  .chat-form:has(.mini-app-button:not([hidden])) {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .profile-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .app-locked .sidebar-head,
  .no-telegram-session .sidebar-head,
  .app-locked .sidebar-list,
  .no-telegram-session .sidebar-list {
    width: min(100vw - 20px, 680px);
  }

  .app-locked .telegram-shell,
  .no-telegram-session .telegram-shell {
    height: auto;
    min-height: var(--browser-viewport-height);
    overflow: visible;
  }

  .app-locked .sidebar,
  .no-telegram-session .sidebar {
    grid-template-rows: auto auto;
    height: auto;
    min-height: var(--browser-viewport-height);
    overflow: visible;
    padding-bottom: calc(24px + var(--browser-safe-bottom));
  }

  .app-locked .sidebar-list,
  .no-telegram-session .sidebar-list {
    overflow: visible;
    padding-bottom: calc(28px + var(--browser-safe-bottom));
  }

  .auth-screen {
    min-height: auto;
    align-content: start;
    gap: clamp(8px, 2.5vw, 14px);
    padding: 8px 0 20px;
  }

  .auth-screen-brand {
    position: relative;
    top: auto;
    left: -5px;
    gap: 0;
    width: calc(100% - 5px);
    max-width: calc(100% - 5px);
    margin-bottom: clamp(12px, 4vw, 22px);
  }

  .auth-screen-logo {
    flex: 0 0 auto;
    width: clamp(150px, 52vw, 209px);
    height: clamp(150px, 52vw, 209px);
    margin-right: -30px;
    transform: translateY(8%);
  }

  .auth-screen-brand-title {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 0;
    max-width: calc(100% - clamp(150px, 52vw, 209px) + 30px);
    overflow: hidden;
    font-size: min(38px, calc((100vw - 5px - clamp(150px, 52vw, 209px) + 30px) / 6));
    white-space: nowrap;
  }

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

  .auth-card {
    min-height: 0;
    border-radius: 26px;
  }

  .auth-hero h2 {
    font-size: 28px;
  }
}

.video-note-player {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.video-note-player-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-note-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg);
}

.video-note-ring-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.12);
  stroke-width: 3;
}

.video-note-ring-progress {
  fill: none;
  stroke: var(--black);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear;
}

.video-note-player-shell.unplayed .video-note-ring-progress {
  stroke-dashoffset: 125.66;
}

.video-note-media-wrap {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--black);
}

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

.video-note-time {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}

.message.video-note-message {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.message.video-note-message.visual-media-only .message-meta {
  right: 8px;
  bottom: 8px;
}

.message.video-note-message .video-note-player {
  margin: 0;
}

.attachment-thumb.video-note-thumb {
  border-radius: 50%;
}

.attachment-thumb.video-note-thumb video {
  object-fit: cover;
}

.attachment-meta small.video-note-badge {
  color: var(--accent-content);
}

.video-note-editor-modal .video-note-editor-panel {
  width: min(420px, calc(100vw - 24px));
}

.video-note-editor-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.video-note-editor-viewport {
  position: relative;
  width: min(320px, calc(100vw - 72px));
  height: min(320px, calc(100vw - 72px));
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  touch-action: none;
}

.video-note-editor-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.video-note-editor-stage video {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  pointer-events: none;
}

.video-note-editor-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.video-note-editor-zoom {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.video-note-editor-zoom input[type="range"] {
  width: 100%;
}

.video-note-editor-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.video-note-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.video-note-editor-actions .primary {
  background: var(--accent-content);
  color: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.video-note-editor-actions button:not(.primary) {
  background: transparent;
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.viewer-media-wrap.viewer-video-note-wrap {
  width: min(360px, 86vw);
  height: min(360px, 86vw);
  border-radius: 50%;
  overflow: hidden;
}

.viewer-media-wrap.viewer-video-note-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
