/* Делаем карточку тарифа относительной, чтобы позиционировать ярлык внутри нее */
.plan-card.popular {
  position: relative;
  overflow: visible; /* Убираем обрезку, чтобы ярлык был виден */
}

/* Обертка для позиционирования */
.plan-badge-wrapper {
    position: absolute;
    top: 0;
    right: 20px; /* Отступ от края карточки */
    width: 0;
    height: 0;
    z-index: 1;
}

/* Стили для самого ярлыка */
.popular-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%); /* Смещаем ярлык, чтобы его центр был на границе */
  background-color: #1e90ff; /* Используем цвет акцентной кнопки */
  color: white;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* Добавляем обводку в цвет фона, чтобы создать эффект "врезанности" */
  border: 2px solid #111;
}
/* ==========================================================================
   1. Global Styles & Variables
   ========================================================================== */

:root {
    /* Colors */
    --bg-color: #0D1117;
    --primary-color: #2F81F7;
    --primary-hover-color: #4C93FF;
    --card-bg-color: #161B22;
    --card-border-color: #30363D;
    --text-primary-color: #E6EDF3;
    --text-secondary-color: #8B949E;
    --text-muted-color: #6E7681;
    --accent-green: #238636;
    --accent-red: #DA3633;
    --accent-purple: #8957E5;
    --accent-teal: #39D3BB;
    --accent-amber: #E3B341;
    --contest-gradient-start: #ff8a00;
    --contest-gradient-end: #ff3d6c;
    --contest-glow: rgba(255, 138, 0, 0.25);
    --surface-1: #0f141b;
    --surface-2: #141a22;
    --surface-3: #1b2230;
    --border-soft: rgba(148, 163, 184, 0.2);
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.35);
    --glow-primary: 0 0 0 1px rgba(47, 129, 247, 0.35), 0 14px 30px rgba(47, 129, 247, 0.2);

    /* Typography */
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    /* Spacing */
    --spacing-unit: 8px;
    --container-padding: calc(var(--spacing-unit) * 3); /* 24px */

    /* Other */
    --border-radius: 12px;
    --transition-speed: 0.25s;
    --tg-viewport-height: 100vh; /* Fallback */
    --maintenance-banner-height: 0px;
}

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

html {
    height: 100%;
    overflow: hidden;
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary-color);
    line-height: var(--line-height-base);
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}

body.webapp-design-legacy .design-modern-only {
    display: none !important;
}

body.webapp-design-modern .design-legacy-only {
    display: none !important;
}

input,
textarea,
[contenteditable="true"],
[data-allow-copy="true"] {
    user-select: text;
    -webkit-user-select: text;
}

.app-shell {
    position: relative;
    width: 100%;
    min-height: var(--tg-viewport-height);
    overflow-x: hidden;
    height: var(--tg-viewport-height);
    overflow: hidden;
}

/* ==========================================================================
   2. Section Management & Transitions
   ========================================================================== */

.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw; /* Использовать vw для избежания проблем с полосой прокрутки */
    min-height: var(--tg-viewport-height); /* Не меньше высоты окна */
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: var(--container-padding);
    padding-top: 0; /* Убираем верхний паддинг отсюда */
    display: none; /* Скрываем по умолчанию */
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2); /* Немного уменьшим гэп */
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.section.active {
    display: flex;
    position: relative; /* Or static, depending on desired behavior */
    opacity: 1;
    transform: translateX(0);
    z-index: 1;
}
.section.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}


body.maintenance-banner-active {
    --maintenance-banner-height: 64px;
}

body.maintenance-banner-active .section {
    top: var(--maintenance-banner-height);
    min-height: calc(var(--tg-viewport-height) - var(--maintenance-banner-height));
    height: 100%;
}

body.maintenance-screen-active {
    overflow: hidden;
}

body.maintenance-screen-active .modern-app-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
}

body.maintenance-locked .app-shell,
body.channel-lock-active .app-shell,
body.ban-lock-active .app-shell {
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.7;
}

body.channel-lock-active,
body.ban-lock-active {
    overflow: hidden;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.section.active[style*="slideIn"] {
    animation: slideIn var(--transition-speed) ease-out forwards;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: var(--spacing-unit);
    padding-top: calc(var(--spacing-unit) * 4); /* Добавляем отступ сверху здесь */
    flex-shrink: 0; /* Заголовок не должен сжиматься */
}

.section-heading h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
}

.section-back-btn {
    position: absolute;
    left: 0;
    top: calc(50% + 6px);
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: var(--spacing-unit);
}

/* ==========================================================================
   3. Core Components (Cards, Buttons, etc.)
   ========================================================================== */

/* --- Cards --- */
.card {
    background: linear-gradient(160deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.95));
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 2.5);
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Карточка будет занимать все оставшееся место */
    box-shadow: var(--shadow-soft);
}

.card.panel {
    gap: calc(var(--spacing-unit) * 3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-footer {
    margin-top: var(--spacing-unit);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--card-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* --- Buttons --- */
.block-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-unit);
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.6) calc(var(--spacing-unit) * 2.2);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease, color var(--transition-speed) ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    background: rgba(22, 27, 34, 0.8);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    white-space: normal;
    line-height: 1.35;
}

.block-btn .btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.block-btn > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.block-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 55%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.block-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lift);
}

.block-btn:hover::after {
    opacity: 1;
}

.block-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}

.block-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.block-btn.primary {
    background: linear-gradient(135deg, #2f81f7, #1d6fe2);
    color: white;
    border-color: rgba(47, 129, 247, 0.6);
    box-shadow: var(--glow-primary);
}
.block-btn.primary:hover {
    background: linear-gradient(135deg, #4c93ff, #2f81f7);
    border-color: rgba(76, 147, 255, 0.8);
}

.block-btn.secondary {
    background: rgba(22, 27, 34, 0.6);
    color: var(--text-primary-color);
    border-color: var(--border-soft);
}
.block-btn.secondary:hover {
    background: rgba(47, 129, 247, 0.1);
    border-color: rgba(47, 129, 247, 0.4);
}
.block-btn.danger {
    background: linear-gradient(135deg, rgba(202, 63, 92, 0.96), rgba(157, 33, 63, 0.96));
    color: #fff;
    border-color: rgba(238, 121, 145, 0.42);
    box-shadow: 0 14px 28px rgba(123, 20, 44, 0.24);
}
.block-btn.danger:hover {
    background: linear-gradient(135deg, rgba(217, 78, 107, 0.98), rgba(176, 39, 72, 0.98));
}
.block-btn.contest {
    background: linear-gradient(135deg, var(--contest-gradient-start), var(--contest-gradient-end));
    border: none;
    color: #0d1117;
    box-shadow: 0 14px 30px rgba(255, 61, 108, 0.2);
    position: relative;
    overflow: hidden;
}
.block-btn.contest::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.35), transparent 60%);
    opacity: 0.6;
}
.block-btn.contest:hover {
    filter: brightness(1.05);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
    width: 100%;
}

.icon-btn {
    background: rgba(22, 27, 34, 0.6);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.icon-btn .icon-content {
    width: 20px;
    height: 20px;
}
.icon-btn:hover {
    color: var(--text-primary-color);
    border-color: rgba(47, 129, 247, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

/* --- Other Small Components --- */
.chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 2em;
    line-height: 1.5;
}

.chip.muted {
    background-color: rgba(110, 118, 129, 0.2);
    color: var(--text-secondary-color);
}

.chip.accent {
    background-color: rgba(47, 129, 247, 0.2);
    color: var(--primary-color);
}

.eyebrow {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warning {
    color: var(--accent-amber);
    font-size: 0.875rem;
    font-weight: 500;
}

.muted {
    color: var(--text-muted-color);
    font-size: 0.875rem;
}

.mono {
    font-family: 'SF Mono', 'Consolas', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary-color);
    word-break: break-all;
}

.admin-only {
    display: none;
}

.empty-state {
    padding: calc(var(--spacing-unit) * 2);
    border: 1px dashed var(--card-border-color);
    border-radius: var(--border-radius);
    text-align: center;
}

/* --- Skeleton Loaders --- */
.skeleton {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton-text {
    background: linear-gradient(to right, var(--card-bg-color) 8%, #2a3038 18%, var(--card-bg-color) 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s linear infinite;
    height: 1em;
    border-radius: 4px;
}

.skeleton-p { height: 1em; width: 100%; }
.skeleton-p.short { width: 60%; }
.skeleton-h3 { height: 1.5em; width: 40%; margin-bottom: var(--spacing-unit); }

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-unit);
}

.skeleton-box {
    background: linear-gradient(to right, var(--card-bg-color) 8%, #2a3038 18%, var(--card-bg-color) 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s linear infinite;
    height: 70px;
    border-radius: var(--border-radius);
}

/* ==========================================================================
   4. Section-Specific Styles
   ========================================================================== */

/* --- Home Section --- */
#home {
    justify-content: flex-start;
    gap: var(--home-vertical-gap, 18px);
    text-align: center;
    padding-top: calc(var(--container-padding) * 0.6);
    min-height: var(--tg-viewport-height);
    height: 100%;
    max-height: var(--tg-viewport-height);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.home-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Элемент не будет сжиматься */
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    font-weight: 600;
    color: var(--text-secondary-color);
}
.logo {
    font-size: 24px;
    color: var(--text-primary-color);
}
.logo svg {
    width: 24px;
    height: 24px;
}
.logo img {
    width: 60px;
    height: 60px;
}

.welcome-text {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
}

.status-pulse-container {
    position: relative;
    width: var(--home-circle-size, clamp(140px, 24vh, 200px));
    height: var(--home-circle-size, clamp(140px, 24vh, 200px));
    margin: calc(var(--spacing-unit) * 2) auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    justify-content: center;
}

.status-pulse {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--card-bg-color);
    border: 2px solid var(--card-border-color);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.status-pulse.state-active {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(35, 134, 54, 0.5), 0 0 40px rgba(35, 134, 54, 0.3);
    animation: pulse-green 2s infinite;
}

.status-pulse.state-expired, .status-pulse.state-offline {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(218, 54, 51, 0.5);
    animation: pulse-red 2.5s infinite;
}

.status-text {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary-color);
    transition: color var(--transition-speed) ease;
}
.status-text.state-active { color: var(--accent-green); }
.status-text.state-expired, .status-text.state-offline { color: var(--accent-red); }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(35, 134, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0); }
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(218, 54, 51, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(218, 54, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(218, 54, 51, 0); }
}

.home-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    gap: var(--home-content-gap, calc(var(--spacing-unit) * 2.75));
    justify-content: flex-start;
}

.home-content .card {
    flex-grow: 0;
}

.info-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 1.25);
    border-radius: 12px;
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid var(--border-soft);
}
.info-card .info-row:not(:last-child) {
    border-bottom: none;
    margin-bottom: calc(var(--spacing-unit) * 1.25);
}
.info-card .info-label {
    color: var(--text-secondary-color);
}
.info-card .info-value {
    font-weight: 600;
}

.info-card .info-label {
    color: var(--text-secondary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
}

.info-icon, .section-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle; /* Для лучшего выравнивания с текстом */
}

.btn-icon,
.info-icon,
.section-icon,
.icon-content,
.row-icon img,
.wizard-image img,
.logo img {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}


.home-nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
    background-color: var(--card-bg-color);
    padding: var(--spacing-unit);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border-color);
    flex-shrink: 0;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: var(--spacing-unit);
    border-radius: var(--spacing-unit);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.support-nav-btn {
    position: relative;
}

.support-unread-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
}

.support-unread-badge.hidden {
    display: none;
}

@media (max-height: 820px) {
    :root {
        --container-padding: 18px;
    }
    #home {
        padding-top: 12px;
    }
    .logo img {
        width: 48px;
        height: 48px;
    }
    .status-pulse-container {
        margin: 12px auto;
    }
    .home-content {
        gap: 16px;
    }
    .block-btn {
        padding: 12px 16px;
    }
}

@media (max-height: 700px) {
    :root {
        --container-padding: 14px;
    }
    .status-pulse-container {
        margin: 8px auto;
    }
    .home-content {
        gap: 12px;
    }
    .home-nav {
        padding: 8px;
    }
    .nav-btn {
        padding: 6px;
    }
}

@media (max-height: 600px) {
    :root {
        --container-padding: 12px;
    }
    .status-pulse-container {
        margin: 6px auto;
    }
    .section-heading {
        padding-top: 18px;
    }
    .home-content {
        gap: 10px;
    }
    .block-btn {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
}
.nav-btn:hover {
    color: var(--text-primary-color);
    background-color: rgba(139, 148, 158, 0.1);
}
.nav-btn.contest-nav {
    color: #fff;
    background: linear-gradient(135deg, var(--contest-gradient-start), var(--contest-gradient-end));
    box-shadow: 0 10px 22px rgba(255, 138, 0, 0.25);
}
.nav-btn.contest-nav:hover {
    color: #fff;
    background: linear-gradient(135deg, #ff9b2f, #ff5579);
}
.nav-btn.contest-nav .btn-icon {
    filter: brightness(0) invert(1);
}
.nav-btn .btn-icon, .block-btn .btn-icon {
    width: 24px;
    height: 24px;
}

/* --- Profile Section --- */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.25);
}

.menu-row {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 1.6) calc(var(--spacing-unit) * 1.75);
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.85));
    border: 1px solid var(--border-soft);
    color: var(--text-primary-color);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 14px;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.menu-row > span:not(.row-icon):not(.row-value):not(.chevron) {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}
.menu-row:not(:last-child) {
    border-bottom: none;
}
.menu-row:hover {
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.16), rgba(13, 17, 23, 0.9));
    border-color: rgba(47, 129, 247, 0.35);
    transform: translateY(-1px);
}
.menu-row.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.menu-row.disabled:hover {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.85));
    transform: none;
}
.menu-row.has-value .row-value {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted-color);
}
.menu-row.has-value:hover .row-value {
    color: var(--text-primary-color);
}
.menu-row.has-value .chevron {
    margin-left: calc(var(--spacing-unit) * 1.5);
}

#service-review-menu-row .row-value {
    font-weight: 700;
    letter-spacing: 0.01em;
}

#service-review-menu-row .row-value.ready {
    color: #71f6bf;
}

#service-review-menu-row .row-value.cooldown {
    color: #f9c75d;
}

#service-review-menu-row .row-value.prompt {
    color: #79a8ff;
}

.row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 14px rgba(0, 0, 0, 0.35);
}
.row-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* Делает любую иконку белой */
}
.row-icon.green { background-color: var(--accent-green); }
.row-icon.purple { background-color: var(--accent-purple); }
.row-icon.teal { background-color: var(--accent-teal); }
.row-icon.blue { background-color: var(--primary-color); }
.row-icon.amber { background-color: var(--accent-amber); }
.row-icon.gold { background: linear-gradient(135deg, #ffb347, #ff8c3a); }

.chevron {
    margin-left: auto;
    color: var(--text-muted-color);
    font-size: 1.5rem;
    font-weight: 300;
}

.panel-header .muted {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    color: var(--text-secondary-color);
}

/* --- Subscription Section --- */
#subscription .section-heading {
    padding-top: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

#subscription.section {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    height: 100%;
    max-height: var(--tg-viewport-height);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 128px);
    scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 128px);
}

#subscription .card {
    flex-grow: 0;
    flex-shrink: 0;
}

#subscription .card.panel {
    padding: calc(var(--spacing-unit) * 2);
    gap: calc(var(--spacing-unit) * 2);
    overflow: visible;
}

#subscription .card.panel > .muted {
    font-size: 0.82rem;
    line-height: 1.4;
}

.plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-unit); /* Уменьшаем отступ */
    margin-bottom: var(--spacing-unit); /* Добавляем отступ снизу */
}

#subscription .plan-grid {
    gap: calc(var(--spacing-unit) * 0.75);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.plan-card {
    border: 2px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-unit); /* Уменьшаем внутренний отступ */
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.plan-card:hover {
    border-color: var(--text-secondary-color);
}
.plan-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(47, 129, 247, 0.1);
}

.plan-card.popular {
    padding-top: calc(var(--spacing-unit) * 3);
    overflow: visible;
}

#subscription .plan-card {
    padding: calc(var(--spacing-unit) * 0.75);
}

#subscription .plan-card.popular {
    padding-top: calc(var(--spacing-unit) * 2.5);
}

.plan-card.popular .plan-badge-wrapper {
    position: absolute;
    top: 0;
    right: calc(var(--spacing-unit) * 0.75);
    left: auto;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    z-index: 2;
    pointer-events: none;
}

