* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #582C4F;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --border-color: #E5E5EA;
    --cancel-color: #007AFF;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.app-container {
    max-width: 428px;
    margin: 0 auto;
    background-color: #F2F2F7;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 4px;
    font-size: 14px;
    font-weight: 600;
    height: 44px;
    background-color: var(--bg-primary);
}

.status-bar-right {
    display: flex;
    gap: 4px;
    align-items: center;
}

.status-icon {
    width: 17px;
    height: 11px;
    color: var(--text-primary);
}

.status-icon.battery {
    width: 24px;
    height: 11px;
}

/* Header - не используется в Telegram Mini App (навигация через tg.BackButton) */
/* Стили оставлены для совместимости с web-версией */
.header {
    display: none; /* Скрыт в Telegram Mini App */
    /* display: flex; */
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 12px;
    background-color: #F2F2F7;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.cancel-btn {
    background: none;
    border: none;
    color: var(--cancel-color);
    font-size: 17px;
    font-weight: 400;
    padding: 8px;
    cursor: pointer;
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.app-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
}

.app-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 18px;
    margin-top: 2px;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    padding: 8px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search Bar */
.search-container {
    padding: 16px 16px 16px;
    background-color: transparent;
    width: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #7474801F;
    border-radius: 10px;
    padding: 8px 12px;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    max-height: 44px;
}

.search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 17px;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px 16px 180px; /* Увеличено для кнопки Next (80px) + нижнего меню (80px) + отступ */
    overflow-y: auto;
}

.main-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 16px;
    gap: 2px;
}

.segment-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background-color: #7474801F;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-primary);
    font-weight: 500;
}

/* Section Header */
.section-header {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 400;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-title {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 22px;
}

.empty-state-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 20px;
}

/* Region List */
.region-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.region-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.region-item:active {
    background-color: var(--bg-secondary);
}

.region-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.region-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.region-name {
    flex: 1;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.region-chevron {
    width: 8px;
    height: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Country List */
.country-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.country-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.country-item:active {
    background-color: var(--bg-secondary);
}

.country-flag {
    width: 40px;
    height: 30px;
    min-width: 40px;
    min-height: 30px;
    max-width: 40px;
    max-height: 30px;
    margin-right: 12px;
    border: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 0;
    overflow: hidden;
    background-color: transparent;
    border-radius: 8px;
}

.country-flag img {
    width: 40px;
    height: 30px;
    min-width: 40px;
    min-height: 30px;
    max-width: 40px;
    max-height: 30px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 8px;
    /* Чёткие края скругления */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    transform: translate3d(0, 0, 0);
    image-rendering: -webkit-optimize-contrast;
    /* Prevent blurring on high-DPI displays */
    transform: translateZ(0);
    backface-visibility: hidden;
    flex-shrink: 0;
}

.country-name {
    flex: 1;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
}

.country-chevron {
    width: 8px;
    height: 14px;
    color: var(--text-secondary);
    margin-left: 8px;
    flex-shrink: 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 428px !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    background-color: var(--bg-primary) !important;
    border-top: 0.5px solid var(--border-color) !important;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 10000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 4px 16px;
    cursor: pointer;
    flex: 1;
}

.nav-icon {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    color: var(--primary-color);
}

.nav-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color 0.2s ease;
}

.nav-item.active .nav-label {
    color: var(--primary-color);
}

/* Safe area for iPhone notch */
@supports (padding: max(0px)) {
    .app-container {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .bottom-nav {
        padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom)));
    }
}

/* Hide scrollbar but keep functionality */
.main-content::-webkit-scrollbar {
    display: none;
}

.main-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Plans Screen Styles */

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--cancel-color);
    font-size: 17px;
    font-weight: 400;
    padding: 8px;
    cursor: pointer;
}

.back-icon {
    width: 8px;
    height: 14px;
    color: var(--cancel-color);
}

/* Plans Content */
.plans-content {
    flex: 1;
    padding: 0 16px 180px; /* Увеличено для кнопки Next (80px) + нижнего меню (80px) + отступ */
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.global-plans-content {
    padding-top: 16px;
}

.plans-content::-webkit-scrollbar {
    display: none;
}

/* Country Info */
.country-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    padding-top: 24px; /* Отступ от верхнего меню Telegram */
}

