/* ════════════════════════════════════════════════════════════════════════════
   PrimeSIM Design System
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --ps-black:      #080810;
  --ps-gold:       #C8A96E;
  --ps-gold-light: #E8D5A8;
  --ps-gold-dark:  #8B6F3A;
  --ps-white:      #F5F2EC;
  --ps-grey:       #1E1E28;
  --ps-grey-mid:   #2A2A35;
  --ps-grey-light: #4A4A5A;

  --color-bg:            var(--ps-black);
  --color-surface:       var(--ps-grey);
  --color-surface2:      var(--ps-grey-mid);
  --color-accent:        var(--ps-gold);
  --color-text:          var(--ps-white);
  --color-muted:         var(--ps-grey-light);
  --color-border:        rgba(200,169,110,0.15);
  --color-border-strong: rgba(200,169,110,0.30);

  --nav-height:    64px;
  --header-height: 56px;
  --radius:        16px;
  --tr:            0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font-family: inherit; border: none; }
input  { font-family: inherit; }

/* ── Body ────────────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Золотая сетка */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    repeating-linear-gradient(0deg,  transparent, transparent 70px, rgba(200,169,110,0.012) 70px, rgba(200,169,110,0.012) 71px),
    repeating-linear-gradient(90deg, transparent, transparent 70px, rgba(200,169,110,0.012) 70px, rgba(200,169,110,0.012) 71px);
  pointer-events: none;
  z-index: 0;
}

/* Ambient glow */
body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(200,169,110,0.06) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  z-index: 0;
  animation: ambientPulse 6s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%,100% { opacity: 1;   transform: translate(-50%,-50%) scale(1);    }
  50%      { opacity: 0.5; transform: translate(-50%,-50%) scale(1.15); }
}

/* ── App shell ───────────────────────────────────────────────────────────── */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.ps-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-height);
  background: rgba(8,8,16,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(200,169,110,0.1);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.ps-logo { display: inline-flex; flex-direction: column; }

.ps-logo__wordmark {
  font-family: 'Syncopate', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  line-height: 1;
}
.ps-logo--sm .ps-logo__wordmark { font-size: 17px; }
.ps-logo--lg .ps-logo__wordmark { font-size: 26px; }

.ps-logo__prim { color: var(--ps-white); }
.ps-logo__e    { color: var(--ps-gold); }
.ps-logo__sim  { color: var(--ps-white); opacity: 0.45; }

.ps-logo__line { display: flex; height: 1.5px; margin-top: 4px; }
.ps-logo__line-prim { flex: 4; background: rgba(245,242,236,0.18); }
.ps-logo__line-e    { flex: 1; background: var(--ps-gold); box-shadow: 0 0 10px rgba(200,169,110,0.55); }
.ps-logo__line-sim  { flex: 3; background: rgba(245,242,236,0.07); }

/* ── Screens ─────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.screen.active { display: block; }

/* ── Bottom navigation — плавающий «остров» (v3) ─────────────────────────── */
.ps-bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  min-height: 56px;
  padding: 8px 6px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(30, 30, 40, 0.92);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: 28px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}

.ps-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: none;
  border: none;
  border-radius: 20px;
  transition: background var(--tr), color var(--tr);
  min-height: 44px;
  justify-content: center;
}

.ps-nav-btn .ps-nav-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  transition: color var(--tr);
}
.ps-nav-btn .ps-nav-svg svg {
  width: 22px;
  height: 22px;
}

.ps-nav-label {
  font-family: 'Syncopate', sans-serif;
  font-size: 7px;
  letter-spacing: 0.18em;
  color: var(--color-muted);
  transition: color var(--tr);
}

.ps-nav-btn.active {
  background: rgba(200, 169, 110, 0.14);
}
.ps-nav-btn.active .ps-nav-svg,
.ps-nav-btn.active .ps-nav-label {
  color: var(--ps-gold);
}

.ps-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}
.ps-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ps-gold);
  color: var(--ps-black);
  font-size: 10px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ps-nav-badge.visible {
  display: inline-flex;
}


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 1 — МАГАЗИН
   ════════════════════════════════════════════════════════════════════════════ */

.ps-shop-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(8,8,16,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px 0;
}

/* Search */
.ps-search-wrap { position: relative; margin-bottom: 0; }

.ps-search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px; opacity: 0.4; pointer-events: none;
}

