* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }

.tg-mini-only {
  display: none !important;
}
.tg-mini-only[hidden] {
  display: none !important;
}
html[data-tg-mini-app="1"] .tg-mini-only:not([hidden]) {
  display: flex !important;
}
html[data-tg-mini-app="1"] .earn-ref-block.tg-mini-only:not([hidden]) {
  display: block !important;
}

/* ── Dynamic top safe-area (см. static/safe-area.js) ──────────────────────────
   Защитный отступ сверху подстраивается под окружение:
   - Mini App (Telegram/MAX): динамический инсет платформы, иначе дефолт 95px
   - Веб/PWA: уменьшается до ~10px
   Значения проставляет safe-area.js на <html>. Фолбэки ниже = текущее
   поведение в мини-аппе, если JS не отработал (старый клиент). */
:root {
  --st-logo: 54px;   /* лого/заголовок хедера (между управляющими элементами) */
  --st-btn: 95px;    /* кнопки назад/меню, шапки, верх контента */
  --st-head: 90px;   /* высота шапок-спейсеров (gen-header, pub-sheet) */
  --st-newchat: 100px; /* шапка экрана «новое сообщение» */
  --device-safe-top: env(safe-area-inset-top, 0px);
  --full-panel-safe-top: calc(var(--device-safe-top, env(safe-area-inset-top, 0px)) + var(--topbar-safe-h, 0px));
  --app-safe-btn-top: calc(var(--device-safe-top, env(safe-area-inset-top, 0px)) + var(--st-btn, 95px));
  --app-safe-head-top: calc(var(--device-safe-top, env(safe-area-inset-top, 0px)) + var(--st-head, 90px));
  --app-safe-padding-top: var(--device-safe-top, env(safe-area-inset-top, 0px));
  --bottom-nav-safe-bottom: env(safe-area-inset-bottom, 0px);
  --android-bottom-safe: 0px;
  --android-nav-extra-bottom: 0px;
  --app-bottom-safe-area: 0px;
  --ios-pwa-status-offset: 0px;
  --keyboard-height: 0px;
}

html[data-env="tg"] {
  --full-panel-safe-top: var(--topbar-safe-h, 0px);
  --app-safe-btn-top: var(--st-btn, 95px);
  --app-safe-head-top: var(--st-head, 90px);
  --app-safe-padding-top: 0px;
  --bottom-nav-safe-bottom: 0px;
  --app-bottom-safe-area: 0px;
}

html[data-android="1"] {
  --android-nav-extra-bottom: max(env(safe-area-inset-bottom, 0px), var(--android-bottom-safe, 24px));
  --bottom-nav-safe-bottom: var(--android-nav-extra-bottom);
}

html[data-android="1"][data-env="tg"],
html[data-android="1"][data-env="web"] {
  --app-bottom-safe-area: 40px;
  --android-bottom-safe: 40px;
  --android-nav-extra-bottom: 40px;
  --bottom-nav-safe-bottom: var(--android-nav-extra-bottom);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: #111;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.ios-pwa-edge,
html.ios-pwa-edge body {
  height: 100vh;
  min-height: 100vh;
}


/* ── Desktop: phone-sized window ── */
@media (min-width: 600px) {
  html {
    height: 100%;
    background: #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  body {
    width: 390px;
    height: 844px;
    max-height: 100vh;
    border-radius: 40px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.08);
    overflow: hidden;
    flex-shrink: 0;
    transform: translateZ(0);
  }
}

/* ── Topbar wrapper: animated hide-on-scroll ── */
.topbar-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  will-change: transform;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-wrap.tb-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

/* ── TG/MAX safe-area spacer above the topbar ── */
/* Height = --topbar-safe-h, set by safe-area.js:
   mini-app → real TG inset (px), web → 0.
   overflow:hidden collapses the block when height is 0. */
.topbar-safe {
  display: block;
  background: #fff;
  height: var(--topbar-safe-h, 0px);
  overflow: hidden;
}
html.ios-pwa-edge .topbar-safe {
  height: var(--device-safe-top, env(safe-area-inset-top, 0px));
  background: #fff;
}
html.ios-pwa-edge {
  --ios-pwa-status-offset: env(safe-area-inset-top, 0px);
}
html.ios-pwa-edge :is(
  #owngen-wrap,
  .ps-wrap,
  #pc-wrap,
  #dialogs-panel,
  .pin-notif-overlay,
  #msg-new-chat-panel,
  #tab-search .search-wrap,
  #tab-profile .profile-wrap,
  .pub-sheet,
  .pp-overlay,
  .flw-panel,
  .ct-modal-wrap,
  .pi-crop-overlay,
  .ch-crop-overlay,
  .av-overlay,
  .cp-media-viewer,
  .earn-stats-modal-wrap,
  .help-panel,
  .topup-modal-wrap
) {
  top: var(--ios-pwa-status-offset);
  --device-safe-top: 0px;
}
html.ios-pwa-edge body.profile-editing > #pi-edit {
  top: var(--ios-pwa-status-offset);
  --device-safe-top: 0px;
}

/* ── Top bar — Pinterest style ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 55px;
  padding: 0 10px 6px 10px;
  background: #fff;
  border-bottom: 0px solid #efefef;
}

.logo img {
  height: 45px;
  width: auto;
  display: block;
}

/* ── Topbar right-side actions ── */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 7px;
}

.topbar-add-wrap {
  position: relative;
}

.topbar-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: #2f2f2f;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.topbar-add-btn svg {
  width: 30px;
  height: 30px;
}

.topbar-add-btn:active {
  opacity: 0.5;
}

/* Scale down msg-header-bell buttons inside topbar-actions only */
.topbar-actions .msg-header-bell {
  padding: 7px;
}

.topbar-actions .msg-header-bell svg {
  width: 23px;
  height: 23px;
}

/* Context menu that drops from the "+" topbar button */
.topbar-add-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  overflow: hidden;
  z-index: 12;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.92) translateY(-6px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

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

/* ── Filter button (воронка) + dropdown menu ────────────────────────────── */
.topbar-filter-wrap {
  position: relative;
}

.topbar-filter-btn {
  position: relative;
}

.topbar-filter-btn.is-active {
  color: var(--accent, #9b59b6);
}

.topbar-filter-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #9b59b6);
  border: 1.5px solid #fff;
  pointer-events: none;
}

.topbar-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 178px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  overflow: hidden;
  z-index: 12;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.92) translateY(-6px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

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

.topbar-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.topbar-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.topbar-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 400;
  color: #1c1c1e;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.topbar-filter-item:active {
  background: rgba(0, 0, 0, 0.06);
}

.topbar-filter-item.is-active {
  font-weight: 600;
  color: var(--accent, #9b59b6);
}

.topbar-filter-item .tf-check {
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0;
  color: var(--accent, #9b59b6);
}

.topbar-filter-item.is-active .tf-check {
  opacity: 1;
}

/* Disabled sheet button (e.g. «Создать видео» — coming soon) */
.sheet-btn--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── «Своя генерация» — full-screen create-photo wrap ── */
#owngen-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--bnav-h, 68px);
  z-index: 551;
  background: #fff;
  display: flex;
  flex-direction: column;
  /* roll fully past the viewport (+ bottom-nav height) so no strip remains */
  transform: translateY(calc(100% + var(--bnav-h, 68px)));
  /* hard cutoff when closed, delayed until the slide-out finishes */
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.38s;
  will-change: transform;
}

#owngen-wrap.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}
#owngen-wrap.owngen-wrap--tab-hidden {
  display: none !important;
}

#owngen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: var(--app-safe-head-top) 16px calc(env(safe-area-inset-bottom, 0px) + 80px);
}

/* Model chips container: pull 6px on each side so effective gap from screen = 10px */
#owngen-models {
  margin-left: 0px;
  margin-right: 0px;
  width: calc(100% + 0px);
}

#owngen-body::-webkit-scrollbar {
  display: none;
}

#owngen-prompt {
  min-height: 100px;
  height: 100px;
}

/* ── Own-gen disabled model chip ── */
.ps-chip--disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* ── Own-gen result overlay ── */
#owngen-result {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 2;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
#owngen-result::-webkit-scrollbar { display: none; }

.owngen-result-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.owngen-result-state {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.owngen-result-spinner-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 60px 16px;
}

.owngen-spinner-icon {
  width: 48px;
  height: 48px;
  color: #111;
  animation: owngen-spin 0.9s linear infinite;
}
.owngen-spinner-icon svg {
  width: 100%;
  height: 100%;
}

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

.owngen-result-hint {
  font-size: 14px;
  color: #777;
  text-align: center;
  margin: 0;
}

.owngen-result-more-wrap {
  position: absolute;
  top: var(--app-safe-btn-top);
  right: 10px;
  z-index: 5;
}

#owngen-result.owngen-result-menu-open .owngen-result-inner {
  filter: blur(6px);
}

#owngen-result .owngen-result-inner {
  transition: filter 0.18s ease;
}

.owngen-done-photo-wrap {
  flex-shrink: 0;
  margin-top: var(--app-safe-head-top);
  padding: 0 5px;
  position: relative;
}

.owngen-img-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #1a1a1a;
}

.owngen-result-photo {
  width: 100%;
  display: block;
  object-fit: contain;
}

.owngen-hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.owngen-hint-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,.13);
  background: #f5f5f5;
  color: #333;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.owngen-hint-chip:active {
  background: #e8e8e8;
}
.owngen-hint-chip--clear {
  color: #888;
  border-color: rgba(0,0,0,.09);
}
.owngen-hint-chip--clear:active {
  background: #f0f0f0;
}
@media (prefers-color-scheme: dark) {
  .owngen-hint-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #e8e8e8; }
  .owngen-hint-chip:active { background: rgba(255,255,255,.14); }
  .owngen-hint-chip--clear { color: #888; }
}

.owngen-result-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 14px 16px 10px;
}

.owngen-result-actions--video {
  flex-direction: column;
}

.owngen-result-actions--video .gen-result-action-btn {
  width: 100%;
  flex: none;
}

.owngen-result-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
}

.owngen-result-prompt {
  font-size: 13px;
  color: #444;
  line-height: 1.45;
  text-align: center;
  word-break: break-word;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.gen-result-meta-prompt {
  font-size: 13px;
  color: #555;
  line-height: 1.45;
  text-align: center;
  word-break: break-word;
  margin: 0;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.owngen-result-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #999;
}

.owngen-meta-sep {
  opacity: 0.4;
}

.owngen-error-text {
  font-size: 14px;
  color: #c00;
  text-align: center;
  padding: 0 16px;
  line-height: 1.5;
  margin: 0;
}

.owngen-delete-overlay {
  z-index: 2300;
}

/* Bell in topbar — override messages.css position:relative via higher specificity */
.topbar .topbar-bell {
  position: relative;
  filter: none;
  color: #2f2f2f;
}

/* ── Auth banner ── */
.auth-banner {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  padding: 8px 14px;
  font-size: 12px;
  color: #795548;
  text-align: center;
  flex-shrink: 0;
}

/* ── Feed ── */
.feed {
  flex: 1;
  overflow-y: auto;
  padding: 5px;
  /* Top padding reserves space for the absolute-positioned topbar-wrap */
  padding-top: calc(52px + var(--topbar-safe-h, 0px) + 5px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

html.ios-pwa-edge #tab-home .feed {
  padding-top: calc(52px + var(--topbar-safe-h, 0px) + var(--ios-pwa-status-offset, 0px) + 5px);
}

.feed::-webkit-scrollbar { display: none; }

.masonry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  align-items: start;
  gap: 5px;
}

.masonry-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pin {
  border-radius: 18px;
  overflow: hidden;
  background: #e8e8e8;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
  /* Suppress iOS native image callout / context menu on long-press */
  -webkit-touch-callout: none;
}
.pin img, .pin video {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.pin:active {
  transform: none;
}

.pin--promo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 5px solid;
  border-color: #c9a227 #f5d060 #b8860b #e8c04a;
  border-radius: 18px;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 0 1px rgba(255,220,80,.20);
}

.pin-free-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5a3a00;
  background: linear-gradient(135deg, #f5d060 0%, #c9a227 100%);
  padding: 2px 8px 3px;
  border-radius: 7px;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255,255,180,.4);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

.pin-vid-len-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 5;
  font-size: 10px;
  font-weight: 600;
  color: #5a5ff5;
  background: rgba(238, 239, 254, 0.92);
  padding: 2px 7px 3px;
  border-radius: 7px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
#mine-masonry .pin-vid-len-badge {
  bottom: 26px;
  right: 10px;
}

/* ── Skeleton shimmer ── */
@keyframes sk-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.pin--loading {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.28) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.video-wrap--loading {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.28) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.pc-slot--loading {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.28) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.pc-sim-skeleton {
  border-radius: 14px;
  background-color: #e8e8e8;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

/* Text-area shimmer skeleton (author name, comment placeholder) */
.pc-text-skel {
  border-radius: 6px;
  color: transparent !important;
  background-color: #e8e8e8;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
  min-height: 1em;
  pointer-events: none;
  user-select: none;
}

/* ── Swipe image fade-in (async load) ── */
@keyframes pc-img-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.pc-img--fadein {
  animation: pc-img-fadein 0.2s ease forwards;
}

/* ── High-res crossfade overlay — fades in OVER the thumbnail ── */
#pc-img-hi {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* ── Blur-up / LQIP — card open from feed ── */
.pc-img--blurred {
  filter: blur(10px);
  transform: scale(1.06);
  transition: filter 0.35s ease, transform 0.35s ease;
}

.pc-price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5;
}

.pc-price--video {
  bottom: auto;
  top: 12px;
}

.pin-premium-star {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  font-size: 30px;
  line-height: 1;
  color: #f5d060;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 6px rgba(200,140,0,.4);
  filter: drop-shadow(0 0 2px rgba(180,120,0,.5));
}

.pc-price--free {
  color: #5a3a00;
  background: linear-gradient(135deg, #f5d060 0%, #c9a227 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-weight: 700;
  letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(255,255,180,.4);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

/* Photo dots switcher inside prompt card */
.pc-img-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 6;
  pointer-events: auto;
}

.pc-img-dots.hidden {
  display: none;
}

.pc-img-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.pc-img-dot.active {
  background: #fff;
  transform: scale(1.25);
}

.pin img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

/* ── Video pin ── */
.video-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
}

.video-poster,
.video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  transition: opacity 0.3s ease;
}

.video-poster {
  z-index: 2;
}

.video-preview {
  z-index: 1;
}

.video-icon {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Spacer so .video-wrap takes correct height via aspect-ratio */
.video-wrap::before {
  content: "";
  display: block;
  width: 100%;
  padding-top: 0;
}

/* ── Overlay ── */
.sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 610;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sheet-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Bottom sheet ── */
.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(50px + env(safe-area-inset-bottom, 0px));
  z-index: 620;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.3s;
  will-change: transform;
}

.sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

.sheet-header {
  display: flex;
  align-items: center;
  padding: 10px 0 18px;
  position: relative;
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-close svg {
  width: 18px;
  height: 18px;
  color: #111;
}

.sheet-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-right: 36px; /* balance the close button */
}

.sheet-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding-top: 4px;
}

.sheet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #111;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.sheet-btn-icon {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.sheet-btn:active .sheet-btn-icon {
  background: #e0e0e0;
}

.sheet-btn-icon svg {
  width: 36px;
  height: 36px;
  color: #111;
}

/* ── Photo prompt full-screen sheet ── */
.ps-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--nav-height, 73px);
  background: #fff;
  z-index: 550;
  display: flex;
  flex-direction: column;
  /* translateY(100%) — это высота элемента (viewport − nav-height); чтобы шторку
     полностью убрать за нижнюю границу viewport, докатываем её ещё на nav-height. */
  transform: translateY(calc(100% + var(--nav-height, 73px)));
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
}

.ps-wrap.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

.ps-header {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  height: 100px;
  padding: 67px 16px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

/* Web/PWA: компактная шапка окна создания фото/видео промта (в Telegram/MAX без изменений) */
html[data-env="web"] .ps-header {
  height: 70px;
  padding: 30px 16px 12px;
}

.ps-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
}

.ps-back-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