.country-flag-large {
    width: 80px;
    height: 60px;
    min-width: 80px;
    min-height: 60px;
    max-width: 80px;
    max-height: 60px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    line-height: 0;
    border: none;
    background-color: transparent;
    overflow: hidden;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Для Region планов - круглые флаги */
.country-flag-large img:not(.country-flag-img) {
    width: 80px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    /* Prevent sub-pixel rendering issues */
    transform: translate3d(0, 0, 0);
    /* Crisp rendering for flag images */
    image-rendering: -webkit-optimize-contrast;
}

/* Специальные стили для контейнера иконки Африки */
.country-flag-large.africa-icon-container {
    min-height: 100px !important;
    height: auto !important;
    overflow: visible !important;
    padding: 5px 0;
}

/* Специальный стиль для иконки Африки - уменьшаем размер, чтобы не обрезалась */
.country-flag-large img.region-icon-africa {
    width: 70px;
    height: auto;
    max-height: 100px;
    min-height: auto;
    object-fit: contain;
    object-position: center;
    /* Убираем обрезание в Telegram Mini App */
    overflow: visible;
    display: block;
    margin: 0 auto;
}

/* Для Local планов флаг должен быть закругленным и правильно обрезанным */
.country-flag-img {
    width: 80px;
    height: 60px;
    min-width: 80px;
    min-height: 60px;
    max-width: 80px;
    max-height: 60px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 12px;
    /* Чёткие края скругления */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    transform: translate3d(0, 0, 0);
    /* Crisp rendering for flag images */
    image-rendering: -webkit-optimize-contrast;
    /* Prevent blurring on high-DPI displays */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Убеждаемся, что флаг не обрезается */
    overflow: hidden;
    /* Для SVG флагов - правильное масштабирование */
    flex-shrink: 0;
}

/* Переопределяем для local планов - закругленные флаги */
.country-flag-large .country-flag-img {
    border-radius: 12px !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
    mask-image: radial-gradient(white, black) !important;
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 80px !important;
    min-height: 60px !important;
    max-width: 80px !important;
    max-height: 60px !important;
}

.country-name-large {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 34px;
    letter-spacing: 0.36px;
}

/* Plans Segmented Control */
.plans-segmented {
    margin-bottom: 24px;
}

/* Plans List */
.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-item.selected {
    background-color: #F3F0FF;
    border-color: var(--primary-color);
}

.plan-item:active {
    background-color: var(--bg-secondary);
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.plan-data {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
}

.plan-duration {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 20px;
}

.plan-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.plan-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
}

.radio-button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.radio-button.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--bg-primary);
}

.radio-button svg {
    width: 10px;
    height: 10px;
}

/* Region Info Banner */
.region-info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #2D2D2DCC;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.region-info-banner:active {
    background-color: #3D3D3D;
}

.region-info-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.region-info-text {
    flex: 1;
    font-size: 15px;
    font-weight: 400;
    color: #FFFFFF;
    line-height: 20px;
}