.popular-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    z-index: 1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.plan-header .plan-name { font-weight: 600; }
.plan-header .plan-caption { font-size: 0.8rem; color: var(--text-secondary-color); }
.plan-price { font-size: 1.4rem; font-weight: 700; margin-top: calc(var(--spacing-unit) * 0.5); } /* Уменьшаем размер и отступ */
.plan-price .currency { font-size: 1rem; font-weight: 500; color: var(--text-secondary-color); }
.plan-discount {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.6);
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted-color);
    flex-wrap: wrap;
}
.plan-discount .price-before {
    text-decoration: line-through;
    color: var(--text-secondary-color);
}
.plan-discount .discount-pill {
    background: rgba(47, 129, 247, 0.18);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
}
.price-alt { font-size: 0.875rem; color: var(--text-muted-color); margin-top: 4px; }

#subscription .plan-header .plan-name {
    font-size: 0.95rem;
}

#subscription .plan-header .plan-caption {
    font-size: 0.72rem;
}

#subscription .plan-price {
    font-size: 1.2rem;
    margin-top: 2px;
}

#subscription .plan-price .currency {
    font-size: 0.85rem;
}

#subscription .plan-discount {
    font-size: 0.7rem;
    margin-top: 2px;
}

#subscription .price-alt {
    font-size: 0.75rem;
    margin-top: 2px;
}

.trial-section {
    padding: var(--spacing-unit) 0; /* Уменьшаем отступ */
    border-top: 1px solid var(--card-border-color);
    border-bottom: 1px solid var(--card-border-color);
    margin: var(--spacing-unit) 0; /* Добавляем вертикальные отступы */
}

#subscription .trial-section {
    padding: calc(var(--spacing-unit) * 0.5) 0;
    margin: calc(var(--spacing-unit) * 0.5) 0;
}

#subscription .payment-method-selector {
    gap: calc(var(--spacing-unit) * 0.5);
}

#subscription .payment-method-trigger {
    padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
    font-size: 0.95rem;
}

#subscription .block-btn {
    padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
    font-size: 0.95rem;
}

.subscription-tariff-card {
    border: 1px solid var(--card-border-color);
    border-radius: 16px;
    padding: calc(var(--spacing-unit) * 1.25);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.subscription-tariff-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.8);
    margin-bottom: calc(var(--spacing-unit) * 0.9);
}

.subscription-tariff-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(var(--spacing-unit) * 0.6);
}

.subscription-tariff-switch .tariff-btn {
    border: 1px solid var(--card-border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary-color);
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.subscription-tariff-switch .tariff-btn.active {
    border-color: var(--primary-color);
    color: var(--text-color);
    background: rgba(47, 129, 247, 0.16);
}

.subscription-tariff-switch .tariff-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.subscription-tariff-meta {
    margin-top: calc(var(--spacing-unit) * 1);
    padding-top: calc(var(--spacing-unit) * 0.8);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.subscription-tariff-meta-title {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted-color);
}

.subscription-tariff-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subscription-tariff-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid rgba(123, 156, 217, 0.28);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(210, 224, 247, 0.9);
}

.subscription-tariff-meta-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(114, 172, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(114, 172, 255, 0.2);
}

.device-slider-card {
    border: 1px solid var(--card-border-color);
    border-radius: 16px;
    padding: calc(var(--spacing-unit) * 1.25);
    background: linear-gradient(180deg, rgba(47, 129, 247, 0.07), rgba(47, 129, 247, 0.02));
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.8);
}

.device-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: calc(var(--spacing-unit) * 0.8);
}

.device-slider-title .device-slider-value {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.device-slider-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    touch-action: none;
}

.device-slider-track.dragging {
    cursor: grabbing;
}

.device-slider-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f81f7, #4ca3ff);
}

.device-slider-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f6fbff;
    border: 2px solid #2f81f7;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
    cursor: grab;
    touch-action: none;
}

.device-slider-track:focus-visible {
    outline: 2px solid rgba(47, 129, 247, 0.65);
    outline-offset: 3px;
}

.device-slider-ticks {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted-color);
}

.device-slider-ticks span {
    text-align: center;
}

.device-slider-ticks span.active {
    color: var(--text-color);
    font-weight: 600;
}

/* --- Subscription management --- */
#subscription-management .section-heading {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.subscription-manage-content {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.2);
    padding-bottom: calc(var(--spacing-unit) * 2);
}

.subscription-manage-card {
    gap: calc(var(--spacing-unit) * 1.1);
}

.subscription-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: calc(var(--spacing-unit) * 0.8);
}

.subscription-manage-header h3 {
    margin: 0;
    font-size: 1rem;
}

.subscription-manage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(var(--spacing-unit) * 0.8);
}

.subscription-manage-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
}

.subscription-manage-item strong {
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
}

.subscription-device-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.8);
}

.subscription-device-item {
    border: 1px solid var(--card-border-color);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.6);
}

.subscription-device-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.8);
}

.subscription-device-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.subscription-device-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 0.5);
    color: var(--text-secondary-color);
    font-size: 0.75rem;
}

.subscription-device-meta span {
    display: block;
}

.subscription-device-action {
    display: flex;
    justify-content: flex-end;
}

.subscription-device-action .block-btn {
    width: auto;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.subscription-upgrade-method {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.5);
}

#subscription-upgrade-payment-method {
    border: 1px solid var(--card-border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.subscription-upgrade-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 0.7);
}

.subscription-psproxy-actions {
    gap: calc(var(--spacing-unit) * 0.7);
}

.subscription-psproxy-actions .block-btn {
    min-height: 44px;
}

.subscription-upgrade-btn {
    justify-content: flex-start;
    text-align: left;
}

.subscription-upgrade-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.subscription-payment-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.7);
}

.subscription-payment-item {
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--spacing-unit) * 0.8);
}

.subscription-payment-item .meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subscription-payment-item .amount {
    font-weight: 700;
    white-space: nowrap;
}

.subscription-payment-item .status-chip {
    font-size: 0.72rem;
}

@media (max-width: 720px) {
    .subscription-manage-grid {
        grid-template-columns: 1fr;
    }

    .subscription-device-meta {
        grid-template-columns: 1fr;
    }
}

.payment-method-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

/* --- Page Drawers (for contest) --- */
.page-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 1300;
}
.page-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.page-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 95%;
    height: 95%;
    background-color: var(--card-bg-color);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1301;
    display: flex;
    flex-direction: column;
}
.page-drawer.open {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--card-border-color);
    flex-shrink: 0;
}

.drawer-header h3 {
    font-size: 1.2rem;
}

.drawer-content {
    flex-grow: 1;
    min-height: 0;
    padding: calc(var(--spacing-unit) * 2);
}

.drawer-content.scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer-content.with-tabs {
    display: flex;
    flex-direction: column;
}

.drawer-footer {
    padding: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--card-border-color);
    flex-shrink: 0;
}

.drawer-footer .contact-support-btn {
    margin: 0;
}

.page-drawer .close-btn {
    background: none;
    border: none;
    color: var(--text-secondary-color);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.protocol-options {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.25);
    margin-top: calc(var(--spacing-unit) * 1.5);
}

.protocol-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.25);
    padding: calc(var(--spacing-unit) * 1.4);
    border-radius: var(--border-radius);
    border: 2px solid var(--card-border-color);
    background-color: var(--card-bg-color);
    color: var(--text-primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease, color var(--transition-speed) ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.protocol-option:hover {
    border-color: var(--text-secondary-color);
    background-color: rgba(139, 148, 158, 0.08);
    transform: translateY(-1px);
}

.protocol-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.protocol-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 129, 247, 0.15);
    border: 1px solid rgba(47, 129, 247, 0.25);
}

.protocol-icon.shadowsocks {
    background: rgba(255, 152, 96, 0.18);
    border-color: rgba(255, 152, 96, 0.35);
}

.protocol-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.protocol-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.protocol-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary-color);
}

.protocol-desc {
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--text-muted-color);
}

.protocol-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(47, 129, 247, 0.16);
    color: #9fb7ff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.protocol-state {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7cf7b2;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.protocol-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(47, 129, 247, 0.12);
}

.protocol-option.selected .protocol-state {
    opacity: 1;
}

.protocol-option.selected .protocol-desc {
    color: var(--text-secondary-color);
}

.protocol-option.selected .protocol-icon {
    background: rgba(47, 129, 247, 0.25);
    border-color: rgba(47, 129, 247, 0.45);
}

.payment-method-trigger {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    background-color: transparent;
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.payment-method-trigger:hover {
    border-color: var(--text-secondary-color);
    color: var(--text-primary-color);
}

.payment-method-label {
    flex-shrink: 0;
    color: var(--text-secondary-color);
}

.payment-method-value {
    flex: 1;
    min-width: 0;
    text-align: right;
    color: var(--text-muted-color);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-method-trigger.has-value .payment-method-value {
    color: var(--text-primary-color);
}

.payment-method-chevron {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--text-muted-color);
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}
.pay-btn {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}
.pay-stars {
    background-color: #54A9EB; /* Telegram Stars color */
    color: white;
    border: none;
}
.pay-yookassa {
    background-color: #FFDB4D; /* YooKassa color */
    color: #1A1A1A;
    border: none;
}

/* --- Setup Section --- */
.wizard-step {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: calc(var(--spacing-unit) * 2);
}
.wizard-step.active { display: flex; }

#os-confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: calc(var(--spacing-unit) * 2);
    width: 100%;
}

.wizard-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}
.wizard-image img {
    width: 40px;
    height: 40px;
}

.icon-content {
    width: 20px;
    height: 20px;
}

.wizard-step h3 { font-size: 1.25rem; }
.wizard-subtext { color: var(--text-secondary-color); max-width: 300px; }

.fixed-bottom {
    margin-top: auto;
    flex-shrink: 0; /* Предотвращаем сжатие */
    padding-top: var(--spacing-unit);
}

.selection-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-unit);
    width: 100%;
}
.card-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--card-border-color);
    color: var(--text-primary-color);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}
.card-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.link-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    background-color: var(--bg-color);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    border-radius: 8px;
    border: 1px solid var(--card-border-color);
    width: 100%;
}

/* --- Referrals Section --- */
.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.referral-link-card {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    margin-top: 20px;
    margin-bottom: 24px;
}

.referral-link-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
}
.referral-link-card {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.copy-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    background-color: var(--bg-color);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    border-radius: 8px;
    margin-bottom: var(--spacing-unit);
}

.copy-row .mono {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.telegram-proxy-section .section-heading {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.telegram-proxy-panel {
    gap: calc(var(--spacing-unit) * 1.9) !important;
    padding: calc(var(--spacing-unit) * 2.2);
}

.telegram-proxy-hint {
    margin: 0;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1.7);
    border-radius: 16px;
    border: 1px solid rgba(90, 151, 255, 0.28);
    background: radial-gradient(160% 120% at 0% 0%, rgba(47, 129, 247, 0.2) 0%, rgba(14, 20, 29, 0.96) 55%);
    line-height: 1.55;
    color: var(--text-secondary-color);
}

.telegram-proxy-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.6);
}

.telegram-proxy-item {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(118, 169, 255, 0.28);
    border-radius: 18px;
    background:
        linear-gradient(150deg, rgba(19, 27, 40, 0.98), rgba(10, 15, 24, 0.97)),
        radial-gradient(120% 110% at 100% 0%, rgba(57, 211, 187, 0.13), rgba(57, 211, 187, 0) 60%);
    padding: calc(var(--spacing-unit) * 1.8);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.25);
    box-shadow: 0 18px 32px rgba(2, 7, 15, 0.45);
}

.telegram-proxy-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(76, 147, 255, 0.95), rgba(57, 211, 187, 0.75));
}

.telegram-proxy-head {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: calc(var(--spacing-unit) * 1.1);
}

.telegram-proxy-ordinal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    margin-top: 2px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #a9c3ff;
    background: rgba(65, 116, 215, 0.22);
    border: 1px solid rgba(65, 116, 215, 0.4);
}

.telegram-proxy-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.telegram-proxy-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary-color);
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.telegram-proxy-caption {
    font-size: 0.8rem;
    color: var(--text-muted-color);
    line-height: 1.3;
}

.telegram-proxy-badge-group {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: auto;
}

.telegram-proxy-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b8ffd7;
    background: rgba(35, 134, 54, 0.2);
    border: 1px solid rgba(35, 134, 54, 0.38);
}

.telegram-proxy-status.offline {
    color: #ffd0d0;
    background: rgba(218, 54, 51, 0.2);
    border-color: rgba(218, 54, 51, 0.38);
}

.telegram-proxy-endpoint-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.95);
    padding: calc(var(--spacing-unit) * 1.1);
    border-radius: 13px;
    background: rgba(7, 12, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.telegram-proxy-endpoint-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-color);
    white-space: nowrap;
}

.telegram-proxy-endpoint {
    display: block;
    font-family: 'SF Mono', 'Consolas', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #d9e4ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telegram-proxy-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: calc(var(--spacing-unit) * 0.85);
}

.telegram-proxy-actions .block-btn {
    min-height: 46px;
    padding-top: calc(var(--spacing-unit) * 1.05);
    padding-bottom: calc(var(--spacing-unit) * 1.05);
    border-radius: 12px;
    font-weight: 700;
}

.telegram-proxy-connect-btn {
    box-shadow: 0 10px 24px rgba(47, 129, 247, 0.28);
}

.telegram-proxy-copy-btn {
    background: linear-gradient(160deg, rgba(26, 33, 44, 0.95), rgba(14, 20, 30, 0.95));
    border-color: rgba(138, 160, 197, 0.24);
}

.telegram-proxy-footer-actions {
    padding-top: calc(var(--spacing-unit) * 0.6);
}

@media (max-width: 420px) {
    .telegram-proxy-panel {
        padding: calc(var(--spacing-unit) * 1.7);
    }

    .telegram-proxy-item {
        padding: calc(var(--spacing-unit) * 1.35);
    }

    .telegram-proxy-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .telegram-proxy-badge-group {
        align-items: flex-start;
        margin-left: 44px;
    }

    .telegram-proxy-actions {
        grid-template-columns: 1fr;
    }

    .telegram-proxy-actions .block-btn {
        min-height: 42px;
        font-size: 0.95rem;
    }
}

.referral-buttons {
    display: flex;
    flex-direction: row;
    gap: calc(var(--spacing-unit) * 1.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 1.5);
    margin: var(--spacing-unit) 0; /* Уменьшаем вертикальные отступы */
}

.stat-box {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
    padding: calc(var(--spacing-unit) * 1.5); /* Уменьшаем внутренние отступы */
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(0, 102, 255, 0.2);
}

.stat-box .eyebrow {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0 0 var(--spacing-unit) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box .title {
    font-size: 2.2rem; /* Уменьшаем размер шрифта */
    font-weight: 700;
    margin: 0;
}

.ref-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.ref-list li {
    padding: var(--spacing-unit) 0;
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ref-list li:not(:last-child) {
    border-bottom: 1px solid var(--card-border-color);
}

/* --- Contest Section --- */
#contest.section.scrollable {
    padding-bottom: calc(var(--spacing-unit) * 3);
}

#contest .section-heading {
    justify-content: flex-end;
    text-align: right;
}


/* --- Contest Section --- */

.contest-shell {
    /* Определяем кастомные переменные для всей секции конкурса */
    --contest-accent-color: var(--contest-gradient-start);
    --contest-bg-color: #0F0F0F; /* Слегка отличающийся фон для выделения */
    --contest-card-bg-color: #1C1C1C;
    --contest-border-color: #303030;
    --contest-primary-text: #FFEADD; /* Теплый белый текст */
    --contest-secondary-text: #A89C94; /* Теплый серый текст */

    background-color: var(--contest-bg-color);
    color: var(--contest-primary-text);
}

.contest-shell {
    display: flex;
    flex-direction: column;
}

.contest-shell > * + * {
    margin-top: calc(var(--spacing-unit) * 3);
}

.contest-header {
    text-align: center;
    padding: var(--spacing-unit) 0;
    margin-bottom: var(--spacing-unit);
}

#contest-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--contest-gradient-start), var(--contest-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-unit);
}

#contest-description {
    color: var(--text-secondary-color);
    font-size: 1rem;
    max-width: 50ch;
    margin: 0 auto;
}

.contest-countdown {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-unit);
    background-color: var(--card-bg-color);
    border: 1px solid var(--card-border-color);
    color: var(--text-secondary-color);
    font-size: 0.9rem;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    border-radius: 2em;
    margin: var(--spacing-unit) auto 0;
    flex-shrink: 0;
}