/* Кнопка «назад» — фиксированный отступ сверху и стиль как у .pc-back-btn в карточке пина */
.ps-back {
  position: absolute;
  top: var(--app-safe-btn-top);
  left: 10px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.ps-back svg {
  width: 35px;
  height: 35px;
  stroke: #000000;
  stroke-width: 1.5;
  transform: translateX(-2px);
}

.ps-back:active {
  background: rgba(255, 255, 255, 0.90);
}

.ps-back-title {
  font-size: 14px;
  font-weight: 400;
  color: #888;
}

.ps-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 0;
  -webkit-overflow-scrolling: touch;
}

/* Upload zone */
.ps-upload {
  width: 100%;
  height: 100px;
  border-radius: 18px;
  border: 2px dashed #ddd;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}

.ps-upload:active {
  border-color: #bbb;
}

.ps-upload svg {
  width: 40px;
  height: 40px;
  color: #bbb;
}

.ps-upload span {
  font-size: 14px;
  color: #aaa;
  font-weight: 500;
}

.ps-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.ps-upload-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.ps-upload-clear.visible {
  display: flex;
}

.ps-upload-clear svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
}

.ps-upload-clear:active {
  background: rgba(0,0,0,0.75);
}

/* Photo chips (единая зона загрузки) */
.ps-photo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 0;
}
.ps-photo-chip {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: visible;
  flex-shrink: 0;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.ps-photo-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  pointer-events: none;
}
.ps-photo-chip .ps-chip-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  padding: 0;
}
.ps-photo-chip .ps-chip-del svg {
  width: 11px;
  height: 11px;
  stroke: #555;
  stroke-width: 2.5;
}
/* Ghost chip — следует за курсором/пальцем */
.ps-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 14px 36px rgba(0,0,0,.30), 0 4px 12px rgba(0,0,0,.18);
  will-change: transform;
  cursor: grabbing;
}
.ps-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  pointer-events: none;
}
/* Placeholder — пунктирный слот, раздвигает соседей */
.ps-drag-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px dashed #e60023;
  background: rgba(230,0,35,.07);
  flex-shrink: 0;
  box-sizing: border-box;
}
.ps-upload.ps-upload-full {
  opacity: 0.45;
  pointer-events: none;
}

/* Sections */
.ps-section {
  margin-bottom: 10px;
}

.ps-label {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.ps-label-hint {
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #bbb;
}

/* Model chips */
.ps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ps-chip {
  flex: 0 0 calc((100% - 16px) / 3);
  padding: 7px 6px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-chip.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.ps-textarea {
  width: 100%;
  height: 80px;
  min-height: 80px;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  resize: none;
  overflow: hidden;
  outline: none;
  background: #fff;
  line-height: 1.5;
  transition: height 0.15s ease;
}

.ps-textarea:focus {
  border-color: #111;
}

/* Tags */
.ps-tags-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  /* Автотеги is last child — pushed right by margin-left: auto */
}

.ps-tag-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 12px;
  border-radius: 20px;
  background: #f0f0f0;
  font-size: 13px;
  font-weight: 500;
  color: #111;
}

.ps-tag-chip button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ps-tag-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px dashed #ccc;
  background: #fff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  color: #999;
  display: flex;
  align-items: center;      /* вертикальная центровка */
  justify-content: center;  /* горизонтальная центровка */
  padding-bottom: 4px;      /* сдвиг + вверх на 2px: увеличь/уменьши это значение */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  overflow: hidden;
}

.ps-tag-add-btn:active {
  background: #f5f5f5;
}

.ps-tag-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.ps-tag-field {
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  outline: none;
  background: #fff;
}

.ps-tag-field:focus {
  border-color: #111;
}

.ps-tag-ok {
  height: 44px;
  width: 110px;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.ps-autotags-btn {
  margin-left: auto;
  height: 44px;
  width: 110px;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 12px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  overflow: hidden;
}

.ps-star {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  top: -2px;
}

.ps-autotags-btn:active {
  background: #f5f5f5;
}

/* Price stepper */
.ps-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 22px;
  font-weight: 300;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.ps-stepper-btn:active {
  background: #f5f5f5;
}

.ps-price-input {
  flex: 1;
  text-align: center;
  padding: 11px 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #111;
  outline: none;
  -moz-appearance: textfield;
}

.ps-price-input::-webkit-outer-spin-button,
.ps-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.ps-spacer {
  height: 16px;
}

/* Footer save button */
.ps-save-btn {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.ps-save-btn:active {
  opacity: 0.8;
}

.ps-save-inline {
  display: block;
  width: 100%;
  margin-bottom: 0;
}

.ps-save-inset {
  height: calc(24px + env(safe-area-inset-bottom, 16px));
}

/* ── Video in upload zone ── */
.ps-upload video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

/* ── Extra model chips (hidden by default) ── */
.ps-chip-extra {
  display: none;
}

/* ── "Ещё" button inside chip grid ── */
.ps-more-btn {
  flex: 0 0 calc((100% - 16px) / 3);
  padding: 7px 6px;
  border-radius: 20px;
  border: 1.5px dashed #d0d0d0;
  background: #fafafa;
  font-size: 11.5px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.ps-more-btn:active {
  background: #f0f0f0;
  color: #555;
}

/* ── Video sample collapsible section ── */
.vp-sample-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s ease;
  margin-bottom: 0;
}

.vp-sample-wrap.open {
  grid-template-rows: 1fr;
}

.vp-sample-inner {
  overflow: hidden;
}

/* ── Vid-len slider (I2V models with pcs pricing) ── */
.vp-vid-len-wrap {
  padding-top: 4px;
}
#vp-vid-len-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
  accent-color: #111;
}
#vp-vid-len-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
#vp-vid-len-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
#vp-vid-len-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
#vp-vid-len-ticks span {
  font-size: 11px;
  color: #aaa;
  flex: 1;
  text-align: center;
}
#vp-vid-len-ticks span:first-child { text-align: left; }
#vp-vid-len-ticks span:last-child  { text-align: right; }
.vp-vid-len-val-badge {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  background: #f3f3f3;
  border-radius: 8px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  display: inline-block;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Comment section ── */
.ps-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.ps-comment-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ps-comment-toggle:active {
  background: #f0f0f0;
}

.ps-comment-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
  margin-top: 0;
}

.ps-comment-body.open {
  grid-template-rows: 1fr;
  margin-top: 10px;
}

.ps-comment-inner {
  overflow: hidden;
}

.ps-comment-field {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  resize: none;
  outline: none;
  background: #fff;
  line-height: 1.5;
  min-height: 80px;
  display: block;
}

.ps-comment-field:focus {
  border-color: #111;
}

.ps-comment-counter {
  font-size: 11px;
  color: #bbb;
  text-align: right;
  margin-top: 4px;
}

/* ── Success modal ── */
.ps-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ps-modal-overlay.visible {
  display: flex;
}

.ps-modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.ps-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-align: center;
}

.ps-modal-hint {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-top: -8px;
}

.ps-modal-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-modal-link-group {
  width: 100%;
}

.ps-modal-link-label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  margin: 0 0 5px 2px;
}

.ps-modal-link {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: all;
}

.ps-modal-link:active {
  background: #ebebeb;
}

.ps-modal-copied {
  font-size: 12px;
  color: #4caf50;
  font-weight: 600;
  min-height: 16px;
}

.ps-modal-close {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.ps-modal-close:active {
  opacity: 0.8;
}

/* ══════════════════════════════════════════
   ── Prompt Card ──
   ══════════════════════════════════════════ */

.pc-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--bnav-h, 68px);
  background: #fff;
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow-x: hidden;
  pointer-events: none;
}

.pc-wrap.pc-visible {
  display: flex;
  pointer-events: auto;
}

/* Tab-isolation: pin card lives at document.body root; hidden when the user
   leaves the tab it was opened on (Task #563 — гарантия неналожения экранов). */
.pc-wrap.pc-wrap--tab-hidden {
  display: none !important;
}

.pc-safe-top {
  height: 70px;
  flex-shrink: 0;
}
html[data-env="tg"] .pc-safe-top {
  height: 0;
}
.pc-safe-top--pin-card {
  height: calc(var(--app-safe-btn-top) + 50px + 10px);
}
html[data-env="tg"] .pc-safe-top--pin-card,
html[data-env="max"] .pc-safe-top--pin-card {
  height: calc(var(--app-safe-btn-top) - 5px);
}

.pc-tape-viewport {
  width: 100%;
  overflow: hidden;
}

#pc-tape-track {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.pc-tape-slide {
  flex-shrink: 0;
  width: 100vw;
  box-sizing: border-box;
  padding: 0 5px calc(68px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pc-tape-slide::-webkit-scrollbar { display: none; }

#pc-slide-prev,
#pc-slide-next {
  pointer-events: none;
}

#pc-slide-curr {
  pointer-events: auto;
}

/* Neighbour body: pre-rendered content for side slides */
.pc-nb-body {
  pointer-events: none;
  user-select: none;
}
.pc-nb-body .pc-sim-skeleton {
  border-radius: 10px;
}

/* Desktop: constrain slide width to match phone window */
@media (min-width: 600px) {
  .pc-tape-slide {
    width: 390px;
  }
}

.pc-media-wrap {
  position: relative;
  width: 100%;
  max-height: calc((100dvh - 100px) * 0.8);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: paint;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.pc-slot {
  flex-shrink: 0;
  width: 100%;
}

.pc-img,
.pc-video {
  width: 100%;
  height: auto;
  flex-shrink: 0;
  display: block;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}

.pc-content {
  padding: 0 5px calc(68px + env(safe-area-inset-bottom, 0px));
  display: none;
}

.pc-img.pc-hidden,
.pc-video.pc-hidden {
  display: none;
}

.pc-back-btn {
  position: absolute;
  top: var(--app-safe-btn-top);
  left: 10px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.pc-back-btn svg {
  width: 25px;
  height: 25px;
  stroke: #000000;
  stroke-width: 1.5;
  transform: translateX(-1px);
} 

.pc-back-btn:active {
  background: rgba(255, 255, 255, 0.90);
}

.pc-more-btn {
  position: absolute;
  top: var(--app-safe-btn-top);
  right: 10px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.pc-more-btn svg {
  width: 22px;
  height: 22px;
  color: #111;
}

.pc-more-btn:active {
  background: rgba(255, 255, 255, 0.90);
}

.pc-more-menu {
  position: absolute;
  top: calc(var(--app-safe-btn-top) + 55px);
  right: 10px;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 20;
  display: none;
  flex-direction: column;
}

.pc-more-menu.pc-more-open {
  display: flex;
}

.pc-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: none;
  border: none;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.pc-more-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #444;
}

.pc-more-item:active {
  background: rgba(0, 0, 0, 0.06);
}

.pc-more-item--danger,
.pc-more-item--danger svg {
  color: #e60023;
  stroke: #e60023;
}

.pc-more-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.10);
  margin: 0 14px;
}

/* «Не интересно» ↔ «Снова показывать» — переключение содержимого кнопки */
.pc-more-item .pc-more-hide-on,
.pc-more-item .pc-more-hide-off {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.pc-more-item .pc-more-hide-on { display: none; }
.pc-more-item.is-hidden .pc-more-hide-off { display: none; }
.pc-more-item.is-hidden .pc-more-hide-on { display: flex; }

/* Toast — всплывающее сообщение сверху экрана.
   Сверху, чтобы не пересекаться с нижней панелью Telegram WebApp
   и навигацией. z-index максимально высокий, чтобы быть выше любых
   динамических слоёв (sheets, pc-wrap, profile, comments). */
.app-toast {
  position: fixed;
  left: 50%;
  top: calc(var(--device-safe-top, env(safe-area-inset-top, 0px)) + 24px);
  transform: translate(-50%, -16px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  background: #1c1c1e;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.35;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: 2147483647;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
  text-align: center;
  white-space: normal;
}
.app-toast.app-toast--visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0s;
}

.pc-sound-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pc-sound-btn.pc-show {
  display: flex;
}

.pc-sound-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.pc-sound-btn:active {
  background: rgba(0, 0, 0, 0.65);
}

.pc-content {
  display: none;
}

.pc-actions {
  display: flex;
  gap: 6px;
  padding: 12px 0 0;
  flex-shrink: 0;
  align-items: stretch;
}

.pc-guest-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px 11px 14px;
  margin: 10px 0 0;
  background: #fef2f4;
  border-radius: 14px;
  border: 1px solid rgba(230, 0, 35, 0.12);
}

.pc-guest-banner.visible {
  display: flex;
}

.pc-guest-banner-text {
  font-size: 13px;
  line-height: 1.35;
  color: #555;
  font-weight: 500;
  flex: 1;
}

.pc-guest-banner-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: #e60023;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.pc-guest-banner-btn:active {
  opacity: 0.82;
}

.pc-wrap.pc-ref-unauth #pc-slide-curr {
  position: relative;
}

.pc-wrap.pc-ref-unauth #pc-slide-curr::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.92) 60%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  border-radius: 0 0 18px 18px;
  z-index: 5;
}

.pc-retry-wrap {
  flex: 2;
  position: relative;
}

.pc-retry-wrap .pc-btn-retry {
  flex: unset;
  width: 100%;
}

.pc-btn-retry {
  flex: 2;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.pc-btn-retry:active {
  opacity: 0.82;
}

/* ── Author + tags block inside the expanded card ── */
.pc-author-tags-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 25px 10px 20px 10px;
}

