:root {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

.support-links {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
    z-index: 10000;
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.support-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: #ffffff;
    background: #229ed9;
    box-shadow: 0 16px 40px rgba(7, 19, 14, 0.22), 0 0 0 3px rgba(34, 158, 217, 0.18);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.support-link svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
    flex: 0 0 auto;
}

.telegram-support-link {
    background: #229ed9;
    box-shadow: 0 16px 40px rgba(7, 19, 14, 0.22), 0 0 0 3px rgba(34, 158, 217, 0.18);
}

.whatsapp-support-link {
    background: #25d366;
    box-shadow: 0 16px 40px rgba(7, 19, 14, 0.22), 0 0 0 3px rgba(37, 211, 102, 0.18);
}

.support-link:hover,
.support-link:focus-visible {
    color: #ffffff;
    outline: none;
    transform: translateY(-1px);
}

.telegram-support-link:hover,
.telegram-support-link:focus-visible {
    background: #1687bd;
}

.whatsapp-support-link:hover,
.whatsapp-support-link:focus-visible {
    background: #1fad53;
}

.theme-toggle {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 9999;
    display: inline-grid;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(7, 19, 14, 0.12);
    border-radius: 50%;
    color: #07130e;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(7, 19, 14, 0.2);
    cursor: pointer;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.theme-toggle::before {
    content: none;
}

html[data-theme="dark"] .theme-toggle {
    color: #ffffff;
    background: linear-gradient(135deg, #07130e, #02733b);
    border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .support-link {
    border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .telegram-support-link {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32), 0 0 0 3px rgba(34, 158, 217, 0.22);
}

html[data-theme="dark"] .whatsapp-support-link {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32), 0 0 0 3px rgba(37, 211, 102, 0.22);
}

html[data-theme="dark"] .theme-toggle::before {
    content: none;
}

html[data-theme="dark"] body {
    background-color: #07130e;
    color: #f4fff7;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: #f4fff7;
    background-color: #102018;
    border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: rgba(255, 255, 255, 0.56);
}

html[data-theme="dark"] header,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .container,
html[data-theme="dark"] .card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .action-panel,
html[data-theme="dark"] .chart-container,
html[data-theme="dark"] .transactions,
html[data-theme="dark"] .deposit-container,
html[data-theme="dark"] .withdraw-container,
html[data-theme="dark"] .investment-page,
html[data-theme="dark"] .history,
html[data-theme="dark"] .referral-box,
html[data-theme="dark"] .profile-container,
html[data-theme="dark"] .form-container,
html[data-theme="dark"] .auth-container {
    color: #f4fff7;
    background-color: #102018;
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] header {
    background: rgba(8, 19, 14, 0.94);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .about-hero,
html[data-theme="dark"] .contact-hero {
    background:
        linear-gradient(90deg, rgba(7, 19, 14, 0.96) 0%, rgba(7, 19, 14, 0.88) 52%, rgba(3, 107, 53, 0.42) 100%),
        var(--dark-image, url("../images/finance-hero.jpg")) center / cover no-repeat;
}

html[data-theme="dark"] .hero::after,
html[data-theme="dark"] .about-hero::after,
html[data-theme="dark"] .contact-hero::after {
    background: linear-gradient(180deg, rgba(7, 19, 14, 0), #07130e);
}

html[data-theme="dark"] .about-hero {
    --dark-image: url("../images/grow.jpg");
}

html[data-theme="dark"] .contact-hero {
    --dark-image: url("../images/support.jpg");
}

html[data-theme="dark"] .investment-info,
html[data-theme="dark"] .story-section,
html[data-theme="dark"] .testimonials,
html[data-theme="dark"] .contact-main {
    background: #07130e;
}

html[data-theme="dark"] .faq-section,
html[data-theme="dark"] .principles {
    background:
        linear-gradient(180deg, rgba(7, 19, 14, 0.96), rgba(7, 19, 14, 0.98)),
        url("../images/finance-hero.jpg") center / cover no-repeat;
}

html[data-theme="dark"] .principles {
    background:
        linear-gradient(90deg, rgba(7, 19, 14, 0.98), rgba(7, 19, 14, 0.9)),
        url("../images/money.jpg") center / cover no-repeat;
}

html[data-theme="dark"] .feature-grid article,
html[data-theme="dark"] .faq-list details,
html[data-theme="dark"] .story-grid article,
html[data-theme="dark"] .testimonial-cards article,
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .contact-info {
    color: #f4fff7;
    background: #102018;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .principles h2,
html[data-theme="dark"] .faq-list summary,
html[data-theme="dark"] .story-grid h3,
html[data-theme="dark"] .testimonial-cards h3,
html[data-theme="dark"] .contact-form h2,
html[data-theme="dark"] .contact-info h2 {
    color: #f4fff7;
}

html[data-theme="dark"] .name,
html[data-theme="dark"] .nav-links a {
    color: #78f095;
}

html[data-theme="dark"] .section-heading .eyebrow {
    color: #78f095;
}

html[data-theme="dark"] .contact-form input,
html[data-theme="dark"] .contact-form textarea {
    background: #07130e;
}

html[data-theme="dark"] .main {
    background:
        radial-gradient(circle at top right, rgba(0, 166, 81, 0.15), transparent 28rem),
        #07130e;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] label,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .summary-card span,
html[data-theme="dark"] table td {
    color: #f4fff7;
}

html[data-theme="dark"] table tr,
html[data-theme="dark"] table td {
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] table tr:hover,
html[data-theme="dark"] .feature-grid article,
html[data-theme="dark"] .faq-list details {
    background-color: rgba(0, 166, 81, 0.12);
}

html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .feature-grid p,
html[data-theme="dark"] .faq-list p,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .no-data {
    color: #a8b8ad;
}

@media (max-width: 520px) {
    .support-links {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(68px, calc(env(safe-area-inset-bottom) + 68px));
        gap: 8px;
    }

    .support-link {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .support-link span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .support-link svg {
        width: 19px;
        height: 19px;
    }

    .theme-toggle {
        top: auto;
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        width: 38px;
        height: 38px;
        font-size: 1.08rem;
    }
}
