:root {
    /* Colors */
    --color-bg-start: #0099ff;
    --color-bg-end: #0055ff;
    --color-white: #ffffff;
    --color-text-primary: #1a1f2e;
    --color-text-secondary: #5a6175;
    --color-text-light: #8b92a7;
    --color-primary: #007aff;
    --color-accent: #00c6ff;
    --color-success: #34c759;
    --skeleton-base: #e4e9f1;
    --skeleton-highlight: #f3f6fb;

    /* Gradients */
    --gradient-bg: linear-gradient(180deg, #2ebf91 0%, #8360c3 100%);
    /* Placeholder, will override in body */
    --gradient-app: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    --gradient-pill: linear-gradient(90deg, #00C6FF 0%, #0072FF 100%);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;

    /* Fonts */
    --font-main: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    --bottom-bar-offset: calc(104px + env(safe-area-inset-bottom, 0px));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 82% 18%, rgba(161, 224, 255, 0.18) 0%, rgba(161, 224, 255, 0) 30%),
        linear-gradient(145deg, #08c3ff 0%, #1094ff 40%, #3651ff 100%);
    color: var(--color-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

.app-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 82% 18%, rgba(161, 224, 255, 0.18) 0%, rgba(161, 224, 255, 0) 30%),
        linear-gradient(145deg, #08c3ff 0%, #1094ff 40%, #3651ff 100%);
}

.app-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 32%, rgba(6, 23, 61, 0.12) 100%);
    pointer-events: none;
}

.app-background-glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(24px);
    opacity: 0.56;
    mix-blend-mode: screen;
}

.app-background-glow-left {
    width: 250px;
    height: 250px;
    left: -84px;
    bottom: 14%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(173, 229, 255, 0.13) 40%, rgba(173, 229, 255, 0) 74%);
}

.app-background-glow-right {
    width: 310px;
    height: 310px;
    right: -110px;
    top: 8%;
    background: radial-gradient(circle, rgba(194, 233, 255, 0.18) 0%, rgba(151, 215, 255, 0.1) 44%, rgba(151, 215, 255, 0) 76%);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-md);
    padding-bottom: var(--bottom-bar-offset);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    margin-bottom: 4px;
}

.logo {
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 1.6rem;
    color: white;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.miniapp-link {
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    padding: 10px 14px;
    font-family: var(--font-main);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.miniapp-link:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.2);
}

.status-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-link::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
    animation: statusBlink 1.1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes statusBlink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
        box-shadow: 0 0 4px rgba(74, 222, 128, 0.35);
    }

    100% {
        opacity: 1;
    }
}

/* Notification Button */
.notification-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.notification-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.notification-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.browser-logout-btn {
    margin-left: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    padding: 10px 14px;
    font-family: var(--font-main);
    font-size: 0.92rem;
    cursor: pointer;
}

.browser-auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(4, 17, 44, 0.36) 0%, rgba(4, 17, 44, 0.62) 100%),
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 82% 18%, rgba(161, 224, 255, 0.2) 0%, rgba(161, 224, 255, 0) 30%),
        linear-gradient(145deg, #08c3ff 0%, #1094ff 40%, #3651ff 100%);
    backdrop-filter: blur(16px);
    overflow-y: auto;
}

.maintenance-screen {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 10, 20, 0.82);
    backdrop-filter: blur(14px);
}

.maintenance-card {
    width: min(100%, 460px);
    padding: 32px 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    color: #f8fafc;
    text-align: center;
}

.maintenance-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(248, 113, 113, 0.14);
    color: #fda4af;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.maintenance-card h1 {
    margin: 0 0 12px;
    font-size: 1.8rem;
    line-height: 1.2;
}

.maintenance-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
    white-space: pre-wrap;
}

.browser-auth-card {
    width: min(100%, 880px);
    min-height: 540px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: #ffffff;
    box-shadow:
        0 36px 100px rgba(0, 27, 86, 0.48),
        0 0 0 1px rgba(0, 39, 118, 0.08);
}

.browser-auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 34px;
    color: #f8fafc;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 34%),
        linear-gradient(145deg, #00c6ff 0%, #0072ff 58%, #3651ff 100%);
}

.browser-auth-hero::after {
    content: '';
    position: absolute;
    right: -78px;
    bottom: -88px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.browser-auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 800;
}