.pc-author {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.pc-author:active {
  opacity: 0.7;
}

.pc-author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

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

.pc-author-avatar svg {
  width: 16px;
  height: 16px;
  stroke: #999;
}

.pc-comment-text {
  display: none;
  margin: -6px 4px 14px 10px;
  font-size: 15px;
  line-height: 1.45;
  color: #444;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Блок похожих промптов в карточке пина ── */
.pc-similar-section {
  margin-top: 6px;
  border-top: 0px solid #ebebeb;
  padding: 16px 0 24px;
}
.pc-similar-title {
  font-size: 17px;
  font-weight: 600;
  color: #000000;
  letter-spacing: 0.01em;
  margin: 0 0 10px 10px;
}
.pc-similar-masonry {
  display: flex;
  gap: 5px;
  padding: 0 5px;
}

.pc-author-name {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.pc-author-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.pc-follow-btn {
  height: 35px;
  width: 130px;
  padding: 0 8px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, opacity .15s;
  white-space: nowrap;
  background: #e60023;
  color: #fff;
}
.pc-follow-btn.following {
  background: #f6f6f4;
  border: 0px solid #e1e1e0;
  color: #111;
}
.pc-follow-btn:active { opacity: .75; }

.pc-notify-btn {
  width: 35px;
  height: 35px;
  border-radius: 14px;
  border: 0px solid #e1e1e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, opacity .15s;
  background: #f6f6f4;
  flex-shrink: 0;
}
.pc-notify-btn svg {
  width: 20px;
  height: 20px;
  transition: stroke .18s;
}
.pc-bell-off { stroke: #888; display: block; }
.pc-bell-on  { stroke: #e8332a; display: none; }

.pc-notify-btn.active {
  background: #ffeaea;
}
.pc-notify-btn.active .pc-bell-off { display: none; }
.pc-notify-btn.active .pc-bell-on  { display: block; }
.pc-notify-btn:active { opacity: .75; }

.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pc-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: #f4f4f4;
  color: #777;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pc-tag-chip:active {
  background: #e8e8e8;
}

.pc-btn-icon {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  border: 1px solid #e1e1e0;
  background: #f6f6f4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: #111;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pc-btn-icon:active {
  background: #ebebea;
}

.pc-btn-icon svg {
  width: 22px;
  height: 22px;
  stroke: #111;
  fill: none;
}

.pc-btn-save.active svg {
  stroke: #e60023;
  fill: #e60023;
}

/* ── Bottom nav ── */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0px 18px 0px;
  background: #fff;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
}

html[data-android="1"][data-env="tg"] .bottom-nav,
html[data-android="1"][data-env="web"] .bottom-nav {
  bottom: var(--app-bottom-safe-area, 40px);
  padding: 6px 0 8px;
}

html[data-android="1"][data-env="tg"] .nav-item,
html[data-android="1"][data-env="web"] .nav-item {
  padding-top: 6px;
  padding-bottom: 6px;
}

html.nav-debug .bottom-nav {
  background: rgba(255, 23, 68, 0.24) !important;
  outline: 3px solid #ff1744 !important;
  outline-offset: -3px;
}

html.nav-debug .bottom-nav::before {
  content: "bottom-nav";
  position: absolute;
  left: 4px;
  top: 2px;
  z-index: 2;
  padding: 1px 4px;
  background: #ff1744;
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  border-radius: 3px;
}

html.nav-debug .nav-item {
  background: rgba(41, 121, 255, 0.22) !important;
  outline: 1px dashed #2979ff !important;
}

html.nav-debug .tab-layer {
  outline: 2px dashed #00c853 !important;
  outline-offset: -2px;
}

.nav-debug-panel {
  position: fixed;
  left: 6px;
  right: 6px;
  bottom: 84px;
  z-index: 2147483000;
  max-height: 46vh;
  overflow: auto;
  padding: 8px 10px;
  border: 2px solid #111;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: none;
  user-select: text;
  -webkit-user-select: text;
}

.nav-debug-line {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2147482999;
  height: 2px;
  pointer-events: none;
}

.nav-debug-line--nav-top { background: #00c853; }
.nav-debug-line--nav-bottom { background: #ff1744; }
.nav-debug-line--vv-bottom { background: #aa00ff; }

.nav-debug-safe-band {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147482998;
  background: rgba(255, 193, 7, 0.28);
  pointer-events: none;
}

html.ios-pwa-edge .bottom-nav {
  padding-bottom: 20px;
}

/* Окно создания промта: пока открыта клавиатура — прячем нижний нав-бар
   (клавиатура должна перекрывать его, а не поднимать над собой) и растягиваем
   шторку до самого низа, чтобы под контентом не оставалось пустой полосы.
   Порядок элементов на странице не меняется — это только видимость. */
html.kb-sheet .bottom-nav { visibility: hidden; }
html.kb-sheet .ps-wrap { bottom: 0; }
html.kb-sheet #owngen-wrap { bottom: 0; }

/* DM chat open → slide nav out of view smoothly */
.bottom-nav {
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.bottom-nav--dm-chat {
  transform: translateY(calc(100% + var(--bottom-nav-safe-bottom, env(safe-area-inset-bottom, 0px))));
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 12px;
  transition: color 0.15s;
}

.nav-badge {
  position: absolute;
  top: 1px;
  right: 12px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff3040;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
  border: 2px solid #fff;
  pointer-events: none;
}

.nav-item.active {
  color: #111;
}

.nav-item svg {
  width: 25px;
  height: 25px;
}

/* ── 3-screen tab layers ── */

.tab-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--bnav-h, 68px);  /* sit above bottom-nav */
  overflow: hidden;
  will-change: transform;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 50;
}

/* Home layer is a flex column so .feed { flex:1 } fills the space */
#tab-home     { display: flex; flex-direction: column; transform: translateX(0); }
#tab-search   { transform: translateX(100%); }
#tab-messages { transform: translateX(100%); }
#tab-profile  { transform: translateX(100%); }

html.ios-pwa-edge #tab-search,
html.ios-pwa-edge #tab-messages {
  top: var(--ios-pwa-status-offset);
  --device-safe-top: 0px;
}

/* ── Messages tab layer ── */
.tab-messages-layer {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.messages-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #bbb;
  text-align: center;
  padding: 0 32px;
}

.messages-placeholder svg {
  width: 56px;
  height: 56px;
  stroke: #d0d0d0;
}

.messages-placeholder h2 {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.messages-placeholder p {
  font-size: 14px;
  color: #999;
  line-height: 1.5;
  margin: 0;
}

/* ── Search overlay ── */

.search-wrap {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.search-topbar {
  flex-shrink: 0;
  height: var(--app-safe-btn-top);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  background: #fff;
  font-size: 17px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.2px;
}

.search-header {
  flex-shrink: 0;
  padding: 12px 14px 12px;
  background: #fff;
  border-bottom: 1px solid #efefef;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border-radius: 16px;
  padding: 0 6px 0 16px;
  height: 48px;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: #bbb;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.search-btn svg {
  width: 18px;
  height: 18px;
}

.search-btn:disabled {
  background: #e0e0e0;
  color: #aaa;
  cursor: default;
}

.search-btn.loading {
  cursor: default;
}

.search-btn.loading svg {
  display: none;
}

.search-btn.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: search-spin 0.7s linear infinite;
}

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

.search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 5px;
}

.search-results::-webkit-scrollbar { display: none; }

.search-masonry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 5px;
}

.search-masonry .masonry-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-empty-hint {
  font-size: 14px;
  color: #bbb;
  text-align: center;
  line-height: 1.5;
  padding: 40px 20px;
  width: 100%;
}

.search-mode-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 14px 8px;
  background: #fff;
}

.search-mode-tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #111;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.search-mode-tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.search-user-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}

.search-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.search-user-item:active {
  background: #f5f5f5;
}

.search-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8e8e8;
}

.search-user-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e8e8e8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #aaa;
}

.search-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-user-name {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-user-slug {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-user-count {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

/* ── Profile overlay ── */
/* Keep nav visible as the lower boundary while profile edit is open. */
body.profile-editing .bottom-nav {
  display: flex;
  pointer-events: none;
}

.profile-wrap {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.profile-header {
  height: 120px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 20px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Web/PWA: уменьшаем высоту шапки профиля до 50px (в Telegram/MAX остаётся 120px) */
html[data-env="web"] .profile-header {
  height: 50px;
}

.profile-tabs {
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding-bottom: 6px;
  position: relative;
}

.profile-tab-indicator {
  display: none;  ё
}

.profile-tab {
  background: none;
  border: none;
  font-size: 16px; /* ← размер шрифта вкладок профиля */
  font-weight: 500;
  color: #bbb;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.profile-tab.active {
  color: #111;
  font-weight: 650;
}

.profile-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.profile-panels {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.profile-panels.show-subscription {
  transform: translateX(-33.333%);
}

.profile-panels.show-earnings {
  transform: translateX(-66.666%);
}

.profile-panel {
  position: relative;
  width: 33.333%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-saved-feed {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px 5px calc(72px + env(safe-area-inset-bottom, 0px));
}

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 0 44px;
  text-align: center;
  margin-top: -40px;
}

.profile-empty-text {
  font-size: 15px;
  color: #999;
  line-height: 1.55;
}

.profile-cta-btn {
  background: #e60023;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.profile-cta-btn:active {
  opacity: 0.82;
}

/* ── Like burst animation ── */
@keyframes pc-like-burst {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
  25%  { opacity: 0.55; transform: translate(-50%, -50%) scale(1.15); }
  55%  { opacity: 0.5;  transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.75); }
}

.pc-like-anim {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  width: 33%;
  aspect-ratio: 1;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}

.pc-like-anim svg {
  width: 100%;
  height: 100%;
}

.pc-like-anim.burst {
  animation: pc-like-burst 1s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

/* ── Постоянные подсказки-стрелки по краям при мульти-фото ── */
.pc-edge-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  pointer-events: none;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform;
}
.pc-edge-hint.visible {
  opacity: 1;
  visibility: visible;
}
.pc-edge-hint-left  { left: 0;  background: linear-gradient(to right, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%); }
.pc-edge-hint-right { right: 0; background: linear-gradient(to left,  rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%); }
.pc-edge-hint svg {
  width: 25px;
  height: 25px;
  color: rgba(255,255,255,1);
  padding: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  box-shadow: 0 2px 8px rgba(0,0,0,0.24);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.55));
  flex-shrink: 0;
}

/* ── Edge tap flash для переключения фото в карточке ── */
.pc-edge-flash {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  pointer-events: none;
  opacity: 0;
  z-index: 15;
}
.pc-edge-flash-left  { left: 0;  background: linear-gradient(to right, rgba(255,255,255,0.32), rgba(255,255,255,0)); }
.pc-edge-flash-right { right: 0; background: linear-gradient(to left,  rgba(255,255,255,0.32), rgba(255,255,255,0)); }
.pc-edge-flash.flash { animation: pc-edge-flash-anim 0.42s ease-out forwards; }
@keyframes pc-edge-flash-anim {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Like button on prompt card ── */
.pc-like-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  border-radius: 20px;
  padding: 7px 11px 7px 9px;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}
.pc-like-btn:active {
  transform: scale(0.90);
}
.pc-like-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.pc-like-off {
  stroke: #fff;
  fill: none;
}
.pc-like-on {
  fill: #fff;
  display: none;
}
.pc-like-btn.active .pc-like-off {
  display: none;
}
.pc-like-btn.active .pc-like-on {
  display: block;
}
.pc-like-count {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
}

/* ── Delete confirm modal ── */
.del-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.del-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.del-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 20px;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.del-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  text-align: center;
}
.del-modal-hint {
  font-size: 14px;
  color: #666;
  text-align: center;
  line-height: 1.5;
}
.del-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.del-modal-btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.del-modal-btn:active { opacity: 0.75; }
.del-modal-btn--cancel  { background: #f0f0f0; color: #111; }
.del-modal-btn--confirm { background: #e60023; color: #fff; }

/* ── WIP Modal (В разработке) ── */
.wip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.wip-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.wip-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 20px;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wip-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  text-align: center;
}
.wip-modal-hint {
  font-size: 14px;
  color: #666;
  text-align: center;
  line-height: 1.5;
}
.wip-modal-actions {
  display: flex;
  margin-top: 6px;
}
.wip-modal-btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  background: #e60023;
  color: #fff;
}
.wip-modal-btn:active { opacity: 0.75; }

/* ── Profile Info Panel ── */
/* ══════════════════════════════
   PROFILE PANEL — Instagram style
   ══════════════════════════════ */

.profile-panel-info {
  display: flex;
  flex-direction: column;
  width: 33.333%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
  justify-content: flex-start;
  background: #fff;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ── VIEW MODE ── */
.pi-view {
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  gap: 16px;
}

.pi-edit {
  display: none;
  flex-direction: column;
  padding: 0 0 24px;
}

.profile-panel-info.edit-mode .pi-view { display: none; }
.profile-panel-info.edit-mode .pi-content-tabs,
.profile-panel-info.edit-mode .pi-content-panel { display: none !important; }
/* В edit-mode pi-edit переносится в document.body (JS), поэтому
   position:fixed позиционируется относительно viewport, а не
   transformed-предков (profile-panels / profile-wrap / #tab-profile). */
body.profile-editing > #pi-edit {
  display: flex;
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--bnav-h, 68px) !important;
  max-height: calc(100dvh - var(--bnav-h, 68px));
  box-sizing: border-box;
  z-index: 310;
  background: #fff;
  overflow-y: auto;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  transform: translateX(100%);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

body.profile-editing.profile-editing-open > #pi-edit {
  transform: translateX(0);
}

body.profile-editing.pi-short-link-keyboard-space > #pi-edit {
  padding-bottom: calc(var(--pi-edit-keyboard-pad, 300px) + env(safe-area-inset-bottom, 0px));
}

/* Header row: avatar left + names right */
.pi-view-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pi-view-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.pi-view-ph {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5e6ff 0%, #ffe6f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
}

.pi-view-ph svg {
  width: 34px;
  height: 34px;
}

.pi-view-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.pi-view-avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(30,30,30,0.72);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.pi-view-avatar-edit-btn svg {
  width: 13px;
  height: 13px;
  color: #fff;
  stroke: #fff;
}

/* Name + TG username */
.pi-names {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pi-name {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-username {
  font-size: 13px;
  color: var(--tg-theme-link-color, #2481cc);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats row */
.pi-stats {
  display: flex;
  align-items: stretch;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  overflow: hidden;
}

.pi-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  gap: 2px;
}

.pi-stat--mid {
  border-left: 1px solid #ebebeb;
  border-right: 1px solid #ebebeb;
}

.pi-stat--clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pi-stat--clickable:active {
  background: #f7f7f7;
}

.pi-stat-num {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
}

.pi-stat-label {
  font-size: 11px;
  color: #999;
  font-weight: 400;
  white-space: nowrap;
}

/* ── Instagram-style profile layout (shared: pi-view + pub-prof-head) ── */
.pp-top-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 10px 10px;
}
.pi-view-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pi-view-delete-avatar-btn {
  background: none;
  border: none;
  color: #e60023;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}

.pp-top-row .pi-view-avatar-wrap {
  flex-shrink: 0;
  width: 86px;
  height: 86px;
}
.pp-top-row .pi-avatar,
.pp-top-row .pi-view-avatar { width: 86px; height: 86px; }
.pp-top-row .pi-avatar-placeholder,
.pp-top-row .pi-view-ph { width: 86px; height: 86px; }
.pp-right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}
.pp-name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pp-top-row .pi-stats {
  flex: none;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.pp-top-row .pi-stat {
  padding: 2px 0;
  align-items: flex-start;
}
.pp-top-row .pi-stat--mid { border: none; }

/* pp-meta: bio + links wrapper */
.pp-meta {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pp-meta .pi-bio-view { margin: 0; }
.pp-meta .pi-channels-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pp-meta .pi-channel-chip-view {
  background: none;
  border-radius: 0;
  padding: 0;
  gap: 5px;
}
.pp-meta .pi-channel-chip-view svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.pp-meta .pi-channel-chip-view span {
  font-size: 14px;
  color: #4a90e2;
  font-weight: 500;
}

/* pi-view with pp-top-row: reset own gap/padding */
.profile-panel-info .pi-view {
  padding: 16px 0 0;
  gap: 0;
}

/* Bio text (view) */
.pi-bio-view-wrap {
  display: none;
}

.pi-bio-view {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Bio truncation (4 lines max) */
.pi-bio-view.bio-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.bio-clamp-wrap {
  position: relative;
}
.bio-more-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  padding-left: 28px;
  background: linear-gradient(to right, transparent, #fff 38%);
  color: #4a90e2;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Bio full-text modal */
.bio-full-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.bio-full-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.bio-full-sheet {
  position: relative;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(30px);
  transition: transform 0.22s ease;
}
.bio-full-overlay.open .bio-full-sheet {
  transform: translateY(0);
}
.bio-full-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.bio-full-close:active { background: #e0e0e0; }
.bio-full-close svg { width: 16px; height: 16px; stroke: #333; }
.bio-full-text {
  margin: 0;
  padding-right: 36px;
  font-size: 14px;
  line-height: 1.55;
  color: #222;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Follow button inside public followers panel */
.pp-flw-follow-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.pp-flw-follow-btn:active { opacity: 0.8; }
.pp-flw-follow-btn--following {
  background: #efefef;
  color: #111;
}
/* Public followers panel z-index (inside pp-overlay z=750) */
#pp-pub-flw-panel {
  z-index: 800;
}

/* Link chips (view mode — read only) */
.pi-channels-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pi-channel-chip-view {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 8px 14px 8px 10px;
  font-size: 13px;
  color: #333;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.pi-channel-chip-view svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #229ed9;
}

.pi-channel-chip-view span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Own-profile action buttons (grey row, replaces pi-view-actions) ── */
.pi-own-actions {
  display: flex;
  gap: 8px;
  padding: 2px 10px 16px;
  align-items: center;
}
.pi-own-btn-edit,
.pi-own-btn-followers {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: #efefef;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.pi-own-btn-edit:active,
.pi-own-btn-followers:active { background: #e2e2e2; }
.pi-own-btn-person,
.pi-own-btn-notifs {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: #efefef;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.pi-own-btn-person:active,
.pi-own-btn-notifs:active { background: #e2e2e2; }
.pi-own-btn-person svg,
.pi-own-btn-notifs svg { width: 20px; height: 20px; }

/* ── Icon-tab bar (Сохранённые | Мои Промпты) inside Профиль panel ── */
.pi-content-tabs {
  display: flex;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pi-content-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: #bbb;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.pi-content-tab.active {
  color: #111;
  border-top-color: #111;
}

.pi-content-tab svg {
  width: 30px;
  height: 30px;
}

/* ── Gen profile cards (tab «Мои Генерации») ── */
.gen-profile-card {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
  margin-bottom: 0px;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.gen-profile-card__img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.gen-profile-card__vid {
  width: 100%;
  display: block;
  object-fit: cover;
  background: #e8e8e8;
}

/* Play-icon overlay для видео-генераций в ленте «Мои генерации» */
.gen-profile-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gen-profile-card__play svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  opacity: 0.95;
}

/* ── Content panels inside Профиль ── */
.pi-content-panel {
  display: none;
}

.pi-content-panel.active {
  display: block;
}

/* Feeds inside content panels are inline (parent scrolls) */
.pi-inline-feed {
  display: none;
  position: static !important;
  inset: auto !important;
  overflow-y: visible !important;
  padding: 5px 5px 0 !important;
}

.pi-inline-empty {
  min-height: 220px;
  justify-content: center;
  margin-top: 0 !important;
  padding: 40px 44px !important;
}

/* ── Mine filter bar ── */
.mine-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
}

.mine-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px;
  border-radius: 20px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  letter-spacing: 0.01em;
}

.mine-add-btn svg {
  flex-shrink: 0;
}

.mine-add-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.mine-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1.5px solid #dbdbdb;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s;
}

.mine-filter-btn:active {
  background: #f5f5f5;
}

.mine-filter-btn.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.mine-filter-btn.active svg {
  stroke: #fff;
}

/* ── Mine filter modal ── */
.mine-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.4);
}

.mine-filter-overlay.visible {
  display: block;
}

.mine-filter-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 10px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.mine-filter-overlay.visible .mine-filter-sheet {
  transform: translateY(0);
}

.mine-filter-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 4px auto 16px;
}

.mine-filter-section {
  margin-bottom: 20px;
}

.mine-filter-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.mine-filter-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 15px;
  color: #111;
  border-bottom: 1px solid #f0f0f0;
}

.mine-filter-radio:last-child {
  border-bottom: none;
}

.mine-filter-radio input[type="radio"] {
  accent-color: #111;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mine-filter-apply-btn {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}

.mine-filter-apply-btn:active {
  background: #333;
}

/* ── Per-pin stats overlay (mine tab only) ── */
.pin-mine-stats {
  position: absolute;
  bottom: 8px;
  left: 4px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
  pointer-events: none;
}

.pin-mine-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2px 5px 2px 4px;
  border-radius: 6px;
  line-height: 1;
}

.pin-mine-stat svg {
  flex-shrink: 0;
}

/* ── Delete button on mine cards ── */
.pin-mine-delete-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  padding: 0;
}

.pin:hover .pin-mine-delete-btn,
.pin:focus-within .pin-mine-delete-btn {
  opacity: 1;
}

.pin-mine-delete-btn:hover {
  background: rgba(220,38,38,0.82);
  color: #fff;
}

/* ── Long-press visual feedback ─────────────────────────────────────────────
   pin--lp-active: pin slowly compresses while finger is held (500ms = timer).
   The shrink itself is the progress indicator — no ring needed.
   pin--action-mode: bounce-back keyframe confirms activation.
   @media(hover:none) scopes to touch devices so desktop pins stay unaffected. */
@media (hover: none) {
  .pin--lp-active {
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.25, 0, 0.5, 1);
  }
  .pin--lp-active::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
    z-index: 4;
  }
}

@keyframes _pinActionBounce {
  0%   { transform: scale(0.95); }
  100% { transform: scale(1);    }
}
.pin--action-mode {
  animation: _pinActionBounce 0.22s ease-out both;
}

/* Long-press action-mode: keep action buttons visible regardless of hover/focus */
.pin--action-mode .pin-mine-delete-btn,
.pin--action-mode .pin-unsave-btn {
  opacity: 1;
}

/* ── Saved: unsave button (same shape as mine-delete, bookmark-minus icon) ── */
.pin-unsave-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  padding: 0;
}

.pin:hover .pin-unsave-btn,
.pin:focus-within .pin-unsave-btn {
  opacity: 1;
}

.pin-unsave-btn:hover {
  background: rgba(220,38,38,0.82);
  color: #fff;
}

/* ── Moderation overlay for owner's inactive / blocked pins ── */
.pin-moderation-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 18px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
  pointer-events: none;
  padding: 8px;
  text-align: center;
}