.ps-search {
  width: 100%;
  padding: 11px 16px 11px 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 15px;
  outline: none;
  transition: border-color var(--tr);
  -webkit-appearance: none;
}
.ps-search:focus        { border-color: rgba(200,169,110,0.5); }
.ps-search::placeholder { color: var(--color-muted); }

/* Inner tab bar */
.ps-tabs {
  display: flex;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  margin: 12px 0 0;
}

.ps-tab {
  flex: 1;
  padding: 9px 6px;
  border-radius: 9px;
  background: transparent;
  color: var(--color-muted);
  font-family: 'Syncopate', sans-serif;
  font-size: 8px;
  letter-spacing: 0.12em;
  transition: all var(--tr);
  white-space: nowrap;
  text-align: center;
}
.ps-tab.active {
  background: var(--color-surface2);
  color: var(--ps-gold);
  border: 1px solid rgba(200,169,110,0.2);
}

.tab-content        { display: none; padding-top: 10px; }
.tab-content.active { display: block; }

/* ── Section label ───────────────────────────────────────────────────────── */
.ps-section-label {
  font-family: 'Syncopate', sans-serif;
  font-size: 8px; letter-spacing: 0.28em;
  color: var(--color-muted);
  text-transform: uppercase;
  padding: 12px 16px 8px;
}

/* ── Banner (Telegram channel) ───────────────────────────────────────────── */
.ps-banner {
  margin: 8px 16px 4px;
  background: linear-gradient(135deg, rgba(200,169,110,0.10) 0%, rgba(200,169,110,0.04) 100%);
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}

.ps-banner__body { flex: 1; min-width: 0; }

/* Крестик «скрыть баннер» — правый верхний угол */
.ps-banner__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  font-size: 19px;
  line-height: 1;
  color: var(--color-muted);
  opacity: 0.65;
  cursor: pointer;
  border-radius: 50%;
  transition: opacity var(--tr), background var(--tr);
}
.ps-banner__close:active {
  opacity: 1;
  background: rgba(200,169,110,0.12);
}

.ps-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ps-banner__title {
  padding-right: 24px;   /* место под крестик */
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 3px;
}
.ps-banner__sub {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 10px;
}
.ps-banner__btn {
  background: var(--ps-gold);
  color: var(--ps-black);
  border: none;
  border-radius: 8px;
  font-family: 'Syncopate', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  padding: 8px 14px;
  transition: opacity var(--tr);
}
.ps-banner__btn:active { opacity: 0.8; }

.ps-banner__close {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  font-size: 13px; color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── ReferralBadge на карточках тарифов ─────────────────────────────────── */
.ps-ref-badge {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ps-gold);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: opacity var(--tr);
}
.ps-ref-badge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ps-ref-badge__text { white-space: nowrap; }
.ps-ref-badge:active { opacity: 0.7; }

/* ── Плашка реф-CTA в корзине ───────────────────────────────────────────── */
.ps-cart-referral {
  margin: 10px 0;
  padding: 14px;
  background: linear-gradient(135deg, rgba(200,169,110,0.10) 0%, rgba(200,169,110,0.04) 100%);
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ps-cart-referral__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.ps-cart-referral__body { flex: 1; min-width: 0; }
.ps-cart-referral__title {
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 4px;
}
.ps-cart-referral__sub {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 10px;
}
.ps-cart-referral .ps-btn-outline {
  width: 100%;
}

/* ── Country list (card style) ───────────────────────────────────────────── */
.ps-country-list { padding: 0 16px; }

.ps-country-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ps-grey);
  border: 1px solid rgba(200,169,110,0.1);
  border-radius: 14px;
  padding: 15px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.ps-country-row:active {
  border-color: var(--ps-gold);
  background: rgba(200,169,110,0.05);
}

/* Россия (featured) — золотая звезда */
.ps-country-row--featured::after {
  content: '★ Топ';
  position: absolute;
  right: 46px; top: 50%;
  transform: translateY(-50%);
  font-family: 'Syncopate', sans-serif;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--ps-gold);
  white-space: nowrap;
}