.browser-auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(0, 85, 255, 0.24);
    color: #007aff;
    font-size: 1.3rem;
    font-weight: 900;
    font-style: italic;
}

.browser-auth-hero-copy {
    position: relative;
    z-index: 1;
}

.browser-auth-kicker {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.browser-auth-card h1 {
    max-width: 360px;
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 2.35rem;
    line-height: 1.06;
}

.browser-auth-subtitle {
    max-width: 340px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.5;
}

.browser-auth-telegram {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.browser-auth-telegram:hover {
    background: rgba(255, 255, 255, 0.18);
}

.browser-auth-telegram:active {
    transform: translateY(1px);
}

.browser-auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    background: #ffffff;
}

.browser-auth-link {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.browser-auth-link:hover {
    text-decoration: underline;
}

.browser-auth-message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 122, 255, 0.14);
    border-radius: 14px;
    background: rgba(0, 122, 255, 0.08);
    color: var(--color-primary);
    line-height: 1.45;
}

.browser-auth-message[data-state="success"] {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.browser-auth-message[data-state="error"] {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.browser-auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f1f5f9;
}

.browser-auth-tabs.is-hidden {
    display: none;
}

.browser-auth-tab {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 11px 12px;
    background: transparent;
    color: #64748b;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.browser-auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.browser-auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.browser-auth-form.active {
    display: flex;
}

.browser-auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.browser-auth-form label,
.browser-auth-field label {
    font-size: 0.92rem;
    font-weight: 750;
    color: #334155;
}

.browser-auth-form input,
.browser-auth-field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 14px 16px;
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.browser-auth-form input:focus,
.browser-auth-field input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.browser-auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.4;
    margin-top: 2px;
}

.browser-auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
    border-radius: 6px;
    flex: 0 0 auto;
}

.browser-auth-checkbox span {
    display: block;
}

.browser-auth-inline-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: -4px;
}

.browser-auth-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    background: rgba(0, 122, 255, 0.08);
    color: var(--color-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.browser-auth-secondary:hover {
    background: rgba(0, 122, 255, 0.14);
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.12);
}

.browser-auth-secondary:active {
    transform: translateY(1px);
}

