:root {
  color-scheme: dark;
  --app-safe-top: 0px;
  --app-safe-right: 0px;
  --app-safe-bottom: 0px;
  --app-safe-left: 0px;
  --app-safe-raw-top: 0px;
  --app-safe-raw-right: 0px;
  --app-safe-raw-bottom: 0px;
  --app-safe-raw-left: 0px;
  --tg-header-offset: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #010101;
  color: #f3f4f6;
  --stories-progress: 0;
  --stories-drag-y: 0px;
  --logo-shift-x: 0px;
  --logo-appear-comp-x: 0px;
  --stories-collapsed-shift-x: 0px;
  --stories-collapsed-alpha: 1;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

.webapp {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(32px + env(safe-area-inset-top, 0px) + var(--app-safe-top, 0px))
    calc(16px + env(safe-area-inset-right, 0px) + var(--app-safe-right, 0px))
    calc(32px + env(safe-area-inset-bottom, 0px) + var(--app-safe-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px) + var(--app-safe-left, 0px));
}

.webapp.step-channels {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--app-safe-top, 0px) + 55px);
}
.webapp-container {
  width: 100%;
  max-width: 540px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
}

.preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  z-index: 999;
}

body.is-bootstrapping .app-top-logo {
  display: none;
}

body.is-bootstrapping .webapp-container > :not(#preloader) {
  display: none;
}

.global-top-logo {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--app-safe-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 140;
  pointer-events: none;
}

.global-top-logo__img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
}

.webapp.step-channels .global-top-logo {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.hero {
  text-align: center;
  margin-bottom: 20px;
}

.webapp.step-phone .hero,
.webapp.step-code .hero,
.webapp.step-password .hero,
.webapp.step-sessions .hero {
  margin-top: calc(var(--app-safe-raw-top, 0px) + 40px);
}

.webapp.step-channels .hero {
  margin-top: 0;
  margin-bottom: 0;
  height: 0;
  overflow: hidden;
}

.hero-emoji {
  display: none;
}

.hero-logo {
  display: inline-block;
  max-width: 96px;
  height: auto;
}

.app-top-logo {
  position: relative;
  top: auto;
  left: auto;
  transform: translateX(calc(var(--logo-shift-x, 0px) + var(--logo-appear-comp-x, 0px)));
  z-index: 2;
  pointer-events: none;
  transition: transform 0.24s ease;
}


.app-top-logo__img {
  width: 70px;
  height: 70px;
  display: block;
  object-fit: contain;
  padding-bottom: 0;
}

.stories-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: fixed;
  top: var(--app-safe-top, 0px);
  left: calc(16px + var(--app-safe-left, 0px));
  right: calc(16px + var(--app-safe-right, 0px));
  margin-top: 0;
  margin-bottom: 0;
  min-height: 70px;
  z-index: 150;
}

.stories-collapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  min-height: calc(28px + var(--stories-progress, 0) * 34px);
  max-height: 68px;
  margin-top: 0px;
  margin-bottom: 0;
  opacity: calc((1 - var(--stories-progress, 0)) * var(--stories-collapsed-alpha, 1));
  overflow: hidden;
  position: relative;
  left: 0;
  width: auto;
  transform: translate3d(var(--stories-collapsed-shift-x, 0px), var(--stories-drag-y, 0px), 0);
  transition: opacity 0.28s ease,
    transform 0.2s ease,
    min-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  z-index: 1;
}

/* When fully expanded — collapse the bubble row so it takes no layout space */
.webapp.stories-expanded .stories-collapsed {
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.stories-collapsed.hidden {
  display: none;
}

.story-bubble {
  /* grow from 28px → 62px as progress goes 0 → 1 */
  width: calc(28px + var(--stories-progress, 0) * 34px);
  height: calc(28px + var(--stories-progress, 0) * 34px);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  background: #151515;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(11px + var(--stories-progress, 0) * 5px);
  font-weight: 700;
  color: #e5e7eb;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    font-size 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    margin-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-ring {
  position: relative;
}

.story-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    var(--story-ring-color, #ffffff) 0
      calc((360deg / var(--story-count, 1)) - var(--story-gap, 0deg)),
    transparent 0 calc(360deg / var(--story-count, 1))
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--story-ring-width, 2px)),
    #000 calc(100% - var(--story-ring-width, 2px) + 1px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--story-ring-width, 2px)),
    #000 calc(100% - var(--story-ring-width, 2px) + 1px)
  );
  z-index: 2;
  pointer-events: none;
}