.pin-moderation-overlay--blocked {
  background: rgba(180,0,0,0.55);
}

.pin-moderation-overlay__reason {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .01em;
  text-transform: none;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
  max-width: 90%;
  word-break: break-word;
}

.pc-moderation-status {
  align-self: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pc-moderation-status--blocked {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

/* ── Stub panels (Подписка / Заработок) ── */
.profile-panel-stub {
  align-items: center;
  justify-content: center;
}

.pi-edit-profile-btn {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #dbdbdb;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pi-edit-profile-btn:active {
  background: #f5f5f5;
}

/* ── EDIT MODE ── */

/* Header: avatar + controls on the left, name on the right */
.pi-edit-avatar-section {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 18px;
  row-gap: 8px;
  align-items: center;
  justify-items: center;
  padding: 22px 18px 20px 50px;
  border-bottom: 1px solid #f0f0f0;
}

/* Avatar block lives in the left column (rows 1–3, stacked) */
.pi-edit-avatar-section .pi-avatar-wrap { grid-column: 1; grid-row: 1; }
.pi-edit-avatar-section .pi-edit-photo-label { grid-column: 1; grid-row: 2; }
.pi-edit-avatar-section .pi-delete-avatar-btn { grid-column: 1; grid-row: 3; }

.pi-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pi-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #f0f0f0;
  object-fit: cover;
  display: block;
}

.pi-avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5e6ff 0%, #ffe6f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
}

.pi-avatar-placeholder svg {
  width: 40px;
  height: 40px;
}

/* Буквенная заглушка — применяется через JS (setAvatarFallback) */
.pi-avatar-placeholder.pi-av-letter {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
  /* фон задаётся через el.style.background в avatar.js */
}

.pi-avatar-cam {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e60023;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}

.pi-avatar-cam svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.pi-edit-photo-label {
  background: none;
  border: none;
  color: #e60023;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.pi-delete-avatar-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.pi-delete-avatar-btn:active {
  color: #e60023;
}

/* Edit fields list */
.pi-edit-fields {
  display: flex;
  flex-direction: column;
}

.pi-edit-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  min-height: 52px;
  box-sizing: border-box;
}

/* Name field — large block on the right of the avatar */
#pi-field-name {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  min-height: 0;
  border-bottom: none;
  margin-top: -50px;
}

#pi-field-name .pi-edit-field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #999;
}

.pi-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#pi-field-name .pi-edit-field-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #111;
}

#pi-field-name .pi-edit-field-chevron {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f4f4f4;
  color: #555;
}

#pi-field-name .pi-edit-field-chevron:active {
  background: #ececec;
}

#pi-field-name .pi-edit-field-chevron svg {
  width: 17px;
  height: 17px;
}