.browser-auth-secondary:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.browser-auth-submit {
    margin-top: 10px;
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    background: var(--gradient-pill);
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(0, 114, 255, 0.24);
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.browser-auth-submit:hover {
    box-shadow: 0 18px 38px rgba(0, 114, 255, 0.3);
}

.browser-auth-submit:active {
    transform: translateY(1px);
}

.browser-auth-submit:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.browser-auth-text-button {
    align-self: center;
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    padding: 6px 8px;
}

.browser-auth-text-button:hover {
    text-decoration: underline;
}

.browser-auth-help {
    margin: 0 0 2px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 760px) {
    .browser-auth-screen {
        align-items: flex-start;
        padding: 0;
    }

    .browser-auth-card {
        width: 100%;
        min-height: auto;
        grid-template-columns: 1fr;
        max-height: 100dvh;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .browser-auth-hero {
        min-height: auto;
        gap: 14px;
        padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px;
    }

    .browser-auth-hero::after {
        width: 120px;
        height: 120px;
        right: -46px;
        bottom: -54px;
    }

    .browser-auth-brand {
        font-size: 0.95rem;
    }

    .browser-auth-card h1 {
        max-width: none;
        margin-bottom: 8px;
        font-size: 1.75rem;
        line-height: 1.12;
    }

    .browser-auth-subtitle {
        max-width: none;
        font-size: 0.95rem;
    }

    .browser-auth-telegram {
        width: 100%;
        min-height: 42px;
        padding: 10px 14px;
    }

    .browser-auth-panel {
        padding: 18px;
    }

    .browser-auth-tabs {
        position: sticky;
        top: 0;
        z-index: 2;
        margin-bottom: 16px;
        background: #edf6ff;
    }

    .browser-auth-form input,
    .browser-auth-field input {
        min-height: 46px;
        padding: 13px 14px;
    }

    .browser-auth-submit {
        min-height: 48px;
    }
}

@media (max-width: 420px) {
    .browser-auth-screen {
        padding: 0;
    }

    .browser-auth-card {
        max-height: 100dvh;
        border-radius: 0;
    }

    .browser-auth-hero,
    .browser-auth-panel {
        padding-right: 16px;
        padding-left: 16px;
    }

    .browser-auth-brand {
        gap: 10px;
    }

    .browser-auth-mark {
        width: 38px;
        height: 38px;
    }

    .browser-auth-card h1 {
        font-size: 1.55rem;
    }

    .browser-auth-tabs {
        margin-bottom: 14px;
    }

    .browser-auth-form {
        gap: 11px;
    }

    .browser-auth-kicker {
        margin-bottom: 8px;
        font-size: 0.74rem;
    }

    .browser-auth-checkbox {
        font-size: 0.88rem;
    }
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0f172a; /* Match bg color or transparent if header */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge.active {
    opacity: 1;
}

.logo-v {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    /* Flex is better for centering */
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* Slight rounding for the logo container */
    backdrop-filter: blur(10px);
    /* Logo styling from image seems just a text V or an SVG. Let's use stylized text V for now */
    font-style: italic;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Actually image shows a 3D-ish V icon. Let's make it simple */
    background: none;
    -webkit-text-fill-color: white;
}

.logo-v span {
    display: block;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Nav Tabs */
.nav-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

.nav-tabs {
    display: flex;
    background: transparent;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
}

.nav-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 20px;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.2;
    min-height: 44px;
}

.nav-tab-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-tab-label {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-tab.active {
    color: var(--color-primary);
    background: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-tab:active {
    transform: scale(0.96);
}

/* Small-screen adjustments for nav tabs */
@media (max-width: 420px) {
    .nav-tabs-wrapper {
        width: 100%;
        padding: 0 var(--spacing-sm);
    }

    .nav-tabs {
        width: 100%;
        gap: 6px;
    }

    .nav-tab {
        font-size: clamp(0.74rem, 2.7vw, 0.84rem);
        line-height: 1.15;
        padding: 10px 6px;
        gap: 4px;
    }

    .nav-tab-icon {
        width: 16px;
        height: 16px;
    }

    .nav-tab-label {
        max-width: 100%;
    }
}

@media (max-width: 379px) {
    .nav-tab {
        padding: 10px 4px;
    }

    .nav-tab-label {
        display: none;
    }

    .nav-tab-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 340px) {
    .nav-tabs {
        gap: 4px;
    }

    .nav-tab {
        padding: 10px 2px;
    }

    .nav-tab-icon {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 900px) {
    :root {
        --bottom-bar-offset: 32px;
    }

    body {
        min-width: 900px;
    }

    .app-background-glow-left {
        width: 420px;
        height: 420px;
        left: -120px;
        bottom: 8%;
    }

    .app-background-glow-right {
        width: 520px;
        height: 520px;
        right: -140px;
        top: 0;
    }

    .container {
        width: min(100%, 1120px);
        max-width: 1120px;
        padding: 28px 32px 40px;
        gap: 20px;
    }

    .app-header {
        padding: 8px 0;
        margin-bottom: 0;
    }

    .logo {
        font-size: 1.9rem;
    }

    .miniapp-link {
        min-height: 44px;
        padding: 10px 16px;
    }

    .notification-btn {
        width: 44px;
        height: 44px;
    }

    .nav-tabs-wrapper {
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .nav-tabs {
        width: auto;
        min-width: 560px;
        padding: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 28px;
        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
    }

    .nav-tab {
        min-width: 132px;
        flex: 0 0 auto;
        padding: 12px 18px;
        border-radius: 22px;
        font-size: 0.95rem;
    }
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
    animation: fadeIn 0.4s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.card-title {
    color: #4da6ff;
    /* Light blue for titles */
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.5px;
}

/* Profile Card Specifics */
.profile-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.profile-col:nth-child(2) {
    flex: 1;
    margin: 0 12px;
    text-align: center;
    align-items: center;
}

.profile-col.right-align {
    align-items: flex-end;
    flex-shrink: 0;
}

.label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.value.mono {
    font-family: var(--font-mono);
}

.status-pill {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: #e0e0e0;
    color: #888;
    position: relative;
    overflow: hidden;
}

.status-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2.5s infinite;
}

.status-pill.active {
    background: var(--gradient-pill);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.3);
}

.status-pill.active::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
}

.status-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.status-sub {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Subscription Card Specifics */
.subscription-layout {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.sub-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.sub-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    align-items: flex-end;
    min-width: 140px;
    flex-shrink: 0;
}

.value.highlight {
    color: var(--color-text-primary);
    /* Just bold black */
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    /* Thicker bar */
    background: #eef2f6;
    border-radius: var(--radius-pill);
    padding: 3px;
    margin-top: 4px;
    margin-bottom: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-pill);
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(0, 114, 255, 0.4);
    min-width: 10px;
    /* Ensure visibility */
    position: relative;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

.value-small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.sub-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-item .label {
    margin-bottom: 0;
}

/* Buttons */
.actions {
    display: flex;
    gap: var(--spacing-md);
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 50;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%);
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(0, 114, 255, 0) 0%, rgba(0, 114, 255, 0.22) 24%, rgba(0, 114, 255, 0.38) 100%);
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 58px;
    padding: 16px 14px;
    border: none;
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-primary);
    box-shadow: 0 10px 24px rgba(11, 37, 76, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-primary {
    background: white;
    color: var(--color-text-primary);
    box-shadow: 0 14px 30px rgba(11, 37, 76, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-icon {
    width: 20px;
    height: 20px;
    color: #007aff;
}

.btn-primary .btn-icon {
    color: #007aff;
}

/* Stats specific */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.referral-card .card-title,
.referral-stats-card .card-title {
    color: #2b7cff;
}

.referral-link-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.referral-link-row .value {
    flex: 1;
    font-size: 0.95rem;
}

.config-url-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--spacing-md);
}

.promo-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promo-input-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.promo-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #dbe5f3;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-main);
    color: var(--color-text-primary);
    background: #f8fbff;
    text-transform: uppercase;
}

.promo-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
    background: white;
}

.promo-submit-btn {
    min-height: 48px;
    padding-inline: 18px;
}

.promo-hint {
    color: var(--color-text-secondary);
    line-height: 1.45;
    font-size: 0.92rem;
}

.promo-message {
    display: none;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.94rem;
    line-height: 1.4;
}

.promo-message.active {
    display: block;
}

.promo-message.success {
    background: rgba(52, 199, 89, 0.12);
    color: #15803d;
}

.promo-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

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

#subscription-url {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-steps {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.config-steps li strong {
    color: var(--color-text-primary);
}

.instruction-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-md);
    background: #f1f6ff;
    padding: 4px;
    border-radius: 14px;
}