.ps-country-flag {
  font-size: 28px;
  width: 38px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.ps-country-info { flex: 1; min-width: 0; }

.ps-country-name {
  font-size: 15px; font-weight: 400;
  color: var(--color-text);
}
.ps-country-region {
  font-family: 'Syncopate', sans-serif;
  font-size: 8px; letter-spacing: 0.12em;
  color: var(--color-muted);
  margin-top: 3px;
  text-transform: uppercase;
}

.ps-price-pill {
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--ps-gold);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Regions grid ─────────────────────────────────────────────────────────── */
.ps-regions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 8px;
}

.ps-region-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), transform var(--tr);
  min-height: 110px;
  display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.ps-region-card::before {
  content: '';
  position: absolute; top: -50px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(200,169,110,0.04) 0%, transparent 65%);
}
.ps-region-card:active { border-color: var(--ps-gold); background: rgba(200,169,110,0.04); transform: scale(0.97); }

.ps-region-emoji { font-size: 26px; }
.ps-region-name {
  font-family: 'Syncopate', sans-serif;
  font-size: 9px; letter-spacing: 0.18em;
  color: var(--color-text);
}
.ps-region-price { font-size: 11px; color: var(--color-muted); }

/* ── Global plans ─────────────────────────────────────────────────────────── */
.ps-global-list { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }

.ps-global-card {
  background: linear-gradient(135deg, var(--ps-grey) 0%, var(--ps-grey-mid) 100%);
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: 20px;
  padding: 26px 22px;
  position: relative; overflow: hidden;
  cursor: default;
  transition: border-color var(--tr), transform var(--tr);
}
.ps-global-card:has(.global-add-cart-btn:active) {
  border-color: rgba(200, 169, 110, 0.35);
}

.ps-global-card::after {
  content: '';
  position: absolute;
  top: 0; left: 32px; right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ps-gold), transparent);
  border-radius: 0 0 2px 2px;
}
.ps-global-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(200,169,110,0.05) 0%, transparent 65%);
  pointer-events: none;
}

.ps-global-card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ps-global-card__countries {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; font-style: italic;
  color: rgba(200,169,110,0.65);
}
.ps-global-card__title {
  font-family: 'Syncopate', sans-serif;
  font-size: 20px; font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-text);
  margin-bottom: 14px;
}
.ps-global-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(200, 169, 110, 0.12);
}
.ps-btn-global-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(200, 169, 110, 0.45);
  background: rgba(200, 169, 110, 0.08);
  color: var(--ps-gold);
  font-family: 'Syncopate', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 100%;
  transition: border-color var(--tr), background var(--tr), transform 0.15s ease;
}
.ps-btn-global-add:hover {
  background: rgba(200, 169, 110, 0.14);
  border-color: var(--ps-gold);
}
.ps-btn-global-add:active { transform: scale(0.98); }
.ps-btn-global-add .ps-inline-cart-ic {
  display: flex;
  width: 16px;
  height: 16px;
  opacity: 0.95;
}
.ps-btn-global-add .ps-inline-cart-ic svg {
  width: 16px;
  height: 16px;
}
.ps-global-card__price {
  font-size: 30px; font-weight: 300;
  color: var(--ps-gold);
  line-height: 1;
}
.ps-global-card__price span { font-size: 16px; color: var(--color-muted); }


/* ════════════════════════════════════════════════════════════════════════════
   COUNTRY DETAIL SCREEN (slide overlay)
   ════════════════════════════════════════════════════════════════════════════ */

.ps-country-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  background: var(--ps-black);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.ps-country-screen.open {
  transform: translateX(0);
}

/* Внутренний хедер */
.ps-country-screen__header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(8,8,16,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(200,169,110,0.08);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.ps-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px 0;
  color: var(--ps-gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 300;
  cursor: pointer;
  min-height: 44px;
}
.ps-back-btn__arrow { font-size: 22px; line-height: 1; }
.ps-back-btn__label { font-size: 16px; }

/* Hero: флаг + название */
.ps-country-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 14px;
}

.ps-country-hero__flag {
  font-size: 52px;
  line-height: 1;
  flex-shrink: 0;
}

.ps-country-hero__name {
  font-family: 'Syncopate', sans-serif;
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text);
}
.ps-country-hero__sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 400;
  color: rgba(245,242,236,0.65);
  margin-top: 5px;
}

