


/* ════════════════════════════════════════════════════════════════════════════
   LIGHT THEME — override ALL primitive vars so every component responds
   ════════════════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  /* Primitive overrides */
  --ps-black:      #F0EDE6;   /* bg becomes warm light */
  --ps-white:      #18181F;   /* text becomes near-black */
  --ps-grey:       #E4DFD2;   /* surfaces become light */
  --ps-grey-mid:   #DAD4C5;
  --ps-grey-light: #7A7A8A;
  --ps-gold:       #8B6F3A;   /* darker gold for contrast on light */
  --ps-gold-light: #6B5228;
  --ps-gold-dark:  #C8A96E;   /* swap: light gold used in gradients */

  /* Semantic overrides */
  --color-bg:            #F0EDE6;
  --color-surface:       #E4DFD2;
  --color-surface2:      #DAD4C5;
  --color-text:          #18181F;
  --color-muted:         #7A7A8A;
  --color-border:        rgba(139,111,58,0.2);
  --color-border-strong: rgba(139,111,58,0.4);
}

/* Opaque element backgrounds (hardcoded rgba in dark theme) */
[data-theme="light"] body                  { background: #F0EDE6; }
[data-theme="light"] .ps-header            { background: rgba(240,237,230,0.94); border-color: rgba(139,111,58,0.12); }
[data-theme="light"] .ps-shop-header       { background: rgba(240,237,230,0.94); }
[data-theme="light"] .ps-country-screen    { background: #F0EDE6; }
[data-theme="light"] .ps-country-screen__header { background: rgba(240,237,230,0.94); border-color: rgba(139,111,58,0.1); }
[data-theme="light"] .ps-buy-bar           { background: rgba(240,237,230,0.98); border-color: rgba(139,111,58,0.12); backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .ps-sheet__content    { background: #E4DFD2; }
[data-theme="light"] .ps-sheet__footer     { background: #E4DFD2; border-color: rgba(139,111,58,0.12); }

/* Ambient decorations hidden on light */
[data-theme="light"] body::before,
[data-theme="light"] body::after           { display: none; }

/* Logo — black text on light bg */
[data-theme="light"] .ps-logo__prim        { color: #18181F; }
[data-theme="light"] .ps-logo__sim         { color: #18181F; }
[data-theme="light"] .ps-logo__line-prim   { background: rgba(24,24,31,0.18); }
[data-theme="light"] .ps-logo__line-e      { box-shadow: none; }
[data-theme="light"] .ps-logo__line-sim    { background: rgba(24,24,31,0.07); }

/* Online pill */
[data-theme="light"] .ps-pill             { border-color: rgba(139,111,58,0.3); color: #8B6F3A; }
[data-theme="light"] .ps-dot-blink        { background: #8B6F3A; box-shadow: none; }
[data-theme="light"] .ps-menu-row__online-dot { background: #8B6F3A; box-shadow: none; }

/* Active nav label color (uses --ps-gold, already overridden) */
[data-theme="light"] .ps-nav-btn.active::after { background: #8B6F3A; box-shadow: none; }

/* Sheet overlay darker on light */
[data-theme="light"] .ps-sheet-overlay.open { background: rgba(24,24,31,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ════════════════════════════════════════════════════════════════════════════
   FLAG CIRCLES (flagcdn.com) — wrapper div so onerror & clip work reliably
   ════════════════════════════════════════════════════════════════════════════ */
.ps-flag {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid rgba(200,169,110,0.15);
  background: var(--color-surface2);
  font-size: 18px;   /* fallback emoji size */
}
.ps-flag img {
  width: 140%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* ОАЭ: в круге якорим по левому краю — видна красная вертикаль у древка */
.ps-flag--hoist-start {
  justify-content: flex-start;
}
.ps-flag--hoist-start img {
  object-position: left center;
  width: 165%;
  height: 100%;
  max-width: none;
}
.ps-flag-fallback {
  font-size: 18px;
  line-height: 1;
}
.ps-flag--lg { width: 56px; height: 56px; font-size: 26px; }
.ps-flag--sm { width: 24px; height: 24px; font-size: 13px; }
.ps-flag--xs { width: 22px; height: 22px; font-size: 11px; }

.ps-inline-cart-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-right: 4px;
}
.ps-inline-cart-ic svg {
  width: 18px;
  height: 18px;
}


/* ════════════════════════════════════════════════════════════════════════════
   PREMIUM COUNTRY ROW (Russia / featured)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-country-row--premium {
  background: linear-gradient(135deg, rgba(200,169,110,0.10) 0%, rgba(200,169,110,0.03) 100%);
  border-color: rgba(200,169,110,0.30);
}

.ps-premium-badge {
  font-family: 'Syncopate', sans-serif;
  font-size: 7px; letter-spacing: 0.18em;
  color: var(--ps-gold);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Price under country name */
.ps-country-meta {
  font-size: 11px;
  color: var(--ps-gold);
  margin-top: 3px;
  opacity: 0.75;
}


/* ════════════════════════════════════════════════════════════════════════════
   SHEET — ALWAYS-VISIBLE FOOTER (flex child, never scrolls)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-sheet__footer {
  flex-shrink: 0;   /* never compressed by flex */
  background: var(--ps-grey);
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(200,169,110,0.1);
  box-shadow: 0 -8px 16px -8px rgba(8,8,16,0.35);
}
.ps-sheet__footer .ps-btn-primary { width: 100%; }

/* Two-button row inside sheet footer (mirrors .ps-buy-bar__row) */
.ps-sheet__footer-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.ps-sheet__footer-row .ps-btn-outline,
.ps-sheet__footer-row .ps-btn-primary {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  width: auto;
}
.ps-sheet__footer-row .ps-btn-outline {
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.2;
}
.ps-sheet__footer-row .ps-btn-primary {
  flex-direction: column;
  padding: 12px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}


/* ════════════════════════════════════════════════════════════════════════════
   COUNTRIES ACCORDION (in region / global sheets)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-accordion {
  margin-top: 12px;
  border-top: 1px solid rgba(200,169,110,0.1);
  padding-top: 2px;
}

.ps-accordion-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none;
  padding: 12px 0;
  font-family: 'Syncopate', sans-serif;
  font-size: 8px; letter-spacing: 0.2em;
  color: var(--ps-gold);
  cursor: pointer; text-align: left;
  gap: 8px;
}

.ps-accordion-chevron {
  font-size: 16px; flex-shrink: 0;
  transition: transform 0.25s ease;
  display: inline-block;
}
.ps-accordion.open .ps-accordion-chevron { transform: rotate(90deg); }

.ps-accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease;
}
.ps-accordion.open .ps-accordion-body { max-height: 1200px; }

.ps-countries-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 6px;
  padding: 4px 0 12px;
}

.ps-accordion-flag-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ps-accordion-flag-item .ps-flag {
  width: 32px; height: 32px;
}
.ps-accordion-flag-name {
  font-size: 8px;
  color: var(--color-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50px;
  line-height: 1.2;
}


/* ════════════════════════════════════════════════════════════════════════════
   THEME OPTION (in sheet)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-theme-option {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
}
.ps-theme-option:active { border-color: var(--ps-gold); }
.ps-theme-option.active {
  border-color: var(--ps-gold);
  background: rgba(200,169,110,0.06);
}

/* ════════════════════════════════════════════════════════════════════════════
   v3 — Header cart, SVG icons, buy bar, cart screen, global countries toggle
   ════════════════════════════════════════════════════════════════════════════ */

.ps-header-cart {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--ps-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
}
.ps-header-cart:active,
.ps-header-cart:hover {
  background: rgba(200, 169, 110, 0.1);
  border-color: var(--ps-gold);
}
.ps-header-cart .ps-nav-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  line-height: 0;
  padding: 0;
  margin: 0;
  color: var(--ps-gold);
}
.ps-header-cart .ps-nav-svg svg,
.ps-header-cart svg {
  display: block;
  width: 22px;
  height: 22px;
}
.ps-header-cart__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ps-gold);
  color: var(--ps-black);
  font-size: 11px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg);
  line-height: 1;
}
.ps-header-cart__badge.visible {
  display: inline-flex;
}

.ps-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: rgba(200, 169, 110, 0.12);
  color: var(--ps-gold);
}
.ps-icon-circle--xs {
  width: 22px;
  height: 22px;
}
.ps-icon-circle--sm {
  width: 32px;
  height: 32px;
}
.ps-icon-circle--md {
  width: 48px;
  height: 48px;
}
.ps-icon-circle--lg {
  width: 72px;
  height: 72px;
}
.ps-icon-circle--sm svg,
.ps-icon-circle svg {
  width: 18px;
  height: 18px;
}
.ps-icon-circle--xs svg { width: 13px; height: 13px; }
.ps-icon-circle--md svg { width: 24px; height: 24px; }
.ps-icon-circle--lg svg { width: 36px; height: 36px; }
[data-theme="light"] .ps-icon-circle {
  background: rgba(139, 111, 58, 0.08);
  color: var(--ps-gold);
}

.ps-menu-row__icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ps-buy-bar__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 0;
}
.ps-buy-bar__row .ps-btn-outline,
.ps-buy-bar__row .ps-btn-primary {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.ps-buy-bar__row .ps-btn-outline {
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.2;
}
.ps-buy-bar__row .ps-btn-outline .ps-inline-cart-ic {
  margin-right: 0;
}
.ps-buy-bar__row .ps-btn-outline .ps-inline-cart-ic svg {
  width: 20px;
  height: 20px;
}
.ps-buy-bar__row .ps-btn-primary {
  flex-direction: column;
  padding: 12px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}

.ps-global-card__countries-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0 0;
  background: rgba(200, 169, 110, 0.06);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--ps-gold);
  font-family: 'Syncopate', sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.ps-global-card__countries-toggle .ps-chevron {
  transition: transform 0.25s ease;
}
.ps-global-card.open .ps-global-card__countries-toggle .ps-chevron {
  transform: rotate(90deg);
}
.ps-global-card__countries-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.ps-global-card.open .ps-global-card__countries-body {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 10px;
}
.ps-global-card .ps-countries-grid {
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.ps-country-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text);
  opacity: 0.9;
}
.ps-country-mini .ps-flag {
  width: 22px;
  height: 22px;
}

.ps-cart-screen {
  padding: 16px 16px 120px;
}
.ps-cart-title {
  font-family: 'Syncopate', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ps-gold);
  margin-bottom: 16px;
}
.ps-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  margin-bottom: 10px;
}
.ps-cart-item__info {
  flex: 1;
  min-width: 0;
}
.ps-cart-item__title {
  font-weight: 500;
  font-size: 14px;
}
.ps-cart-item__sub {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}
.ps-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--ps-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ps-qty-btn svg {
  width: 14px;
  height: 14px;
}
.ps-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.ps-cart-item__price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ps-cart-remove {
  background: none;
  border: none;
  color: var(--color-muted);
  padding: 4px;
}
.ps-cart-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-muted);
}
.ps-cart-summary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.ps-cart-pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.ps-cart-pay-row:active {
  border-color: var(--ps-gold);
  background: rgba(200, 169, 110, 0.06);
}
.ps-cart-pay-row__label {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--color-muted);
}
.ps-cart-pay-row__value {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  text-align: right;
}
.ps-cart-pay-row__chev {
  color: var(--color-muted);
  font-size: 18px;
  line-height: 1;
}