.instr-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.instr-tab.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.instruction-content {
    min-height: 200px;
}

.instr-panel {
    display: none;
    animation: fadeInInstr 0.3s ease;
}

.instr-panel.active {
    display: block;
}

@keyframes fadeInInstr {
    from {
        opacity: 0;
        transform: translateX(5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.app-recommend {
    background: #f8fbff;
    border-left: 4px solid var(--color-primary);
    padding: 12px;
    border-radius: 4px 12px 12px 4px;
    margin-bottom: var(--spacing-md);
}

.app-info {
    margin-top: 4px;
    font-size: 1rem;
    color: var(--color-text-primary);
}

.instr-links {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #eef2f6;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instr-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.instr-link:after {
    content: '→';
    font-size: 1.1rem;
}

.instr-link:hover {
    opacity: 0.8;
}

.btn-copy {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.25);
    white-space: nowrap;
}

.btn-copy:active {
    transform: scale(0.98);
}

.btn-copy:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

.referral-stats-grid .stats-item {
    background: #f1f6ff;
}

.stats-item {
    background: #f5f8fa;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-subtitle {
    color: white;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    padding-left: 4px;
    opacity: 0.9;
}

/* Servers List */
.servers-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* No Subscription View */
.no-subscription-card {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    gap: var(--spacing-lg);
    animation: fadeIn 0.4s ease;
    margin-top: var(--spacing-xl);
    margin-bottom: calc(var(--bottom-bar-offset) - 8px);
}

.no-sub-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.no-sub-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 166, 0, 0.1);
    color: #ffa600;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.no-sub-icon svg {
    width: 100%;
    height: 100%;
}

.no-sub-text {
    color: var(--color-text-secondary);
    line-height: 1.5;
    font-size: 1.05rem;
}