/* User's personal stats card */
.contest-user-card {
    background: linear-gradient(145deg, rgba(255, 138, 0, 0.1), rgba(255, 61, 108, 0.05));
    border-color: var(--contest-accent-color);
    padding: calc(var(--spacing-unit) * 2);
}

.contest-user-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;
}

.contest-user-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contest-user-stats .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--contest-gradient-start), var(--contest-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contest-user-stats .stat-label {
    font-size: 0.8rem;
    color: var(--contest-secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Invite card styling */
.contest-invite-card {
    background-color: var(--contest-card-bg-color);
    border-color: var(--contest-border-color);
    gap: var(--spacing-unit);
}

.contest-invite-card h4 {
    font-size: 1.1rem;
    color: var(--contest-primary-text);
}

.contest-invite-card .muted {
    color: var(--contest-secondary-text);
    font-size: 0.9rem;
}

.contest-invite-card .copy-row {
    background-color: var(--contest-bg-color);
    border-color: var(--contest-border-color);
}

.contest-invite-card .mono {
    color: var(--contest-secondary-text);
}

.contest-fixed-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--container-padding);
    padding-top: var(--spacing-unit);
    background: linear-gradient(to top, var(--contest-bg-color) 70%, transparent);
    z-index: 5;
}

.contest-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    padding: 0;
}

.contest-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: calc(var(--spacing-unit) * 1.5);
    align-items: flex-start;
    padding: var(--spacing-unit) 0;
}

.contest-step-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--contest-card-bg-color);
    border: 1px solid var(--contest-border-color);
    color: var(--contest-secondary-text);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contest-step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contest-step-title {
    font-weight: 600;
    color: var(--contest-primary-text);
}

.contest-step-points .chip.accent {
    background-color: rgba(255, 138, 0, 0.2);
    color: var(--contest-accent-color);
}

.contest-rules-text {
    background: transparent;
    border: 1px solid var(--contest-border-color);
    border-left: 3px solid var(--contest-accent-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 1.5);
    color: var(--contest-secondary-text);
    line-height: 1.6;
    font-size: 0.9rem;
    white-space: pre-wrap;
    font-family: var(--font-family);
}

.leaderboard-list,
.contest-ref-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    padding: 0; /* Remove default padding */
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: var(--spacing-unit);
    background-color: var(--contest-card-bg-color);
    border: 1px solid var(--contest-border-color);
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.leaderboard-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.leaderboard-item.current-user {
    background-color: rgba(255, 138, 0, 0.1);
    border-color: var(--contest-accent-color);
}

.leaderboard-rank {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-color); /* Use main bg for contrast */
    border: 1px solid var(--contest-border-color);
    color: var(--contest-secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #FFDF00, #FFB800);
    color: #332600;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}
.leaderboard-item:nth-child(2) .leaderboard-rank {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #E1E1E1, #B0B0B0);
    color: #3C3C3C;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}
.leaderboard-item:nth-child(3) .leaderboard-rank {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #E69A6D, #B87333);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
    color: var(--contest-primary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-points {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--contest-gradient-start), var(--contest-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contest-ref-item {
    padding: calc(var(--spacing-unit) * 1.5);
    background-color: var(--contest-card-bg-color);
    border: 1px solid var(--contest-border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.contest-ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-unit);
    color: var(--contest-primary-text);
}

.contest-ref-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 0.75);
}

.contest-ref-header .muted {
    color: var(--contest-secondary-text);
    font-size: 0.85rem;
}

.contest-status {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.contest-status.ok {
    background: rgba(54, 211, 153, 0.15);
    color: #36d399;
    border-color: rgba(54, 211, 153, 0.3);
}

.contest-status.pending {
    background: rgba(227, 179, 65, 0.15);
    color: var(--accent-amber);
    border-color: rgba(227, 179, 65, 0.3);
}

.contest-status.disqualified {
    background: rgba(218, 54, 51, 0.15);
    color: var(--accent-red);
    border-color: rgba(218, 54, 51, 0.3);
}

.contest-faq {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.contest-faq-item {
    padding: var(--spacing-unit) 0;
    border-bottom: 1px solid var(--contest-border-color);
}
.contest-faq-item:last-child {
    border-bottom: none;
}

.contest-faq-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--contest-primary-text);
    font-weight: 600;
}

.contest-faq-item .muted {
    color: var(--contest-secondary-text);
    font-size: 0.9rem;
}

/* Tabs inside drawers */
.contest-tab-nav {
    display: flex;
    border-bottom: 1px solid var(--contest-border-color);
    flex-shrink: 0;
    margin: 0 calc(var(--spacing-unit) * -2);
    padding: 0 calc(var(--spacing-unit) * 2);
}

.contest-tab-btn {
    flex: 1;
    padding: calc(var(--spacing-unit) * 1.5) var(--spacing-unit);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--contest-secondary-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-bottom: -1px;
}

.contest-tab-btn:hover {
    color: var(--contest-primary-text);
}

.contest-tab-btn.active {
    color: var(--contest-primary-text);
    border-bottom-color: var(--contest-accent-color);
}

.contest-tab-content {
    padding-top: calc(var(--spacing-unit) * 2);
}

#info-drawer .contest-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#info-drawer .contest-tab-pane.active {
    flex: 1;
    min-height: 0;
}

#info-drawer #info-tab-rules {
    min-height: 0;
}

#info-drawer #info-tab-rules.active {
    display: flex;
    flex-direction: column;
}

#info-drawer .rules-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.contest-tab-pane {
    display: none;
}

.contest-tab-pane.active {
    display: block;
}

@media (max-width: 520px) {
.contest-admin-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.contest-admin-actions {
    display: flex;
    gap: var(--spacing-unit);
}

.contest-admin-actions .block-btn {
    flex: 1;
}

.contest-admin-buttons {
    margin-top: calc(var(--spacing-unit) * 2);
}

.contest-admin-stats-card .stats-grid {
    margin-top: var(--spacing-unit);
}

.contest-admin-faq-list,
.contest-admin-referrals-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    padding: 0;
}

.admin-setting-row {
    flex-direction: column;
    align-items: flex-start;
}

.admin-segmented {
    width: 100%;
}

.admin-segment-btn {
    flex: 1;
}

#home {
    padding-top: calc(var(--container-padding) * 0.45);
}

.support-entry-card {
    bottom: 10%;
}

.contest-admin-faq-item {
    position: relative;
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 3);
    background-color: var(--bg-color);
}

.contest-admin-faq-remove {
    position: absolute;
    top: var(--spacing-unit);
    right: var(--spacing-unit);
}

.contest-admin-referral-item {
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 1.5);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.contest-admin-referral-header {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-unit);
    font-weight: 600;
}

.contest-admin-referral-names {
    flex: 1;
}

.contest-admin-referral-points {
    color: var(--primary-color);
    font-weight: 700;
    white-space: nowrap;
}

.contest-admin-referral-meta {
    color: var(--text-muted-color);
    font-size: 0.85rem;
}

.contest-ref-timeline,
.contest-admin-referral-times {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 6px;
    color: var(--text-secondary-color);
    font-size: 0.85rem;
}

.contest-ref-timeline strong,
.contest-admin-referral-times strong {
    color: var(--text-primary-color);
    font-weight: 600;
}

.contest-admin-shell {
    display: grid;
    gap: calc(var(--spacing-unit) * 2);
}

.contest-admin-column {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    min-width: 0;
}

.contest-admin-card {
    gap: calc(var(--spacing-unit) * 1.5);
}

.contest-admin-heading .muted {
    margin-top: 4px;
}

.contest-admin-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.contest-admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-unit);
}

.contest-admin-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-unit);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    color: var(--text-primary-color);
    border-radius: calc(var(--border-radius) - 4px);
    padding: calc(var(--spacing-unit) * 1.6) calc(var(--spacing-unit) * 1.8);
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(6, 10, 24, 0.25);
    transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.toggle-btn[data-state="on"] {
    border-color: rgba(124, 92, 255, 0.7);
    background: linear-gradient(150deg, rgba(124, 92, 255, 0.35), rgba(124, 92, 255, 0.08));
    color: #efeaff;
    box-shadow: 0 14px 28px rgba(70, 40, 170, 0.35);
}

.toggle-btn::after {
    content: '';
    width: 12px;
    height: 12px;
    margin-left: auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.toggle-btn[data-state="on"]::after {
    background: #d5c7ff;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.28);
}

.toggle-btn:hover {
    border-color: rgba(124, 92, 255, 0.45);
    transform: translateY(-1px);
}

.toggle-btn:active {
    transform: translateY(0);
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-unit);
    padding: calc(var(--spacing-unit) * 1.2);
    border-radius: calc(var(--border-radius) - 6px);
    border: 1px solid var(--card-border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.toggle-text {
    flex: 1;
    min-width: 0;
}

.toggle-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--card-border-color);
    border-radius: 999px;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.switch-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    border-radius: 50%;
    background: #c4b5fd;
    transition: transform var(--transition-speed) ease, background-color var(--transition-speed) ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.switch input:checked ~ .switch-track {
    background: rgba(124, 92, 255, 0.35);
    border-color: rgba(124, 92, 255, 0.6);
}

.switch input:checked ~ .switch-thumb {
    transform: translateX(20px);
    background: #f0e7ff;
}

.contest-admin-form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.2);
}

.contest-admin-form input,
.contest-admin-form textarea,
.contest-admin-form select,
.contest-admin-field input,
.contest-admin-field textarea,
.contest-admin-field select,
.contest-admin-selector select {
    background-color: var(--bg-color);
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    padding: calc(var(--spacing-unit) * 1.5);
    color: var(--text-primary-color);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

.contest-admin-form input:focus,
.contest-admin-form textarea:focus,
.contest-admin-form select:focus,
.contest-admin-field input:focus,
.contest-admin-field textarea:focus,
.contest-admin-field select:focus,
.contest-admin-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.3);
}

.contest-admin-selector select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 13px) calc(50% - 3px),
        calc(100% - 36px) 50%;
    background-size: 6px 6px, 6px 6px, 1px 18px;
    background-repeat: no-repeat;
    padding-right: calc(var(--spacing-unit) * 3.4);
}

.contest-admin-text-preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    padding: calc(var(--spacing-unit) * 1.4);
    border-radius: calc(var(--border-radius) - 6px);
    border: 1px solid var(--card-border-color);
    background: rgba(255, 255, 255, 0.02);
}

.contest-admin-preview {
    margin: 0;
    padding: calc(var(--spacing-unit) * 1.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 12, 22, 0.35);
    color: var(--text-primary-color);
    line-height: 1.4;
    white-space: pre-wrap;
}

.contest-admin-preview.is-empty {
    color: var(--text-muted-color);
    font-style: italic;
}

.contest-admin-hidden-fields {
    display: none;
}

.contest-admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contest-admin-field input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contest-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--spacing-unit);
}

.contest-admin-block {
    margin-top: var(--spacing-unit);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

#contest-admin-finalize-status.success {
    color: #49d17d;
}

#contest-admin-finalize-status.error {
    color: #ff7b7b;
}

.contest-admin-split {
    display: grid;
    gap: calc(var(--spacing-unit) * 1.5);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--spacing-unit) * 2);
    background: rgba(7, 9, 18, 0.7);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    z-index: 1405;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(560px, 100%);
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border-color);
    padding: calc(var(--spacing-unit) * 2);
    box-shadow: 0 24px 60px rgba(3, 6, 18, 0.45);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
}

.modal-body {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-unit);
}

.modal-close {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.modal-open {
    overflow: hidden;
}

@media (min-width: 760px) {
    .contest-admin-shell {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .contest-admin-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 700px) {
    .contest-admin-toolbar {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .contest-admin-actions {
        min-width: 240px;
    }
}

/* --- FAQ & Contact Sections --- */
.faq-list details {
    border-bottom: 1px solid var(--card-border-color);
    padding: var(--spacing-unit) 0;
}
.faq-list summary {
    font-weight: 600;
    cursor: pointer;
    padding: var(--spacing-unit) 0;
}
.faq-list p {
    padding: var(--spacing-unit) 0;
    color: var(--text-secondary-color);
}

.form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}
.form label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary-color);
    margin-top: var(--spacing-unit);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.form input, .form textarea, .form select {
    background: linear-gradient(180deg, rgba(15, 20, 27, 0.9), rgba(13, 17, 23, 0.9));
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: calc(var(--spacing-unit) * 1.6);
    color: var(--text-primary-color);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.form input:focus, .form textarea:focus, .form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.25), 0 10px 24px rgba(47, 129, 247, 0.15);
}
.form button {
    margin-top: var(--spacing-unit);
}

/* --- Payment History Section --- */
.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    overflow-y: auto;
    height: 100%;
}

.payment-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px var(--spacing-unit);
    padding: var(--spacing-unit);
    border-bottom: 1px solid var(--card-border-color);
    align-items: center;
}

.payment-item-date {
    grid-column: 1 / 2;
    font-size: 0.875rem;
    color: var(--text-secondary-color);
}

.payment-item-plan {
    grid-column: 2 / 3;
    font-weight: 600;
}

.payment-item-amount {
    grid-column: 1 / 3;
    color: var(--text-muted-color);
}

/* ==========================================================================
   5. Overlays & Drawers (Support, Toast)
   ========================================================================== */

/* --- Telegram Auth Loading --- */
.auth-loading {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
    background: rgba(13, 17, 23, 0.92);
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(8px);
}

.auth-loading::before,
.auth-loading::after {
    content: '';
    position: absolute;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
}

.auth-loading::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(47, 129, 247, 0.25), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(137, 87, 229, 0.2), transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(35, 134, 54, 0.18), transparent 50%);
}

.auth-loading::after {
    background:
        radial-gradient(circle at 50% 50%, rgba(22, 27, 34, 0.65), rgba(13, 17, 23, 0.95));
}

body.tg-auth-confirmed .auth-loading {
    display: none;
}

.auth-loading.hidden {
    display: none !important;
}

.auth-loading-card {
    position: relative;
    z-index: 1;
    background: linear-gradient(155deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.95));
    border: 1px solid rgba(47, 129, 247, 0.3);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    width: 90vw;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.25);
    text-align: center;
    color: var(--text-primary-color);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(47, 129, 247, 0.18);
}

.auth-loading-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(47, 129, 247, 0.9);
}

.auth-loading-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.auth-loading-note {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
}

.auth-loading-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.25);
    margin-top: calc(var(--spacing-unit) * 0.5);
}

.auth-loading-btn {
    width: 100%;
}

.auth-loading-hint {
    font-size: 0.8rem;
    color: var(--text-muted-color);
}

/* --- Maintenance --- */
.maintenance-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 64px;
    padding: calc(var(--spacing-unit) * 1.2) calc(var(--spacing-unit) * 2);
    background: rgba(22, 27, 34, 0.95);
    border-bottom: 1px solid var(--card-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-unit);
    z-index: 1100;
    backdrop-filter: blur(10px);
}

.maintenance-banner__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.maintenance-banner__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    flex-wrap: wrap;
}

.maintenance-banner__title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted-color);
}

.maintenance-banner__text {
    font-size: 0.95rem;
    color: var(--text-primary-color);
}

.maintenance-banner__btn {
    border: 1px solid var(--card-border-color);
    background: transparent;
    color: var(--text-secondary-color);
    padding: calc(var(--spacing-unit) * 0.8) calc(var(--spacing-unit) * 1.6);
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.maintenance-banner__btn:hover {
    border-color: var(--text-secondary-color);
    color: var(--text-primary-color);
}

.maintenance-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 38%),
        radial-gradient(circle at bottom, rgba(124, 58, 237, 0.16), transparent 34%),
        rgba(8, 12, 20, 0.94);
    backdrop-filter: blur(16px);
}

.maintenance-screen__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    pointer-events: none;
    opacity: 0.65;
}

.maintenance-screen__glow--left {
    width: 260px;
    height: 260px;
    left: -84px;
    top: 18%;
    background: rgba(59, 130, 246, 0.22);
}

.maintenance-screen__glow--right {
    width: 280px;
    height: 280px;
    right: -110px;
    bottom: 18%;
    background: rgba(139, 92, 246, 0.2);
}

.maintenance-screen__glow--center {
    width: 420px;
    height: 420px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 211, 238, 0.08);
}

@keyframes maintenance-orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes maintenance-orbit-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.03); }
}

@keyframes maintenance-time-pop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