/* Шит способов оплаты (TonMobile-style) */
/* Открывается поверх корзины И поверх шторки пополнения (#topup-sheet z-index:201),
   поэтому поднимаем его выше — иначе попап «прячется» под пополнением и некликабелен. */
#pay-overlay.ps-sheet-overlay { z-index: 300; }
#pay-sheet.ps-sheet--pay      { z-index: 301; }
.ps-sheet--pay .ps-sheet__content {
  padding-top: 8px;
}
.ps-pay-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.ps-pay-sheet__title {
  font-size: 17px;
  font-weight: 500;
  color: var(--color-muted);
}
.ps-pay-sheet__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface2);
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ps-pay-sheet__close:active {
  opacity: 0.85;
}
.ps-pay-sheet__body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
}
.ps-pay-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 16px;
}
.ps-pay-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 4px 12px 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  border-radius: 12px;
  transition: background 0.15s;
}
.ps-pay-option:active {
  background: rgba(200, 169, 110, 0.08);
}
.ps-pay-option__label {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text);
}
.ps-pay-option__radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(139, 111, 58, 0.35);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .ps-pay-option__radio {
  border-color: rgba(200, 169, 110, 0.35);
}
.ps-pay-option.selected .ps-pay-option__radio {
  border-color: var(--ps-gold);
}
.ps-pay-option:not(.selected) .ps-pay-option__dot {
  display: none;
}
.ps-pay-option.selected .ps-pay-option__dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ps-gold);
}