.pi-edit-field--bio {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

.pi-edit-field--links {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

.pi-edit-field-label {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  flex-shrink: 0;
  min-width: 80px;
}

.pi-edit-field--bio .pi-edit-field-label,
.pi-edit-field--links .pi-edit-field-label {
  min-width: unset;
}

.pi-edit-field-value {
  flex: 1;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-edit-field-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.pi-edit-field-chevron svg {
  width: 16px;
  height: 16px;
}

/* Bio in edit mode */
.pi-bio-wrap {
  width: 100%;
  position: relative;
}

.pi-bio {
  width: 100%;
  resize: none;
  border: 1.5px solid #ebebeb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: #222;
  line-height: 1.5;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color 0.18s, background 0.18s;
  -webkit-appearance: none;
}

.pi-bio:focus {
  outline: none;
  border-color: #e60023;
  background: #fff;
}

.pi-bio::placeholder {
  color: #bbb;
}

/* Channel chips (edit mode — with remove) */
.pi-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.pi-channel-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f4f4f4;
  border-radius: 20px;
  padding: 6px 10px 6px 8px;
  font-size: 13px;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  max-width: 180px;
}

.pi-channel-chip:active {
  background: #ebebeb;
}

.pi-channel-chip svg:first-child {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #229ed9;
}

.pi-channel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-channel-remove {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ddd;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pi-channel-remove:active {
  background: #ccc;
}

.pi-channel-remove svg {
  width: 9px;
  height: 9px;
  color: #777;
}

/* Done / save button */
.pi-done-btn {
  flex: 2;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.pi-done-btn:active {
  opacity: 0.85;
}

.pi-done-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Inline edit form ── */
.pi-edit-form {
  display: flex;
  flex-direction: column;
}

.pi-edit-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.pi-edit-form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #999;
}

.pi-edit-form-input {
  width: 100%;
  border: 1.5px solid #ebebeb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  color: #222;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color 0.18s, background 0.18s;
  -webkit-appearance: none;
  outline: none;
}

.pi-edit-form-input:focus {
  border-color: #e60023;
  background: #fff;
}

.pi-edit-form-input::placeholder {
  color: #bbb;
}

.pi-edit-form-input.error {
  border-color: #e60023;
}

.pi-edit-nick-format {
  font-size: 12px;
  color: #bbb;
  line-height: 1.4;
}

.pi-edit-nick-hint {
  font-size: 13px;
  color: #888;
  min-height: 0;
  line-height: 1.4;
}

.pi-edit-nick-hint:empty { display: none; }
.pi-edit-nick-hint.error   { color: #e60023; }
.pi-edit-nick-hint.ok      { color: #22a44b; }
.pi-edit-nick-hint.checking { color: #aaa; }

/* Short-link field */
.pi-edit-short-link-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
}

.pi-edit-short-link-wrap:focus-within {
  border-color: #c8c8c8;
  background: #fff;
}

.pi-edit-short-link-prefix {
  padding: 0 10px 0 12px;
  font-size: 13px;
  color: #aaa;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-edit-short-link-wrap .pi-edit-short-link-input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding-left: 0 !important;
  min-width: 0;
}

/* Short-link format hint — multi-paragraph */
.pi-edit-nick-format p {
  margin: 0;
  line-height: 1.5;
}
.pi-edit-nick-format p + p {
  margin-top: 6px;
}

/* Copyable link preview shown below the hint when slug is valid */
.pi-edit-link-preview {
  display: block;
  margin-top: 6px;
  padding: 8px 12px;
  background: #f0f7ff;
  border: 1px solid #cce0ff;
  border-radius: 8px;
  font-size: 13px;
  color: #1a6fc4;
  word-break: break-all;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.pi-edit-link-preview:active {
  background: #daeeff;
}

/* Link rows */
.pi-edit-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pi-edit-link-row .pi-edit-form-input {
  flex: 1;
}

.pi-edit-link-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pi-edit-link-remove:active {
  background: #e0e0e0;
}

.pi-edit-link-remove svg {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.pi-edit-link-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px;
  border: none;
  background: none;
  color: #e60023;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pi-edit-link-add-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Edit mode footer */
.pi-edit-footer {
  display: flex;
  gap: 10px;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.pi-edit-cancel-btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  border: 1.5px solid #dbdbdb;
  background: #fff;
  color: #555;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pi-edit-cancel-btn:active {
  background: #f5f5f5;
}

/* Profile save toast */
.pi-save-toast {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #222;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 22px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pi-save-toast.pi-save-toast--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

/* Stub for removed pi-finance */
.pi-finance {
  display: none;
}

.pi-finance-hint {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  line-height: 1.5;
}

.pi-finance-badge {
  background: #fff3e0;
  color: #f59300;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
}

/* ── Edit Name Modal ── */
.pi-name-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pi-name-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.pi-name-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 20px;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.94);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.pi-name-modal-overlay.visible .pi-name-modal {
  transform: scale(1);
}

.pi-name-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pi-name-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.pi-name-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f4f4f4;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pi-name-modal-close svg {
  width: 14px;
  height: 14px;
  color: #666;
}

.pi-name-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid #ebebeb;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  color: #111;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color 0.18s, background 0.18s;
  -webkit-appearance: none;
}

.pi-name-input:focus {
  outline: none;
  border-color: #e60023;
  background: #fff;
}

.pi-name-modal-actions {
  display: flex;
  gap: 10px;
}

.pi-name-modal-btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pi-name-modal-btn:active {
  opacity: 0.75;
}

.pi-name-modal-btn--cancel {
  background: #f0f0f0;
  color: #111;
}

.pi-name-modal-btn--save {
  background: #e60023;
  color: #fff;
}

.pi-name-modal-btn--save:disabled {
  background: #e0e0e0;
  color: #aaa;
  cursor: default;
}

/* ── Bio footer ── */
.pi-bio-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
  min-height: 28px;
  gap: 8px;
}

.pi-bio-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.pi-bio-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.pi-bio-btn:active { opacity: 0.7; }

.pi-bio-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pi-bio-btn--cancel {
  background: #f0f0f0;
  color: #111;
}

.pi-bio-btn--save {
  background: #e60023;
  color: #fff;
}

.pi-bio-counter {
  font-size: 12px;
  color: #ccc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pi-bio-counter.over {
  color: #e60023;
  font-weight: 600;
}

.pi-bio.error {
  border-color: #e60023;
}

/* ── Nick modal additions ── */
.pi-nick-format-hint {
  font-size: 12px;
  color: #bbb;
  line-height: 1.4;
  margin-top: -8px;
}

.pi-nick-hint {
  font-size: 13px;
  line-height: 1.4;
  min-height: 16px;
  color: transparent;
  transition: color 0.15s;
}

.pi-nick-hint.error    { color: #e60023; }
.pi-nick-hint.ok       { color: #2da44e; }
.pi-nick-hint.checking { color: #aaa; }

.pi-nick-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.pi-nick-suggestion {
  background: #f4f4f4;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.pi-nick-suggestion:active {
  background: #e8e8e8;
}

/* ── Channel add button ── */
.pi-channel-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px dashed #ccc;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: #aaa;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.pi-channel-add:active {
  background: #f0f0f0;
  border-color: #aaa;
}

.pi-channel-add svg {
  width: 14px;
  height: 14px;
}

/* ── Avatar crop modal ── */
.pi-crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pi-crop-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.pi-crop-modal {
  width: min(360px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pi-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pi-crop-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.pi-crop-header-spacer {
  width: 68px;
}

.pi-crop-cancel-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  transition: background 0.15s;
}

.pi-crop-cancel-btn:active {
  background: rgba(255,255,255,0.28);
}

.pi-crop-area {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
  touch-action: none;
  user-select: none;
}

.pi-crop-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pi-crop-circle {
  position: absolute;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.52);
  cursor: grab;
  touch-action: none;
  box-sizing: border-box;
  pointer-events: all;
}

.pi-crop-circle:active {
  cursor: grabbing;
}

.pi-crop-save-btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.pi-crop-save-btn:active {
  opacity: 0.85;
}

.pi-crop-save-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── Channel-avatar crop overlay (mirror of pi-crop, separate DOM element) ── */
.ch-crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 701;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.ch-crop-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.ch-crop-modal {
  width: min(360px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ch-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ch-crop-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.ch-crop-header-spacer { width: 68px; }
.ch-crop-cancel-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  transition: background 0.15s;
}
.ch-crop-cancel-btn:active { background: rgba(255,255,255,0.28); }
.ch-crop-area {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
  touch-action: none;
  user-select: none;
}
.ch-crop-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.ch-crop-circle {
  position: absolute;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.52);
  cursor: grab;
  touch-action: none;
  box-sizing: border-box;
  pointer-events: all;
}
.ch-crop-circle:active { cursor: grabbing; }
.ch-crop-save-btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ch-crop-save-btn:active  { opacity: 0.85; }
.ch-crop-save-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Compose channel avatar placeholder — with image preview ── */
.compose-channel-avatar-ph {
  cursor: pointer;
  overflow: hidden;
}
.compose-channel-avatar-ph--has-avatar svg { display: none; }
.compose-channel-avatar-ph img.ch-av-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ── Dialogs channel avatar — image variant (no initial letter) ── */
.dialogs-channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ══ Profile view — «...» button & context menu ══ */
.pi-view {
  position: relative;
}

.pi-more-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
}

.pi-more-btn svg {
  width: 20px;
  height: 20px;
  color: #333;
}

.pi-more-btn:active {
  background: #e4e4e4;
}

.pi-more-menu {
  position: absolute;
  top: 58px;
  right: 14px;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 20;
  display: none;
  flex-direction: column;
}

.pi-more-menu.pi-more-open {
  display: flex;
}

/* ══ Public profile bottom sheet ══ */
.pub-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 400;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
}

.pub-sheet.open {
  transform: translateY(0);
}

/* ── Public profile slide-in overlay ── */
.pp-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: var(--bnav-h, 68px);
  z-index: 750;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.35s;
  will-change: transform;
  background: #fff;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.pp-overlay.open {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}
.pp-overlay--tab-hidden {
  display: none !important;
}
.pp-overlay--fullh {
  bottom: 0;
}

/* ── Profile panel nav row (floating over scroll) ── */
.pp-overlay .pp-nav-row {
  position: absolute;
  top: var(--app-safe-head-top);
  left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  height: 60px;
  background: transparent;
  pointer-events: none;
}
.pp-overlay .pp-nav-row > * { pointer-events: auto; }
.pp-overlay .pub-sheet-header {
  border-bottom: none;
  background: transparent;
  padding-bottom: 0;
}
.pp-overlay .pub-sheet-back {
  position: static;
  transform: none;
  right: auto; top: auto;
  width: 50px; height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.pp-overlay .pub-sheet-back:active { background: #e2e2e2; }
.pp-overlay .pub-sheet-back svg { width: 25px; height: 25px; stroke: #000000; stroke-width: 1.5; }
.pp-overlay .pub-dots-btn {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.pp-overlay .pub-dots-btn:active { background: #e2e2e2; }
.pp-overlay .pub-dots-btn svg { width: 22px; height: 22px; color: #111; }
.pp-overlay .pub-sheet-scroll { padding-top: 60px; }

/* ── Profile panel: header / stats layout ── */
.pp-overlay .pub-prof-head { padding: 0; }
.pp-overlay .pp-top-row {
  display: flex; align-items: flex-start;
  gap: 14px; padding: 1px 10px 10px;
}
.pp-overlay .pp-top-row .pi-view-avatar-wrap { flex-shrink: 0; width: 86px; height: 86px; }
.pp-overlay .pp-top-row .pi-avatar,
.pp-overlay .pp-top-row .pi-view-avatar { width: 86px; height: 86px; }
.pp-overlay .pp-top-row .pi-avatar-placeholder,
.pp-overlay .pp-top-row .pi-view-ph { width: 86px; height: 86px; }
.pp-overlay .pp-right-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 8px; padding-top: 2px;
}
.pp-overlay .pp-name-block { display: flex; flex-direction: column; gap: 2px; }
.pp-overlay .pp-name-block .pi-username { display: block; font-size: 13px; color: var(--tg-theme-link-color, #2481cc); cursor: pointer; }
.pp-overlay .pp-name-block .pi-name { }
.pp-overlay .pp-top-row .pi-stats {
  flex: none; border: none; border-radius: 0;
  background: transparent; padding: 0;
  margin-top: 10px; margin-left: 0px;
}
.pp-overlay .pp-top-row .pi-stat { padding: 2px 0; align-items: flex-start; }
.pp-overlay .pp-top-row .pi-stat--mid { border: none; }
.pp-overlay .pp-meta {
  padding: 0 10px 0px;
  display: flex; flex-direction: column; gap: 8px; margin-top: -15px;
}
.pp-overlay .pp-meta .pi-bio-view { margin: 0; padding-left: 0px; }
.pp-overlay .pp-meta .pi-channels-view { display: flex; flex-direction: column; gap: 6px; margin-top: 0px; }
.pp-overlay .pp-meta .pi-channel-chip-view { background: none; border-radius: 0; padding: 0; gap: 5px; }
.pp-overlay .pp-meta .pi-channel-chip-view svg { width: 14px; height: 14px; flex-shrink: 0; }
.pp-overlay .pp-meta .pi-channel-chip-view span { font-size: 14px; color: #4a90e2; font-weight: 500; }

/* ── Profile panel: action buttons ── */
.pp-overlay .pp-actions { display: flex; gap: 8px; padding: 0px 110px 10px 10px; align-items: center; }
.pp-overlay .pp-btn-subscribe {
  flex: 1; height: 35px; border-radius: 10px; border: none;
  background: #e60023; color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.pp-overlay .pp-btn-subscribe:active { opacity: 0.82; }
.pp-overlay .pp-btn-subscribe.pp-btn-following {
  background: #f6f6f4; color: #111; border: 0px solid #e1e1e0;
}
.pp-overlay .pp-btn-subscribe.pp-btn-following:active { background: #ebebea; opacity: 1; }
.pp-overlay .pp-btn-message {
  flex: 1; height: 35px; border-radius: 10px; border: 0px solid #e1e1e0;
  background: #f6f6f4; color: #111; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.pp-overlay .pp-btn-message:active { background: #ebebea; }
.pp-overlay .pp-btn-bell {
  width: 35px; height: 35px; border-radius: 10px; border: 0px solid #e1e1e0;
  background: #f6f6f4; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.pp-overlay .pp-btn-bell:active { background: #ebebea; }
.pp-overlay .pp-btn-bell svg { width: 20px; height: 20px; }
.pp-overlay .pp-bell-off { stroke: #111; display: block; }
.pp-overlay .pp-bell-on  { stroke: #e8332a; display: none; }
.pp-overlay .pp-btn-bell.active { background: #ffeaea; }
.pp-overlay .pp-btn-bell.active .pp-bell-off { display: none; }
.pp-overlay .pp-btn-bell.active .pp-bell-on  { display: block; }

/* ── Profile panel: pin skeleton shimmer ── */
.pp-pin-skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: pp-shimmer 1.4s ease-in-out infinite;
  aspect-ratio: 3/4;
  width: 100%;
  margin-bottom: 8px;
}
@keyframes pp-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Profile context menu (dropdown near button) ── */
.pp-ctx-backdrop {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.pp-ctx-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.pp-ctx-menu {
  position: absolute;
  right: 10px;
  top: 60px;
  z-index: 201;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 4px 0;
  transform-origin: top right;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.15s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.pp-ctx-menu.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.pp-ctx-handle { display: none; }
.pp-ctx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  font-size: 15px; font-weight: 500;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  border: none; background: none;
  width: 100%; text-align: left;
  font-family: inherit; color: #111;
}
.pp-ctx-item:active { background: rgba(0,0,0,0.06); }
.pp-ctx-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.pp-ctx-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
/* Bell state in context menu */
.pp-ctx-bell-on-icon  { display: none; }
.pp-ctx-bell-off-icon { display: block; }
.pp-ctx-bell-active .pp-ctx-bell-off-icon { display: none; }
.pp-ctx-bell-active .pp-ctx-bell-on-icon  { display: block; stroke: #e8332a; }

.pub-sheet-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: var(--app-safe-head-top);
  padding-top: var(--app-safe-padding-top, var(--device-safe-top, env(safe-area-inset-top, 0px)));
  padding-bottom: 18px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}

.pub-sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.2px;
}

.pub-sheet-back {
  position: absolute;
  right: 14px;
  top: calc(var(--app-safe-head-top) + 45px);
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.pub-sheet-back svg {
  width: 26px;
  height: 26px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pub-sheet-back:active {
  background: #e4e4e4;
}

.pub-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 5px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.pub-prof-head {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 0px solid #f0f0f0;
  margin-bottom: 8px;
}

#pub-masonry {
  padding: 0 8px;
}

.pub-prof-empty {
  padding: 48px 16px;
  text-align: center;
  color: #aaa;
  font-size: 15px;
  grid-column: 1 / -1;
  width: 100%;
}

/* ── Login modal: Mini App hand-off + web authentication ── */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 800;
  pointer-events: none;
  transition: background 0.25s ease;
}

.login-modal-overlay.visible {
  background: rgba(0, 0, 0, 0.52);
  pointer-events: auto;
}

.login-modal {
  --login-accent: #e60023;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 30px 30px 26px;
  box-sizing: border-box;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%) scale(0.93);
  opacity: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.28s ease;
}

.login-modal-overlay.visible .login-modal {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.login-modal-logo {
  height: 54px;
  max-width: 82%;
  width: auto;
  object-fit: contain;
  margin-bottom: 4px;
}

.login-modal-title {
  font-size: 30px;
  font-weight: 760;
  color: #111;
  text-align: center;
  line-height: 1.2;
}

.login-modal-hint {
  font-size: 16px;
  color: #626267;
  text-align: center;
  line-height: 1.4;
}

.login-modal-btns {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

.login-modal-section-title {
  color: #55555b;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.login-app-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-provider-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 14px 22px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 650;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  appearance: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.login-provider-btn:not([aria-disabled="true"]):active {
  transform: scale(0.985);
}

.login-provider-btn--tg {
  color: #171717;
  border-color: var(--login-accent);
  background: rgba(230, 0, 35, 0.025);
}

.login-provider-btn--max {
  color: #55555b;
  background: #f4f4f5;
}

.login-app-card {
  min-height: 90px;
  padding: 14px 18px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  border-radius: 18px;
  box-shadow: none;
}

.login-app-card:not([aria-disabled="true"]):hover {
  background: rgba(230, 0, 35, 0.045);
  box-shadow: 0 5px 18px rgba(17, 17, 17, 0.06);
  transform: translateY(-1px);
}

.login-app-card:disabled {
  opacity: 1;
  cursor: default;
}

.login-app-icon {
  width: 62px;
  height: 62px;
  margin: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.login-app-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  text-align: left;
}

.login-app-name {
  display: block;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.15;
}

.login-app-action {
  display: block;
  color: #666;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.25;
}

.login-app-recommended {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--login-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.login-vpn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #239653;
  border-radius: 10px;
  background: rgba(35, 150, 83, 0.045);
  color: #188a48;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
}

.login-vpn-badge svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-vpn-badge--max {
  margin-right: 70px;
  padding: 7px 10px;
  font-size: 11.5px;
}

.login-vpn-badge--max svg {
  width: 19px;
  height: 19px;
}

.login-vpn-badge--web {
  border-radius: 8px;
}

.login-app-chevron {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: #171717;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-web-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #5f5f65;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.login-web-divider::before,
.login-web-divider::after {
  content: "";
  height: 1px;
  background: #d4d4d7;
  flex: 1 1 auto;
}

.login-web-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-provider-btn--vk {
  background: #087bff;
  color: #fff;
  box-shadow: none;
}

.login-provider-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.login-provider-btn--mail {
  background: #fff;
  color: #171717;
  border-color: #cfcfd3;
}

.login-mail-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-provider-state {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
  color: #424242;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.18s ease;
}

.login-provider-state--soon {
  inset: 50% 18px auto auto;
  width: auto;
  height: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e8e8ea;
  color: #626267;
  font-size: 12px;
  font-weight: 550;
  opacity: 1;
  transform: translateY(-50%);
  backdrop-filter: none;
}

.login-provider-btn--unavailable {
  cursor: not-allowed;
}

.login-provider-btn--unavailable .login-provider-state--unavailable {
  opacity: 1;
}

.login-provider-btn--unavailable .login-provider-state--soon {
  opacity: 0;
}

.login-modal-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #77777d;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  margin-top: 4px;
}

.login-footnote-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The desktop shell deliberately renders the app inside a 390px phone frame.
   Use the compact modal there too; viewport-based sizing would otherwise make
   the dialog wider than its transformed/overflow-clipped containing block. */
@media (max-width: 520px), (min-width: 600px) {
  .login-modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 24px 18px 21px;
    border-radius: 25px;
    gap: 8px;
  }

  .login-modal-logo {
    height: 46px;
    margin-bottom: 3px;
  }

  .login-modal-title {
    font-size: 25px;
  }

  .login-modal-hint {
    font-size: 13.5px;
  }

  .login-modal-btns {
    margin-top: 15px;
    gap: 13px;
  }

  .login-modal-section-title {
    font-size: 12.5px;
  }

  .login-app-grid {
    gap: 10px;
  }

  .login-app-card {
    min-height: 84px;
    padding: 12px 14px;
    gap: 12px;
  }

  .login-app-icon {
    width: 54px;
    height: 54px;
  }

  .login-app-name {
    font-size: 18px;
  }

  .login-app-action {
    font-size: 12.5px;
  }

  .login-app-recommended {
    padding: 7px 10px;
    font-size: 11px;
  }

  .login-vpn-badge--max {
    margin-right: 64px;
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .login-vpn-badge--max svg {
    width: 17px;
    height: 17px;
  }

  .login-vpn-badge--web {
    gap: 4px;
    padding: 5px 7px;
    font-size: 9.5px;
  }

  .login-vpn-badge--web svg {
    width: 15px;
    height: 15px;
  }

  .login-app-chevron {
    width: 21px;
    height: 21px;
  }

  .login-provider-state--soon {
    right: 14px;
    padding: 7px 12px;
    font-size: 11.5px;
  }

  .login-web-divider {
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .login-provider-btn {
    min-height: 54px;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: 16px;
  }

  .login-provider-icon {
    width: 28px;
    height: 28px;
  }

  .login-modal-footnote {
    gap: 8px;
    font-size: 11.5px;
  }

  .login-footnote-icon {
    width: 22px;
    height: 22px;
  }
}

/* ── Email login: step containers ── */
.login-email-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.login-step-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-bottom: 2px;
  text-align: center;
}

.login-step-hint {
  font-size: 13px;
  color: #888;
  text-align: center;
  min-height: 18px;
}

.login-email-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  background: #fafafa;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.18s;
}
.login-email-input:focus {
  border-color: #2AABEE;
  background: #fff;
}

.login-step-error {
  font-size: 13px;
  color: #e00;
  text-align: center;
  min-height: 16px;
}

.login-step-btn {
  width: 100%;
  padding: 13px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.login-step-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-step-btn:active:not(:disabled) {
  opacity: 0.75;
}

.login-step-row {
  display: flex;
  gap: 10px;
}

.login-step-back {
  flex: 1;
  padding: 11px 8px;
  background: #f0f0f0;
  color: #444;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.18s;
}
.login-step-back:active {
  opacity: 0.7;
}

.login-step-resend {
  flex: 1;
  padding: 11px 8px;
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.18s, background 0.18s;
}
.login-step-resend:disabled {
  background: #f5b8b7;
  color: #fff;
  cursor: default;
}
.login-step-resend:active:not(:disabled) {
  opacity: 0.8;
}

/* ── Email login: 4-cell code input ── */
.login-code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.login-code-cell {
  width: 52px;
  height: 56px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #111;
  background: #fafafa;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.login-code-cell:focus {
  border-color: #2AABEE;
  background: #fff;
}
.login-code-cell::-webkit-outer-spin-button,
.login-code-cell::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.login-open-browser-btn {
  display: inline-block;
  padding: 13px 28px;
  background: #2AABEE;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.login-open-browser-btn:active {
  opacity: 0.75;
}

/* ══════════════════════════════════════════════════════════
   SUBSCRIPTION PANEL
   ══════════════════════════════════════════════════════════ */

.profile-panel-subscription {
  padding: 16px 16px 90px;
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100%;
  box-sizing: border-box;
}

/* ── Balance card ── */
.sub-balance-card {
  background: linear-gradient(135deg, #111 0%, #2d2d2d 100%);
  border-radius: 24px;
  padding: 22px 22px 18px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.sub-balance-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(230, 0, 35, 0.12);
  top: -40px;
  right: -25px;
  pointer-events: none;
}

.sub-balance-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(230, 0, 35, 0.07);
  bottom: -20px;
  left: -10px;
  pointer-events: none;
}

.sub-balance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sub-balance-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.sub-balance-icon svg {
  width: 18px;
  height: 18px;
}

.sub-balance-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sub-balance-amount {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 5px;
  position: relative;
}

.sub-balance-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  min-height: 16px;
}

.sub-active-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 5px 12px;
  margin-top: 14px;
}

.sub-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
}

.sub-active-plan-badge span:last-child {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

/* ── Section title ── */
.sub-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

/* ── Plans list ── */
.sub-plans-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.sub-plan-card {
  background: #fff;
  border: 2px solid #efefef;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
  text-align: left;
  width: 100%;
}

.sub-plan-card.selected {
  border-color: var(--plan-color, #e60023);
  background: var(--plan-bg, #fff8f8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.sub-plan-tag {
  position: absolute;
  top: -1px;
  right: 14px;
  background: var(--plan-color, #e60023);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.2px;
}

.sub-plan-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sub-plan-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f0f0f0;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.sub-plan-card.selected .sub-plan-icon {
  background: var(--plan-color, #e60023);
  color: #fff;
}

.sub-plan-icon svg {
  width: 20px;
  height: 20px;
}

.sub-plan-info {
  flex: 1;
  min-width: 0;
}

.sub-plan-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.sub-plan-name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.2px;
}

.sub-plan-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.sub-plan-card.selected .sub-plan-radio {
  border-color: var(--plan-color, #e60023);
  background: var(--plan-color, #e60023);
}

.sub-plan-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.sub-plan-card.selected .sub-plan-radio-dot {
  opacity: 1;
}

.sub-plan-subtitle {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
  line-height: 1.4;
}

.sub-plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sub-plan-price {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.4px;
  transition: color 0.2s;
}

.sub-plan-card.selected .sub-plan-price {
  color: var(--plan-color, #e60023);
}

.sub-plan-period {
  font-size: 12px;
  color: #aaa;
}

/* Features (expanded when selected) */
.sub-plan-features {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--plan-border, #f0f0f0);
  display: none;
  flex-direction: column;
  gap: 6px;
}

.sub-plan-card.selected .sub-plan-features {
  display: flex;
}

.sub-plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}

.sub-plan-feature-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--plan-check-bg, rgba(230,0,35,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-plan-feature-check svg {
  width: 10px;
  height: 10px;
  color: var(--plan-color, #e60023);
  stroke: var(--plan-color, #e60023);
}

/* ── Bottom actions ── */
.sub-actions {
  position: fixed;
  bottom: var(--nav-height, 56px);
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 55;
}

.sub-actions.visible {
  display: flex;
}

.sub-actions-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 10px 14px;
}

.sub-actions-hint-label {
  font-size: 13px;
  color: #555;
}

.sub-actions-hint-value {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.sub-action-primary {
  width: 100%;
  background: linear-gradient(135deg, #e60023 0%, #c8001f 100%);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.3px;
  box-shadow: 0 6px 24px rgba(230,0,35,0.36), 0 2px 6px rgba(230,0,35,0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.sub-action-primary svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sub-action-primary:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(230,0,35,0.28);
  opacity: 0.92;
}

/* ── История операций row ── */
.sub-history-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  margin-top: 10px;
  margin-bottom: 8px;
  text-align: left;
}

.sub-history-row:active {
  background: #fafafa;
}

.sub-history-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-history-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  flex-shrink: 0;
}

.sub-history-icon svg {
  width: 18px;
  height: 18px;
}

.sub-history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-history-label {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.2px;
}

.sub-history-sub {
  font-size: 12px;
  color: #999;
}

.sub-history-chevron {
  width: 18px;
  height: 18px;
  color: #ccc;
  flex-shrink: 0;
}

/* ── Help button accent in subscription tab ── */
.sub-help-btn {
  border-color: #c5d0fa;
  background: #eef2ff;
}
.sub-help-btn:active {
  background: #e3e9ff;
}
.sub-help-icon {
  background: #dde5ff !important;
}
.sub-help-label {
  color: #3b5bdb !important;
}

/* ── Transactions sheet (slide-up) ── */
.sub-tx-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  z-index: 700;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.sub-tx-sheet.open {
  transform: translateY(0);
}

.sub-tx-handle {
  width: 36px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.sub-tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.sub-tx-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.sub-tx-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
}

.sub-tx-close svg {
  width: 16px;
  height: 16px;
}

.sub-tx-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}

.sub-tx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 10px;
}

.sub-tx-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
}

.sub-tx-empty-icon svg {
  width: 26px;
  height: 26px;
}

.sub-tx-empty-text {
  font-size: 14px;
  color: #999;
  text-align: center;
}

.sub-tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f8f8f8;
}

.sub-tx-item:last-child {
  border-bottom: none;
}

.sub-tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-tx-icon.topup {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.sub-tx-icon.charge {
  background: rgba(230, 0, 35, 0.08);
  color: #e60023;
}

.sub-tx-icon svg {
  width: 18px;
  height: 18px;
}

.sub-tx-info {
  flex: 1;
  min-width: 0;
}

.sub-tx-desc {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-tx-date {
  font-size: 11px;
  color: #aaa;
}

.sub-tx-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.sub-tx-amount.topup {
  color: #4caf50;
}

.sub-tx-amount.charge {
  color: #111;
}

/* ── Top-up sheet (slide-up) ── */
.sub-topup-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  z-index: 701;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
}

.sub-topup-sheet.open {
  transform: translateY(0);
}

.sub-topup-overlay {
  z-index: 700;
}

.sub-topup-handle {
  width: 36px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.sub-topup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.sub-topup-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.sub-topup-body {
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sub-topup-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.sub-topup-amount-wrap {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 16px;
  padding: 0 18px;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.sub-topup-amount-wrap:focus-within {
  background: #fff;
  border-color: #e60023;
}

.sub-topup-currency {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  flex-shrink: 0;
  padding-right: 6px;
}

.sub-topup-amount-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  font-family: inherit;
  padding: 14px 0;
  outline: none;
  -moz-appearance: textfield;
  width: 100%;
  min-width: 0;
}

.sub-topup-amount-input::-webkit-inner-spin-button,
.sub-topup-amount-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sub-topup-presets {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.sub-topup-preset {
  flex: 1;
  min-width: calc(25% - 8px);
  background: #f0f0f0;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  text-align: center;
}

.sub-topup-preset.selected {
  background: rgba(230,0,35,0.07);
  border-color: #e60023;
  color: #e60023;
}

.sub-topup-preset:active {
  background: #e8e8e8;
}

/* ── Floating topup button inside profile-wrap (outside overflow:hidden panels) ── */
.sub-topup-float {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -12px;
  display: none;
  z-index: 5;
}

.sub-topup-float.visible {
  display: block;
}

.sub-topup-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.sub-topup-pay-method {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 15px 18px;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, opacity 0.12s;
  text-align: left;
}

.sub-topup-pay-method--ru {
  background: linear-gradient(135deg, #e60023 0%, #c8001f 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(230,0,35,0.30);
}

.sub-topup-pay-method--intl {
  background: #1a1a2e;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.sub-topup-pay-method:active {
  transform: scale(0.97);
  opacity: 0.88;
}

.sub-topup-pay-method-flag {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.sub-topup-pay-method-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-topup-pay-method-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sub-topup-pay-method-sub {
  font-size: 12px;
  opacity: 0.75;
}

/* ── Top-up modal (centered dialog, no CSS transforms) ── */
.topup-modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.topup-modal-wrap.open {
  display: flex;
}

.topup-modal-card {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.topup-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 7px;
  flex-shrink: 0;
}

.topup-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.topup-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.topup-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: #555;
}

.topup-modal-body {
  padding: 16px 20px 24px;
  flex: 1;
}

.topup-payment-ready {
  text-align: center;
  padding: 4px 0 2px;
}

.topup-payment-ready-icon {
  width: 54px;
  height: 54px;
  margin: 2px auto 14px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.topup-payment-ready-title {
  font-size: 20px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.topup-payment-ready-text {
  font-size: 14px;
  line-height: 1.45;
  color: #555;
  margin: 0 auto 14px;
  max-width: 330px;
}

.topup-payment-ready-amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  margin-bottom: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #f4f4f6;
  color: #111;
  font-size: 18px;
  font-weight: 800;
}

.topup-payment-ready-primary,
.topup-payment-ready-secondary,
.topup-payment-ready-link {
  width: 100%;
  border: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.topup-payment-ready-primary {
  min-height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e60023 0%, #c8001f 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(230,0,35,0.28);
}

.topup-payment-ready-secondary {
  min-height: 46px;
  margin-top: 10px;
  border-radius: 16px;
  background: #f2f2f4;
  color: #222;
  font-size: 14px;
  font-weight: 700;
}

.topup-payment-ready-link {
  width: auto;
  margin-top: 13px;
  background: transparent;
  color: #777;
  font-size: 13px;
  font-weight: 700;
}

.topup-payment-ready-note {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #795548;
  font-size: 13px;
  line-height: 1.35;
}

.topup-payment-ready-note.visible {
  display: block;
}

.topup-payment-ready-note.ok {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

/* ── Transaction history modal ── */
.tx-modal-card {
  max-height: 80vh;
}

.tx-modal-body {
  padding: 0 0 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
}

.tx-table thead th {
  position: sticky;
  top: 0;
  background: #f7f7f9;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #ececec;
  white-space: nowrap;
}

.tx-table thead th:last-child {
  text-align: right;
}

.tx-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.12s;
}

.tx-table tbody tr:last-child {
  border-bottom: none;
}

.tx-table tbody tr:active {
  background: #f7f7f9;
}

.tx-table td {
  padding: 11px 16px;
  font-size: 13px;
  color: #222;
  vertical-align: middle;
}

.tx-col-date {
  white-space: nowrap;
  color: #888;
  font-size: 12px;
  min-width: 100px;
}

.tx-col-desc {
  width: 100%;
  line-height: 1.35;
}

.tx-col-amount {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-size: 14px;
}

.tx-col-amount.income {
  color: #22c55e;
}

.tx-col-amount.expense {
  color: #ef4444;
}

.tx-empty {
  padding: 40px 16px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

/* ────────────────────────────── */
.topup-wip-notice {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-radius: 12px;
  font-size: 14px;
  color: #795548;
  text-align: center;
  line-height: 1.4;
}

.topup-wip-notice.visible {
  display: block;
}

.sub-topup-preset.selected {
  background: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}

/* Desktop: fix bottom actions width */
@media (min-width: 600px) {
  .sub-actions {
    left: 50%;
    transform: translateX(-50%);
    width: 390px;
  }
  .sub-tx-sheet {
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 390px;
    border-radius: 24px 24px 0 0;
  }
  .sub-tx-sheet.open {
    transform: translateX(-50%) translateY(0);
  }
}

/* ══════════════════════════════════════════════════════════
   EARNINGS PANEL
   ══════════════════════════════════════════════════════════ */

.profile-panel-earnings {
  padding: 16px 16px 90px;
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100%;
  box-sizing: border-box;
}

/* ── Info card ── */
.earn-info-card {
  background: linear-gradient(135deg, #111 0%, #1e2d1e 100%);
  border-radius: 24px;
  padding: 22px 22px 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.earn-info-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.14);
  top: -40px;
  right: -25px;
  pointer-events: none;
}

.earn-info-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.08);
  bottom: -20px;
  left: -10px;
  pointer-events: none;
}

.earn-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.earn-info-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.earn-info-icon svg {
  width: 18px;
  height: 18px;
}

.earn-info-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.earn-info-text {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin: 0 0 6px;
}

.earn-info-text:last-child {
  margin-bottom: 0;
}

.earn-info-text strong {
  color: #6ee7b7;
  font-weight: 700;
}

.earn-available-amount {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
  position: relative;
}

.earn-commission-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 16px;
}

.earn-pending-note {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffb020;
  background: rgba(255,176,32,0.12);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 16px;
}

.earn-info-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 14px;
}

/* ── Contract status card ── */
.earn-status-card {
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.earn-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.earn-status-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.earn-status-label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.earn-help-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8e8e8;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.earn-help-btn:active {
  background: #d0d0d0;
}

.earn-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 240px;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 12px;
  padding: 10px 12px;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  pointer-events: none;
}

.earn-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: #1a1a1a;
  transform: rotate(45deg);
  border-radius: 2px;
}

.earn-tooltip.visible {
  display: block;
  pointer-events: auto;
  animation: earn-tooltip-in 0.15s ease;
}

@keyframes earn-tooltip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.earn-status-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #059669;
  flex-shrink: 0;
}

.earn-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  flex-shrink: 0;
}

.earn-status-value--unavailable {
  color: #e60023;
}

.earn-status-dot--unavailable {
  background: #e60023;
}

/* ── Section title ── */
.earn-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

/* ── Earnings table card ── */
.earn-table-card {
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 16px;
}

.earn-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.earn-table-row--today {
  background: #f8fdf9;
}

.earn-table-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 16px;
}

.earn-table-label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.earn-table-amount {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.earn-table-amount--today {
  color: #059669;
}

/* ── Floating withdraw button ── */
.earn-withdraw-float {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -12px;
  display: none;
  z-index: 5;
}

.earn-withdraw-float.visible {
  display: block;
}

.earn-action-btn {
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.3px;
  box-shadow: 0 6px 24px rgba(5,150,105,0.36), 0 2px 6px rgba(5,150,105,0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.earn-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.earn-action-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(5,150,105,0.28);
  opacity: 0.92;
}

/* ════════════════════════════════════════════════
   EARNINGS STATS GRID
   ════════════════════════════════════════════════ */

.earn-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.earn-stat-tile {
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 16px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.earn-stat-tile--wide {
  grid-column: span 2;
}

.earn-stat-tile--accent {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.earn-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.8px;
  line-height: 1;
}

.earn-stat-value--green {
  color: #059669;
}

.earn-stat-value--large {
  font-size: 28px;
  letter-spacing: -1px;
}

.earn-stat-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  line-height: 1.3;
}

/* Conversion bar row */
.earn-stat-conversion-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.earn-stat-conversion-bar-wrap {
  flex: 1;
  height: 6px;
  background: #d1fae5;
  border-radius: 3px;
  overflow: hidden;
}

.earn-stat-conversion-bar {
  display: block;
  height: 100%;
  background: #059669;
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Top-prompt tile */
.earn-stat-tile--top-prompt {
  cursor: pointer;
  transition: background 0.15s;
}
.earn-stat-tile--top-prompt:active {
  background: #f8fafb;
}
.earn-stat-label--top {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  margin-bottom: 2px;
}
.earn-top-prompt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.earn-top-prompt-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}
.earn-top-prompt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.earn-top-prompt-arrow {
  width: 20px;
  height: 20px;
  color: #bbb;
  flex-shrink: 0;
}

/* ── «Заключить договор» float button ── */
.earn-contract-float {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -12px;
  display: none;
  z-index: 5;
}

.earn-contract-float.visible {
  display: block;
}

.earn-contract-btn {
  width: 100%;
  background: linear-gradient(135deg, #1c1c1e 0%, #3a3a3c 100%);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.3px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.32), 0 2px 6px rgba(0,0,0,0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.earn-contract-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.earn-contract-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(0,0,0,0.28);
  opacity: 0.88;
}

/* ════════════════════════════════════════════════
   EARN — REFERRAL LINK BLOCK
   ════════════════════════════════════════════════ */

.earn-ref-block {
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 18px;
  padding: 16px 16px 14px;
  margin-bottom: 12px;
}

.earn-ref-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.earn-ref-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #f5f5f7;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  text-align: left;
  min-width: 0;
}

.earn-ref-link-btn:active {
  background: #eaeaec;
  border-color: #d0d0d0;
}

.earn-ref-link-text {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #1c1c1e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.earn-ref-copy-icon {
  width: 16px;
  height: 16px;
  color: #888;
  flex-shrink: 0;
}

.earn-ref-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin: 10px 0 0;
}

/* ════════════════════════════════════════════════
   EARN — «СТАТИСТИКА» BUTTON
   ════════════════════════════════════════════════ */

.earn-stats-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  background: #f5f5f7;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 4px;
}

.earn-stats-open-btn svg {
  width: 18px;
  height: 18px;
  color: #555;
  flex-shrink: 0;
}

.earn-stats-open-btn:active {
  background: #eaeaec;
  border-color: #d0d0d0;
}

/* ════════════════════════════════════════════════
   EARN — STATISTICS MODAL (slide-up sheet)
   ════════════════════════════════════════════════ */

.earn-stats-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 840;
  pointer-events: none;
  /* hard cutoff: closed overlay paints nothing (child slides via transform);
     delayed until the modal slide-out finishes */
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}

.earn-stats-modal-wrap.open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.earn-stats-modal-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.earn-stats-modal-wrap.open .earn-stats-modal-overlay {
  background: transparent;
}

.earn-stats-modal {
  position: absolute;
  inset: 0;
  height: auto;
  max-height: none;
  background: #f2f2f7;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.earn-stats-modal-wrap.open .earn-stats-modal {
  transform: translateX(0);
}

.earn-stats-modal-header {
  min-height: calc(var(--app-safe-btn-top) + 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--app-safe-btn-top) 16px 0;
  border-bottom: 1px solid #e5e5ea;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0;
  position: relative;
}

.earn-stats-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #1c1c1e;
  letter-spacing: -0.3px;
}

.earn-stats-modal-close {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: #f2f2f7;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: #666;
  transition: background 0.15s;
  flex-shrink: 0;
}

.earn-stats-modal-close svg {
  width: 24px;
  height: 24px;
}

.earn-stats-modal-close:active {
  background: #e5e5ea;
}

.earn-stats-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px;
  overscroll-behavior: contain;
}

/* ════════════════════════════════════════════════
   CONTRACT MODAL — full-screen slide-up form
   ════════════════════════════════════════════════ */

.ct-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
  /* Hard cutoff: a closed overlay must paint NOTHING. transform-only hide leaks
     a ghost fragment on iOS/Telegram webview during tab/overlay churn. visibility
     is delayed until the slide-out completes so the animation still plays. */
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}

.ct-modal-wrap.open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.ct-modal {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  /* roll fully past the viewport (+ bottom-nav height), never leave a strip */
  transform: translateY(calc(100% + var(--bnav-h, 68px)));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.ct-modal-wrap.open .ct-modal {
  transform: translateY(0);
}

.ct-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  padding-top: var(--app-safe-btn-top);
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fff;
}

.ct-modal-back {
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.ct-modal-back svg {
  width: 35px;
  height: 35px;
  stroke: #000000;
  stroke-width: 1.5;
  transform: translateX(-2px);
}

.ct-modal-back:active {
  background: rgba(255, 255, 255, 0.90);
}

.ct-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
  flex: 1;
  text-align: center;
}

.ct-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 8px;
}

.ct-modal-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f0f0f0;
  background: #fff;
}

.ct-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  margin-top: 16px;
}

.ct-field-label:first-child {
  margin-top: 0;
}

.ct-input,
.ct-select {
  width: 100%;
  box-sizing: border-box;
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.ct-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 36px;
}

.ct-input:focus,
.ct-select:focus {
  background: #fff;
  border-color: #1c1c1e;
}

.ct-section-sep {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 24px 0 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.ct-error {
  min-height: 20px;
  font-size: 13px;
  color: #e60023;
  font-weight: 500;
  margin-top: 12px;
  text-align: center;
}

.ct-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #1c1c1e 0%, #3a3a3c 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.24);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, opacity 0.12s;
}

.ct-submit-btn:active {
  transform: scale(0.98);
  opacity: 0.88;
}

.ct-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ════════════════════════════════════════════════
   CONTRACT DONE — bottom sheet
   ════════════════════════════════════════════════ */

.ct-done-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 840;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.ct-done-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ct-done-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  z-index: 841;
  /* roll fully past the viewport (+ bottom-nav height) */
  transform: translateY(calc(100% + var(--bnav-h, 68px)));
  /* hard cutoff when closed, delayed until the slide-out finishes */
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.ct-done-sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

.ct-done-handle {
  width: 36px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.ct-done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.ct-done-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.ct-done-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f2f2f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ct-done-close svg {
  width: 16px;
  height: 16px;
  color: #555;
}

.ct-done-body {
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ct-done-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin: 0 0 20px;
}

.ct-done-text strong {
  color: #111;
  font-weight: 600;
}

.wd-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: #888;
  margin: 8px 0 0;
}

.ct-done-text a {
  color: #1c1c1e;
  font-weight: 600;
}

.ct-pdf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  margin-bottom: 16px;
}

.ct-pdf-row:active {
  background: #efefef;
}

.ct-pdf-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.ct-pdf-icon svg {
  width: 48px;
  height: 48px;
}

.ct-pdf-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ct-pdf-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.ct-pdf-sub {
  font-size: 12px;
  color: #999;
}

.ct-edit-btn {
  width: 100%;
  background: #f2f2f7;
  color: #1c1c1e;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.ct-edit-btn:active {
  background: #e5e5ea;
}

/* ── Followers fullscreen panel ── */
.flw-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 700;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.flw-panel.open {
  transform: translateX(0);
}

.flw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  padding-top: var(--app-safe-btn-top);
  border-bottom: 1px solid #efefef;
  flex-shrink: 0;
}

.flw-back-btn {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.flw-back-btn svg {
  width: 35px;
  height: 35px;
  stroke: #000000;
  stroke-width: 1.5;
  transform: translateX(-2px);
}

.flw-back-btn:active {
  background: rgba(255, 255, 255, 0.90);
}

.flw-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  flex: 1;
  text-align: center;
}

.flw-header-spacer {
  width: 50px;
  flex-shrink: 0;
}

.flw-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.flw-list::-webkit-scrollbar { display: none; }

.flw-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: #aaa;
  font-size: 14px;
}

.flw-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
}

.flw-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #ebebeb;
}

.flw-avatar-ph {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flw-avatar-ph svg {
  width: 26px;
  height: 26px;
  color: #bbb;
}

.flw-avatar-el {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #ccc;
  letter-spacing: 0.5px;
}

.flw-avatar-el img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.flw-info--link {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flw-info--link:active .flw-name {
  opacity: 0.6;
}

.flw-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flw-subname {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.flw-avatar-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.flw-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flw-avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.flw-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.flw-msg-btn {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  background: #f0f0f0;
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.flw-msg-btn:active {
  background: #e4e4e4;
}

.flw-follow-btn {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #e60023;
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.flw-follow-btn:active {
  background: #007fd4;
}

.flw-follow-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.flw-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #bbb;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.flw-remove-btn svg {
  width: 18px;
  height: 18px;
}

.flw-remove-btn:active {
  color: #888;
}

.flw-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 14px;
  text-align: center;
}

/* ── Confirm modal for follower removal ── */
.flw-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 710;
  align-items: flex-end;
  justify-content: center;
}

.flw-confirm-overlay.open {
  display: flex;
}

.flw-confirm-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
}

.flw-confirm-text {
  font-size: 15px;
  color: #111;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 20px;
}

.flw-confirm-actions {
  display: flex;
  gap: 10px;
}

.flw-confirm-cancel {
  flex: 1;
  background: #f0f0f0;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

.flw-confirm-cancel:active {
  background: #e4e4e4;
}

.flw-confirm-ok {
  flex: 1;
  background: #ff3b30;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.flw-confirm-ok:active {
  background: #e0342a;
}

/* ── Avatar full-screen overlay ── */
.av-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
}
.av-overlay.av-visible {
  display: flex;
}
.av-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.av-close-btn {
  position: absolute;
  top: var(--app-safe-btn-top);
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
}
.av-close-btn svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.pi-view-avatar-wrap {
  cursor: pointer;
}

/* ── Document viewer modal ── */
.doc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(0, 0, 0, 0.7);
  align-items: flex-end;
  justify-content: center;
}

.doc-modal.open {
  display: flex;
}

.doc-modal-sheet {
  width: 100%;
  height: 80vh;
  max-height: calc(100vh - var(--topbar-safe-h, 0px) - 16px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}

.doc-modal-handle {
  width: 36px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
  cursor: grab;
}

.doc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.doc-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
}

.doc-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.doc-modal-close svg {
  width: 18px;
  height: 18px;
  color: #111;
}

.doc-modal-body {
  flex: 1;
  overflow: hidden;
}

.doc-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.sub-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.official-docs-modal {
  z-index: 10400;
}

.official-docs-sheet {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.official-docs-modal.open .official-docs-sheet {
  transform: translateY(0);
}

.official-docs-body {
  overflow-y: auto;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.official-docs-list .sub-history-row {
  margin-top: 0;
  margin-bottom: 10px;
}

.official-docs-list .sub-history-left,
.official-docs-list .sub-history-info {
  min-width: 0;
}

.official-docs-list .sub-history-label,
.official-docs-list .sub-history-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Email collect modal ── */
.email-collect-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.email-collect-overlay.open {
  display: flex;
}

.email-collect-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
}

.email-collect-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1;
}

.email-collect-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  text-align: center;
  margin-bottom: 10px;
}

.email-collect-text {
  font-size: 13px;
  color: #555;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 18px;
}

.email-collect-text strong {
  color: #111;
  font-weight: 600;
}

.email-collect-input {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: #111;
  outline: none;
  background: #f8f8f8;
  transition: border-color 0.15s;
  user-select: text;
  -webkit-user-select: text;
}

.email-collect-input:focus {
  border-color: #111;
  background: #fff;
}

.email-collect-error {
  min-height: 18px;
  font-size: 12px;
  color: #e60023;
  margin-top: 6px;
  text-align: center;
}

.email-collect-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.email-collect-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.email-collect-btn--cancel {
  background: #f0f0f0;
  color: #555;
}

.email-collect-btn--cancel:active {
  background: #e0e0e0;
}

.email-collect-btn--ok {
  background: #111;
  color: #fff;
}

.email-collect-btn--ok:active {
  background: #333;
}

.email-collect-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Payment success modal ── */
.pay-success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.pay-success-overlay.open {
  display: flex;
}

.pay-success-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px 28px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.pay-success-icon {
  width: 64px;
  height: 64px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.pay-success-icon svg {
  width: 32px;
  height: 32px;
  color: #2e7d32;
}

.pay-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
  line-height: 1.2;
}

.pay-success-body {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 24px;
}

.pay-success-amount {
  font-size: 26px;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}

.pay-success-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.pay-success-btn:active {
  background: #333;
}

/* ── Consent overlay (new user registration agreements) ── */
.consent-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 10200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.consent-overlay.visible {
  display: flex;
}

.consent-box {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.consent-title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  text-align: center;
  margin-bottom: 8px;
}

.consent-subtitle {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  line-height: 1.45;
  margin-bottom: 20px;
}

.consent-checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.consent-checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: #fff;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.consent-checkmark.checked {
  background: #e60023;
  border-color: #e60023;
}

.consent-checkmark.checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 11px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(42deg);
}

.consent-label {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
}

.consent-label a {
  color: #e60023;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-error {
  display: none;
  font-size: 12px;
  color: #e60023;
  margin-bottom: 12px;
  text-align: center;
}

.consent-error.visible {
  display: block;
}

.consent-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  margin-top: 4px;
}

.consent-btn:active {
  background: #c0001e;
}

.consent-btn:disabled {
  background: #f3a0aa;
  cursor: default;
}

/* ── Welcome bonus modal ─────────────────────────────────────── */
.welcome-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px) brightness(0.55);
  -webkit-backdrop-filter: blur(12px) brightness(0.55);
  animation: wm-fadein 0.28s ease both;
}

@keyframes wm-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.welcome-modal {
  width: 80vw;
  height: 50vh;
  max-width: 400px;
  background: #fff;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 24px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: wm-scalein 0.32s cubic-bezier(.34,1.36,.64,1) both;
  overflow: hidden;
}

@keyframes wm-scalein {
  from { transform: scale(0.82); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.welcome-modal-emoji {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 14px;
  animation: wm-pop 0.45s cubic-bezier(.34,1.56,.64,1) 0.15s both;
}

@keyframes wm-pop {
  from { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);  opacity: 1; }
}

.welcome-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #111;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 18px;
}

.welcome-modal-bonus {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #e60023 0%, #ff3355 100%);
  border-radius: 18px;
  padding: 14px 28px 12px;
  margin-bottom: 16px;
  gap: 2px;
  box-shadow: 0 6px 24px rgba(230,0,35,0.30);
}

.welcome-modal-bonus-amount {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.welcome-modal-bonus-label {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.welcome-modal-text {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
  display: flex;
  align-items: center;
}

.welcome-modal-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: none;
  background: #e60023;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}

.welcome-modal-btn:active {
  background: #c0001e;
  transform: scale(0.97);
}

/* ── iOS PWA install prompt ─────────────────────────────────────────────── */
.pwa-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: wm-fadein 0.25s ease both;
}

.pwa-prompt-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 28px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
  animation: pwa-slidein 0.32s cubic-bezier(.25,1,.5,1) both;
}

@keyframes pwa-slidein {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.pwa-prompt-handle {
  width: 36px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 0 auto 20px;
}

.pwa-prompt-title {
  font-size: 18px;
  font-weight: 800;
  color: #111;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 6px;
}

.pwa-prompt-subtitle {
  font-size: 13px;
  color: #888;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 22px;
}

.pwa-prompt-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pwa-prompt-step {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-prompt-step-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-prompt-step-text {
  font-size: 14px;
  color: #333;
  line-height: 1.45;
}

.pwa-prompt-step-text strong {
  color: #111;
  font-weight: 700;
}

.pwa-prompt-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: none;
  background: #007AFF;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}

.pwa-prompt-btn:active {
  background: #005ecb;
  transform: scale(0.97);
}

/* ── Android/Chrome PWA install banner ──────────────────────────────────── */
.android-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  animation: pwa-slidein 0.3s cubic-bezier(.25,1,.5,1) both;
}

.android-install-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.android-install-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.android-install-text {
  min-width: 0;
}

.android-install-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.android-install-sub {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.android-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.android-install-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: #007AFF;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}

.android-install-btn:active {
  background: #005ecb;
  transform: scale(0.96);
}

.android-install-dismiss {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.android-install-dismiss:active {
  background: #e0e0e0;
}

/* ── Telegram Mini App home screen shortcut prompt ─────────────────────── */
.tg-home-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10400;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 52px 18px 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  animation: pwa-slidein 0.3s cubic-bezier(.25,1,.5,1) both;
}

.tg-home-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tg-home-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.tg-home-text {
  min-width: 0;
}

.tg-home-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tg-home-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #888;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tg-home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 118px;
}

.tg-home-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 20px;
  border: none;
  background: #229ED9;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}

.tg-home-btn:active {
  background: #1688bf;
  transform: scale(0.96);
}

.tg-home-never {
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: #8b8b8b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.tg-home-never:disabled {
  opacity: 0.5;
  cursor: default;
}

.tg-home-never:active {
  color: #555;
}

.tg-home-dismiss {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.tg-home-dismiss:active {
  background: #e0e0e0;
}

/* Telegram Mini App add-to-home confirmation */
.tg-home-thanks-overlay {
  position: fixed;
  inset: 0;
  z-index: 10420;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tg-home-thanks-card {
  width: min(100%, 340px);
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 12px 44px rgba(0,0,0,0.24);
  animation: wm-pop 0.22s ease both;
}

.tg-home-thanks-text {
  margin: 0 0 18px;
  color: #222;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.tg-home-thanks-ok {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: 14px;
  background: #229ED9;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tg-home-thanks-ok:active {
  background: #1688bf;
}

@media (max-width: 420px) {
  .tg-home-prompt {
    flex-direction: column;
    padding-right: 52px;
  }
  .tg-home-actions {
    align-self: stretch;
    max-width: 180px;
    margin-left: 56px;
  }
}

/* ── Help support panel (slides in from right) ── */
.help-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 760;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}
.help-panel.open {
  transform: translateX(0);
}
.help-panel-header {
  padding-top: var(--app-safe-btn-top);
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.help-panel-title-row {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 70px;
}
.help-panel-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
  text-align: center;
}
.help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
}
.help-item-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  margin-bottom: 10px;
  text-align: left;
}
.help-item-row:active {
  background: #fafafa;
}
.help-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.help-item-label {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.2px;
}

/* ── Тех поддержка — red accent ── */
.help-item-row--support {
  border-color: #ffd5d5;
  background: #fff5f5;
}
.help-item-row--support:active {
  background: #ffe8e8;
}
.help-item-row--support .help-item-icon {
  background: #ffe0e0;
}
.help-item-row--support .help-item-label {
  color: #e03131;
}
.help-item-row--support .sub-history-chevron {
  color: #e03131;
}

/* ── Help info modal (bottom sheet 80vh) ── */
.help-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.help-info-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.help-info-sheet {
  width: 100%;
  height: 80vh;
  max-height: calc(100vh - var(--topbar-safe-h, 0px) - 16px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.help-info-overlay.open .help-info-sheet {
  transform: translateY(0);
}
.help-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  gap: 12px;
}
.help-info-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.2px;
  flex: 1;
}
.help-info-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.help-info-close svg {
  width: 16px;
  height: 16px;
  stroke: #555;
}
.help-info-close:active {
  background: #e0e0e0;
}
.help-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #333;
  -webkit-overflow-scrolling: touch;
}
.help-info-body p {
  margin: 0 0 12px;
}
.help-info-body p:last-child {
  margin-bottom: 0;
}
.help-info-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.help-info-body li {
  margin-bottom: 4px;
}
.help-info-body a {
  color: #3b5bdb;
  text-decoration: underline;
  word-break: break-all;
}

/* «Как пользоваться» — лёгкая карточная инструкция */
.how-to-guide {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.how-to-intro {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f2f5ff 0%, #faf7ff 100%);
}
.how-to-intro-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 13px;
  background: #fff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(59, 91, 219, 0.1);
}
.how-to-intro strong {
  display: block;
  margin: 1px 0 4px;
  color: #16181d;
  font-size: 15px;
  line-height: 1.4;
}
.help-info-body .how-to-intro p,
.help-info-body .how-to-result p {
  margin: 0;
  color: #686b73;
  font-size: 13px;
  line-height: 1.45;
}
.how-to-section h3 {
  margin: 0 0 12px;
  color: #16181d;
  font-size: 15px;
  line-height: 1.35;
}
.help-info-body .how-to-features,
.help-info-body .how-to-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.how-to-features {
  display: grid;
  gap: 9px;
}
.help-info-body .how-to-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #eff0f4;
  border-radius: 14px;
  color: #34363b;
  line-height: 1.45;
}
.how-to-features li span {
  flex-shrink: 0;
  font-size: 17px;
}
.how-to-steps {
  display: flex;
  flex-direction: column;
}
.help-info-body .how-to-steps li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0 0 16px;
  color: #34363b;
  line-height: 1.5;
}
.help-info-body .how-to-steps li:last-child {
  padding-bottom: 0;
}
.how-to-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 4px;
  left: 14px;
  width: 2px;
  border-radius: 2px;
  background: #e5e9f8;
}
.how-to-step-number {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #edf1ff;
  color: #3b5bdb;
  font-size: 13px;
  font-weight: 700;
}
.how-to-steps li > div {
  padding-top: 4px;
}
.how-to-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #dfe5ff;
  border-radius: 16px;
  background: #f7f9ff;
}
.how-to-result > span {
  flex-shrink: 0;
  font-size: 22px;
}
.how-to-result strong {
  display: block;
  margin-bottom: 2px;
  color: #293b84;
  font-size: 14px;
}