/* Info-бейдж: только данные */
.ps-info-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 12px 14px;
  background: rgba(200,169,110,0.06);
  border: 1px solid rgba(200,169,110,0.15);
  border-radius: 12px;
}
.ps-info-badge__icon { font-size: 20px; flex-shrink: 0; }
.ps-info-badge__title {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
}
.ps-info-badge__desc {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ── Plan toggle ─────────────────────────────────────────────────────────── */
.ps-plan-toggle {
  display: flex;
  background: var(--ps-grey);
  border: 1px solid rgba(200,169,110,0.15);
  border-radius: 12px;
  padding: 4px;
  margin: 0 16px 16px;
}

.ps-plan-toggle-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-muted);
  font-family: 'Syncopate', sans-serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  transition: all 0.18s;
  text-align: center;
}
.ps-plan-toggle-btn.active {
  background: var(--ps-grey-mid);
  color: var(--ps-gold);
  border-color: rgba(200,169,110,0.25);
}

/* ── Plan list ───────────────────────────────────────────────────────────── */
.ps-plan-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Plan row */
.ps-plan-row {
  display: flex;
  align-items: center;
  background: var(--ps-grey);
  border: 1px solid rgba(200,169,110,0.1);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.ps-plan-row.selected {
  border-color: var(--ps-gold);
  background: rgba(200,169,110,0.06);
}

/* Золотая линия сверху у выбранного */
.ps-plan-row.selected::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--ps-gold);
  box-shadow: 0 0 8px rgba(200,169,110,0.5);
  border-radius: 0 0 2px 2px;
}

.ps-plan-row__left { flex: 1; }

.ps-plan-row__data {
  font-size: 16px; font-weight: 400;
  color: var(--color-text);
}
.ps-plan-row__days {
  font-size: 12px; font-weight: 500;
  color: rgba(245,242,236,0.72);
  margin-top: 3px;
}

.ps-plan-row__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-right: 14px;
}
.ps-plan-row__price {
  font-size: 16px; font-weight: 400;
  color: var(--ps-gold);
  line-height: 1;
}
.ps-plan-row__per {
  font-size: 11px;
  color: var(--color-muted);
}

/* Бейдж скидки */
.ps-plan-row__discount {
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 9px;
  font-family: 'Syncopate', sans-serif;
  letter-spacing: 0.1em;
  color: var(--ps-gold);
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}

/* Radio-кнопка */
.ps-plan-row__radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(200,169,110,0.3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
.ps-plan-row.selected .ps-plan-row__radio {
  border-color: var(--ps-gold);
}
.ps-plan-row.selected .ps-plan-row__radio::after {
  content: '';
  width: 11px; height: 11px;
  background: var(--ps-gold);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(200,169,110,0.5);
}

/* Empty state для планов */
.ps-plan-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--color-muted);
  font-size: 14px;
}

/* ── Sticky buy bar ──────────────────────────────────────────────────────── */
.ps-buy-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(8,8,16,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(200,169,110,0.1);
  z-index: 160;
}

.ps-buy-bar__btn {
  width: 100%;
  padding: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.ps-buy-bar__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* В строке «В корзину» + «Купить сразу» — одинаковая высота и ширина колонок */
.ps-buy-bar__row .ps-buy-bar__btn {
  width: auto;
}


/* ════════════════════════════════════════════════════════════════════════════
   BOTTOM SHEET (регионы / глобальные)
   ════════════════════════════════════════════════════════════════════════════ */

.ps-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,16,0);
  z-index: 200;
  pointer-events: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}
.ps-sheet-overlay.open {
  background: rgba(8,8,16,0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: auto;
}

.ps-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ps-grey);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(200,169,110,0.15);
  z-index: 201;
  max-height: 90vh;
  /* Flex column: handle + scrollable content + sticky footer */
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* clip rounded corners; scroll is on .ps-sheet__content */
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.ps-sheet.open { transform: translateY(0); }

/* Светлая тема: шиты той же ширины, что колонка приложения */
[data-theme="light"] .ps-sheet {
  left: 50%;
  right: auto;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, 100%);
}
[data-theme="light"] .ps-sheet.open {
  transform: translate(-50%, 0);
}

/* Scrollable area inside the sheet */
.ps-sheet__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  background: var(--ps-grey);
}

.ps-sheet__handle {
  width: 36px; height: 4px;
  background: rgba(200,169,110,0.3);
  border-radius: 2px;
  margin: 14px auto 20px;
}

.ps-sheet__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(200,169,110,0.1);
}

.ps-sheet__title-group { display: flex; align-items: center; gap: 14px; }
.ps-sheet__flag { font-size: 38px; line-height: 1; }