.ps-pay-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ps-pay-icon svg {
  width: 22px;
  height: 22px;
  color: #fff;
}
.ps-pay-icon__txt {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.1;
  text-align: center;
  max-width: 34px;
}
.ps-pay-icon--sbp {
  background: linear-gradient(145deg, #4a148c 0%, #6a1b9a 40%, #e65100 100%);
}
.ps-pay-icon--mir {
  background: #0d8043;
}
.ps-pay-icon--intl {
  background: #42a5f5;
}
.ps-pay-icon--ton {
  background: #0098ea;
}
.ps-pay-icon--wallet {
  background: #2481cc;
}
.ps-pay-icon--stars {
  background: #64b5f6;
}
.ps-pay-icon--crypto {
  background: #1a237e;
}
.ps-pay-icon--balance {
  background: linear-gradient(145deg, #00b09b 0%, #16a34a 100%);
}
.ps-pay-icon--balance .ps-pay-icon__txt {
  font-size: 20px;
  font-weight: 800;
}

.ps-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0;
  font-size: 18px;
}
.ps-promo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ps-promo-row .ps-search {
  flex: 1;
}
.ps-promo-row .ps-search:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ps-promo-feedback {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.ps-promo-feedback.ok {
  background: rgba(200, 169, 110, 0.12);
  color: var(--ps-gold);
  border: 1px solid rgba(200, 169, 110, 0.35);
}
.ps-promo-feedback.err {
  background: rgba(255, 90, 90, 0.10);
  color: #ff6b6b;
  border: 1px solid rgba(255, 90, 90, 0.30);
}
.ps-promo-feedback.info {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ps-text-secondary, #aaa);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Карточка "Пригласить друга" в аккаунте ────────────────────────────────── */
.ps-invite-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin: 10px 0;
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.14), rgba(200, 169, 110, 0.04));
  border: 1px solid rgba(200, 169, 110, 0.30);
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.ps-invite-card:active {
  transform: scale(0.98);
}
.ps-invite-card__icon {
  display: inline-flex;
  flex-shrink: 0;
}
.ps-invite-card__text {
  flex: 1;
}
.ps-invite-card__title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.ps-invite-card__sub {
  font-size: 12px;
  color: var(--ps-text-secondary, #999);
}
.ps-invite-card__chev {
  font-size: 22px;
  color: var(--ps-gold);
  opacity: 0.7;
}

/* ── Экран "Пригласить друга" ──────────────────────────────────────────────── */
.ps-invite-screen {
  padding: 16px;
  padding-bottom: 100px;
}
.ps-invite-hero {
  text-align: center;
  padding: 24px 16px 12px;
}
.ps-invite-hero__icon {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 16px;
}
.ps-invite-hero__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ps-gold);
}
.ps-invite-section {
  margin-top: 20px;
}
.ps-invite-steps,
.ps-invite-rules {
  margin: 8px 0 0;
  padding: 12px 16px 12px 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.ps-invite-steps li,
.ps-invite-rules li {
  margin: 4px 0;
}
.ps-invite-link-box {
  margin: 8px 0;
  padding: 12px 14px;
  background: rgba(200, 169, 110, 0.08);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: 12px;
  word-break: break-all;
}
.ps-invite-link {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--ps-gold);
}
.ps-invite-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.ps-invite-actions .ps-btn-primary,
.ps-invite-actions .ps-btn-outline {
  flex: 1;
}
.ps-invite-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.ps-invite-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.ps-invite-stat__num {
  font-size: 20px;
  font-weight: 600;
  color: var(--ps-gold);
}
.ps-invite-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ps-text-secondary, #888);
  margin-top: 4px;
}
.ps-invite-promos {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-invite-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.ps-invite-promo__code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  color: var(--ps-gold);
}
.ps-invite-promo__meta {
  flex: 1;
  font-size: 12px;
  color: var(--ps-text-secondary, #999);
}
.ps-invite-promo__status {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ps-invite-promo__status--active { background: rgba(200, 169, 110, 0.15); color: var(--ps-gold); }
.ps-invite-promo__status--used   { background: rgba(255, 255, 255, 0.06); color: var(--ps-text-secondary, #999); }
.ps-invite-promo__status--expired,
.ps-invite-promo__status--revoked { background: rgba(255, 90, 90, 0.10); color: #ff6b6b; }
.ps-invite-promos__empty {
  padding: 14px;
  text-align: center;
  color: var(--ps-text-secondary, #777);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 12px;
}

[data-theme="light"] .ps-bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 111, 58, 0.15);
  box-shadow:
    0 8px 24px rgba(139, 111, 58, 0.18),
    0 2px 6px rgba(139, 111, 58, 0.1);
}
[data-theme="light"] .ps-nav-btn.active {
  background: rgba(139, 111, 58, 0.1);
}

[data-theme="light"] body,
[data-theme="light"] {
  --color-bg: #eee8dc;
  --color-surface: #ffffff;
  --color-surface2: #f8f3e8;
  --color-text: #1a1a1f;
  --color-muted: #8a7e68;
  --color-border: rgba(139, 111, 58, 0.18);
  --color-border-strong: rgba(139, 111, 58, 0.4);
  --ps-gold: #8b6f3a;
}
[data-theme="light"] body {
  background: #eee8dc;
}

/* Одна колонка по ширине навбара — контент и строки визуально по центру экрана */
[data-theme="light"] #app {
  max-width: 420px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

[data-theme="light"] .ps-country-row,
[data-theme="light"] .ps-menu-card,
[data-theme="light"] .ps-region-card,
[data-theme="light"] .ps-global-card,
[data-theme="light"] .ps-faq-card,
[data-theme="light"] .ps-cart-item,
[data-theme="light"] .ps-cart-pay-row {
  box-shadow: 0 2px 6px rgba(139, 111, 58, 0.12);
  border-color: rgba(139, 111, 58, 0.12);
}
[data-theme="light"] .ps-cart-pay-row {
  background: #ffffff;
}

/* Магазин: строки стран — белая карточка как блок меню в профиле */
[data-theme="light"] .ps-country-row {
  background: #ffffff;
  color: var(--color-text);
}
[data-theme="light"] .ps-country-row:active {
  background: rgba(139, 111, 58, 0.06);
}
[data-theme="light"] .ps-country-row .ps-country-name {
  color: var(--color-text);
}
[data-theme="light"] .ps-country-row .ps-country-meta {
  color: var(--color-muted);
}
[data-theme="light"] .ps-btn-global-add {
  background: rgba(139, 111, 58, 0.08);
  border-color: rgba(139, 111, 58, 0.35);
}
[data-theme="light"] .ps-btn-global-add:hover {
  background: rgba(139, 111, 58, 0.14);
  border-color: rgba(139, 111, 58, 0.5);
}

[data-theme="light"] .ps-country-row--premium {
  background: #fffdf8;
  border-color: rgba(139, 111, 58, 0.35);
  box-shadow: 0 2px 10px rgba(139, 111, 58, 0.12);
}

/* Магазин: РЕГИОНЫ — белые карточки в светлой теме (как страны) */
[data-theme="light"] .ps-region-card {
  background: #ffffff;
  color: var(--color-text);
}
[data-theme="light"] .ps-region-card::before {
  display: none;
}
[data-theme="light"] .ps-region-card:active {
  background: rgba(139, 111, 58, 0.06);
  border-color: var(--ps-gold);
}
[data-theme="light"] .ps-region-name {
  color: var(--color-text);
}

/* Магазин: МИР — белые карточки в светлой теме (как страны) */
[data-theme="light"] .ps-global-card {
  background: #ffffff;
  color: var(--color-text);
}
[data-theme="light"] .ps-global-card::before {
  display: none;
}
[data-theme="light"] .ps-global-card__title {
  color: var(--color-text);
}
[data-theme="light"] .ps-global-card__countries {
  color: rgba(139, 111, 58, 0.7);
}
[data-theme="light"] .ps-global-card__footer {
  border-top-color: rgba(139, 111, 58, 0.12);
}

/* Детальный экран СТРАНЫ — переключатель и строки тарифов в светлой теме */
[data-theme="light"] .ps-plan-toggle {
  background: #f8f3e8;
  border-color: rgba(139, 111, 58, 0.18);
}
[data-theme="light"] .ps-plan-toggle-btn {
  color: var(--color-muted);
}
[data-theme="light"] .ps-plan-toggle-btn.active {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.25);
  color: var(--ps-gold);
  box-shadow: 0 1px 3px rgba(139, 111, 58, 0.12);
}
[data-theme="light"] #plan-list .ps-plan-row {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.18);
  box-shadow: 0 2px 6px rgba(139, 111, 58, 0.08);
}
[data-theme="light"] #plan-list .ps-plan-row.selected {
  background: rgba(139, 111, 58, 0.06);
  border-color: var(--ps-gold);
}
[data-theme="light"] #plan-list .ps-plan-row__data {
  color: var(--color-text);
}
[data-theme="light"] #plan-list .ps-plan-row__days,
[data-theme="light"] #plan-list .ps-plan-row__per {
  color: var(--color-muted);
}
[data-theme="light"] .ps-info-badge {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.18);
  box-shadow: 0 2px 6px rgba(139, 111, 58, 0.08);
}
[data-theme="light"] .ps-info-badge__title {
  color: var(--color-text);
}
[data-theme="light"] .ps-info-badge__desc {
  color: var(--color-muted);
}
[data-theme="light"] .ps-country-hero__name {
  color: var(--color-text);
}
[data-theme="light"] .ps-country-hero__sub {
  color: var(--color-muted);
}