.btn-buy-large {
    width: 100%;
    background: var(--gradient-app);
    color: white;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 114, 255, 0.3);
    transition: transform 0.2s;
    font-family: var(--font-main);
}

.btn-buy-large:active {
    transform: scale(0.98);
}

#btn-buy-no-sub {
    box-shadow: 0 14px 30px rgba(0, 114, 255, 0.34);
}

@media (max-width: 420px) {
    :root {
        --bottom-bar-offset: calc(116px + env(safe-area-inset-bottom, 0px));
    }

    .actions {
        gap: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .btn {
        min-height: 56px;
        font-size: 0.92rem;
        padding: 15px 12px;
    }

    .btn span {
        line-height: 1.15;
    }
}

.server-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.server-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

.server-stats-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-mini .label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-mini .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.server-limit {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.server-status {
    width: 10px;
    height: 10px;
    background: #e0e0e0;
    border-radius: 50%;
}

.server-status.online {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}

@media (min-width: 900px) {
    .main {
        gap: 20px;
        padding-bottom: 0;
    }

    .tab-content {
        gap: 20px;
    }

    #tab-main.tab-content.active {
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        align-items: stretch;
    }

    #tab-stats.tab-content.active {
        display: flex;
        flex-direction: column;
    }

    #tab-referrals.tab-content.active {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    #tab-referrals .referral-stats-card {
        grid-column: 1 / -1;
    }

    #tab-promocodes.tab-content.active {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .card {
        border-radius: 22px;
        padding: 26px;
        box-shadow: 0 16px 44px rgba(8, 51, 122, 0.18);
    }

    .profile-card,
    .subscription-card {
        min-height: 220px;
    }

    .profile-layout {
        min-height: 142px;
        flex-direction: column;
        justify-content: flex-start;
        gap: 20px;
    }

    .profile-col:nth-child(2) {
        margin: 0;
        text-align: left;
        align-items: flex-start;
    }

    .profile-col.right-align {
        align-items: flex-start;
    }

    .subscription-layout {
        min-height: 142px;
        gap: 28px;
    }

    .sub-left,
    .sub-right {
        flex: 1;
    }

    .sub-right {
        min-width: 260px;
    }

    .value {
        font-size: 1.18rem;
    }

    .stats-grid {
        gap: 16px;
    }

    .stats-item {
        padding: 16px;
        border-radius: 16px;
    }

    .stats-overview-card {
        width: 100%;
    }

    .section-subtitle {
        margin: 4px 0 -4px;
        padding-left: 2px;
    }

    .servers-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
    }

    .servers-skeleton {
        grid-column: 1 / -1;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .servers-list > .loading-spinner {
        grid-column: 1 / -1;
    }

    body.loading .servers-skeleton {
        display: grid;
    }

    .server-card {
        min-width: 0;
        padding: 18px;
        border-radius: 18px;
        box-shadow: 0 12px 28px rgba(8, 51, 122, 0.12);
    }

    .server-stats-row {
        gap: 14px;
    }

    .stat-mini {
        min-width: 0;
    }

    .stat-mini .value {
        white-space: normal;
    }

    .actions {
        position: sticky;
        left: auto;
        bottom: 20px;
        transform: none;
        width: 100%;
        max-width: none;
        margin-top: 4px;
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 26px;
        background: rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(16px);
        box-shadow: 0 20px 50px rgba(0, 58, 150, 0.22);
    }

    .btn {
        min-height: 62px;
        border-radius: 20px;
        font-size: 1rem;
    }

    .btn-secondary,
    .btn-primary {
        background: rgba(255, 255, 255, 0.95);
    }

    .no-subscription-card {
        width: min(100%, 680px);
        align-self: center;
        margin-top: 36px;
        margin-bottom: 0;
    }
}

@media (min-width: 1180px) {
    .container {
        width: min(100%, 1240px);
        max-width: 1240px;
    }

    #tab-main.tab-content.active {
        grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
    }

    .servers-list,
    .servers-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .subscription-layout {
        flex-direction: column;
    }

    .sub-right {
        text-align: left;
        align-items: flex-start;
        min-width: 100%;
        margin-top: 16px;
    }

    .referral-link-row,
    .config-url-row,
    .promo-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-copy,
    .promo-submit-btn {
        width: 100%;
    }

    .logo-v {
        font-size: 2.5rem;
    }
}