.ps-sheet__country {
  font-family: 'Syncopate', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--color-text);
}
.ps-sheet__subtitle {
  font-size: 11px; color: var(--color-muted); margin-top: 4px;
}
.ps-sheet__badge {
  display: inline-block;
  margin-top: 6px;
}

.ps-sheet__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  font-size: 16px; color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 4px;
}

/* Plans grid (для регионов/глобальных) */
.ps-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.ps-plan-card {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.ps-plan-card.selected {
  border-color: var(--ps-gold);
  background: rgba(200,169,110,0.07);
}
.ps-plan-card.selected::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1.5px;
  background: var(--ps-gold);
  box-shadow: 0 0 8px rgba(200,169,110,0.6);
}
.ps-plan-card:active { transform: scale(0.97); }

.ps-plan-days {
  font-family: 'Syncopate', sans-serif;
  font-size: 9px; letter-spacing: 0.2em; font-weight: 500;
  color: rgba(245,242,236,0.72);
  margin-bottom: 8px;
}
.ps-plan-price {
  font-size: 22px; font-weight: 300;
  color: var(--ps-gold); line-height: 1;
}
.ps-plan-per-day { font-size: 10px; color: var(--color-muted); margin-top: 5px; }

.ps-sheet-buy-btn { width: 100%; margin-top: 4px; }

/* Sheet section title */
.ps-sheet-section-title {
  font-family: 'Syncopate', sans-serif;
  font-size: 9px; letter-spacing: 0.3em;
  color: var(--color-muted);
  margin-bottom: 16px;
  margin-top: 4px;
}


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 2 — АККАУНТ
   ════════════════════════════════════════════════════════════════════════════ */

.ps-account-screen { padding: 16px 16px calc(16px + var(--nav-height)); }

/* eSIM Card */
.ps-esim-card {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  border-radius: 18px;
  background: linear-gradient(135deg, #0C0C18 0%, #181828 60%, #0C0C18 100%);
  border: 1px solid rgba(200,169,110,0.22);
  padding: 22px 24px;
  position: relative; overflow: hidden;
  margin-bottom: 14px;
}
.ps-esim-card::before {
  content: '';
  position: absolute; top: -80px; right: -50px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(200,169,110,0.07) 0%, transparent 65%);
}
.ps-esim-card::after {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--ps-gold), transparent);
}

.ps-esim-card__top {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.ps-esim-card__chip {
  width: 34px; height: 26px;
  background: linear-gradient(135deg, var(--ps-gold-dark), var(--ps-gold));
  border-radius: 4px;
  opacity: 0.85;
}

.ps-esim-card__body {
  position: absolute;
  bottom: 20px; left: 24px; right: 24px;
}
.ps-esim-card__number {
  font-size: 11px; letter-spacing: 0.24em;
  color: rgba(245,242,236,0.35);
  font-weight: 200;
  margin-bottom: 8px;
}
.ps-esim-card__footer-row {
  display: flex; align-items: flex-end; justify-content: space-between;
}
.ps-esim-card__name {
  font-family: 'Syncopate', sans-serif;
  font-size: 10px; letter-spacing: 0.15em;
  color: rgba(245,242,236,0.6);
}
.ps-esim-card__world {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; font-style: italic;
  color: rgba(200,169,110,0.55);
}

/* Balance block */
.ps-balance-block {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.ps-balance-label {
  font-family: 'Syncopate', sans-serif;
  font-size: 8px; letter-spacing: 0.3em;
  color: var(--color-muted);
  margin-bottom: 5px;
}
.ps-balance-amount { font-size: 26px; font-weight: 300; color: var(--color-text); }

/* Invite banner */
.ps-invite-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(200,169,110,0.08), rgba(200,169,110,0.03));
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  position: relative;
}
.ps-invite-banner__text {
  flex: 1;
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.4;
}
.ps-invite-banner__btn {
  flex-shrink: 0;
  padding: 9px 16px;
  font-size: 10px;
}
.ps-invite-banner__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  font-size: 12px; color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
}

/* ── Menu card (TonMobile style) ─────────────────────────────────────────── */
.ps-menu-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}
.ps-menu-card::before {
  content: '';
  position: absolute; top: -60px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(200,169,110,0.04) 0%, transparent 65%);
  pointer-events: none;
}