/* «Как зарабатывать» */
.earn-guide {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.earn-guide-intro {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8e7 0%, #fffdf7 100%);
}
.earn-guide-intro-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 13px;
  background: #fff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(190, 133, 0, 0.1);
}
.earn-guide-intro strong {
  display: block;
  margin: 1px 0 4px;
  color: #201b10;
  font-size: 15px;
  line-height: 1.4;
}
.help-info-body .earn-guide p {
  margin: 0;
}
.earn-guide-intro p {
  color: #716b60;
  font-size: 13px;
  line-height: 1.45;
}
.earn-guide-caption {
  color: #777;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
.earn-guide-method {
  padding: 16px;
  border: 1px solid #eceef2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(24, 28, 38, 0.05);
}
.earn-guide-method-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}
.earn-guide-method-number {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 12px;
  background: #edf1ff;
  color: #3b5bdb;
  font-size: 16px;
  font-weight: 800;
}
.earn-guide-method-heading div > span {
  display: block;
  margin-bottom: 1px;
  color: #92959d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.earn-guide-method-heading h3 {
  margin: 0;
  color: #16181d;
  font-size: 16px;
  line-height: 1.3;
}
.earn-guide-method > p {
  color: #4c4f56;
  line-height: 1.55;
}
.earn-guide-rates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}
.earn-guide-rate {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: #f7f8fb;
}
.earn-guide-rate > span {
  flex-shrink: 0;
  font-size: 19px;
}
.earn-guide-rate strong,
.earn-guide-rate small {
  display: block;
}
.earn-guide-rate strong {
  color: #20232a;
  font-size: 17px;
  line-height: 1.2;
}
.earn-guide-rate small {
  margin-top: 2px;
  color: #747780;
  font-size: 11px;
  line-height: 1.25;
}
.earn-guide-premium {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #f2df9e;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff9e8, #fffdf7);
}
.earn-guide-star {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f5c84c;
  color: #fff;
  font-size: 15px;
}
.earn-guide-premium strong,
.earn-guide-final strong {
  display: block;
  margin-bottom: 3px;
  color: #403716;
  font-size: 14px;
}
.earn-guide-premium p,
.earn-guide-final p {
  color: #665f4b;
  font-size: 13px;
  line-height: 1.5;
}
.earn-guide-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 0;
  color: #4c4f56;
  font-size: 13px;
  line-height: 1.5;
}
.earn-guide-note > span {
  flex-shrink: 0;
  font-size: 17px;
}
.earn-guide-subsection {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eceef2;
}
.earn-guide-subsection h4 {
  margin: 0 0 7px;
  color: #25272d;
  font-size: 14px;
}
.earn-guide-subsection > p {
  color: #565960;
  font-size: 13px;
  line-height: 1.5;
}
.help-info-body .earn-guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #f4f7ff;
  color: #3d4c7b;
}
.earn-guide-tip > span {
  flex-shrink: 0;
}
.earn-guide-rewards {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}
.earn-guide-rewards > div {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f8fb;
}
.earn-guide-rewards strong {
  color: #3b5bdb;
  font-size: 18px;
  line-height: 1.2;
}
.earn-guide-rewards span {
  color: #565960;
  font-size: 12px;
  line-height: 1.4;
}
.earn-guide-final {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border-radius: 15px;
  background: #f2f5ff;
}
.earn-guide-final > span {
  flex-shrink: 0;
  font-size: 20px;
}
.earn-guide-final strong {
  color: #293b84;
}
.earn-guide-final p {
  color: #56638a;
}
@media (max-width: 360px) {
  .earn-guide-rates {
    grid-template-columns: 1fr;
  }
}
.help-info-footer {
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
}
.help-info-ok {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 16px;
  background: #3b5bdb;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.help-info-ok:active {
  background: #364fc7;
}