.story-bubble.story-ring {
  --story-ring-width: 2px;
}

.story-ring--unread {
  --story-ring-color: #ffffff;
}

.story-ring--read {
  --story-ring-color: #6b7280;
}

.story-ring--private {
  --story-ring-color: #38bdf8;
}

.story-ring--private::before {
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.story-bubble + .story-bubble {
  /* overlap reduces → gap appears as progress increases */
  margin-left: calc(-10px + var(--stories-progress, 0) * 24px);
}

.story-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.stories-expanded {
  /* height driven by CSS var — no clip-path (no stacking context, no pointer-events leak) */
  height: calc(var(--stories-progress, 0) * 120px);
  overflow: hidden;
  /* keep hit-testing clipped to the visible stories area */
  pointer-events: auto;
  position: relative;
  transition: height 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

@media (min-width: 900px) {
  .stories-expanded {
    width: min(1180px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}

.stories-expanded.hidden {
  display: none;
}

/* Only the scroll strip itself gets horizontal gesture handling */
.webapp.stories-expanded .stories-scroll {
  overflow-x: auto;
  pointer-events: auto;
  touch-action: pan-x;
}

.webapp.stories-dragging .stories-collapsed,
.webapp.stories-dragging .stories-expanded,
.webapp.stories-dragging .story-bubble {
  transition: none !important;
}

.stories-scroll {
  display: flex;
  gap: 14px;
  height: 120px;
  min-height: 120px;
  overflow-x: hidden;
  padding: 16px calc(4px + env(safe-area-inset-right, 0px)) 6px calc(4px + env(safe-area-inset-left, 0px));
  scrollbar-width: none;
  justify-content: flex-start;
  pointer-events: none;
  touch-action: auto;
}

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

.stories-scroll.stories-scroll--center {
  justify-content: center;
}

.story-item {
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: #e5e7eb;
  flex-shrink: 0;
}

.story-item--pressed .story-item__avatar {
  filter: grayscale(0.45) brightness(0.82);
  background: #4b5563;
}

.story-item__avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  background: #151515;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.story-item__avatar.story-ring {
  --story-ring-width: 3px;
}

.story-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-item__name {
  font-size: 12px;
  color: #d1d5db;
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.hero-subtitle {
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.4;
}

.card-panel {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#step-sessions.card-panel,
#step-channels.card-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transition: padding-top 0.25s ease;
}

#step-channels.card-panel {
  gap: 0;
}

#step-sessions {
  margin-top: 0;
}

.webapp.step-sessions {
  align-items: stretch;
}

.webapp.step-sessions .webapp-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(-100px);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#step-sessions .session-list {
  margin-top: 16px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.session-item--selected {
  border-color: rgba(255, 255, 255, 0.2);
  background: #111111;
}


.session-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1f2937, #111827);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #e5e7eb;
  font-size: 18px;
  overflow: hidden;
  flex: 0 0 auto;
}

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

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

.session-name {
  font-weight: 800;
  font-size: 16px;
  color: #f3f4f6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  margin-top: 2px;
  color: #9ca3af;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item__action {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.session-item__action--stacked {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.session-item__loader {
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.session-select-btn {
  width: auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.session-select-btn--active {
  background: #ffffff;
  color: #0b0b0b;
  border-color: transparent;
}


.target-session {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.target-session__pay {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.target-session__pay-left {
  flex: 1;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.target-session__pay-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  pointer-events: none;
}

.target-session__pay-right--hidden {
  display: none;
}

.target-session__pay-right .tg-star {
  width: 16px;
  height: 16px;
}

.target-session__pay-old {
  font-size: 12px;
  color: rgba(17, 24, 39, 0.5);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  pointer-events: none;
}

.target-session__pay-amount {
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.session-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.activity-banner {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(
    140deg,
    rgba(59, 130, 246, 0.22),
    rgba(16, 185, 129, 0.14)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.webapp.step-sessions .activity-banner {
  margin-top: calc(var(--app-safe-raw-top, 0px) + 12px);
  margin-bottom: 12px;
}

.activity-banner__title {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.activity-banner__meta {
  font-size: 12px;
  color: rgba(243, 244, 246, 0.86);
}

.activity-banner__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.activity-banner__progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.activity-banner__progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, #38bdf8, #22d3ee 60%, #a5f3fc);
  border-radius: 999px;
  width: 0;
}

.activity-banner__progress-value {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.activity-banner__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.activity-banner__button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.billing-card {
  padding: 12px;
  border-radius: 14px;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-card {
  padding: 18px;
  gap: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 5, 5, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.quote-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quote-eyebrow {
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.64);
}

.quote-title {
  font-size: 22px;
  line-height: 1.08;
}

.quote-subtitle {
  max-width: 42ch;
  color: rgba(226, 232, 240, 0.78);
}

.quote-status {
  color: rgba(148, 163, 184, 0.94);
}

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

.quote-summary__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.quote-summary__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.46);
}

.quote-summary__value {
  font-size: 14px;
  line-height: 1.2;
  color: #f8fafc;
}

.quote-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-step__counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}

.quote-step__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.quote-step__title {
  font-size: 13px;
  line-height: 1.2;
  color: #f8fafc;
}

.quote-step__hint {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.72);
}

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

.billing-meta {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

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

.billing-actions button {
  flex: 1 1 110px;
  width: auto;
  padding: 12px;
}

.tier-hint {
  margin-top: 2px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.tier-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.tier-card {
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, background 0.15s ease;
  flex: 1 1 0;
  min-width: 0;
  padding-top: 42px;
  background: radial-gradient(140% 140% at 0% 0%, rgba(255, 255, 255, 0.1), rgba(6, 6, 6, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.tier-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, 0.14), transparent 55%);
  opacity: 0.5;
  pointer-events: none;
}

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

.tier-card .billing-title {
  font-size: 15px;
  letter-spacing: 0.2px;
}

.tier-card .billing-meta {
  color: rgba(226, 232, 240, 0.8);
}

.tier-card:active {
  transform: translateY(1px);
}

.tier-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tier-card__badge {
  position: absolute;
  top: 12px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 8px 18px rgba(0, 0, 0, 0.26);
}

.tier-card__badge--accent {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.92);
  color: #ffffff;
}

.tier-card__desc {
  color: rgba(248, 250, 252, 0.92);
  font-size: 13px;
  line-height: 1.45;
}

.tier-card__features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
  padding: 10px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tier-card__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.9);
}

.tier-card__feature::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  flex-shrink: 0;
}

.tier-card__feature--muted {
  color: rgba(226, 232, 240, 0.66);
}

.tier-card__feature--strong {
  color: #ffffff;
  font-weight: 800;
}

.tier-card__price {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: auto;
}

.tier-card--selected {
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: 0 26px 56px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tier-card--accent {
  background:
    radial-gradient(160% 120% at 100% 0%, rgba(125, 211, 252, 0.28), transparent 40%),
    linear-gradient(145deg, rgba(37, 99, 235, 0.32), rgba(2, 6, 23, 0.94));
  border-color: rgba(125, 211, 252, 0.42);
}

.tier-card__bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #f9fafb;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.tier-card__amount {
  font-size: 18px;
}

.tier-card__amount--old {
  font-size: 14px;
  color: rgba(248, 250, 252, 0.56);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

button.primary.pay-button .pay-value .tier-card__amount--old {
  font-size: 15px;
  color: rgba(17, 24, 39, 0.55);
}

.tier-card--selected .tier-card__bubble {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b0b0b;
  box-shadow: 0 12px 26px rgba(255, 255, 255, 0.25);
}

.tier-card--selected .tier-card__badge {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b0b0b;
  box-shadow: 0 12px 26px rgba(255, 255, 255, 0.22);
}

@media (max-width: 760px) {
  .tier-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

  .tier-card {
    padding: 38px 10px 12px;
    gap: 8px;
    min-height: 0;
  }

  .tier-card .billing-title {
    font-size: 13px;
    line-height: 1.15;
  }

  .tier-card .billing-meta {
    font-size: 11px;
    line-height: 1.25;
  }

  .tier-card__badge {
    top: 10px;
    left: 8px;
    min-height: 24px;
    padding: 4px 9px 4px 7px;
    font-size: 10px;
  }

  .tier-card__desc {
    display: none;
  }

  .tier-card__features {
    gap: 5px;
    padding: 8px 0 0;
  }

  .tier-card__feature {
    font-size: 11px;
    line-height: 1.2;
  }

  .tier-card__feature:nth-child(n+3) {
    display: none;
  }

  .tier-card__bubble {
    padding: 7px 10px;
  }

  .tier-card__amount {
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .quote-card {
    padding: 16px;
  }

  .quote-title {
    font-size: 19px;
  }

  .quote-summary {
    grid-template-columns: 1fr;
  }

  .quote-step {
    padding: 11px 12px;
  }

  .tier-grid {
    gap: 8px;
  }

  .tier-card {
    padding: 36px 9px 10px;
  }
}

.copy-settings {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.copy-settings__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copy-settings__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 700;
  color: #e5e7eb;
}

.copy-settings__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.copy-settings__desc {
  font-size: 12px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.65);
}

.copy-settings__item--expand {
  cursor: pointer;
}

.copy-settings__item--expanded .copy-settings__chevron {
  transform: rotate(45deg);
}

.copy-settings__item--sub {
  padding: 8px 12px;
}

.copy-settings__item--disabled {
  opacity: 0.5;
}

.copy-settings__chevron {
  width: 12px;
  height: 12px;
  margin-left: auto;
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.copy-settings__sublist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 12px;
}

.copy-settings__attachments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copy-settings__attachments .copy-settings__sublist {
  padding-left: 0;
}

.copy-settings__section-title {
  font-size: 14px;
  font-weight: 700;
  color: #e5e7eb;
}

.copy-settings__switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.copy-settings__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.copy-settings__toggle {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.copy-settings__toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s ease;
}

.copy-settings__input:checked + .copy-settings__toggle {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(16, 185, 129, 0.9));
  border-color: rgba(34, 197, 94, 0.8);
}

.copy-settings__item--accent .copy-settings__input:checked + .copy-settings__toggle {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.35), rgba(99, 102, 241, 0.95));
  border-color: rgba(99, 102, 241, 0.85);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.copy-settings__input:checked + .copy-settings__toggle::after {
  transform: translateX(20px);
}

.copy-settings__save {
  margin-top: 12px;
}

.tg-star {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg height='45' viewBox='0 0 46 45' width='46' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='25%25' x2='74.92%25' y1='.825%25' y2='107.86%25'%3E%3Cstop offset='0' stop-color='%23ffd951'/%3E%3Cstop offset='1' stop-color='%23ffb222'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='50%25' x2='50%25' y1='0%25' y2='99.795%25'%3E%3Cstop offset='0' stop-color='%23e58f0d'/%3E%3Cstop offset='0.99963' stop-color='%23eb7915'/%3E%3C/linearGradient%3E%3Cpath id='c' d='m15.45 13.17 5.29-10.61c.61-1.22 2.09-1.71 3.3-1.09.47.24.86.63 1.09 1.11l5 10.23c.41.83 1.21 1.4 2.12 1.51l10.47 1.27c1.42.17 2.43 1.47 2.26 2.91-.07.59-.34 1.14-.76 1.56l-8.27 8.2c-.33.33-.49.8-.44 1.27l1.38 11.08c.2 1.59-.92 3.04-2.49 3.23-.59.08-1.19-.04-1.72-.32l-8.74-4.81c-.63-.35-1.39-.36-2.03-.03l-9.06 4.68c-1.27.66-2.83.14-3.48-1.14-.25-.49-.34-1.03-.26-1.57l.72-5.08c.36-2.49 1.89-4.64 4.1-5.78l10.06-5.17c.27-.14.37-.47.24-.74-.11-.21-.34-.33-.57-.29l-12.3 1.77c-1.88.27-3.78-.27-5.26-1.48l-4.09-3.36c-1.17-.96-1.35-2.7-.4-3.88.44-.55 1.08-.9 1.77-.99l10.5-1.36c.68-.09 1.26-.51 1.57-1.12z'/%3E%3Cfilter id='d' height='111.7%25' width='111.4%25' x='-5.7%25' y='-5.9%25'%3E%3CfeOffset dx='2' dy='3' in='SourceAlpha' result='shadowOffsetInner1'/%3E%3CfeComposite in='shadowOffsetInner1' in2='SourceAlpha' k2='-1' k3='1' operator='arithmetic' result='shadowInnerInner1'/%3E%3CfeColorMatrix in='shadowInnerInner1' type='matrix' values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1  0 0 0 0.65667938 0'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cuse fill='url(%23a)' fill-rule='evenodd' xlink:href='%23c'/%3E%3Cuse fill='%23000' filter='url(%23d)' xlink:href='%23c'/%3E%3Cuse stroke='url(%23b)' stroke-width='2' xlink:href='%23c'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  vertical-align: middle;
}

.channel-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-detail__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.channel-detail__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.channel-detail__title {
  font-weight: 800;
  font-size: 16px;
  color: #f3f4f6;
}

.channel-detail__desc {
  color: #9ca3af;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.channel-detail__meta {
  color: #cbd5e1;
  font-size: 13px;
}

.channel-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-detail__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-detail__disabled-reason {
  font-size: 12px;
  line-height: 1.35;
  color: #9ca3af;
  text-align: center;
}

.detail-tabs {
  display: flex;
  gap: 8px;
}

.detail-tab {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0b0b;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  box-shadow: none;
}

.detail-tab.active {
  background: #ffffff;
  color: #0b0b0b;
  border-color: transparent;
}

.publications-list {
  gap: 10px;
}

.publication-item {
  cursor: default;
}

.publication-item--selected {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.publication-meta {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.publication-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  padding: 0;
  font-size: 20px;
  background: #111827;
}

.publication-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.publication-thumb--round {
  border-radius: 50%;
}

.publication-thumb--audio {
  font-size: 22px;
}

.publication-thumb--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.publication-thumb--count-2 {
  grid-template-rows: minmax(0, 1fr);
}

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

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

.publication-thumb__cell {
  width: 100%;
  height: 100%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 12px;
}

.publication-thumb__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.publication-thumb__cell--audio {
  font-size: 14px;
}

.publication-thumb__cell--span2 {
  grid-column: 1 / span 2;
}

.publication-get-btn {
  width: 136px;
  min-width: 136px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
}

.publication-action-btn {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #0b0b0b;
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
}

.publication-thumb--openable {
  cursor: pointer;
}

.publication-action-btn .tg-star {
  width: 15px;
  height: 15px;
}

.publication-action-btn__label,
.publication-action-btn__price {
  position: relative;
  z-index: 1;
}

.publication-action-btn__price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}

.publication-action-btn__amount {
  font-size: 14px;
}

.publication-action-btn--pay {
  justify-content: space-between;
  min-width: 136px;
}

.publication-action-btn--busy {
  background: transparent;
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.publication-action-btn--pending {
  background: rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
  pointer-events: none;
}

.publication-action-btn__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #38bdf7;
  transition: width 0.5s linear;
  z-index: 0;
}

.publication-action-btn__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(226, 232, 240, 0.35);
  border-top-color: rgba(226, 232, 240, 0.95);
  animation: spin 0.8s linear infinite;
  position: relative;
  z-index: 1;
}

.publication-action-btn--sent {
  background: #38bdf7;
  color: #ffffff;
  border-color: transparent;
  pointer-events: none;
}

.publication-action-btn--sent-open {
  pointer-events: auto;
  cursor: pointer;
}

.publication-action-btn--queue-full {
  background: rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  pointer-events: none;
}

.publication-action-hint {
  min-width: 136px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  color: #94a3b8;
}

.publications-scroll-top {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px) + var(--app-safe-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--app-safe-bottom, 0px));
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 230;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

.publications-scroll-top:active {
  transform: translateY(1px);
}

.channel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: #e5e7eb;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.chip--green {
  background: linear-gradient(140deg, rgba(52, 211, 153, 0.18), rgba(34, 197, 94, 0.12));
  border-color: rgba(34, 197, 94, 0.36);
  color: #d1fadf;
}