.ps-menu-divider {
  height: 1px;
  background: rgba(200,169,110,0.07);
  margin: 0 16px;
}

.ps-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  min-height: 54px;
  transition: background var(--tr);
}
.ps-menu-row:active { background: rgba(200,169,110,0.04); }

.ps-menu-row__icon { font-size: 18px; flex-shrink: 0; }

.ps-menu-row__text {
  flex: 1;
  font-size: 15px; font-weight: 300;
  color: var(--color-text);
}
.ps-menu-row__text-group {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.ps-menu-row__sub {
  font-size: 12px; color: var(--color-muted);
}

.ps-menu-row__value {
  font-size: 14px;
  color: var(--color-muted);
  margin-right: 4px;
}

.ps-menu-row__chevron {
  font-size: 20px;
  color: var(--color-muted);
  font-weight: 300;
  flex-shrink: 0;
}

.ps-menu-row__online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ps-gold);
  box-shadow: 0 0 6px rgba(200,169,110,0.6);
  flex-shrink: 0;
  margin-right: 4px;
  animation: blink 2s ease-in-out infinite;
}

/* Profile row */
.ps-profile-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
}

.ps-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ps-gold-dark), var(--ps-gold));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syncopate', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--ps-black);
  flex-shrink: 0;
}
.ps-profile-name     { font-size: 16px; font-weight: 400; color: var(--color-text); }
.ps-profile-username { font-size: 12px; color: var(--color-muted); margin-top: 3px; }

/* ── Language picker sheet ───────────────────────────────────────────────── */
.ps-lang-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-lang-option:active { border-color: var(--ps-gold); }
.ps-lang-option.active { border-color: var(--ps-gold); background: rgba(200,169,110,0.06); }

.ps-lang-option__flag { font-size: 24px; }
.ps-lang-option__flag svg {
  width: 22px; height: 22px; display: block;
  color: var(--ps-gold);
}
.ps-lang-option__check svg { width: 18px; height: 18px; display: block; }
.ps-lang-option__name {
  flex: 1;
  font-size: 15px; font-weight: 300;
  color: var(--color-text);
  text-align: left;
}
.ps-lang-option__check {
  font-size: 18px;
  color: var(--ps-gold);
  min-width: 20px;
  text-align: center;
}

/* ── Orders in sheet ─────────────────────────────────────────────────────── */
.ps-order-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid rgba(200,169,110,0.07);
  min-height: 52px;
  gap: 0;
}
.ps-order-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.ps-order-row:last-child { border-bottom: none; }
.ps-order-info {}
.ps-order-name { font-size: 14px; font-weight: 400; color: var(--color-text); }
.ps-order-date { font-size: 11px; color: var(--color-muted); margin-top: 2px; }
.ps-order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ps-order-price { font-size: 14px; font-weight: 400; color: var(--color-text); }

/* Status pills */
.ps-status {
  font-family: 'Syncopate', sans-serif;
  font-size: 7px; letter-spacing: 0.2em;
  padding: 3px 8px; border-radius: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ps-status--active  { background: rgba(200,169,110,0.1); color: var(--ps-gold); border-color: rgba(200,169,110,0.25); }
.ps-status--done    { background: rgba(74,74,90,0.3);    color: var(--ps-grey-light); }
.ps-status--pending { background: rgba(200,169,110,0.05); color: rgba(200,169,110,0.6); border-color: rgba(200,169,110,0.15); }
.ps-status--error   { background: rgba(255,80,80,0.1); color: #ff6060; border-color: rgba(255,80,80,0.2); }


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 3 — ПОМОЩЬ
   ════════════════════════════════════════════════════════════════════════════ */

.ps-help-screen {
  padding: 16px 16px calc(16px + var(--nav-height));
}

.ps-help-title {
  font-family: 'Syncopate', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-text);
  margin-bottom: 16px;
}

.ps-support-btn {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(200,169,110,0.10), rgba(200,169,110,0.04));
  border: 1px solid rgba(200,169,110,0.28);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: 100%;
  transition: border-color var(--tr), background var(--tr);
  margin-bottom: 8px;
  cursor: pointer;
}
.ps-support-btn:active { border-color: var(--ps-gold); background: rgba(200,169,110,0.1); }

.ps-support-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--ps-gold-dark), var(--ps-gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.ps-support-text { flex: 1; text-align: left; }
.ps-support-title-txt {
  font-family: 'Syncopate', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--color-text);
}
.ps-support-sub { font-size: 12px; color: var(--color-muted); margin-top: 3px; }