/* ── Cookie consent banner ──────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
  left: 12px; right: 12px;
  z-index: 1100;
  background: rgba(28, 28, 30, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 14px 16px 12px;
  color: #fff;
  box-shadow: 0 4px 28px rgba(0,0,0,0.40);
  transform: translateY(calc(100% + 72px));
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
}
.cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cookie-banner__text {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 12px;
  color: rgba(255,255,255,0.88);
}
.cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cookie-banner__btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  text-align: center;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cookie-banner__btn:active { opacity: 0.72; }
.cookie-banner__btn--primary {
  background: #fff;
  color: #1c1c1e;
}
.cookie-banner__btn--link {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 400;
}

/* ── Settings modal (bottom sheet 80vh) ────────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.settings-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.settings-sheet {
  width: 100%;
  height: 80vh;
  max-height: calc(100vh - var(--topbar-safe-h, 0px) - 16px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.settings-overlay.open .settings-sheet {
  transform: translateY(0);
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  gap: 12px;
}
.settings-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.2px;
  flex: 1;
}
.settings-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.settings-close svg {
  width: 16px;
  height: 16px;
  stroke: #555;
}
.settings-close:active {
  background: #e0e0e0;
}
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
.settings-section {
  padding: 20px 20px 0;
}
.settings-section + .settings-section {
  padding-top: 24px;
}
.settings-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px 16px;
}
.settings-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.settings-row-title {
  font-size: 15px;
  font-weight: 500;
  color: #111;
}
.settings-row-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}
/* Toggle switch */
.settings-toggle {
  flex-shrink: 0;
  width: 51px;
  height: 31px;
  border-radius: 31px;
  background: #ccc;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.22s ease;
  position: relative;
}
.settings-toggle[aria-checked="true"] {
  background: #34c759;
}
.settings-toggle-thumb {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.settings-toggle[aria-checked="true"] .settings-toggle-thumb {
  transform: translateX(20px);
}

.settings-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f2f8fc;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  color: #1688bf;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: inherit;
  text-align: left;
}
.settings-action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #1688bf;
}
.settings-action-btn:active {
  background: #e1f1fa;
}