.region-info-chevron {
    width: 8px;
    height: 6px;
    color: #FFFFFF;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Countries List Container */
.countries-list-container {
    margin-top: 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.countries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.country-item-small {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

/* Checkout Content */
.checkout-content {
    flex: 1;
    padding: 24px 16px 200px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.checkout-content::-webkit-scrollbar {
    display: none;
}

/* Checkout Card */
.checkout-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.checkout-country-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 34px;
}

.checkout-flag {
    width: 60px;
    height: 45px;
    object-fit: contain;
    display: block;
    /* Чёткие края без CSS border-radius - используем встроенный в SVG */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    transform: translate3d(0, 0, 0);
    image-rendering: -webkit-optimize-contrast;
}

.checkout-region-icon {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    object-fit: cover;
}

.checkout-global-icon {
    width: 60px;
    height: 60px;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.checkout-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 0;
}

.checkout-plan-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.checkout-plan-amount {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.checkout-plan-duration {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 20px;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-total-label {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.checkout-total-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
    display: flex;
    align-items: center;
}

/* Promo Code Section */
.promo-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.promo-section {
    display: flex;
    gap: 12px;
}

.promo-input {
    flex: 1;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
}

.promo-input::placeholder {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.promo-input:focus {
    outline: none;
}

.promo-btn {
    width: 56px;
    height: 44px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 0;
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-btn:active {
    opacity: 0.8;
}

.promo-error {
    font-size: 15px;
    color: #FF3B30;
    line-height: 20px;
    margin-top: 12px;
    text-align: left;
    padding-left: 4px;
}

.promo-success {
    font-size: 15px;
    color: #34C759;
    line-height: 20px;
    margin-top: 12px;
    text-align: left;
    padding-left: 4px;
}

/* Payment method card (Checkout) */
.payment-method-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 !important;
    margin-bottom: 16px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.2s ease;
    text-align: left;
    position: relative;
    z-index: 1;
    /* Убираем дефолтные стили button */
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: inherit;
    /* Убеждаемся, что блок растягивается на всю ширину */
    flex-shrink: 0;
    /* Принудительно растягиваем на всю ширину родителя */
    min-width: 0;
}

.payment-method-card:active {
    background-color: var(--bg-secondary);
}

.payment-method-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: transparent;
    color: #007AFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    transition: width 0.2s ease, height 0.2s ease;
}

/* Увеличиваем иконку когда метод оплаты выбран */
.payment-method-card[data-selected="true"] .payment-method-icon {
    width: 44px;
    height: 44px;
}

.payment-method-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.payment-method-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.payment-method-title {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.payment-method-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-method-chevron {
    width: 8px;
    height: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 12px;
}

/* Bottom sheet */
.sheet-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10002; /* Выше кнопки Purchase (10001) */
    opacity: 0;
    transition: opacity 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 428px;
    background: var(--bg-primary);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    z-index: 10003; /* Выше overlay (10002) и кнопки Purchase (10001) */
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 180ms ease;
    will-change: transform, opacity;
    -webkit-overflow-scrolling: touch;
}

.sheet-overlay.is-open {
    opacity: 1;
}

.sheet.is-open {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .sheet,
    .sheet-overlay {
        transition: none !important;
    }
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}

.sheet-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

.sheet-list {
    padding: 10px 10px 0;
}

.sheet-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
    cursor: pointer;
    margin-bottom: 10px;
    text-align: left;
}

.sheet-item:active {
    background: var(--bg-secondary);
}

.sheet-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sheet-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-primary);
}

.pm-icon-svg {
    width: 26px;
    height: 26px;
    display: block;
}

/* Brand-ish colors */
.pm-stars { background: #F3F0FF; color: #7C3AED; }
.pm-stripe { background: #EEF2FF; color: #635BFF; }
.pm-cryptomus { background: #ECFDF5; color: #10B981; }

.sheet-item-label {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-item-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.sheet-item.selected .sheet-item-radio {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: inset 0 0 0 5px #fff;
}

.checkout-total-price-old {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 8px;
}

.checkout-total-price-new {
    color: var(--text-primary);
    font-weight: 600;
}

/* Bottom Button Container */
.bottom-button-container {
    position: fixed;
    bottom: 80px; /* Размещаем выше нижнего меню (высота меню ~70px + отступ) */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 428px;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background-color: var(--bg-primary);
    border-top: 0.5px solid var(--border-color);
    z-index: 10001 !important; /* Выше нижнего меню (10000) */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* На странице checkout кнопка Purchase должна быть выше bottom-nav */
body.checkout-page .bottom-button-container {
    bottom: 80px;
}

.next-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn-stars {
    margin-bottom: 10px; /* немного выше кнопки Purchase */
}

.next-btn:active {
    opacity: 0.8;
}

@supports (padding: max(0px)) {
    .bottom-button-container {
        padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
    }
}

/* Info Box */
.info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #2D2D2DCC;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    margin-bottom: 16px;
}

.info-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    align-self: center;
    object-fit: contain;
}

.info-text {
    flex: 1;
    font-size: 15px;
    line-height: 20px;
    color: #FFFFFF;
    font-weight: 400;
}

/* Account Page Styles */
.account-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.account-content::-webkit-scrollbar {
    display: none;
}

.account-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.account-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.account-section:last-child {
    margin-bottom: 0;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.account-item:active {
    background-color: var(--bg-secondary);
}

.account-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.account-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.account-icon-esim {
    color: var(--primary-color);
}

.account-icon-swap {
    color: var(--primary-color);
}

.account-item-text {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.account-chevron {
    width: 8px;
    height: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* My eSIMs Page Styles */
.my-esims-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.my-esims-content::-webkit-scrollbar {
    display: none;
}

.my-esims-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.esims-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.esim-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    gap: 16px;
    transition: background-color 0.2s ease;
}

.esim-item:active {
    background-color: var(--bg-secondary);
}

.esim-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.esim-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    width: fit-content;
}

.status-completed {
    background-color: #34C759;
    color: #FFFFFF;
}

.status-canceled {
    background-color: #FF3B30;
    color: #FFFFFF;
}

.status-onhold {
    background-color: #E5E5EA;
    color: #8E8E93;
}

.esim-details-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    background-color: var(--primary-color);
    color: #FFFFFF;
    width: fit-content;
}

.esim-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.esim-id {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.esim-date {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 20px;
}

/* My eSIMs Empty State */
.my-esims-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

.my-esims-empty-text {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 22px;
}

/* Order Details Page Styles */
.order-details-content {
    flex: 1;
    padding: 24px 16px calc(100px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-details-content::-webkit-scrollbar {
    display: none;
}

.order-details-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.order-number {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
    line-height: 34px;
}

.order-plan-info {
    font-size: 17px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 16px;
    line-height: 22px;
}

.order-details-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.order-detail-item {
    font-size: 15px;
    font-weight: 400;
    color: #000000;
    line-height: 20px;
}

.order-detail-label {
    color: #000000;
}

.order-detail-value {
    color: #000000;
}

.order-qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.qr-code-image {
    width: 200px;
    height: 200px;
    display: block;
    object-fit: contain;
    background-color: #FFFFFF;
    border: 1px solid #E5E5EA;
    border-radius: 4px;
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    background-color: #000000;
    border: 1px solid #E5E5EA;
    border-radius: 4px;
    display: block;
}

.order-details-divider {
    height: 1px;
    background-color: #E5E5EA;
    margin: 16px 0;
}

.order-scan-text {
    font-size: 15px;
    font-weight: 400;
    color: #8E8E93;
    text-align: center;
    line-height: 20px;
    margin-bottom: 16px;
}

.order-price-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.order-price {
    font-size: 17px;
    font-weight: 600;
    color: #000000;
    line-height: 22px;
}

.order-payment-provider {
    font-size: 15px;
    font-weight: 400;
    color: #8E8E93;
    line-height: 20px;
}

.order-help-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.order-help-button:active {
    background-color: var(--bg-secondary);
}

.order-help-text {
    font-size: 17px;
    font-weight: 400;
    color: #000000;
    line-height: 22px;
}

.order-help-chevron {
    width: 8px;
    height: 14px;
    color: #000000;
    flex-shrink: 0;
}

/* Current eSIM Page Styles */
.current-esim-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.current-esim-content::-webkit-scrollbar {
    display: none;
}

.current-esim-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.current-esim-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.current-esim-plan {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 22px;
}

.current-esim-order-info {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 20px;
}

.current-esim-start-date {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 20px;
}

.current-esim-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.current-esim-section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
    margin: 0;
}

.current-esim-usage-info {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
}

.current-esim-usage-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.current-esim-usage-text::before {
    content: '';
    flex: 1;
    min-width: 0;
}

.current-esim-iccid-info {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 18px;
    margin-top: 4px;
}

.current-esim-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #E5E5EA;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.current-esim-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-progress {
    background-color: #34C759;
}

.expiration-progress {
    background-color: #007AFF;
}

.current-esim-expiration-text {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
}

.current-esim-expires-date {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 20px;
}

.current-esim-extend-btn {
    align-self: flex-end;
    margin-top: 12px;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: auto;
    margin-left: auto;
}

.current-esim-extend-btn:active {
    opacity: 0.8;
}

/* Current eSIM Empty State */
.current-esim-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

.current-esim-empty-text {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 22px;
}

/* Policy Pages Styles */
.policy-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background-color: var(--bg-secondary);
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.policy-content::-webkit-scrollbar {
    display: none;
}

.text-content-wrapper {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.text-content-wrapper strong {
    font-weight: 700;
    color: var(--text-primary);
}

.policy-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.policy-text {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.policy-section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
    margin: 0;
}

.policy-paragraph {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
    margin: 0;
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.policy-list-item {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
    padding-left: 20px;
    position: relative;
}

.policy-list-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

/* Help Page Styles */
.help-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background-color: var(--bg-secondary);
}

.help-content::-webkit-scrollbar {
    display: none;
}

.help-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.help-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.help-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-item:not(:last-child) {
    margin-bottom: 12px;
}

.help-item:active {
    background-color: var(--bg-secondary);
}

.help-item-text {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 22px;
}

.help-chevron {
    width: 8px;
    height: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* FAQ Page Styles */
.faq-content {
    flex: 1;
    padding: 24px 16px 100px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background-color: var(--bg-secondary);
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.faq-content::-webkit-scrollbar {
    display: none;
}

.faq-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 41px;
    letter-spacing: 0.37px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-question {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 22px;
    margin: 0;
}

.faq-answer {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 20px;
    margin: 0;
}


/* Content Loading Spinner */
.loading-spinner {
    margin: 50px auto;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
}

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

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.error-message h3 {
    color: #FF3B30;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.error-message p {
    color: #666;
    font-size: 0.9rem;
}