.loading-spinner {
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Skeleton loading */
body.loading .loading-spinner {
    display: none;
}

.skeleton-text {
    display: inline-block;
    position: relative;
}

body.loading .skeleton-text {
    color: transparent;
    min-width: 80px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

body.loading .skeleton-text.narrow {
    min-width: 56px;
}

body.loading .skeleton-text.wide {
    min-width: 140px;
}

body.loading .skeleton-pill {
    color: transparent;
    box-shadow: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

body.loading .progress-bar-container {
    background: var(--skeleton-base);
    box-shadow: none;
}

body.loading .progress-fill {
    width: 100%;
    min-width: 0;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    box-shadow: none;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.servers-skeleton {
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
}

body.loading .servers-skeleton {
    display: flex;
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.skeleton-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.skeleton-block {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-block.wide {
    width: 100%;
}

.skeleton-block.lg {
    height: 18px;
}

.skeleton-block.md {
    height: 12px;
    flex: 1;
}

.skeleton-block.sm {
    height: 10px;
    width: 60%;
    margin-top: 12px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--spacing-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: translateY(0);
}

#account-modal .modal-content {
    scrollbar-width: thin;
    scrollbar-color: #28a8ff rgba(0, 122, 255, 0.08);
}

#account-modal .modal-content::-webkit-scrollbar {
    width: 10px;
}

#account-modal .modal-content::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

#account-modal .modal-content::-webkit-scrollbar-track {
    margin: 18px 0;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.08);
}

#account-modal .modal-content::-webkit-scrollbar-thumb {
    border: 2px solid rgba(248, 251, 255, 0.96);
    border-radius: 999px;
    background: linear-gradient(180deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.22);
}

#account-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #32d2ff 0%, #1b82ff 100%);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
}

.close-modal svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 900px) {
    .modal {
        align-items: center;
        padding: 32px;
        background: rgba(3, 18, 45, 0.58);
    }

    .modal-content {
        width: min(100%, 760px);
        max-width: 760px;
        max-height: calc(100vh - 64px);
        border-radius: 26px;
        padding: 28px;
        box-shadow: 0 30px 90px rgba(0, 23, 68, 0.34);
        transform: translateY(18px) scale(0.98);
    }

    .modal.active .modal-content {
        transform: translateY(0) scale(1);
    }

    #plans-modal .modal-content,
    #account-modal .modal-content {
        max-width: 720px;
    }

    #config-modal .modal-content,
    #notifications-modal .modal-content {
        max-width: 860px;
    }

    .plans-container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-button {
        grid-column: 1 / -1;
    }

    .config-url-row {
        align-items: stretch;
    }

    #subscription-url {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0 12px;
        border-radius: 12px;
        background: #f8fbff;
    }
}

.plans-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.plan-card {
    background: #f5f8fa;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-card:active {
    background: #eef2f6;
    transform: scale(0.98);
}

.plan-card.selected {
    border-color: var(--color-primary);
    background: rgba(0, 122, 255, 0.05);
}

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

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

.plan-desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.plan-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.plan-button {
    width: 100%;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    margin-top: var(--spacing-lg);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
    transition: transform 0.2s;
}

.plan-button:active {
    transform: scale(0.98);
}

@media (min-width: 900px) {
    .plans-container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-button {
        grid-column: 1 / -1;
    }
}

/* Referral Info Card */
.referral-info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(245, 250, 255, 1) 100%);
}

.referral-info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 122, 255, 0.04);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(0, 122, 255, 0.08);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(0, 122, 255, 0.07);
    transform: translateY(-1px);
}

.info-icon {
    width: 44px;
    height: 44px;
    background: white;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.12);
    flex-shrink: 0;
}

.info-icon svg {
    width: 22px;
    height: 22px;
}

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

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

.info-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* Notifications List */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 4px;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #28a8ff rgba(0, 122, 255, 0.08);
}

#notifications-modal .modal-content {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #28a8ff rgba(0, 122, 255, 0.08);
}

.notifications-list::-webkit-scrollbar,
#notifications-modal .modal-content::-webkit-scrollbar {
    width: 10px;
}

.notifications-list::-webkit-scrollbar-button,
#notifications-modal .modal-content::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