.chip--red {
  background: linear-gradient(140deg, rgba(248, 113, 113, 0.2), rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.38);
  color: #fee2e2;
}

.chip--loading {
  padding: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: transparent;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chip--loading::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}

.channel-list__section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(229, 231, 235, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 4px 6px;
}

.channel-search {
  position: relative;
}

.channel-tabs {
  display: flex;
  gap: 8px;
  margin-top: 0;
}

.channel-search {
  margin-top: 12px;
}

.channel-search__field {
  position: relative;
}

#channel-list.session-list {
  margin-top: 12px;
}

.channel-tabs.hidden {
  display: none;
}

.tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tab.active {
  background: #ffffff;
  color: #0b0b0b;
  border-color: #ffffff;
  box-shadow: 0 8px 26px rgba(255, 255, 255, 0.18);
}

.channel-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 40px 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  outline: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.channel-search input::placeholder {
  color: #6b7280;
}

.channel-search--active input {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.channel-search input:focus,
.channel-search input:focus-visible {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.channel-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.channel-search__clear:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.channel-search__clear:active {
  transform: translateY(-50%) scale(0.97);
}

.channel-search__meta {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.3;
}

.channel-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 13px;
  user-select: none;
}

.channel-filter input {
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  margin: 0;
}

.channel-filter input:checked {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 10px 26px rgba(255, 255, 255, 0.2);
}

.channel-filter input:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 10px;
  border: solid #0b0b0b;
  border-width: 0 2px 2px 0;
  border-radius: 1px;
  transform: translate(-50%, -52%) rotate(45deg);
}