/* Регионы / Мир — детальный bottom sheet: белые строки тарифов в светлой теме */
[data-theme="light"] .ps-sheet {
  background: #ffffff;
  border-top-color: rgba(139, 111, 58, 0.18);
}
[data-theme="light"] .ps-sheet__content {
  background: #ffffff;
}
[data-theme="light"] .ps-sheet__footer {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.12);
}
[data-theme="light"] .ps-sheet__handle {
  background: rgba(139, 111, 58, 0.25);
}
[data-theme="light"] .ps-sheet__header {
  border-bottom-color: rgba(139, 111, 58, 0.12);
}
[data-theme="light"] .ps-sheet-plan-toggle {
  background: #f8f3e8;
  border-color: rgba(139, 111, 58, 0.18);
}
[data-theme="light"] .ps-sheet-plan-toggle .ps-plan-toggle-btn.active {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.25);
  color: var(--ps-gold);
  box-shadow: 0 1px 3px rgba(139, 111, 58, 0.12);
}
[data-theme="light"] .ps-sheet-plan-list .ps-plan-row {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.18);
  box-shadow: 0 2px 6px rgba(139, 111, 58, 0.08);
}
[data-theme="light"] .ps-sheet-plan-list .ps-plan-row.selected {
  background: rgba(139, 111, 58, 0.06);
  border-color: var(--ps-gold);
}
[data-theme="light"] .ps-sheet-plan-list .ps-plan-row__data {
  color: var(--color-text);
}
[data-theme="light"] .ps-sheet-plan-list .ps-plan-row__days,
[data-theme="light"] .ps-sheet-plan-list .ps-plan-row__per {
  color: var(--color-muted);
}
[data-theme="light"] .ps-sheet__country {
  color: var(--color-text);
}
[data-theme="light"] .ps-sheet__close {
  background: #f8f3e8;
  border-color: rgba(139, 111, 58, 0.18);
  color: var(--color-muted);
}
[data-theme="light"] .ps-accordion {
  border-top-color: rgba(139, 111, 58, 0.12);
}
[data-theme="light"] .ps-shop-header {
  background: rgba(238, 232, 220, 0.96);
}
[data-theme="light"] .ps-header {
  background: rgba(238, 232, 220, 0.94);
}