.maintenance-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 28px 22px 22px;
    max-width: 430px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    box-shadow: 0 26px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.maintenance-card__surface {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 26%),
        linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.03) 52%, rgba(34, 211, 238, 0.06));
    opacity: 0.9;
}

.maintenance-badge {
    position: relative;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #bfcdf4;
    background: rgba(17, 26, 42, 0.88);
    border: 1px solid rgba(110, 133, 182, 0.18);
}

.maintenance-hero,
.maintenance-copy {
    position: relative;
    z-index: 1;
}

.maintenance-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.maintenance-orbit {
    position: relative;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    animation: maintenance-orbit-float 3.2s ease-in-out infinite;
}

.maintenance-orbit__blur {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(139, 92, 246, 0.22));
    filter: blur(22px);
    animation: maintenance-orbit-spin 18s linear infinite;
}

.maintenance-orbit__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.24);
    box-shadow:
        0 0 0 10px rgba(59, 130, 246, 0.08),
        inset 0 0 24px rgba(59, 130, 246, 0.08);
}

.maintenance-orbit__core {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(16, 24, 39, 0.96), rgba(13, 19, 32, 0.98));
    border: 1px solid rgba(86, 132, 255, 0.32);
    box-shadow:
        inset 0 0 28px rgba(65, 105, 225, 0.18),
        0 0 28px rgba(40, 88, 207, 0.16);
}

.maintenance-orbit__icon {
    width: 38px;
    height: 38px;
    color: #60a5fa;
    filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.28));
}

.maintenance-copy h2 {
    margin: 0;
    font-size: 1.72rem;
    line-height: 1.2;
}

.maintenance-copy {
    gap: 8px;
}

.maintenance-text {
    color: rgba(229, 237, 255, 0.82);
    font-size: 0.98rem;
    line-height: 1.65;
    margin: 0;
}

.maintenance-countdown {
    position: relative;
    z-index: 1;
    border-radius: 22px;
    padding: 16px 14px 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(96, 129, 201, 0.22);
}

.maintenance-countdown__header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: rgba(188, 205, 238, 0.86);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.maintenance-countdown__header-icon {
    width: 16px;
    height: 16px;
    color: #60a5fa;
}

.maintenance-countdown__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.maintenance-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.maintenance-time-unit__value {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #60a5fa;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    animation: maintenance-time-pop 2.6s ease-in-out infinite;
}

.maintenance-time-unit__value--purple {
    color: #c084fc;
}

.maintenance-time-unit__value--cyan {
    color: #67e8f9;
}

.maintenance-time-unit__label {
    font-size: 0.68rem;
    color: rgba(170, 185, 216, 0.62);
    text-transform: lowercase;
}

.maintenance-time-unit__separator {
    padding-top: 10px;
    color: rgba(137, 154, 187, 0.58);
    font-size: 1.5rem;
    font-weight: 700;
}

.maintenance-until {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(130, 181, 255, 0.9);
    font-size: 0.82rem;
    line-height: 1.5;
}

.maintenance-updates {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.maintenance-update {
    padding: 14px 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(100, 114, 139, 0.18);
    background: rgba(16, 24, 40, 0.72);
}

.maintenance-update__icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.maintenance-update__icon svg {
    width: 18px;
    height: 18px;
    color: currentColor;
}

.maintenance-update p {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(214, 224, 244, 0.82);
}

.maintenance-update--blue .maintenance-update__icon {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.maintenance-update--purple .maintenance-update__icon {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.18);
}

.maintenance-update--green .maintenance-update__icon {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.maintenance-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
}

.maintenance-actions .block-btn {
    min-height: 50px;
    flex: 1 1 0;
}

.maintenance-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.maintenance-action-btn__icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.maintenance-note {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(151, 163, 188, 0.74);
    font-size: 0.78rem;
    line-height: 1.5;
}

@media (max-width: 380px) {
    .maintenance-card {
        padding: 24px 18px 18px;
    }

    .maintenance-time-unit__value {
        min-height: 52px;
        font-size: 1.7rem;
    }

    .maintenance-actions {
        flex-direction: column;
    }
}

.channel-lock,
.ban-lock {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
    background: rgba(13, 17, 23, 0.94);
    backdrop-filter: blur(8px);
}

.channel-card,
.ban-card {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
    text-align: center;
}

.channel-icon,
.ban-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 129, 247, 0.15);
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
}

.channel-text,
.ban-text {
    color: var(--text-primary-color);
    font-size: 1rem;
}

.channel-actions,
.ban-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

/* --- Support Drawer --- */
.support-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 1300;
}
.support-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.support-drawer {
    position: fixed;
    top: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background-color: var(--card-bg-color);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateY(100%);
    transition: transform var(--transition-speed) ease;
    z-index: 1301;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-unit);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
}

.support-entry-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 1299;
}

.support-entry-overlay.open {
    opacity: 1;
    visibility: visible;
}

.support-entry-card {
    position: fixed;
    left: 50%;
    bottom: 16%;
    transform: translate(-50%, 20px);
    width: min(92vw, 420px);
    background: linear-gradient(160deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.96));
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-entry-card.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.support-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.support-entry-header .icon-btn {
    font-size: 1.4rem;
    line-height: 1;
}

.support-entry-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-ideas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 1302;
}

.support-ideas-overlay.open {
    opacity: 1;
    visibility: visible;
}

.support-ideas-modal {
    position: fixed;
    inset: 0;
    transform: translateY(20px);
    width: 100vw;
    height: 100dvh;
    border: none;
    border-radius: 0;
    background: linear-gradient(165deg, rgba(14, 20, 31, 0.995), rgba(10, 14, 22, 0.99));
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1303;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.support-ideas-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.support-ideas-modal-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(16, 22, 33, 0.98), rgba(16, 22, 33, 0.86));
    backdrop-filter: blur(8px);
    z-index: 2;
}

.support-ideas-modal-header h3 {
    margin: 0;
    font-size: 1.14rem;
    font-weight: 700;
}

.support-ideas-modal-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.support-ideas-modal .support-ideas {
    max-width: min(760px, 100%);
    margin: 0 auto;
    width: 100%;
    padding: 18px 16px 24px;
    overflow: visible;
}

.support-chat-thread::-webkit-scrollbar {
    width: 6px;
}

.support-chat-thread::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.4);
    border-radius: 999px;
}
.support-drawer.open {
    transform: translateY(0);
}

.drawer-handle-container {
    padding: var(--spacing-unit) 0;
    display: flex;
    justify-content: center;
}
.drawer-handle {
    width: 40px;
    height: 4px;
    background-color: var(--card-border-color);
    border-radius: 2px;
}

.support-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit);
}
.support-header h3 { font-size: 1.2rem; }
.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary-color);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.support-faq {
    overflow-y: auto;
    flex-grow: 1;
    padding: var(--spacing-unit);
}

.support-tabs {
    display: flex;
    gap: 8px;
    padding: 0 var(--spacing-unit);
}

.support-tab-btn {
    flex: 1;
    border: 1px solid var(--card-border-color);
    background: var(--card-bg-color);
    color: var(--text-secondary-color);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
}

.support-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.support-tab-content {
    display: none;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.support-tab-content.active {
    display: flex;
}

.support-ideas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 var(--spacing-unit) var(--spacing-unit);
    overflow-y: auto;
}

.support-ideas-intro {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(13, 17, 23, 0.55);
}

.support-ideas-title {
    margin: 0 0 4px;
    font-weight: 700;
}

.support-ideas-intro .muted {
    margin: 0;
}

.support-ideas-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--card-border-color);
    background: linear-gradient(165deg, rgba(18, 25, 39, 0.82), rgba(13, 17, 23, 0.82));
}

.support-ideas-form input,
.support-ideas-form textarea {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    background: rgba(15, 23, 42, 0.68);
    color: var(--text-primary-color);
}

.support-ideas-form textarea {
    resize: vertical;
    min-height: 88px;
}

.support-ideas-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#support-idea-submit-status {
    font-size: 0.82rem;
    text-align: right;
}

.support-ideas-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-ideas-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-ideas-list-title {
    margin: 0;
    font-weight: 600;
}

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

.support-idea-card {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(13, 17, 23, 0.55);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.support-idea-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.support-idea-card-title {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.support-idea-status {
    font-size: 0.74rem;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.support-idea-status.pending {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.35);
    color: #bfdbfe;
}

.support-idea-status.review {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.38);
    color: #fde68a;
}

.support-idea-status.accepted {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.44);
    color: #86efac;
}

.support-idea-status.in_progress {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(129, 140, 248, 0.45);
    color: #c7d2fe;
}

.support-idea-status.done {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(74, 222, 128, 0.45);
    color: #bbf7d0;
}

.support-idea-status.rejected {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.support-idea-card-description {
    margin: 0;
    line-height: 1.4;
    white-space: pre-wrap;
}

.support-idea-card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary-color);
}

.support-idea-card-comment {
    margin: 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.48);
    font-size: 0.86rem;
    line-height: 1.38;
}

.support-status {
    padding: 0 var(--spacing-unit);
}

.support-user-summary {
    margin: 0 var(--spacing-unit);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
    background: var(--card-bg-color);
    display: grid;
    gap: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.support-user-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.support-user-name {
    font-weight: 600;
    font-size: 1rem;
}

.support-user-handle {
    font-size: 0.85rem;
    color: var(--text-secondary-color);
}

.support-user-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    font-size: 0.85rem;
}

.support-user-meta .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary-color);
    margin-bottom: 2px;
}

.support-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--spacing-unit);
    padding-bottom: 72px;
    scroll-padding-bottom: 72px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, rgba(22, 27, 34, 0) 0%, rgba(22, 27, 34, 0.6) 100%);
    border-radius: 12px;
}

.support-chat-message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.35;
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid var(--card-border-color);
    color: var(--text-primary-color);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.support-chat-message.admin {
    align-self: flex-start;
    background: rgba(47, 129, 247, 0.18);
    border-color: rgba(47, 129, 247, 0.4);
}

.support-video-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.5);
}

.support-video-thumb::after {
    content: '?';
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.support-video-thumb video {
    display: block;
}

.support-chat-message.user {
    align-self: flex-end;
    background: rgba(35, 134, 54, 0.2);
    border-color: rgba(35, 134, 54, 0.45);
}

.support-chat-message.system {
    align-self: center;
    background: rgba(15, 23, 42, 0.6);
    color: rgba(226, 232, 240, 0.85);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    font-size: 0.85rem;
    text-align: center;
}

.support-admin-embed {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.support-admin-embed-card {
    flex: 1;
    min-height: 60vh;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(10, 14, 24, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 18px 40px rgba(7, 10, 18, 0.5);
    overflow: hidden;
}

#support-admin-iframe {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: 0;
    border-radius: 14px;
    background: transparent;
}

.support-chat-meta {
    font-size: 0.75rem;
    color: var(--text-secondary-color);
    margin-top: 4px;
}

.support-chat-message .support-chat-media {
    margin-top: 6px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border-color);
    background: rgba(13, 17, 23, 0.6);
    max-width: min(70vw, 260px);
}

.support-chat-message .support-chat-media img,
.support-chat-message .support-chat-media video {
    width: auto;
    max-width: min(70vw, 260px);
    max-height: 240px;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

.support-chat-input {
    padding: 0 var(--spacing-unit) var(--spacing-unit);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--card-border-color);
    background: rgba(13, 17, 23, 0.6);
}

.support-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.support-chat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.support-chat-actions .icon-btn {
    border: 1px solid var(--card-border-color);
    background: rgba(13, 17, 23, 0.7);
    color: var(--text-primary-color);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.support-chat-actions .send-btn {
    background: linear-gradient(135deg, #6d5bff, #7c3aed);
    border-color: transparent;
}

.support-chat-input textarea {
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
    padding: 10px 12px;
    resize: none;
    background: var(--card-bg-color);
    color: var(--text-primary-color);
    flex: 1;
    min-height: 40px;
}

.support-chat-muted {
    padding: 0 var(--spacing-unit);
    font-size: 0.9rem;
    color: var(--text-secondary-color);
}

.support-rating-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(4px);
    z-index: 60;
}

.support-rating-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 360px);
    background: linear-gradient(160deg, rgba(24, 32, 48, 0.95), rgba(15, 23, 42, 0.95));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 16px;
    z-index: 61;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 18px 40px rgba(7, 10, 18, 0.6);
}

.support-rating-modal.inline {
    position: relative;
    inset: auto;
    margin: 18px auto 12px;
    width: min(96%, 520px);
    max-width: 520px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    z-index: 1;
    align-self: center;
}

.support-rating-modal.inline .support-rating-header {
    justify-content: center;
    text-align: center;
}

.support-rating-modal.inline #support-rating-close {
    display: none;
}

.support-rating-modal.inline textarea {
    width: 100%;
    min-height: 84px;
    resize: none;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.95));
    color: var(--text-color, #e2e8f0);
    padding: 12px 14px;
    font-size: 0.95rem;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.25);
}

.support-rating-modal.inline textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.support-rating-modal.inline .support-rating-actions {
    flex-direction: column;
}

.support-rating-modal.inline .support-rating-actions .block-btn {
    width: 100%;
}

.support-rating-modal.hidden,
.support-rating-overlay.hidden {
    display: none;
}

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

.support-rating-header h3 {
    margin: 0;
    font-size: 1rem;
}

.support-rating-stars {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}

.support-rating-stars button {
    border: none;
    background: rgba(30, 41, 59, 0.85);
    color: #94a3b8;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.support-rating-stars button.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.support-rating textarea {
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
    padding: 8px 10px;
    background: var(--card-bg-color);
    color: var(--text-primary-color);
    resize: none;
}

.support-rating textarea::placeholder {
    color: var(--text-secondary-color);
}

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

.service-review-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background:
        radial-gradient(circle at 12% 14%, rgba(34, 197, 94, 0.18), transparent 44%),
        radial-gradient(circle at 92% 4%, rgba(59, 130, 246, 0.2), transparent 40%),
        rgba(5, 10, 24, 0.74);
    backdrop-filter: blur(7px);
}

.service-review-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 71;
    width: min(92vw, 430px);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background:
        linear-gradient(150deg, rgba(19, 27, 43, 0.97), rgba(8, 13, 25, 0.97));
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow:
        0 24px 58px rgba(4, 8, 20, 0.64),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.service-review-overlay.hidden,
.service-review-modal.hidden {
    display: none;
}

.service-review-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.service-review-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    color: rgba(125, 211, 252, 0.9);
}

.service-review-header h3 {
    margin: 4px 0 0;
    font-size: 1.2rem;
    line-height: 1.2;
}

.service-review-subtitle {
    margin: 0;
    color: rgba(203, 213, 225, 0.86);
    font-size: 0.92rem;
    line-height: 1.4;
}

.service-review-stars {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.service-review-stars button {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 12px;
    min-height: 44px;
    background: rgba(30, 41, 59, 0.85);
    color: rgba(148, 163, 184, 0.85);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.service-review-stars button.active {
    border-color: rgba(251, 191, 36, 0.75);
    color: #facc15;
    background: linear-gradient(145deg, rgba(82, 59, 6, 0.74), rgba(46, 30, 4, 0.74));
    transform: translateY(-1px);
}

#service-review-comment {
    width: 100%;
    box-sizing: border-box;
    min-height: 110px;
    resize: vertical;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(10, 16, 30, 0.9);
    color: var(--text-primary-color);
    padding: 12px 14px;
    font-size: 0.94rem;
    line-height: 1.4;
}

#service-review-comment::placeholder {
    color: rgba(148, 163, 184, 0.72);
}

.service-review-meta {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(148, 163, 184, 0.92);
    line-height: 1.35;
}

.service-review-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.support-file-preview {
    margin: 0 var(--spacing-unit);
    padding: 10px;
    border-radius: 12px;
    border: 1px dashed var(--card-border-color);
    background: rgba(13, 17, 23, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
}

.support-file-preview.hidden {
    display: none;
}

.support-file-preview img,
.support-file-preview video {
    max-width: 140px;
    max-height: 120px;
    border-radius: 10px;
}

.support-file-preview .meta {
    font-size: 0.8rem;
    color: var(--text-secondary-color);
}

/* Support chat input: keep one-row layout and hide native file input */
#support-chat-file,
.support-drawer input[type="file"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: block !important;
}

.support-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.support-input-row textarea {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.support-chat-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.support-contact-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.support-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.support-contact-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
    background: rgba(22, 27, 34, 0.7);
}

.support-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-contact-hint {
    font-size: 0.85rem;
}

.support-user-card {
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    padding: 12px;
    background: var(--card-bg-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.support-user-title {
    font-weight: 600;
}

.support-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    font-size: 0.85rem;
}

.support-user-grid .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary-color);
    margin-bottom: 2px;
}