.list-spinner {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 10px 0;
  color: #9ca3af;
  font-size: 13px;
}

.list-spinner::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.country-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #f3f4f6;
}

.country-flag {
  font-size: 22px;
}

.country-name {
  flex: 1;
  font-weight: 600;
}

.country-arrow {
  color: #6b7280;
  font-size: 18px;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.phone-prefix-input {
  max-width: 90px;
  min-width: 82px;
  font-size: 20px;
  font-weight: 700;
  color: #f3f4f6;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.phone-prefix-input::placeholder {
  color: #4b5563;
}

.phone-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: transparent !important; /* hide native text to avoid overlay */
  -webkit-text-fill-color: transparent !important; /* Safari: hide native text to avoid overlay */
  text-shadow: 0 0 0 transparent !important;
  caret-color: #f3f4f6;
  font: inherit;
  letter-spacing: inherit;
  font-variant-numeric: inherit;
  padding: 12px !important; /* keep in sync with ghost */
  outline: none;
  position: relative;
  z-index: 2; /* caret above ghost */
}

.phone-input::placeholder {
  color: transparent;
}

.phone-field {
  flex: 1;
  position: relative;
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  --phone-ghost-offset-x: 0px; /* alignment with input padding */
}

.phone-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  color: #f3f4f6;
  font: inherit;
  letter-spacing: inherit;
  font-variant-numeric: inherit;
  pointer-events: none;
  white-space: pre;
  z-index: 1;
  padding: 12px; /* match input padding so caret and text align */
  box-sizing: border-box;
  transform: translateX(var(--phone-ghost-offset-x));
}