/* Нижняя панель покупки — та же ширина колонки, что и #app / навбар */
[data-theme="light"] .ps-buy-bar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  box-sizing: border-box;
  border-radius: 16px 16px 0 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   TOAST — всплывающее уведомление с галочкой («Добавлено в корзину»)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 50%;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 13px;
  background: linear-gradient(135deg, rgba(30,30,40,0.96), rgba(20,20,28,0.96));
  border: 1px solid rgba(200,169,110,0.35);
  border-radius: 999px;
  box-shadow:
    0 14px 36px -12px rgba(8,8,16,0.7),
    0 0 0 1px rgba(200,169,110,0.08) inset,
    0 0 28px -10px rgba(200,169,110,0.4);
  color: var(--ps-white);
  font-family: 'Syncopate', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-22px) scale(.9);
  transition:
    opacity .28s ease,
    transform .42s cubic-bezier(.18,.89,.32,1.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px);
}
.ps-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.ps-toast__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E8D5A8, #C8A96E 60%, #8B6F3A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px -2px rgba(200,169,110,0.5),
    inset 0 -2px 4px rgba(139,111,58,0.45);
  position: relative;
}
.ps-toast__icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,110,0.45), transparent 65%);
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}
.ps-toast.show .ps-toast__icon::before {
  animation: ps-toast-pulse .9s ease-out .05s;
}
@keyframes ps-toast-pulse {
  0%   { opacity: 0;   transform: scale(.5); }
  35%  { opacity: 0.7; transform: scale(1.0); }
  100% { opacity: 0;   transform: scale(1.5); }
}
.ps-toast__icon svg {
  width: 14px;
  height: 14px;
  stroke: #18181F;
  stroke-width: 3.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.ps-toast.show .ps-toast__icon svg {
  animation: ps-toast-check .42s cubic-bezier(.65,.05,.36,1) .14s forwards;
}
@keyframes ps-toast-check {
  to { stroke-dashoffset: 0; }
}
.ps-toast__text {
  color: var(--ps-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

/* Light theme — белая карточка, золотой текст */
[data-theme="light"] .ps-toast {
  background: linear-gradient(135deg, #ffffff, #faf6ee);
  border-color: rgba(139,111,58,0.35);
  box-shadow:
    0 14px 36px -12px rgba(139,111,58,0.32),
    0 0 0 1px rgba(139,111,58,0.06) inset,
    0 0 24px -10px rgba(200,169,110,0.45);
}
[data-theme="light"] .ps-toast__text {
  color: var(--ps-gold-dark);
}

/* ════════════════════════════════════════════════════════════════════════════
   CHECKOUT SUCCESS — полноэкранный оверлей (остаёмся в WebApp)
   ════════════════════════════════════════════════════════════════════════════ */
.ps-checkout-success {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 8, 16, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}
.ps-checkout-success__panel {
  width: 100%;
  max-width: 380px;
  background: var(--ps-grey);
  border: 1px solid rgba(200, 169, 110, 0.28);
  border-radius: 20px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
}
.ps-checkout-success__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #e8d5a8, #c8a96e 55%, #8b6f3a);
  color: #18181f;
  font-size: 28px;
  line-height: 56px;
  font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(200, 169, 110, 0.55);
}
.ps-checkout-success__title {
  font-family: 'Syncopate', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ps-gold);
  margin-bottom: 8px;
}
.ps-checkout-success__sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text);
  opacity: 0.88;
  margin-bottom: 12px;
  line-height: 1.45;
}
.ps-checkout-success__orders {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.ps-checkout-success__pay-label {
  font-family: 'Syncopate', sans-serif;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--ps-gold);
  text-align: left;
  margin-bottom: 6px;
}
.ps-checkout-success__pre {
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.45;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(200, 169, 110, 0.12);
  border-radius: 12px;
  padding: 12px;
  max-height: 28vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}