.notifications-list::-webkit-scrollbar-track,
#notifications-modal .modal-content::-webkit-scrollbar-track {
    margin: 8px 0;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.08);
}

.notifications-list::-webkit-scrollbar-thumb,
#notifications-modal .modal-content::-webkit-scrollbar-thumb {
    border: 2px solid rgba(248, 251, 255, 0.96);
    border-radius: 999px;
    background: linear-gradient(180deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.22);
}

.notifications-list::-webkit-scrollbar-thumb:hover,
#notifications-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #32d2ff 0%, #1b82ff 100%);
}

.notification-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    overflow: hidden;
}

.notification-item.unread {
    background: rgba(0, 122, 255, 0.06);
    border-color: rgba(0, 122, 255, 0.15);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.notification-media {
    width: 100%;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
    aspect-ratio: 16 / 9;
}

.notification-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.notification-item.unread .notification-icon {
    color: var(--color-primary);
}

.notification-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.notification-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    min-width: 0;
    line-height: 1.2;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    margin-left: 8px;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.notification-message a {
    color: var(--color-primary);
    text-decoration: underline;
}

.notification-message strong,
.notification-message b {
    color: var(--color-text-primary);
}

.notification-message code,
.notification-message pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(148, 163, 184, 0.14);
    color: var(--color-text-primary);
    border-radius: 10px;
}

.notification-message code {
    padding: 2px 6px;
}

.notification-message pre {
    padding: 10px 12px;
    white-space: pre-wrap;
    overflow-x: auto;
}

.notification-message blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 3px solid rgba(0, 122, 255, 0.35);
    color: var(--color-text-primary);
}

.notification-message .tg-spoiler {
    background: currentColor;
    color: transparent;
    border-radius: 4px;
    padding: 0 4px;
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.notification-action {
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.notification-action:active {
    transform: scale(0.98);
}

.notification-action.is-default {
    background: rgba(148, 163, 184, 0.14);
    color: var(--color-text-primary);
}

.notification-action.is-primary {
    background: rgba(0, 122, 255, 0.12);
    color: #0a66d9;
}

.notification-action.is-success {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.notification-action.is-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #64748b);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.header-menu {
    position: relative;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.header-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(10, 25, 48, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 80;
}

.header-menu-dropdown[hidden] {
    display: none !important;
}

.header-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-menu-item:active {
    background: rgba(0, 122, 255, 0.08);
    transform: scale(0.99);
}

.header-menu-disabled,
.header-menu-item:disabled {
    color: var(--text-secondary, #94a3b8);
    opacity: 0.65;
    cursor: default;
    pointer-events: none;
}

.account-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
}

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

.account-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.account-section-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.account-section-text {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.account-badge.success {
    background: rgba(52, 199, 89, 0.14);
    color: #1f9d55;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-telegram-widget {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.account-form label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.account-form input {
    width: 100%;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #fff;
    font-size: 0.96rem;
    color: var(--color-text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-form input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.account-inline-actions {
    margin-top: -4px;
}

.header-menu-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-menu-status::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
    animation: statusBlink 1.1s ease-in-out infinite;
    flex-shrink: 0;
}

.btn-text-action {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-text-action:active {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(0.98);
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.btn-delete-notif {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    opacity: 0.6;
}

.btn-delete-notif svg {
    width: 16px;
    height: 16px;
}

.btn-delete-notif:active {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 1;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

/* VLINE Promo Modal */
#vline-promo-modal .vline-promo-content {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.vline-promo-icon {
    margin-bottom: var(--spacing-md);
}

.vline-promo-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--color-primary);
}

.vline-promo-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.vline-promo-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.vline-promo-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.vline-promo-actions .btn {
    min-width: 160px;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.vline-promo-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vline-promo-actions .btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.vline-promo-actions .btn-secondary {
    background: rgba(0, 122, 255, 0.1);
    color: var(--color-text-secondary);
}

.vline-promo-message {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    min-height: 24px;
    line-height: 24px;
    font-weight: 500;
}

.vline-promo-message.success {
    color: var(--color-success);
}

.vline-promo-message.error {
    color: #ff3b30;
}

@media (min-width: 900px) {
    .vline-promo-title {
        font-size: 1.5rem;
    }
}