.ghost-entered {
  color: #f3f4f6;
}

.ghost-zeros {
  color: #4b5563;
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  color: #cbd5e1;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
  outline: none;
}

#step-password.password-invalid input[type="password"] {
  border-color: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.6), 0 0 0 4px rgba(248, 113, 113, 0.16);
}

#step-password.password-invalid {
  animation: password-shake 0.26s ease;
}

input::placeholder {
  color: #4b5563;
}

button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #161616;
  color: #9ca3af;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

button.primary {
  background: #2a2f3a;
  color: #8b95a5;
  opacity: 0.4;
  pointer-events: none;
}

button.primary.accent {
  background: #ffffff;
  color: #0b0b0b;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.18);
}

button.primary.pay-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

button.primary.pay-button .pay-text {
  flex: 1;
  text-align: left;
  font-weight: 700;
}

button.primary.pay-button .pay-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

button.primary.pay-button .pay-amount {
  font-size: 20px;
}

button.primary.pay-button .tg-star {
  width: 20px;
  height: 20px;
}

button.primary.pay-button.hidden {
  display: none;
}

button.primary.accent:active {
  transform: translateY(1px);
  box-shadow: none;
}

button:active {
  transform: translateY(1px);
  box-shadow: none;
}

button.primary.active {
  background: #fff;
  color: #111827;
  opacity: 1;
  pointer-events: auto;
}