.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-panel-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
    background: rgba(22, 27, 34, 0.7);
}

.admin-setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-setting-title {
    font-weight: 600;
}

.admin-switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-flex;
}

.admin-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #2b333d;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.admin-switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.admin-switch input:checked + .admin-switch-slider {
    background: var(--primary-color);
}

.admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(20px);
}

.admin-segmented {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid var(--card-border-color);
    overflow: hidden;
    background: #11161d;
    flex-wrap: wrap;
}

.admin-segment-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary-color);
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.admin-segment-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(47, 129, 247, 0.3);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-status {
    font-size: 0.85rem;
}

.contact-support-btn {
    margin: var(--spacing-unit);
    padding: calc(var(--spacing-unit) * 1.5);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
}

.payment-method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit);
}

.payment-method-header h3 {
    font-size: 1.1rem;
}

.payment-method-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    overflow-y: auto;
    padding: var(--spacing-unit);
}

.payment-method-option {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--card-border-color);
    background-color: var(--bg-color);
    color: var(--text-primary-color);
    padding: calc(var(--spacing-unit) * 1.5);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.payment-method-option:hover {
    border-color: var(--text-secondary-color);
}

.payment-method-option.selected {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(47, 129, 247, 0.12);
}

.payment-method-empty {
    text-align: center;
    color: var(--text-muted-color);
    font-size: 0.9rem;
    padding: calc(var(--spacing-unit) * 2) 0;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 2);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.toast {
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
    border-radius: 2em;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: toast-in 0.5s forwards;
}
.toast.success { background-color: var(--accent-green); }
.toast.error { background-color: var(--accent-red); }
.toast.info { background-color: var(--primary-color); }

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Payment Overlays --- */
.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.payment-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-unit);
    color: var(--text-primary-color);
    width: min(320px, 80vw);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--card-border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.payment-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg-color);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1002;
    padding: var(--spacing-unit);
    display: flex;
    flex-direction: column;
}

.payment-drawer.open {
    transform: translateY(0);
}

.payment-success-content {
    padding: calc(var(--spacing-unit) * 2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.payment-success-content h3 { font-size: 1.5rem; }
.payment-success-content p { color: var(--text-secondary-color); }

/* --- Payment Method Dropdown --- */
.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-button {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    background-color: transparent;
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.dropdown-button:hover {
    border-color: var(--text-secondary-color);
    color: var(--text-primary-color);
}

.dropdown-button::after {
    content: 'Ў';
    font-size: 0.8rem;
    color: var(--text-secondary-color);
    transition: transform var(--transition-speed) ease;
}

.dropdown.open .dropdown-button::after {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg-color);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-option {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
    border-bottom: 1px solid var(--card-border-color);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: rgba(139, 148, 158, 0.1);
}

.dropdown-option.selected {
    background-color: rgba(47, 129, 247, 0.1);
    color: var(--primary-color);
}

.support-rating textarea {
    background: rgba(13, 17, 23, 0.85);
    color: var(--text-primary-color);
}

.support-rating-stars button {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.support-rating-stars button.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.5);
}

.support-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    pointer-events: auto;
}

.support-lightbox.hidden {
    display: none;
}

.support-lightbox-content {
    position: relative;
    width: min(92vw, 520px);
    max-height: 80vh;
    background: rgba(12, 18, 27, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.support-lightbox-content img,
.support-lightbox-content video {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.support-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 20px;
    border-radius: 10px;
    cursor: pointer;
}

/* =============================== MODERN WEBAPP =============================== */
body.webapp-design-modern {
    --bg-color: #070c16;
    --card-bg-color: #131927;
    --card-border-color: rgba(94, 109, 145, 0.28);
    --text-primary-color: #f2f6ff;
    --text-secondary-color: #93a1bc;
    --text-muted-color: #71809d;
    --primary-color: #2f6bff;
    --primary-hover-color: #4a80ff;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(36, 92, 255, 0.18), rgba(36, 92, 255, 0) 44%),
        linear-gradient(180deg, #070c16 0%, #09101d 100%);
}

body.webapp-design-modern .background-rings {
    opacity: 0.18;
    filter: saturate(1.1);
}

body.webapp-design-modern .app-shell {
    padding-bottom: 0;
}

body.webapp-design-modern .section {
    width: 100%;
    max-width: 100%;
    padding: 20px 20px 28px;
    gap: 18px;
    scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
}

body.webapp-design-modern.modern-nav-visible .section {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
}

body.webapp-design-modern #home.section,
body.webapp-design-modern.modern-nav-visible #home.section {
    height: 100%;
    max-height: var(--tg-viewport-height);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 136px);
}

@keyframes modern-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    body.webapp-design-modern .section.active > * {
        animation: modern-fade-in-up 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    body.webapp-design-modern .section.active > *:nth-child(1) { animation-delay: 0.02s; }
    body.webapp-design-modern .section.active > *:nth-child(2) { animation-delay: 0.05s; }
    body.webapp-design-modern .section.active > *:nth-child(3) { animation-delay: 0.08s; }
    body.webapp-design-modern .section.active > *:nth-child(4) { animation-delay: 0.11s; }
    body.webapp-design-modern .section.active > *:nth-child(5) { animation-delay: 0.14s; }
    body.webapp-design-modern .section.active > *:nth-child(6) { animation-delay: 0.17s; }
}

body.webapp-design-modern .card,
body.webapp-design-modern .support-admin-embed-card,
body.webapp-design-modern .page-drawer,
body.webapp-design-modern .support-drawer,
body.webapp-design-modern .support-entry-card,
body.webapp-design-modern .payment-drawer,
body.webapp-design-modern .maintenance-card,
body.webapp-design-modern .channel-card,
body.webapp-design-modern .ban-card {
    flex: 0 0 auto;
    min-height: 0;
    border-radius: 22px;
    border: 1px solid rgba(102, 123, 168, 0.24);
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.96), rgba(14, 20, 31, 0.94));
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern .card.panel,
body.webapp-design-modern .contest-user-card,
body.webapp-design-modern .contest-invite-card,
body.webapp-design-modern .contest-admin-card,
body.webapp-design-modern .support-contact-card,
body.webapp-design-modern .support-user-card {
    border-radius: 22px;
    border: 1px solid rgba(102, 123, 168, 0.24);
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.96), rgba(14, 20, 31, 0.94));
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern .section-heading {
    position: sticky;
    top: 0;
    z-index: 25;
    justify-content: flex-start;
    gap: 12px;
    margin: -20px -20px 0;
    padding: 14px 20px 16px;
    background: rgba(10, 14, 26, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.webapp-design-modern .section-heading h2 {
    min-width: 0;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
}

body.webapp-design-modern .section-back-btn {
    position: static;
    width: auto;
    min-width: 52px;
    height: 40px;
    margin-top: 6px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(90, 108, 145, 0.28);
    background: rgba(18, 24, 38, 0.86);
    color: #c8d4ec;
    font-size: 0.94rem;
    line-height: 1;
}

body.webapp-design-modern .block-btn {
    min-height: 54px;
    border-radius: 16px;
    line-height: 1.3;
    white-space: normal;
    text-wrap: balance;
}

body.webapp-design-modern .block-btn.primary {
    background: linear-gradient(180deg, #2f6bff 0%, #2557d6 100%);
    box-shadow: 0 18px 32px rgba(30, 73, 188, 0.34);
}

body.webapp-design-modern .block-btn.secondary,
body.webapp-design-modern .payment-method-trigger {
    background: rgba(20, 27, 42, 0.92);
    border: 1px solid rgba(96, 114, 150, 0.28);
    color: #dfe8ff;
}

body.webapp-design-modern .block-btn.danger {
    background: linear-gradient(180deg, rgba(197, 66, 96, 0.98), rgba(157, 33, 63, 0.98));
    border-color: rgba(236, 123, 145, 0.34);
    box-shadow: 0 18px 32px rgba(116, 19, 41, 0.28);
}

body.webapp-design-modern .menu-row,
body.webapp-design-modern .payment-history-item,
body.webapp-design-modern .telegram-proxy-card,
body.webapp-design-modern .subscription-device-card,
body.webapp-design-modern .subscription-payment-card {
    border-radius: 18px;
    background: rgba(20, 27, 42, 0.88);
    border: 1px solid rgba(94, 109, 145, 0.18);
}

body.webapp-design-modern .menu-row:hover {
    background: rgba(30, 39, 58, 0.96);
}

body.webapp-design-modern .modern-home {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: auto;
    padding-bottom: 8px;
}

body.webapp-design-modern .modern-home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
}

body.webapp-design-modern .modern-home-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.webapp-design-modern .modern-home-brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(6, 227, 255, 0.08);
    border: 1px solid rgba(6, 227, 255, 0.16);
}

body.webapp-design-modern .modern-home-brand-mark img {
    width: 18px;
    height: 18px;
}

body.webapp-design-modern .modern-home-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #7081a5;
}

body.webapp-design-modern .modern-home-brand-copy h1 {
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 700;
    color: #f6f8ff;
}

body.webapp-design-modern .modern-home-topbar,
body.webapp-design-modern .modern-home-brand,
body.webapp-design-modern .modern-home-brand-mark,
body.webapp-design-modern .modern-home-brand-copy,
body.webapp-design-modern .modern-home-kicker {
    display: none !important;
}

body.webapp-design-modern .modern-home-hero {
    display: grid;
    place-items: center;
    gap: 16px;
    padding: 22px 18px 24px;
    min-height: 186px;
    position: relative;
    overflow: hidden;
}

body.webapp-design-modern .modern-home-hero::before {
    content: '';
    position: absolute;
    inset: auto -20% 58% -20%;
    height: 120px;
    background: radial-gradient(circle, rgba(62, 112, 255, 0.18), transparent 70%);
    pointer-events: none;
}

body.webapp-design-modern .modern-home-status-ring {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background:
        radial-gradient(circle at center, rgba(20, 28, 43, 0.94) 0 42%, transparent 42% 100%),
        conic-gradient(from 220deg, rgba(25, 233, 124, 0.15), rgba(25, 233, 124, 0.85), rgba(25, 233, 124, 0.15));
    box-shadow:
        0 0 0 8px rgba(20, 233, 124, 0.08),
        inset 0 0 18px rgba(25, 233, 124, 0.18);
}

body.webapp-design-modern .modern-home-status-ring-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(25, 233, 124, 0.18);
    animation: modern-status-ring-pulse 2.2s ease-in-out infinite;
}

@keyframes modern-status-ring-pulse {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.06);
    }
}

body.webapp-design-modern .modern-home-status-ring.is-offline {
    background:
        radial-gradient(circle at center, rgba(20, 28, 43, 0.94) 0 42%, transparent 42% 100%),
        conic-gradient(from 220deg, rgba(128, 145, 174, 0.15), rgba(128, 145, 174, 0.72), rgba(128, 145, 174, 0.15));
    box-shadow:
        0 0 0 8px rgba(128, 145, 174, 0.08),
        inset 0 0 18px rgba(128, 145, 174, 0.18);
}

body.webapp-design-modern .modern-home-status-ring.is-expired {
    background:
        radial-gradient(circle at center, rgba(20, 28, 43, 0.94) 0 42%, transparent 42% 100%),
        conic-gradient(from 220deg, rgba(255, 177, 53, 0.15), rgba(255, 177, 53, 0.82), rgba(255, 177, 53, 0.15));
    box-shadow:
        0 0 0 8px rgba(255, 177, 53, 0.08),
        inset 0 0 18px rgba(255, 177, 53, 0.18);
}

body.webapp-design-modern .modern-home-status-ring.is-offline .modern-home-status-ring-pulse {
    border-color: rgba(128, 145, 174, 0.2);
}

body.webapp-design-modern .modern-home-status-ring.is-expired .modern-home-status-ring-pulse {
    border-color: rgba(255, 177, 53, 0.2);
}

body.webapp-design-modern .modern-home-status-ring-inner {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    gap: 4px;
    background: linear-gradient(180deg, #0e1523, #111a28);
    border: 1px solid rgba(26, 233, 124, 0.24);
}

body.webapp-design-modern .modern-home-status-ring.is-offline .modern-home-status-ring-inner {
    border-color: rgba(128, 145, 174, 0.28);
}

body.webapp-design-modern .modern-home-status-ring.is-expired .modern-home-status-ring-inner {
    border-color: rgba(255, 177, 53, 0.28);
}

body.webapp-design-modern .modern-home-status-ring-icon {
    width: 24px;
    height: 24px;
    opacity: 0.92;
}

body.webapp-design-modern .modern-home-status-ring-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7ff0aa;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.webapp-design-modern .modern-home-status-ring.is-offline .modern-home-status-ring-label {
    color: #c0cbdf;
}

body.webapp-design-modern .modern-home-status-ring.is-expired .modern-home-status-ring-label {
    color: #ffd58b;
}

body.webapp-design-modern .modern-home-status-copy {
    text-align: center;
    position: relative;
    z-index: 1;
}

body.webapp-design-modern .modern-home-status-copy h2 {
    margin-top: 12px;
    font-size: 1.08rem;
    font-weight: 700;
}

body.webapp-design-modern .modern-home-status-copy .muted {
    margin-top: 6px;
    line-height: 1.45;
    max-width: 270px;
}

body.webapp-design-modern .modern-home-summary {
    padding: 10px 14px;
}

body.webapp-design-modern .modern-home-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

body.webapp-design-modern .modern-home-summary-row:not(:last-child) {
    border-bottom: 1px solid rgba(77, 92, 126, 0.22);
}

body.webapp-design-modern .modern-home-summary-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #93a1bc;
    font-size: 0.92rem;
}

body.webapp-design-modern .modern-home-summary-row strong {
    font-size: 0.96rem;
    color: #f3f7ff;
}

body.webapp-design-modern .modern-home-actions {
    display: grid;
    gap: 10px;
}

body.webapp-design-modern .modern-home-highlight {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

body.webapp-design-modern .modern-home-highlight-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 107, 255, 0.12);
    border: 1px solid rgba(47, 107, 255, 0.2);
}

body.webapp-design-modern .modern-home-highlight-title {
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #edf3ff;
}

body.webapp-design-modern .modern-home-actions .block-btn,
body.webapp-design-modern .maintenance-actions .block-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.webapp-design-modern .modern-home-actions .block-btn:hover,
body.webapp-design-modern .maintenance-actions .block-btn:hover {
    transform: translateY(-1px);
}

body.webapp-design-modern .maintenance-screen {
    background:
        radial-gradient(circle at top, rgba(52, 97, 255, 0.18), transparent 42%),
        radial-gradient(circle at bottom, rgba(123, 92, 255, 0.14), transparent 36%),
        rgba(8, 12, 20, 0.94);
}

body.webapp-design-modern .maintenance-card {
    border-radius: 24px;
    padding: 24px 20px 20px;
    background: linear-gradient(180deg, rgba(17, 24, 38, 0.98), rgba(11, 18, 29, 0.96));
}

body.webapp-design-modern .maintenance-countdown {
    background: linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(123, 92, 255, 0.1));
    border-color: rgba(86, 119, 195, 0.22);
}

body.webapp-design-modern .maintenance-update {
    background: rgba(20, 27, 42, 0.82);
    border-color: rgba(94, 109, 145, 0.18);
}

body.webapp-design-modern .maintenance-note {
    color: rgba(163, 176, 205, 0.76);
}

body.webapp-design-modern .modern-app-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid rgba(95, 111, 146, 0.24);
    background: rgba(10, 16, 26, 0.92);
    box-shadow:
        0 26px 44px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

body.webapp-design-modern.modern-nav-visible .app-shell {
    padding-bottom: 104px;
}

body.webapp-design-modern .modern-app-nav.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
}