.ps-checkout-success__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-checkout-success__actions .ps-btn-primary,
.ps-checkout-success__actions .ps-btn-outline {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

[data-theme="light"] .ps-checkout-success__panel {
  background: #ffffff;
  border-color: rgba(139, 111, 58, 0.22);
}
[data-theme="light"] .ps-checkout-success__pre {
  background: #f8f3e8;
  border-color: rgba(139, 111, 58, 0.15);
  color: var(--color-text);
}

/* Автопродление в списке заказов */
.ps-order-autorenew {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(200, 169, 110, 0.1);
}
.ps-order-autorenew__label {
  font-family: 'Syncopate', sans-serif;
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--ps-gold);
}
.ps-order-autorenew__hint {
  font-size: 10px;
  color: var(--color-muted);
  margin-top: 4px;
  line-height: 1.35;
}
.ps-toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 169, 110, 0.25);
  position: relative;
  flex-shrink: 0;
  transition: background var(--tr), border-color var(--tr);
}
.ps-toggle.on {
  background: rgba(200, 169, 110, 0.35);
  border-color: var(--ps-gold);
}
.ps-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ps-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease;
}
.ps-toggle.on .ps-toggle__knob {
  transform: translateX(18px);
}
[data-theme="light"] .ps-toggle {
  background: #e8e0d4;
}
[data-theme="light"] .ps-toggle.on {
  background: #d4c4a8;
}