button.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
  box-shadow: none;
  cursor: default;
}

button.is-loading > * {
  visibility: hidden;
}

button.primary.is-loading,
button.primary.active.is-loading,
button.primary.accent.is-loading {
  background: #2a2a2a;
  opacity: 1;
  color: transparent;
}

button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}

button.copy-settings__item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e5e7eb;
  text-align: left;
}

button.copy-settings__item:disabled {
  opacity: 0.5;
  cursor: default;
}

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

.copy-settings__pay-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #f9fafb;
}

.copy-settings__pay--disabled .copy-settings__pay-value {
  opacity: 0.6;
}

.muted {
  color: #94a3b8;
  font-size: 14px;
}

.hidden {
  display: none;
}

.webapp.story-viewer-open {
  overflow: hidden;
}

.encryption-badge {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  text-align: center;
}

.encryption-badge__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #6ee7b7;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.encryption-badge__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

body.step-phone .encryption-badge,
body.step-code .encryption-badge,
body.step-password .encryption-badge {
  display: flex;
}

@keyframes password-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.modal-body {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  max-height: 80vh;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.modal-search {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
  outline: none;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.story-viewer.hidden {
  display: none;
}

.story-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.story-viewer__sheet {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(max(var(--app-content-safe-top, 0px), var(--app-safe-raw-top, 0px)) + var(--tg-header-offset, 0px))
    12px
    calc(
      18px
      + max(var(--app-content-safe-bottom, 0px), var(--app-safe-raw-bottom, 0px))
      + min(12px, max(var(--app-content-safe-bottom, 0px), var(--app-safe-raw-bottom, 0px)))
    );
  gap: 10px;
}

.story-viewer__progress {
  display: flex;
  gap: 4px;
}

.story-viewer__seg {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  background: rgba(148, 163, 184, 0.35);
}

.story-viewer__seg-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
}

.story-viewer__seg--idle .story-viewer__seg-fill {
  background: rgba(148, 163, 184, 0.8);
}

.story-viewer__seg--blocked .story-viewer__seg-fill {
  background: #ec1d24;
}

.story-viewer__seg--done .story-viewer__seg-fill {
  background: #ffffff;
}

.story-viewer__seg--current {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.story-viewer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 0;
}

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

.story-viewer__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.story-viewer__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-viewer__author-meta {
  min-width: 0;
}

.story-viewer__name {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-viewer__time {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.story-viewer__close {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  box-shadow: none;
  border: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
}

.story-viewer__media {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  z-index: 4;
}

.story-viewer__nav--prev {
  left: 0;
}

.story-viewer__nav--next {
  right: 0;
}

.story-viewer__img,
.story-viewer__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

@media (min-width: 900px) {
  .story-viewer__sheet {
    width: min(560px, 100%);
    margin: 0 auto;
  }

  .story-viewer__media {
    width: min(430px, 100%);
    margin: 0 auto;
  }

  .story-viewer__img,
  .story-viewer__video {
    object-fit: contain;
  }
}

.story-viewer__locked {
  color: #fca5a5;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  padding: 20px;
}

.story-viewer__spinner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
  z-index: 5;
}

.story-viewer__bottom {
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-viewer__action {
  min-height: 46px;
  height: 46px;
  padding: 0 14px;
  position: relative;
  overflow: hidden;
}

.story-action-btn__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgb(56, 189, 247);
  opacity: 1;
  transition: width 0.5s linear;
  z-index: 0;
}

.story-action-btn__label {
  position: relative;
  z-index: 1;
}

.story-viewer__action.story-action-btn--busy {
  background: #3b3b3b;
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
  opacity: 1 !important;
}

.story-viewer__action.story-action-btn--pending {
  background: rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
  opacity: 1 !important;
}

.story-viewer__action.story-action-btn--sent {
  background: #38bdf7;
  color: #ffffff;
  box-shadow: none;
  opacity: 1 !important;
}

.story-viewer__action-hint {
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: #94a3b8;
}

.story-action-btn__spinner {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  display: inline-block;
  flex: 0 0 16px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid rgba(226, 232, 240, 0.35);
  border-top-color: rgba(226, 232, 240, 0.95);
  animation: spin 0.8s linear infinite;
  position: relative;
  z-index: 1;
}

.country-list {
  overflow-y: auto;
  padding: 0 8px 12px;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

.country-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.country-item .flag {
  font-size: 20px;
}

.country-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.country-item .name {
  font-weight: 700;
}

.country-item .code {
  color: #9ca3af;
  font-size: 13px;
}

@media (max-width: 480px) {
  .webapp-container {
    padding: 0;
  }
  .hero-title {
    font-size: 24px;
  }
}