body.webapp-design-modern .modern-app-nav-btn {
    min-height: 54px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: #8d9ab7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

body.webapp-design-modern .modern-app-nav-btn img {
    width: 17px;
    height: 17px;
    opacity: 0.82;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

body.webapp-design-modern .modern-app-nav-btn.active {
    background: linear-gradient(180deg, rgba(47, 107, 255, 0.22), rgba(47, 107, 255, 0.12));
    border-color: rgba(77, 124, 255, 0.28);
    color: #f3f7ff;
}

body.webapp-design-modern .modern-app-nav-btn.active img {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

body.webapp-design-modern .chip.success {
    color: #8dffc6;
    background: rgba(21, 190, 108, 0.12);
    border-color: rgba(21, 190, 108, 0.22);
}

body.webapp-design-modern .chip.warning {
    color: #ffd27f;
    background: rgba(255, 177, 53, 0.12);
    border-color: rgba(255, 177, 53, 0.22);
}

body.webapp-design-modern #profile .card.panel,
body.webapp-design-modern #subscription-management .subscription-manage-card,
body.webapp-design-modern #telegram-proxies .telegram-proxy-panel,
body.webapp-design-modern #payment-history .card.panel,
body.webapp-design-modern #faq .card.panel,
body.webapp-design-modern #contact .card.panel {
    border-radius: 22px;
}

body.webapp-design-modern .profile-menu-card {
    padding: 0;
    overflow: hidden;
}

body.webapp-design-modern #profile .panel-header {
    padding: 18px 18px 14px;
}

body.webapp-design-modern #profile .card-footer {
    padding: 0 18px 18px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.webapp-design-modern .profile-menu-card-head {
    padding: 16px 16px 0;
}

body.webapp-design-modern .profile-menu-card .menu-list {
    padding: 10px 10px 12px;
    gap: 6px;
}

body.webapp-design-modern .profile-menu-card .menu-row {
    min-height: 56px;
    padding-left: 14px;
    padding-right: 14px;
}

body.webapp-design-modern .subscription-info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 0;
}

body.webapp-design-modern .subscription-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 107, 255, 0.14);
    border: 1px solid rgba(47, 107, 255, 0.2);
    flex-shrink: 0;
}

body.webapp-design-modern .modern-page-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
}

body.webapp-design-modern .modern-page-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(47, 107, 255, 0.28), rgba(47, 107, 255, 0.12));
    border: 1px solid rgba(91, 141, 255, 0.24);
}

body.webapp-design-modern .modern-page-hero--purple .modern-page-hero-icon {
    background: linear-gradient(180deg, rgba(136, 88, 255, 0.3), rgba(136, 88, 255, 0.12));
    border-color: rgba(168, 123, 255, 0.22);
}

body.webapp-design-modern .modern-page-hero-copy h3 {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 700;
    color: #f5f8ff;
}

body.webapp-design-modern .modern-page-hero-copy .muted {
    margin-top: 6px;
    line-height: 1.5;
}

body.webapp-design-modern .referral-how-it-works {
    padding: 16px;
}

body.webapp-design-modern #referrals .stat-box {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern #referrals .referral-link-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body.webapp-design-modern .referral-how-list {
    display: grid;
    gap: 10px;
}

body.webapp-design-modern .referral-how-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.webapp-design-modern .referral-how-step {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #f5f8ff;
    background: linear-gradient(180deg, rgba(47, 107, 255, 0.88), rgba(37, 87, 214, 0.88));
    box-shadow: 0 8px 14px rgba(39, 112, 228, 0.28);
    flex-shrink: 0;
}

body.webapp-design-modern .support-quick-links {
    justify-content: stretch;
}

body.webapp-design-modern .support-quick-links .block-btn {
    flex: 1 1 0;
}

body.webapp-design-modern #contact .support-contact-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #f5f8ff;
}

body.webapp-design-modern #profile > .card.panel:first-of-type,
body.webapp-design-modern #subscription-management .subscription-manage-card:first-child,
body.webapp-design-modern .modern-page-hero,
body.webapp-design-modern .account-access-hero,
body.webapp-design-modern .account-link-success-card {
    position: relative;
    overflow: hidden;
}

body.webapp-design-modern #profile > .card.panel:first-of-type::before,
body.webapp-design-modern #subscription-management .subscription-manage-card:first-child::before,
body.webapp-design-modern .modern-page-hero::before,
body.webapp-design-modern .account-access-hero::before,
body.webapp-design-modern .account-link-success-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 90px;
    background: radial-gradient(circle at top left, rgba(68, 116, 255, 0.18), transparent 68%);
    pointer-events: none;
}

body.webapp-design-modern #profile .panel-header {
    align-items: center;
    gap: 14px;
}

body.webapp-design-modern #profile .card-footer {
    padding: 0 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.webapp-design-modern #profile .profile-menu-card-head {
    padding: 14px 16px 6px;
}

body.webapp-design-modern #subscription-management .subscription-manage-content {
    gap: 14px;
}

body.webapp-design-modern #subscription-management .subscription-manage-header {
    align-items: center;
}

body.webapp-design-modern #subscription-management .subscription-manage-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

body.webapp-design-modern #subscription-management .subscription-manage-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(20, 27, 42, 0.82);
    border-color: rgba(112, 137, 187, 0.18);
}

body.webapp-design-modern #subscription-management .subscription-manage-item strong {
    text-align: right;
    color: #edf4ff;
}

body.webapp-design-modern #subscription-management .subscription-device-item {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(112, 137, 187, 0.18);
    background: rgba(20, 27, 42, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.webapp-design-modern #subscription-management .subscription-device-name {
    font-size: 0.96rem;
    color: #edf4ff;
}

body.webapp-design-modern #subscription-management .subscription-device-meta {
    grid-template-columns: 1fr;
    gap: 6px;
}

body.webapp-design-modern #subscription-management .subscription-device-action .block-btn {
    min-height: 40px;
    border-radius: 14px;
}

body.webapp-design-modern #contact .support-contact-panel {
    padding: 0;
    overflow: hidden;
}

body.webapp-design-modern #contact .support-contact-card {
    padding: 18px;
}

.account-access-hero,
.account-access-methods-card,
.account-access-warning-card,
.account-link-status-card,
.account-link-checklist-card,
.account-link-success-card,
.account-email-form-card,
.login-methods-list-card {
    border-radius: 22px;
}

.account-access-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(27, 53, 112, 0.34), rgba(20, 28, 42, 0.92));
    border: 1px solid rgba(94, 137, 235, 0.22);
}

.account-access-hero h3,
.account-link-checklist-head h3,
.account-access-warning-head h3,
.login-method-card-copy strong,
.account-access-method-copy strong {
    color: #f4f8ff;
}

.account-access-hero-icon,
.account-access-method-icon,
.account-link-success-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
}

.account-access-hero-icon,
.account-access-method-icon {
    color: #f4f8ff;
    background: rgba(53, 104, 255, 0.18);
    border: 1px solid rgba(100, 142, 252, 0.24);
}

.account-access-hero-icon img,
.account-access-method-icon img,
.account-link-success-icon img {
    width: 20px;
    height: 20px;
}

.account-access-method-icon--google {
    background: rgba(255, 191, 0, 0.16);
    border-color: rgba(255, 191, 0, 0.22);
    color: #ffd76c;
}

.account-access-method-icon--email {
    background: rgba(6, 227, 255, 0.12);
    border-color: rgba(6, 227, 255, 0.18);
    color: #7eefff;
}

.account-access-list-head,
.account-link-status-row,
.account-link-checklist-head,
.account-access-warning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-access-method-list,
.login-methods-list,
.account-link-actions,
.account-email-form-grid {
    display: grid;
    gap: 12px;
}

.account-access-method-row,
.login-method-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 110, 144, 0.18);
    background: rgba(20, 27, 42, 0.82);
}

.account-access-method-row {
    cursor: pointer;
}

.account-access-method-row.is-static {
    cursor: default;
}

.account-access-method-copy,
.login-method-card-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.account-access-method-copy span,
.login-method-card-copy span {
    overflow-wrap: anywhere;
}

.account-access-method-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(205, 218, 244, 0.78);
    background: rgba(255, 255, 255, 0.05);
}

.account-access-method-status.success {
    color: #87f5b2;
    background: rgba(26, 201, 116, 0.12);
}

.account-link-checklist {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
    color: rgba(222, 230, 248, 0.88);
}

.account-link-success-card {
    text-align: center;
    gap: 10px;
}

.account-link-success-icon {
    margin: 0 auto 4px;
    color: #7af0ac;
    background: rgba(26, 201, 116, 0.12);
    border: 1px solid rgba(26, 201, 116, 0.24);
}

.account-field {
    display: grid;
    gap: 8px;
}

.account-field span {
    font-size: 0.88rem;
    color: rgba(204, 216, 238, 0.8);
}

.account-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(96, 114, 150, 0.24);
    background: rgba(11, 17, 28, 0.74);
    color: #f6f9ff;
    font: inherit;
}

.account-field input:focus {
    outline: none;
    border-color: rgba(88, 145, 255, 0.74);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.16);
}

#link-email-code {
    letter-spacing: 0.28em;
    text-align: center;
    font-size: 1.04rem;
    font-weight: 700;
}

.account-password-wrap {
    position: relative;
}

.account-password-wrap input {
    padding-right: 52px;
}

.account-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.account-email-password-rules {
    margin-top: 6px;
}

.account-link-error-card {
    padding: 12px 14px;
    border-radius: 16px;
    color: #ffcad4;
    background: rgba(157, 33, 63, 0.2);
    border: 1px solid rgba(217, 78, 107, 0.24);
}

.account-link-checklist li.is-valid {
    color: #86f3b1;
}

.login-method-card {
    flex-direction: column;
    align-items: stretch;
}

.login-method-card-main,
.login-method-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-method-card-actions {
    justify-content: flex-end;
}

.login-method-locked-note {
    margin-left: auto;
}

.login-method-delete-modal {
    max-width: 420px;
}

body.webapp-design-modern .account-access-hero,
body.webapp-design-modern .account-access-methods-card,
body.webapp-design-modern .account-access-warning-card,
body.webapp-design-modern .account-link-status-card,
body.webapp-design-modern .account-link-checklist-card,
body.webapp-design-modern .account-link-success-card,
body.webapp-design-modern .account-email-form-card,
body.webapp-design-modern .login-methods-list-card {
    background: linear-gradient(160deg, rgba(14, 20, 32, 0.94), rgba(16, 24, 38, 0.86));
    border: 1px solid rgba(107, 134, 184, 0.2);
    box-shadow:
        0 20px 44px rgba(2, 7, 18, 0.36),
        inset 0 1px 0 rgba(190, 213, 255, 0.04);
}

body.webapp-design-modern .account-access-method-row:hover {
    background: rgba(26, 35, 52, 0.96);
    border-color: rgba(118, 148, 206, 0.28);
}

body.webapp-design-modern #profile .profile-overview-card {
    gap: 0;
    padding: 18px;
}

body.webapp-design-modern #profile .panel-header {
    margin-bottom: 18px;
    padding: 0;
}

body.webapp-design-modern #profile .panel-header .muted {
    min-width: 0;
    font-size: 0.96rem;
    color: #e8eefb;
}

body.webapp-design-modern #profile .card-footer {
    margin-top: 0;
    padding: 18px 0 0;
}

body.webapp-design-modern #profile .profile-menu-card-head {
    padding: 16px 16px 8px;
}

body.webapp-design-modern #profile .profile-menu-card .menu-list {
    padding: 0 10px 10px;
    gap: 8px;
}

body.webapp-design-modern #profile .profile-menu-card .menu-row {
    gap: 12px;
    min-height: 60px;
    padding: 14px 16px;
}

body.webapp-design-modern #profile .menu-row > span:nth-child(2) {
    min-width: 0;
    flex: 1 1 auto;
}

body.webapp-design-modern #profile .menu-row .row-value {
    margin-left: auto;
    flex-shrink: 0;
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

body.webapp-design-modern #profile .menu-row .chevron {
    margin-left: 0;
    flex-shrink: 0;
}

body.webapp-design-modern #referrals > .referrals-shell {
    padding: 0;
    gap: 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    overflow: visible;
}

body.webapp-design-modern #referrals-content {
    display: grid !important;
    gap: 18px;
}

body.webapp-design-modern #referrals > .referrals-shell > .skeleton {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(102, 123, 168, 0.24);
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.96), rgba(14, 20, 31, 0.94));
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern #referrals-content > .referrals-intro {
    margin: 0;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(88, 137, 255, 0.2);
    background: linear-gradient(145deg, rgba(29, 57, 124, 0.42), rgba(18, 25, 39, 0.94));
    color: #dce8ff;
    line-height: 1.55;
}

body.webapp-design-modern #referrals .referral-link-card,
body.webapp-design-modern #referrals .referrals-history-card,
body.webapp-design-modern #referrals .referral-how-it-works {
    margin: 0;
    padding: 18px;
}

body.webapp-design-modern #referrals .referral-link-card .card-header,
body.webapp-design-modern #referrals .referrals-history-card .card-header,
body.webapp-design-modern #referrals .referral-how-it-works .card-header {
    padding-bottom: 0;
}

body.webapp-design-modern #referrals .copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 16px;
    border: 1px solid rgba(94, 109, 145, 0.18);
    background: rgba(20, 27, 42, 0.82);
}

body.webapp-design-modern #referrals .copy-row .mono {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    color: #eef4ff;
}

body.webapp-design-modern #referrals .referral-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.webapp-design-modern #referrals .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

body.webapp-design-modern #referrals .stat-box {
    min-height: 112px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

body.webapp-design-modern #referrals .stat-box .eyebrow {
    margin-bottom: 10px;
}

body.webapp-design-modern #referrals .ref-list li {
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    font-size: 0.94rem;
}

body.webapp-design-modern #subscription-management .subscription-manage-content {
    display: grid !important;
    gap: 18px;
}

body.webapp-design-modern #subscription-management .subscription-manage-card {
    padding: 18px;
    gap: 16px;
}

body.webapp-design-modern #subscription-management .subscription-manage-card--summary {
    padding: 20px;
}

body.webapp-design-modern #subscription-management .subscription-manage-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.webapp-design-modern #subscription-management .subscription-device-list,
body.webapp-design-modern #subscription-management .subscription-payment-list {
    display: grid;
    gap: 12px;
}

body.webapp-design-modern #subscription-management .subscription-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.webapp-design-modern #subscription-management .subscription-upgrade-btn {
    min-height: 60px;
}

body.webapp-design-modern .account-access-hero,
body.webapp-design-modern .account-access-methods-card,
body.webapp-design-modern .account-access-warning-card,
body.webapp-design-modern .account-link-status-card,
body.webapp-design-modern .account-link-checklist-card,
body.webapp-design-modern .account-link-success-card,
body.webapp-design-modern .account-email-form-card,
body.webapp-design-modern .login-methods-list-card {
    padding: 18px;
}

body.webapp-design-modern .account-access-method-row {
    min-height: 68px;
}

body.webapp-design-modern .account-access-method-copy {
    min-width: 0;
}

body.webapp-design-modern .account-access-method-copy strong {
    font-size: 0.98rem;
}

body.webapp-design-modern .account-access-method-status {
    flex-shrink: 0;
}

@media (max-width: 420px) {
    body.webapp-design-modern .section {
        padding-left: 14px;
        padding-right: 14px;
    }

    body.webapp-design-modern .section-heading {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.webapp-design-modern .modern-app-nav {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    body.webapp-design-modern #profile .menu-row .row-value {
        max-width: 100px;
        font-size: 0.82rem;
    }

    body.webapp-design-modern #referrals .referral-buttons,
    body.webapp-design-modern #subscription-management .subscription-manage-actions,
    body.webapp-design-modern #subscription-management .subscription-upgrade-grid {
        grid-template-columns: 1fr;
    }

    body.webapp-design-modern .account-access-method-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    body.webapp-design-modern .account-access-method-status {
        margin-left: 54px;
    }
}

/* ========================= MODERN SUBSCRIPTION REFRESH ========================= */
body.webapp-design-modern #subscription .card.panel {
    position: relative;
    overflow: visible;
    padding-bottom: 112px;
    border-radius: 22px;
    border: 1px solid rgba(112, 159, 255, 0.24);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(52, 125, 255, 0.16) 0%, rgba(52, 125, 255, 0) 56%),
        linear-gradient(170deg, rgba(10, 17, 29, 0.96), rgba(12, 20, 32, 0.88));
    box-shadow:
        0 28px 54px rgba(2, 7, 18, 0.46),
        inset 0 1px 0 rgba(180, 212, 255, 0.2);
}

body.webapp-design-modern #subscription .card.panel::before {
    content: '';
    position: absolute;
    inset: -60% auto auto -45%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 133, 255, 0.2), rgba(58, 133, 255, 0));
    pointer-events: none;
}

body.webapp-design-modern #subscription .card.panel > * {
    position: relative;
    z-index: 1;
}

body.webapp-design-modern #subscription .card.panel > .muted {
    color: rgba(211, 225, 255, 0.75);
    font-size: 0.86rem;
    line-height: 1.5;
}