/* Danger section */
.settings-danger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff0f0;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  color: #ff3b30;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: inherit;
  text-align: left;
}
.settings-danger-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #ff3b30;
}
.settings-danger-btn:active {
  background: #ffe0de;
}

/* ── Dialogs / Channels panel ────────────────────────────────────────────── */
#dialogs-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--nav-height, 73px);
  z-index: 600;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
}

#dialogs-panel.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

#dialogs-panel.dialogs-panel--tab-hidden {
  display: none !important;
}

.dialogs-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(70px + var(--topbar-safe-h, 0px));
  padding-top: var(--topbar-safe-h, 0px);
  padding-left: 10px;
  padding-right: 16px;
  background: #fff;
  border-bottom: 1px solid #efefef;
  flex-shrink: 0;
}

.dialogs-panel-header .pc-back-btn.dialogs-back-btn {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
}

.dialogs-panel-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.2px;
  pointer-events: none;
}

.dialogs-panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dialogs-search-wrap {
  padding: 10px 16px 6px;
}

.dialogs-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialogs-search-row .dialogs-search-bar {
  flex: 1;
}
.dialogs-search-row .dialogs-compose-btn {
  flex-shrink: 0;
  position: relative;
  top: auto;
  left: auto;
}

.dialogs-search-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 0 14px;
  height: 38px;
}

.dialogs-search-bar:focus-within {
  justify-content: flex-start;
}

.dialogs-search-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: #aaa;
}

.dialogs-search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: #111;
  min-width: 0;
  -webkit-appearance: none;
}

.dialogs-search-input::placeholder {
  color: #b0b0b0;
}

.dialogs-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.dialogs-channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f4f4f4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dialogs-channel-row:active {
  background: #f8f8f8;
}

.dialogs-channel-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8e8e8;
  flex-shrink: 0;
  overflow: hidden;
}

.dialogs-channel-row--skeleton {
  cursor: default;
  pointer-events: none;
}

.dialogs-channel-skeleton-circle,
.dialogs-channel-skeleton-line {
  background-color: #e8e8e8;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.dialogs-channel-skeleton-line {
  border-radius: 6px;
  height: 12px;
}

.dialogs-channel-skeleton-name {
  width: min(54%, 210px);
  height: 14px;
}

.dialogs-channel-skeleton-time {
  width: 34px;
  flex-shrink: 0;
}

.dialogs-channel-skeleton-last {
  width: min(72%, 280px);
  margin-top: 8px;
}

.dialogs-channel-avatar--pending {
  background-color: #d4d4d4;
}

.dialogs-channel-info {
  flex: 1;
  min-width: 0;
}

.dialogs-channel-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dialogs-channel-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-channel-time {
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

.dialogs-ch-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #a0a0a0;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 0px;
  box-sizing: border-box;
}

.dialogs-channel-last {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}
.dialogs-channel-last-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-channel-avatar--initial {
  background: #c8c8c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0;
}

.dialogs-channels-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.dialogs-channels-empty-text {
  font-size: 14px;
  color: #aaa;
  text-align: center;
  line-height: 1.5;
}

/* ── Dialogs search results ── */
.dialogs-search-section-header {
  padding: 12px 16px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: 0.04em;
}

.dialogs-search-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
  color: #aaa;
}

.search-show-more-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 12px;
  padding: 10px 0;
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  color: #007aff;
  cursor: pointer;
  text-align: center;
}
.search-show-more-btn:disabled {
  color: #aaa;
  cursor: default;
}

/* ── Compose bottom-sheet ─────────────────────────────────────────────────── */
.compose-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 699;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.compose-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.compose-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 700;
  background: #fff;
  border-radius: 18px 18px 0 0;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              height 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform, height;
  overflow: hidden;
}
.compose-sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              height 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}
.compose-sheet.expanded {
  height: 80vh;
  max-height: calc(100vh - var(--topbar-safe-h, 0px) - 16px);
  height: 80dvh;
  max-height: calc(100dvh - var(--topbar-safe-h, 0px) - 16px);
  display: flex;
  flex-direction: column;
}

.compose-sheet-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}
.compose-sheet-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
}

/* pick screen */
.compose-pick-screen {
  padding: 4px 0 max(20px, env(safe-area-inset-bottom, 0px));
}
.compose-option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.compose-option-row:active {
  background: #f5f5f5;
}
.compose-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.compose-option-icon svg {
  width: 22px;
  height: 22px;
  stroke: #555;
}
.compose-option-label {
  font-size: 16px;
  font-weight: 500;
  color: #111;
}

/* channel form screen */
.compose-channel-screen {
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  box-sizing: border-box;
}
.compose-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 54px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}
.compose-channel-back {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.compose-channel-back:active { background: #f0f0f0; }
.compose-channel-back svg {
  width: 22px;
  height: 22px;
  stroke: #111;
}
.compose-channel-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
}
.compose-channel-next {
  padding: 7px 16px;
  border-radius: 20px;
  border: none;
  background: #e03030;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, opacity 0.15s;
}
.compose-channel-next:disabled {
  background: #e8c8c8;
  color: #c08080;
  cursor: default;
}
.compose-channel-next:not(:disabled):active { opacity: 0.75; }

.compose-channel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.compose-channel-body > * {
  flex: 0 0 auto;
}

/* name capsule */
.compose-channel-name-capsule {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px 16px;
}
.compose-channel-avatar-ph {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.compose-channel-avatar-ph svg {
  width: 26px;
  height: 26px;
  stroke: #aaa;
}
.compose-channel-name-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: #111;
  min-width: 0;
}
.compose-channel-name-input::placeholder { color: #b8b8b8; }

/* description block */
.compose-channel-desc-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compose-channel-desc-capsule {
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px 16px;
}
.compose-channel-desc-input {
  width: 100%;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: #111;
}
.compose-channel-desc-input::placeholder { color: #b8b8b8; }
.compose-channel-desc-hint {
  font-size: 13px;
  color: #999;
  margin: 0;
  padding: 0 4px;
}

/* radio type */
.compose-channel-type-block {
  background: #f7f7f7;
  border-radius: 14px;
  overflow: hidden;
}
.compose-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.compose-type-row + .compose-type-row {
  border-top: 1px solid #efefef;
}
.compose-type-label {
  font-size: 16px;
  color: #111;
}
.compose-type-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #aaa;
  opacity: 0;
  transition: opacity 0.15s;
}
.compose-type-row--selected .compose-type-check {
  opacity: 1;
}
.compose-type-desc {
  font-size: 13px;
  color: #999;
  line-height: 1.55;
  padding: 10px 16px 4px;
  margin: 0;
}

/* compose-sheet screen slide animations */
@keyframes cslide-in-r  { from { transform: translateX(100%) } to { transform: translateX(0) } }
@keyframes cslide-out-l { from { transform: translateX(0) }    to { transform: translateX(-100%) } }
@keyframes cslide-in-l  { from { transform: translateX(-100%) } to { transform: translateX(0) } }
@keyframes cslide-out-r { from { transform: translateX(0) }    to { transform: translateX(100%) } }
.cslide-in-r  { animation: cslide-in-r  0.28s cubic-bezier(0.32,0.72,0,1) both; }
.cslide-out-l { animation: cslide-out-l 0.28s cubic-bezier(0.32,0.72,0,1) both; }
.cslide-in-l  { animation: cslide-in-l  0.28s cubic-bezier(0.32,0.72,0,1) both; }
.cslide-out-r { animation: cslide-out-r 0.28s cubic-bezier(0.32,0.72,0,1) both; }

/* slug screen */
.compose-slug-input-capsule {
  display: flex;
  align-items: center;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px 16px;
}
.compose-slug-prefix {
  font-size: 15px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.compose-slug-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: #111;
  min-width: 0;
}
.compose-slug-input::placeholder { color: #b8b8b8; }
.compose-slug-status {
  font-size: 13px;
  min-height: 18px;
  padding: 4px 4px 0;
  color: transparent;
}
.compose-slug-status.ok { color: #22a45d; }
.compose-slug-status.err { color: #e03030; }

/* private invite capsule */
.compose-invite-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 16px;
  border: none;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  gap: 12px;
}
.compose-invite-capsule:active { background: #efefef; }
.compose-invite-url {
  font-size: 14px;
  color: #555;
  word-break: break-all;
  flex: 1;
}
.compose-invite-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: stroke 0.2s;
}
.compose-invite-pending::before {
  content: "Ссылка появится после создания";
  font-size: 14px;
  color: #b8b8b8;
  font-style: italic;
}

/* ── @-mention links ─────────────────────────────────────────────────────── */
.at-mention-link {
  color: var(--tg-theme-link-color, #2481cc);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border-radius: 3px;
  padding: 0 1px;
  transition: opacity 0.15s, background 0.15s;
}
.at-mention-link:hover {
  text-decoration: underline;
}
.at-mention-link--loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Payout notification modal ─────────────────────────────────────────────── */
.payout-notif-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.22s ease;
}
.payout-notif-modal-wrap.open {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.45);
}
.payout-notif-modal {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 20px;
  max-width: 300px;
  width: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease;
}
.payout-notif-modal-wrap.open .payout-notif-modal {
  transform: scale(1);
  opacity: 1;
}
.payout-notif-modal-icon {
  font-size: 36px;
  line-height: 1;
}
.payout-notif-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  text-align: center;
}
.payout-notif-modal-text {
  font-size: 15px;
  color: #444;
  text-align: center;
  line-height: 1.45;
}
.payout-notif-modal-ok {
  margin-top: 8px;
  width: 100%;
  padding: 12px 0;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.payout-notif-modal-ok:active {
  opacity: 0.75;
}
.notify-banner-av--payout {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f4ff;
  color: #007aff;
}

/* Payout avatar in pin-notif-sheet */
.pin-notif-av--payout {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f4ff;
  border-radius: 50%;
  flex-shrink: 0;
}