.ps-support-online {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: 'Syncopate', sans-serif;
  font-size: 7px; letter-spacing: 0.12em;
  color: var(--ps-gold);
  flex-shrink: 0;
}

/* FAQ */
.ps-faq-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.ps-faq-item { border-bottom: 1px solid rgba(200,169,110,0.08); overflow: hidden; }
.ps-faq-item:last-child { border-bottom: none; }

.ps-faq-trigger {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px;
  width: 100%; background: none; border: none; text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 300;
  color: var(--color-text);
  min-height: 52px;
  gap: 12px;
  transition: background var(--tr);
}
.ps-faq-trigger:active { background: rgba(200,169,110,0.03); }

.ps-faq-trigger::after {
  content: '+';
  font-size: 22px; font-weight: 300;
  color: var(--ps-gold);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  line-height: 1;
}
.ps-faq-item.open .ps-faq-trigger::after { transform: rotate(45deg); }

.ps-faq-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 13px; line-height: 1.7;
  color: var(--color-muted);
  padding: 0 16px;
}
.ps-faq-item.open .ps-faq-body { max-height: 400px; padding: 0 16px 16px; }
.ps-faq-item.open .ps-faq-body--long { max-height: 2400px; }
.ps-faq-body b { color: var(--color-text); font-weight: 500; }


/* ════════════════════════════════════════════════════════════════════════════
   COMPONENTS (общие)
   ════════════════════════════════════════════════════════════════════════════ */

/* Primary button */
.ps-btn-primary {
  background: linear-gradient(135deg, var(--ps-gold-dark), var(--ps-gold));
  color: var(--ps-black);
  border: none;
  border-radius: 12px;
  font-family: 'Syncopate', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em;
  padding: 14px 20px;
  min-height: 46px;
  transition: opacity var(--tr), transform 0.15s;
  white-space: nowrap;
}
.ps-btn-primary:active { opacity: 0.82; transform: scale(0.97); }

/* Outline button */
.ps-btn-outline {
  background: transparent;
  color: var(--ps-gold);
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 300;
  padding: 12px 20px;
  min-height: 44px;
  transition: background var(--tr), border-color var(--tr);
}
.ps-btn-outline:active { background: rgba(200,169,110,0.07); border-color: var(--ps-gold); }

/* Pill */
.ps-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(200,169,110,0.28);
  border-radius: 20px;
  padding: 4px 11px;
  font-family: 'Syncopate', sans-serif;
  font-size: 8px; letter-spacing: 0.22em;
  color: var(--ps-gold);
}

/* Blinking dot */
.ps-dot-blink {
  width: 6px; height: 6px;
  background: var(--ps-gold);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* Divider */
.ps-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,169,110,0.15), transparent);
  margin: 16px 0;
}

/* Dot status */
.ps-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.ps-dot--green { background: var(--ps-gold); box-shadow: 0 0 6px rgba(200,169,110,0.5); }
.ps-dot--grey  { background: var(--ps-grey-light); }


/* ════════════════════════════════════════════════════════════════════════════
   ANIMATIONS & UTILITIES
   ════════════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ps-fade-up { animation: fadeUp 0.4s ease forwards; }

/* Skeleton shimmer */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.ps-skeleton {
  background: linear-gradient(90deg,
    rgba(200,169,110,0.05) 25%,
    rgba(200,169,110,0.13) 50%,
    rgba(200,169,110,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

.ps-skel-row    { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.ps-skel-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.ps-skel-lines  { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ps-skel-line   { height: 13px; }
.ps-skel-line.w60 { width: 60%; }
.ps-skel-line.w35 { width: 35%; }

/* Empty state */
.ps-empty {
  text-align: center; padding: 52px 24px;
  color: var(--color-muted);
}
.ps-empty-icon { font-size: 44px; margin-bottom: 12px; }
.ps-empty-icon svg { width: 44px; height: 44px; color: var(--ps-gold); display: inline-block; }
.ps-flag-globe { display: inline-flex; }
.ps-flag-globe svg { width: 16px; height: 16px; color: var(--color-muted); }
.ps-empty-text {
  font-family: 'Syncopate', sans-serif;
  font-size: 10px; letter-spacing: 0.2em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 0; }