body.webapp-design-modern #subscription .subscription-tariff-card,
body.webapp-design-modern #subscription .device-slider-card {
    border: 1px solid rgba(125, 170, 255, 0.26);
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(14, 22, 34, 0.92), rgba(19, 30, 46, 0.8));
    box-shadow: inset 0 1px 0 rgba(210, 228, 255, 0.08);
}

body.webapp-design-modern #subscription .subscription-tariff-title {
    align-items: center;
}

body.webapp-design-modern #subscription .subscription-tariff-title .eyebrow {
    color: rgba(196, 212, 245, 0.74);
    font-weight: 600;
}

body.webapp-design-modern #subscription #subscription-tariff-caption {
    font-size: 0.76rem;
    color: rgba(177, 204, 252, 0.9) !important;
}

body.webapp-design-modern #subscription .subscription-tariff-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body.webapp-design-modern #subscription .subscription-tariff-switch .tariff-btn {
    appearance: none;
    border: 1px solid rgba(140, 174, 238, 0.28);
    border-radius: 13px;
    padding: 11px 10px;
    background: linear-gradient(180deg, rgba(13, 20, 32, 0.85), rgba(14, 21, 32, 0.45));
    color: rgba(199, 221, 255, 0.86);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    font-family: inherit;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
}

body.webapp-design-modern #subscription .subscription-tariff-switch .tariff-btn.active {
    color: #f2f7ff;
    border-color: rgba(112, 170, 255, 0.95);
    background: linear-gradient(180deg, rgba(38, 106, 224, 0.76), rgba(27, 90, 207, 0.86));
    box-shadow: 0 10px 24px rgba(26, 93, 214, 0.38);
    transform: translateY(-1px);
}

body.webapp-design-modern #subscription .subscription-tariff-switch .tariff-btn:active {
    transform: translateY(0);
}

body.webapp-design-modern #subscription .subscription-tariff-meta {
    border-top: 1px solid rgba(133, 175, 244, 0.24);
    margin-top: 10px;
    padding-top: 10px;
}

body.webapp-design-modern #subscription .subscription-tariff-meta-title {
    color: rgba(176, 203, 245, 0.72);
}

body.webapp-design-modern #subscription .subscription-tariff-meta-item {
    border-color: rgba(132, 177, 250, 0.34);
    background: rgba(26, 45, 72, 0.55);
    color: rgba(230, 240, 255, 0.92);
}

body.webapp-design-modern #subscription .device-slider-card {
    gap: 12px;
}

body.webapp-design-modern #subscription .device-slider-head {
    align-items: center;
}

body.webapp-design-modern #subscription .device-slider-title .device-slider-value {
    font-size: 1.18rem;
    line-height: 1.2;
    color: #edf4ff;
}

body.webapp-design-modern #subscription .device-slider-track {
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(136, 176, 246, 0.34);
    background: linear-gradient(180deg, rgba(11, 17, 28, 0.86), rgba(10, 17, 27, 0.72));
    box-shadow: inset 0 2px 10px rgba(3, 9, 18, 0.7);
    overflow: hidden;
}

body.webapp-design-modern #subscription .device-slider-track.disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

body.webapp-design-modern #subscription .device-slider-fill {
    background: linear-gradient(90deg, #2f83ff 0%, #4da0ff 55%, #82beff 100%);
    box-shadow: 0 0 24px rgba(69, 142, 255, 0.52);
    transition: width 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.webapp-design-modern #subscription .device-slider-thumb {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(236, 245, 255, 0.96);
    background: linear-gradient(180deg, #ffffff, #dcecff);
    box-shadow:
        0 10px 22px rgba(9, 18, 34, 0.62),
        0 0 0 8px rgba(47, 131, 255, 0.16);
    transition: left 0.18s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.18s ease;
}

body.webapp-design-modern #subscription .device-slider-track.dragging .device-slider-thumb {
    box-shadow:
        0 14px 26px rgba(9, 18, 34, 0.66),
        0 0 0 10px rgba(47, 131, 255, 0.22);
}

body.webapp-design-modern #subscription .device-slider-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.webapp-design-modern #subscription .device-slider-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(166, 198, 255, 0.48);
    background: rgba(15, 29, 52, 0.72);
    box-shadow: 0 0 0 2px rgba(8, 14, 25, 0.78);
}

body.webapp-design-modern #subscription .device-slider-marker.active {
    background: #dff0ff;
    border-color: #dff0ff;
}

body.webapp-design-modern #subscription .device-slider-ticks {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

body.webapp-design-modern #subscription .device-slider-tick {
    appearance: none;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0;
    cursor: pointer;
    color: rgba(173, 194, 231, 0.8);
    font: inherit;
}

body.webapp-design-modern #subscription .device-slider-tick-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(144, 179, 238, 0.34);
    transition: transform 0.18s ease, background-color 0.18s ease;
}

body.webapp-design-modern #subscription .device-slider-tick-label {
    font-size: 0.72rem;
    font-weight: 600;
}

body.webapp-design-modern #subscription .device-slider-tick.active {
    color: #f2f8ff;
}

body.webapp-design-modern #subscription .device-slider-tick.active .device-slider-tick-dot {
    transform: scale(1.28);
    background: #78b4ff;
}

body.webapp-design-modern #subscription #subscription-plans {
    gap: 12px;
}

body.webapp-design-modern #subscription .plan-card {
    border: 1px solid rgba(125, 162, 230, 0.3);
    border-radius: 18px;
    padding: 14px 14px 12px;
    min-height: 136px;
    background: linear-gradient(170deg, rgba(17, 26, 41, 0.95), rgba(16, 24, 38, 0.74));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

body.webapp-design-modern #subscription .plan-card:hover {
    transform: translateY(-2px);
    border-color: rgba(156, 190, 255, 0.52);
}

body.webapp-design-modern #subscription .plan-card.selected {
    transform: translateY(-3px);
    border-color: rgba(115, 169, 255, 0.92);
    background: linear-gradient(160deg, rgba(27, 85, 181, 0.36), rgba(15, 31, 53, 0.82));
    box-shadow:
        0 18px 30px rgba(7, 15, 28, 0.45),
        inset 0 1px 0 rgba(214, 233, 255, 0.22);
}

body.webapp-design-modern #subscription .plan-card.popular {
    overflow: visible;
}

body.webapp-design-modern #subscription .plan-card .plan-name {
    color: #ecf4ff;
    font-size: 0.98rem;
}

body.webapp-design-modern #subscription .plan-card .plan-caption {
    color: rgba(178, 201, 240, 0.88);
    font-size: 0.74rem;
}

body.webapp-design-modern #subscription .plan-card .plan-price {
    margin-top: 8px;
    font-size: 1.56rem;
    line-height: 1.05;
    color: #f5f9ff;
}

body.webapp-design-modern #subscription .plan-card .plan-price .currency {
    color: rgba(182, 208, 249, 0.86);
    font-size: 0.92rem;
}

body.webapp-design-modern #subscription .plan-card .price-alt {
    margin-top: 6px;
    color: rgba(171, 197, 239, 0.82);
    font-size: 0.78rem;
}

body.webapp-design-modern #subscription .plan-card.price-updated .plan-price {
    animation: subscription-price-pulse 0.34s ease;
}

@keyframes subscription-price-pulse {
    0% {
        transform: scale(1);
        color: #f5f9ff;
    }
    45% {
        transform: scale(1.05);
        color: #ffffff;
    }
    100% {
        transform: scale(1);
        color: #f5f9ff;
    }
}

body.webapp-design-modern #subscription .payment-method-trigger,
body.webapp-design-modern #subscription #pay-button,
body.webapp-design-modern #subscription .trial-section .block-btn {
    border-radius: 16px;
    min-height: 52px;
    font-weight: 700;
}

body.webapp-design-modern #subscription #pay-button {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 42;
    box-shadow: 0 16px 28px rgba(39, 112, 228, 0.34);
}

body.webapp-design-modern #subscription #pay-button:disabled {
    box-shadow: none;
    opacity: 0.6;
}

@media (max-width: 420px) {
    body.webapp-design-modern #subscription .card.panel {
        padding: 14px;
        gap: 14px;
    }

    body.webapp-design-modern #subscription .plan-card {
        min-height: 122px;
        padding: 12px;
    }

    body.webapp-design-modern #subscription .plan-card .plan-price {
        font-size: 1.42rem;
    }

    body.webapp-design-modern #subscription #pay-button {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
}

/* ========================= BROWSER SIGN-IN ========================= */
.browser-signin-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(90% 120% at 10% 0%, rgba(47, 107, 255, 0.2), transparent 50%),
        radial-gradient(70% 90% at 100% 100%, rgba(6, 227, 255, 0.14), transparent 55%),
        #08101f;
}

.browser-signin-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.browser-signin-card {
    width: min(100%, 480px);
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(104, 131, 184, 0.2);
    background: linear-gradient(160deg, rgba(12, 18, 30, 0.94), rgba(15, 24, 38, 0.88));
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.browser-signin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.browser-signin-brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(6, 227, 255, 0.08);
    border: 1px solid rgba(6, 227, 255, 0.18);
}

.browser-signin-kicker {
    margin: 0 0 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7890bc;
}

.browser-signin-brand h1 {
    margin: 0 0 6px;
    font-size: 1.28rem;
    color: #f7faff;
}

.browser-signin-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(20, 27, 42, 0.82);
    border: 1px solid rgba(96, 114, 150, 0.18);
}

.browser-signin-tab {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: rgba(210, 224, 250, 0.84);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.browser-signin-tab.active {
    color: #fff;
    background: linear-gradient(180deg, #2f6bff 0%, #2557d6 100%);
    box-shadow: 0 14px 24px rgba(30, 73, 188, 0.28);
}

.browser-signin-panel {
    display: none;
    gap: 14px;
}

.browser-signin-panel.active {
    display: grid;
}

.browser-signin-info-card,
.browser-signin-note,
.browser-signin-profile {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(96, 114, 150, 0.18);
    background: rgba(20, 27, 42, 0.82);
}

.browser-signin-info-card h3,
.browser-signin-profile-head h3 {
    margin: 0 0 6px;
    color: #f5f8ff;
}

.browser-signin-form-grid,
.browser-signin-form-actions,
.browser-signin-profile-grid {
    display: grid;
    gap: 12px;
}

.browser-signin-divider {
    position: relative;
    text-align: center;
    color: rgba(174, 191, 221, 0.64);
}

.browser-signin-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(96, 114, 150, 0.18);
}

.browser-signin-divider span {
    position: relative;
    padding: 0 12px;
    background: #101827;
}

.browser-signin-status {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
}

.browser-signin-status.hidden {
    display: none;
}

.browser-signin-status.info {
    background: rgba(47, 107, 255, 0.14);
    border: 1px solid rgba(47, 107, 255, 0.24);
    color: #cfe0ff;
}

.browser-signin-status.success {
    background: rgba(26, 201, 116, 0.14);
    border: 1px solid rgba(26, 201, 116, 0.24);
    color: #8df1b5;
}

.browser-signin-status.error {
    background: rgba(197, 66, 96, 0.18);
    border: 1px solid rgba(197, 66, 96, 0.24);
    color: #ffcad4;
}

.browser-signin-profile.hidden {
    display: none;
}

.browser-signin-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.browser-signin-profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.browser-signin-profile-item {
    display: grid;
    gap: 4px;
}

@media (max-width: 540px) {
    .browser-signin-card {
        padding: 18px;
        border-radius: 24px;
    }

    .browser-signin-brand {
        align-items: flex-start;
    }

    .browser-signin-profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Shared compatibility for updated markup */
.subscription-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.subscription-period-card,
.subscription-checkout-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.webapp-design-legacy #subscription .tariff-btn-icon,
body.webapp-design-legacy #subscription .tariff-btn-icon img,
body.webapp-design-legacy #subscription .tariff-btn-check {
    display: none !important;
}

body.webapp-design-legacy #subscription .tariff-btn-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

body.webapp-design-legacy #subscription .subscription-tariff-switch .tariff-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    min-height: 96px;
    text-align: left;
}

body.webapp-design-legacy #subscription .tariff-btn-copy strong {
    display: block;
    font: inherit;
}

body.webapp-design-legacy #subscription .tariff-btn-copy small {
    display: block;
    color: var(--text-secondary-color);
    font-size: 0.74rem;
    line-height: 1.35;
}

body.webapp-design-legacy .service-review-sheet-handle,
body.webapp-design-legacy .service-review-icon,
body.webapp-design-legacy .service-review-comment-head {
    display: none;
}

body.webapp-design-legacy .service-review-header-copy {
    display: block;
}

body.webapp-design-legacy .service-review-stars-card,
body.webapp-design-legacy .service-review-comment-card,
body.webapp-design-legacy .service-review-note-card {
    padding: 0;
    border: none;
    background: transparent;
}

#device-slider-ticks {
    display: none !important;
}

/* Modern WebApp refinements */
body.webapp-design-modern .section {
    padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 112px);
    gap: 0;
}

body.webapp-design-modern #home.section,
body.webapp-design-modern.modern-nav-visible #home.section {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 136px);
}

body.webapp-design-modern .section > * + * {
    margin-top: 18px;
}

body.webapp-design-modern .section > .section-heading + * {
    margin-top: 0;
}

body.webapp-design-modern .section-heading {
    top: 0;
    margin: 0 -20px;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 14px;
    min-height: 74px;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(7, 12, 22, 0.96) 0%, rgba(7, 12, 22, 0.84) 76%, rgba(7, 12, 22, 0) 100%);
    border-bottom: none;
    backdrop-filter: blur(22px);
}

body.webapp-design-modern .section-heading::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(86, 105, 145, 0), rgba(86, 105, 145, 0.44), rgba(86, 105, 145, 0));
}

body.webapp-design-modern .section-heading h2 {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.2;
}

body.webapp-design-modern .section-heading .section-icon {
    width: 20px;
    height: 20px;
}

body.webapp-design-modern .section-back-btn {
    flex: 0 0 auto;
}

body.webapp-design-modern #subscription .subscription-purchase-shell {
    padding: 0;
    gap: 12px;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

body.webapp-design-modern #subscription .subscription-info-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
}

body.webapp-design-modern #subscription .subscription-info-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.24);
}

body.webapp-design-modern #subscription .subscription-info-copy {
    display: grid;
    gap: 5px;
}

body.webapp-design-modern #subscription .subscription-info-copy strong {
    color: #f4f8ff;
    font-size: 1rem;
    line-height: 1.3;
}

body.webapp-design-modern #subscription .subscription-tariff-card,
body.webapp-design-modern #subscription .device-slider-card,
body.webapp-design-modern #subscription .subscription-period-card,
body.webapp-design-modern #subscription .subscription-payment-card {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 34px rgba(2, 7, 18, 0.26);
}

body.webapp-design-modern #subscription .subscription-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

body.webapp-design-modern #subscription .subscription-block-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

body.webapp-design-modern #subscription .subscription-block-copy h3 {
    display: none;
}

body.webapp-design-modern #subscription .subscription-block-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

body.webapp-design-modern #subscription .subscription-block-title-row .eyebrow {
    margin: 0;
}

body.webapp-design-modern #subscription .subscription-help-btn {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(117, 142, 190, 0.2);
    background: rgba(17, 24, 39, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.webapp-design-modern #subscription .subscription-help-btn img {
    width: 18px;
    height: 18px;
}

body.webapp-design-modern #subscription #subscription-tariff-caption {
    display: none;
}

body.webapp-design-modern #subscription .subscription-tariff-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body.webapp-design-modern #subscription .subscription-tariff-switch .tariff-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 12px 14px;
    border-radius: 16px;
    min-height: 112px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
    overflow: hidden;
}

body.webapp-design-modern #subscription .subscription-tariff-switch .tariff-btn::before {
    display: none;
}

body.webapp-design-modern #subscription .tariff-btn-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: transparent;
    font-size: 0;
    border: none;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.32);
}

body.webapp-design-modern #subscription .tariff-btn-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #ffffff;
}

body.webapp-design-modern #subscription .tariff-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    overflow: hidden;
}

body.webapp-design-modern #subscription .tariff-btn-icon img {
    width: 22px;
    height: 22px;
}

body.webapp-design-modern #subscription .tariff-btn-icon.blue {
    background: rgba(47, 107, 255, 0.18);
    color: #7db0ff;
}

body.webapp-design-modern #subscription .tariff-btn-icon.amber {
    background: rgba(255, 189, 89, 0.16);
    color: #ffd67f;
}

body.webapp-design-modern #subscription .tariff-btn-icon.purple {
    background: rgba(139, 92, 246, 0.18);
    color: #c5a7ff;
}