/* ── Checkout success: per-order paid rows ──────────────────────────────── */
.ps-success-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ps-success-order-row:last-child { border-bottom: none; }
.ps-success-order-id {
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
}
.ps-btn-paid {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--ps-gold);
  background: rgba(200,169,110,0.08);
  color: var(--ps-gold);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.ps-btn-paid:disabled { opacity: 0.45; cursor: default; }
.ps-btn-paid:not(:disabled):active { background: rgba(200,169,110,0.18); }
.ps-paid-sent {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ps-gold);
  font-weight: 500;
}
[data-theme="light"] .ps-btn-paid {
  border-color: var(--ps-gold-dark, #b8960a);
  color: var(--ps-gold-dark, #b8960a);
  background: rgba(200,169,110,0.06);
}

/* ── Order: eSIM QR block ────────────────────────────────────────────────── */
.ps-order-esim {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ps-order-esim__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  width: 100%;
}
.ps-order-esim__qr {
  border-radius: 8px;
  display: block;
  width: 180px;
  height: 180px;
  background: #fff;
}
.ps-order-esim__lpa {
  font-family: monospace;
  font-size: 10px;
  color: var(--color-muted);
  word-break: break-all;
  text-align: center;
  padding: 0 4px;
  line-height: 1.5;
}
.ps-order-esim__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.ps-btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="light"] .ps-order-esim {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
}

/* ── Top-up sheet ─────────────────────────────────────────────────────────── */
.ps-topup-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ps-topup-amount {
  flex: 1 1 calc(33% - 8px);
  min-width: 80px;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--ps-white);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}