body.webapp-design-modern #subscription .tariff-btn-copy {
    min-width: 0;
    display: grid;
    gap: 0;
    justify-items: center;
}

body.webapp-design-modern #subscription .tariff-btn-copy strong {
    font-size: 0.82rem;
    color: #f4f8ff;
    line-height: 1.25;
    font-weight: 600;
}

body.webapp-design-modern #subscription .tariff-btn-copy small {
    display: none;
}

body.webapp-design-modern #subscription .tariff-btn-check {
    display: none !important;
}

body.webapp-design-modern #subscription .tariff-btn.active {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.18);
    transform: none;
}

body.webapp-design-modern #subscription .subscription-tariff-meta {
    display: none;
}

body.webapp-design-modern #subscription .subscription-tariff-meta-title {
    color: rgba(193, 209, 240, 0.74);
    margin-bottom: 10px;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}

body.webapp-design-modern #subscription .subscription-tariff-meta-list {
    gap: 8px;
}

body.webapp-design-modern #subscription .subscription-tariff-meta-item {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 14px;
    border-color: rgba(132, 177, 250, 0.2);
    background: rgba(20, 29, 45, 0.86);
    color: rgba(230, 240, 255, 0.92);
}

body.webapp-design-modern #subscription .device-slider-card {
    gap: 12px;
}

body.webapp-design-modern #subscription .device-slider-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.webapp-design-modern #subscription .device-slider-title .device-slider-value,
body.webapp-design-modern #subscription .device-slider-value {
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.2;
    color: #60a5fa;
}

body.webapp-design-modern #subscription .device-slider-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

body.webapp-design-modern #subscription .device-slider-fill {
    background: linear-gradient(90deg, #2f81f7, #56a5ff);
}

body.webapp-design-modern #subscription .device-slider-thumb {
    width: 22px;
    height: 22px;
    border-width: 2px;
    box-shadow:
        0 0 10px rgba(59, 130, 246, 0.35),
        0 6px 14px rgba(9, 18, 34, 0.3);
}

body.webapp-design-modern #subscription .device-slider-ticks {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-top: 4px;
}

body.webapp-design-modern #subscription .subscription-period-card #subscription-plans {
    gap: 12px;
}

body.webapp-design-modern #subscription .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.webapp-design-modern #subscription .plan-card {
    min-height: 148px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    gap: 8px;
}

body.webapp-design-modern #subscription .plan-card.selected {
    transform: none;
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.18);
}

body.webapp-design-modern #subscription .plan-card.popular {
    padding-top: 14px;
}

body.webapp-design-modern #subscription .plan-card .plan-header {
    display: grid;
    gap: 4px;
    margin-bottom: auto;
}

body.webapp-design-modern #subscription .plan-card .plan-name {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.25;
}

body.webapp-design-modern #subscription .plan-card .plan-caption {
    display: none;
}

body.webapp-design-modern #subscription .plan-card .plan-price {
    margin-top: 2px;
    font-size: 1.4rem;
    line-height: 1;
    color: #f4f8ff;
}

body.webapp-design-modern #subscription .plan-card .price-alt {
    margin-top: 2px;
    color: rgba(160, 178, 208, 0.78);
}

body.webapp-design-modern #subscription .plan-modern-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #ffffff;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    align-self: flex-start;
}

body.webapp-design-modern #subscription .trial-section {
    margin-top: 0;
    padding: 0;
    border: none;
}

body.webapp-design-modern #subscription .trial-section .block-btn {
    min-height: 54px;
    border-radius: 18px;
    background: rgba(18, 25, 39, 0.92);
    border: 1px solid rgba(120, 145, 192, 0.18);
}

body.webapp-design-modern #subscription .subscription-payment-card {
    display: block;
}

body.webapp-design-modern #subscription .subscription-payment-methods-inline {
    display: grid;
    gap: 12px;
}

body.webapp-design-modern #subscription .payment-method-option--inline {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
    text-align: left;
}

body.webapp-design-modern #subscription .payment-method-option-emoji {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 1.1rem;
    line-height: 1;
}

body.webapp-design-modern #subscription .payment-method-option-emoji.star {
    background: rgba(80, 132, 255, 0.16);
    border-color: rgba(129, 179, 255, 0.2);
}

body.webapp-design-modern #subscription .payment-method-option-emoji.card {
    background: rgba(255, 189, 89, 0.14);
    border-color: rgba(255, 210, 125, 0.18);
}

body.webapp-design-modern #subscription .payment-method-option-emoji.crypto {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.18);
}

body.webapp-design-modern #subscription .payment-method-option-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

body.webapp-design-modern #subscription .payment-method-option-copy strong {
    color: #f4f8ff;
    font-size: 0.92rem;
}

body.webapp-design-modern #subscription .payment-method-option-copy small {
    color: rgba(179, 196, 225, 0.82);
    font-size: 0.78rem;
}

body.webapp-design-modern #subscription .payment-method-option-check {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(145, 164, 197, 0.28);
    background: rgba(255, 255, 255, 0.04);
    flex: 0 0 auto;
    position: relative;
}

body.webapp-design-modern #subscription .payment-method-option--inline.selected {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.18);
}

body.webapp-design-modern #subscription .payment-method-option--inline.selected .payment-method-option-check {
    border-color: rgba(59, 130, 246, 0.96);
    background: rgba(59, 130, 246, 1);
}

body.webapp-design-modern #subscription .payment-method-option--inline.selected .payment-method-option-check::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 999px;
    background: #f4f8ff;
}

body.webapp-design-modern #subscription .subscription-checkout-footer {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 20;
    margin-top: 4px;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(7, 12, 22, 0) 0%, rgba(7, 12, 22, 0.84) 26%, rgba(7, 12, 22, 0.98) 100%);
}

body.webapp-design-modern #subscription #pay-button {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    border-radius: 16px;
    min-height: 54px;
    box-shadow: 0 16px 28px rgba(39, 112, 228, 0.34);
    font-size: 1rem;
}

body.webapp-design-modern .subscription-plan-info-modal {
    width: min(480px, 100%);
    border-radius: 24px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 20, 32, 0.98);
}

body.webapp-design-modern .subscription-plan-info-header-copy {
    display: grid;
    gap: 4px;
}

body.webapp-design-modern .subscription-plan-info-header-copy h3 {
    margin: 0;
    color: #f4f8ff;
    font-size: 1.08rem;
    line-height: 1.28;
}

body.webapp-design-modern .subscription-plan-info-body {
    display: grid;
    gap: 12px;
}

body.webapp-design-modern .subscription-plan-info-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(120, 145, 192, 0.14);
    background: rgba(18, 25, 39, 0.82);
}

body.webapp-design-modern .subscription-plan-info-item strong {
    display: block;
    margin-bottom: 6px;
    color: #f4f8ff;
    font-size: 0.98rem;
}

body.webapp-design-modern .subscription-plan-info-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.webapp-design-modern .subscription-plan-info-item-icon img {
    width: 20px;
    height: 20px;
}

body.webapp-design-modern .subscription-plan-info-item-icon.blue {
    background: rgba(47, 107, 255, 0.18);
}

body.webapp-design-modern .subscription-plan-info-item-icon.amber {
    background: rgba(255, 189, 89, 0.16);
}

body.webapp-design-modern .subscription-plan-info-item-icon.purple {
    background: rgba(139, 92, 246, 0.18);
}

body.webapp-design-modern .subscription-plan-info-actions {
    grid-template-columns: 1fr;
}

body.webapp-design-modern #subscription-management .subscription-manage-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid rgba(103, 138, 205, 0.2);
    background: linear-gradient(145deg, rgba(24, 40, 72, 0.62), rgba(14, 20, 31, 0.94));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body.webapp-design-modern #subscription-management .subscription-manage-hero-icon,
body.webapp-design-modern #admin-tools .admin-hero-icon,
body.webapp-design-modern .support-page-hero-badge,
body.webapp-design-modern .service-review-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(47, 107, 255, 0.16);
    border: 1px solid rgba(126, 166, 255, 0.24);
}

body.webapp-design-modern #subscription-management .subscription-manage-hero-icon img,
body.webapp-design-modern #admin-tools .admin-hero-icon img,
body.webapp-design-modern .support-page-hero-badge img,
body.webapp-design-modern #contact .support-contact-icon img,
body.webapp-design-modern .modern-page-hero-icon img,
body.webapp-design-modern #subscription .subscription-info-icon img {
    width: 24px;
    height: 24px;
}

body.webapp-design-modern #subscription-management .subscription-manage-hero-copy {
    display: grid;
    gap: 4px;
}

body.webapp-design-modern #subscription-management .subscription-manage-hero-copy h3,
body.webapp-design-modern #contact .support-page-hero-copy h3,
body.webapp-design-modern #admin-tools .admin-hero-copy h3 {
    margin: 0;
    color: #f4f8ff;
    font-size: 1.12rem;
    line-height: 1.3;
}

body.webapp-design-modern #subscription-management .subscription-manage-content {
    gap: 16px;
}

body.webapp-design-modern #subscription-management .subscription-manage-card {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(102, 123, 168, 0.18);
    background: linear-gradient(160deg, rgba(14, 20, 32, 0.96), rgba(16, 24, 38, 0.9));
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern #subscription-management .subscription-manage-card--summary {
    background: linear-gradient(160deg, rgba(20, 36, 66, 0.94), rgba(16, 24, 38, 0.92));
}

body.webapp-design-modern #subscription-management .subscription-manage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

body.webapp-design-modern #subscription-management .subscription-manage-item {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(122, 145, 188, 0.14);
    background: rgba(20, 27, 42, 0.76);
}

body.webapp-design-modern #subscription-management .subscription-manage-item strong {
    display: block;
    margin-top: 8px;
    color: #eff5ff;
    line-height: 1.35;
}

body.webapp-design-modern #subscription-management .subscription-manage-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.webapp-design-modern #subscription-management .subscription-upgrade-method select,
body.webapp-design-modern #subscription-management .subscription-upgrade-grid .subscription-upgrade-btn {
    border-radius: 16px;
}

body.webapp-design-modern #subscription-management .subscription-upgrade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.webapp-design-modern #subscription-management .subscription-upgrade-btn {
    min-height: 66px;
    padding: 14px 16px;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
}

body.webapp-design-modern #contact .support-page-hero,
body.webapp-design-modern #admin-tools .admin-hero-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid rgba(92, 128, 201, 0.2);
    background: linear-gradient(145deg, rgba(24, 40, 72, 0.6), rgba(14, 20, 31, 0.94));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

body.webapp-design-modern #contact .support-contact-panel,
body.webapp-design-modern #contact .support-faq-preview-card,
body.webapp-design-modern #contact .support-response-card,
body.webapp-design-modern #admin-tools .admin-panel {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(102, 123, 168, 0.18);
    background: linear-gradient(160deg, rgba(14, 20, 32, 0.96), rgba(16, 24, 38, 0.9));
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern #contact .support-contact-card--primary {
    padding: 0;
    border: none;
    background: transparent;
}

body.webapp-design-modern #contact .support-contact-topline,
body.webapp-design-modern #contact .support-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.webapp-design-modern #contact .support-contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 107, 255, 0.16);
    border: 1px solid rgba(126, 166, 255, 0.24);
}

body.webapp-design-modern #contact .support-faq-preview-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

body.webapp-design-modern #admin-tools .admin-panel {
    gap: 16px;
}

body.webapp-design-modern #admin-tools .admin-setting-row {
    border-radius: 18px;
    border-color: rgba(122, 145, 188, 0.14);
    background: rgba(20, 27, 42, 0.78);
}

body.webapp-design-modern #admin-tools .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.webapp-design-modern #contest-admin .contest-admin-shell {
    gap: 18px;
}

body.webapp-design-modern #contest-admin .contest-admin-card {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(102, 123, 168, 0.18);
    background: linear-gradient(160deg, rgba(14, 20, 32, 0.96), rgba(16, 24, 38, 0.9));
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.webapp-design-modern #contest-admin .contest-admin-selector select,
body.webapp-design-modern #contest-admin .contest-admin-form input,
body.webapp-design-modern #contest-admin .contest-admin-form textarea,
body.webapp-design-modern #contest-admin .contest-admin-form select,
body.webapp-design-modern #contest-admin .contest-admin-field input,
body.webapp-design-modern #contest-admin .contest-admin-field textarea,
body.webapp-design-modern #contest-admin .contest-admin-field select {
    border-radius: 16px;
    background: rgba(12, 19, 31, 0.94);
    border-color: rgba(117, 141, 186, 0.18);
}

body.webapp-design-modern #contest-admin .contest-admin-actions,
body.webapp-design-modern #contest-admin .contest-admin-buttons {
    gap: 10px;
}

body.webapp-design-modern #contest-admin .contest-admin-referral-item,
body.webapp-design-modern #contest-admin .contest-admin-faq-item {
    border-radius: 16px;
    border: 1px solid rgba(122, 145, 188, 0.14);
    background: rgba(20, 27, 42, 0.76);
}

body.webapp-design-modern .service-review-overlay {
    background:
        radial-gradient(circle at 50% 0%, rgba(47, 107, 255, 0.2), transparent 36%),
        rgba(5, 10, 24, 0.76);
    backdrop-filter: blur(10px);
}

body.webapp-design-modern .service-review-modal {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    transform: none;
    width: auto;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 30px;
    padding: 12px 18px 18px;
    gap: 14px;
    background: linear-gradient(180deg, rgba(15, 21, 33, 0.98), rgba(8, 13, 24, 0.98));
}

body.webapp-design-modern .service-review-sheet-handle {
    width: 44px;
    height: 5px;
    margin: 0 auto 2px;
    border-radius: 999px;
    background: rgba(181, 197, 225, 0.28);
}

body.webapp-design-modern .service-review-header {
    align-items: center;
}

body.webapp-design-modern .service-review-header-copy {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body.webapp-design-modern .service-review-icon {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(160, 166, 255, 0.24);
}

body.webapp-design-modern .service-review-icon img {
    width: 22px;
    height: 22px;
}

body.webapp-design-modern .service-review-eyebrow {
    color: rgba(172, 197, 255, 0.9);
}

body.webapp-design-modern .service-review-stars-card,
body.webapp-design-modern .service-review-comment-card,
body.webapp-design-modern .service-review-note-card {
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(122, 145, 188, 0.14);
    background: rgba(18, 25, 40, 0.84);
}

body.webapp-design-modern .service-review-stars {
    gap: 10px;
}

body.webapp-design-modern .service-review-stars button {
    min-height: 52px;
    border-radius: 16px;
    background: rgba(12, 19, 31, 0.92);
}

body.webapp-design-modern .service-review-comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #f4f8ff;
}

body.webapp-design-modern #service-review-comment {
    min-height: 118px;
    border-radius: 16px;
    background: rgba(9, 14, 24, 0.92);
}

body.webapp-design-modern .service-review-meta {
    color: rgba(182, 199, 230, 0.86);
}

body.webapp-design-modern .service-review-actions {
    gap: 10px;
}

@media (max-width: 720px) {
    body.webapp-design-modern #subscription-management .subscription-manage-grid,
    body.webapp-design-modern #subscription-management .subscription-upgrade-grid,
    body.webapp-design-modern #admin-tools .admin-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    body.webapp-design-modern .section {
        padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 104px);
    }

    body.webapp-design-modern #home.section,
    body.webapp-design-modern.modern-nav-visible #home.section {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 128px);
    }

    body.webapp-design-modern .section-heading {
        margin: 0 -16px;
        padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 12px;
    }

    body.webapp-design-modern #subscription .subscription-purchase-shell,
    body.webapp-design-modern #subscription-management .subscription-manage-card,
    body.webapp-design-modern #contact .support-contact-panel,
    body.webapp-design-modern #contact .support-faq-preview-card,
    body.webapp-design-modern #contact .support-response-card,
    body.webapp-design-modern #admin-tools .admin-panel,
    body.webapp-design-modern #contest-admin .contest-admin-card {
        padding: 16px;
        border-radius: 22px;
    }

    body.webapp-design-modern #subscription .tariff-btn {
        min-height: 144px;
        padding: 16px 12px 14px;
    }

    body.webapp-design-modern #subscription .plan-card {
        min-height: 156px;
        padding: 14px;
    }

    body.webapp-design-modern #subscription .payment-method-option--inline {
        padding: 14px;
    }

    body.webapp-design-modern .subscription-plan-info-modal {
        padding: 16px;
        border-radius: 24px;
    }

    body.webapp-design-modern .service-review-modal {
        left: 8px;
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        padding: 10px 14px 14px;
    }
}


