:root {
    --primary-color:  #56569e;
    --primary-light:  #7b7bc4;
    --primary-dim:    rgba(86, 86, 158, 0.12);
    --primary-border: rgba(86, 86, 158, 0.3);
    --secondary-color: #16161d;
    --bg-dark:        #0c0c10;
    --bg-darker:      #0a0a0e;
    --text-light:     #eeeef8;
    --text-gray:      #6b6b85;
    --success:        #3dd68c;
    --danger:         #f04747;
    --warning:        #f0c050;
    --border-color:   #1e1e28;
    --card-bg:        #16161d;
    --input-bg:       #0f0f14;
    --dropdown-bg:    #1c1c25;
    --divider:        rgba(255,255,255,0.06);
}

[data-theme="dark"] {
    --secondary-color: #16161d;
    --bg-dark:        #0c0c10;
    --bg-darker:      #0a0a0e;
    --text-light:     #eeeef8;
    --text-gray:      #6b6b85;
    --border-color:   #1e1e28;
    --card-bg:        #16161d;
    --input-bg:       #0f0f14;
    --dropdown-bg:    #1c1c25;
    --divider:        rgba(255,255,255,0.06);
    --success:        #3dd68c;
    --danger:         #f04747;
    --warning:        #f0c050;
}

[data-theme="light"] {
    --secondary-color: #ffffff;
    --bg-dark:        #f0f2f5;
    --bg-darker:      #ffffff;
    --text-light:     #111827;
    --text-gray:      #6b7280;
    --border-color:   #e5e7eb;
    --card-bg:        #ffffff;
    --input-bg:       #f9fafb;
    --dropdown-bg:    #ffffff;
    --divider:        rgba(0,0,0,0.07);
    --success:        #16a34a;
    --danger:         #dc2626;
    --warning:        #d97706;
}

html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
    transition: none !important;
    animation: none !important;
}

*, *::before, *::after {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stat-card, .shard-card, .s-online .shard-dot, .s-reconnecting .shard-dot, .pulse-dot {
    transition: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0a0e8;
}
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-darker);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(86, 86, 158, 0.18) 0%, transparent 65%);
    background-attachment: fixed;
    color: var(--text-light);
    line-height: 1.6;
}

a { color: var(--primary-color); text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.navbar-dashboard {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.nav-brand:hover { opacity: 0.8; }

.bot-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.bot-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.01em;
}

.bot-name sup {
    font-size: 0.5em;
    color: var(--primary-light);
    vertical-align: super;
}

.nav-menu {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-menu a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s;
}

.nav-menu a:hover { color: var(--primary-light); }

.nav-menu a.nav-active { color: var(--text-light); }

.user-info { display: flex; align-items: center; gap: 12px; }

.nav-guest-controls { display: flex; align-items: center; gap: 12px; }

.nav-menu-theme-row,
.nav-menu-lang-row,
.nav-menu-separator { display: none; }

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 8px;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.07); }
[data-theme="light"] .nav-hamburger:hover { background: rgba(0,0,0,0.06); }

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}
.nav-hamburger.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(86,86,158,0.35);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 9px 18px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
    background: var(--primary-dim);
    transform: translateY(-1px);
}

.hero {
    text-align: center;
    padding: 100px 20px 80px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-inner { max-width: 780px; margin: 0 auto; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.82rem;
    color: var(--primary-light);
    margin-bottom: 28px;
    font-weight: 600;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 48px;
    color: var(--text-light);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero h1 span { color: var(--primary-light); }

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-gray);
    margin-bottom: 44px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.features-section { padding: 140px 0 100px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 28px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 28px rgba(86,86,158,0.15);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 1.3rem;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-light);
}

.feature-card p {
    color: var(--text-gray);
    line-height: 1.65;
    font-size: 0.92rem;
}

.footer {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 52px 0 28px;
}

.footer-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.footer-col { display: flex; flex-direction: column; gap: 14px; }
.footer-col-brand { display: flex; flex-direction: column; gap: 12px; }

.footer-brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    text-decoration: none;
}

.footer-logo { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }

.footer-bot-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.01em;
}

.footer-bot-name sup {
    font-size: 0.5em;
    font-weight: 600;
    color: var(--text-light);
    vertical-align: super;
}

.footer-desc { font-size: 0.82rem; color: var(--text-gray); line-height: 1.6; max-width: 260px; }
.footer-copy { font-size: 0.76rem; color: var(--text-gray); }

.footer-col-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col-links a {
    color: var(--text-gray);
    font-size: 0.84rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

.footer-col-links a:hover { color: var(--primary-light); }

.theme-switcher-guest {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

[data-theme="light"] .theme-switcher-guest {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

.theme-switcher-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.theme-switcher-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-light); }
[data-theme="light"] .theme-switcher-btn:hover { background: rgba(0,0,0,0.05); }
.theme-switcher-btn.active { background: rgba(86,86,158,0.15); color: var(--primary-light); }

.lang-guest-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 14px;
    background: none; border: none;
    color: var(--text-light); font-size: 0.88rem;
    cursor: pointer; transition: background 0.15s; text-align: left;
    font-family: inherit;
}

.lang-guest-option:hover { background: rgba(86,86,158,0.08); }
.lang-guest-option.lang-guest-active { color: var(--primary-light); }

.wz-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    background: #1e1e28;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.87rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    opacity: 0;
    z-index: 99999;
    transition: opacity 0.2s cubic-bezier(.4,0,.2,1), transform 0.2s cubic-bezier(.4,0,.2,1);
}

.wz-toast.wz-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.wz-toast-icon {
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; background: #56569e;
}

.wz-toast-icon svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wz-toast-success .wz-toast-icon { background: #3dd68c; }
.wz-toast-error   .wz-toast-icon { background: #f04747; }
.wz-toast-info    .wz-toast-icon { background: #56569e; }

.legal-page { padding: 60px 20px; min-height: calc(100vh - 200px); }
.legal-container { max-width: 800px; margin: 0 auto; }

.legal-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.legal-header h1 { font-size: 2rem; font-weight: 700; color: var(--text-light); margin: 0 0 8px; }
.legal-date { color: var(--text-gray); font-size: 0.85rem; }
.legal-section { margin-bottom: 36px; }
.legal-section h2 { font-size: 1.1rem; font-weight: 600; color: var(--text-light); margin: 0 0 12px; }
.legal-section p { color: var(--text-gray); line-height: 1.7; margin: 0 0 12px; }
.legal-section ul { color: var(--text-gray); line-height: 1.7; padding-left: 20px; margin: 8px 0; }
.legal-section li { margin-bottom: 4px; }
.legal-section a { color: var(--primary-light); }
.legal-section a:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .footer-wide { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-col-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.1rem; }
    .hero .subtitle { font-size: 1rem; }
    .features-grid { grid-template-columns: 1fr; }

    .navbar-dashboard { position: relative; }
    .nav-guest-controls { display: none !important; }
    .nav-menu {
        display: none !important;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-darker);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column !important;
        gap: 0 !important;
        z-index: 400;
        padding: 6px 0 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    }
    .nav-menu.open { display: flex !important; }
    .nav-menu a { padding: 13px 20px; font-size: 0.95rem; border-radius: 0; }
    .nav-menu a:hover { background: rgba(255,255,255,0.05); color: var(--text-light); }
    [data-theme="light"] .nav-menu a:hover { background: rgba(0,0,0,0.04); }
    .nav-hamburger { display: flex; }

    .nav-menu-theme-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 12px 20px;
        border-top: 1px solid var(--border-color);
        margin-top: 4px;
    }
    .nav-menu-theme-label {
        font-size: 0.92rem;
        color: var(--text-gray);
        display: flex;
        align-items: center;
        gap: 7px;
    }
    .nav-menu-theme-btns {
        display: flex;
        align-items: center;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        padding: 3px;
        gap: 2px;
    }
    .nav-menu-theme-btns .theme-switcher-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    [data-theme="light"] .nav-menu-theme-btns {
        background: rgba(0,0,0,0.04);
        border-color: rgba(0,0,0,0.1);
    }
    .nav-menu-separator {
        display: block;
        height: 1px;
        background: var(--border-color);
        margin: 0 20px;
    }
    .nav-menu-lang-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 10px 20px 14px;
        border-top: 1px solid var(--border-color);
    }
    .nav-menu-lang-btns {
        display: flex;
        align-items: center;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        padding: 3px;
        gap: 2px;
    }
    [data-theme="light"] .nav-menu-lang-btns {
        background: rgba(0,0,0,0.04);
        border-color: rgba(0,0,0,0.1);
    }
    .nav-menu-lang-btn {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 0 10px;
        height: 34px;
        border: none;
        border-radius: 7px;
        background: transparent;
        color: var(--text-gray);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.18s, color 0.18s;
        font-family: inherit;
    }
    .nav-menu-lang-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-light); }
    [data-theme="light"] .nav-menu-lang-btn:hover { background: rgba(0,0,0,0.06); }
    .nav-menu-lang-btn.lang-active {
        background: rgba(255,255,255,0.13);
        color: var(--text-light);
    }
    [data-theme="light"] .nav-menu-lang-btn.lang-active { background: rgba(0,0,0,0.10); }
}

@media (max-width: 560px) {
    .footer-wide { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; }
    .footer-col-brand { grid-column: unset; }
}

@media (max-width: 480px) {
    .hero { padding: 64px 16px 52px; min-height: 100dvh; }
    .hero h1 { font-size: 1.75rem; margin-bottom: 28px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { justify-content: center; }
    .features-section { padding: 80px 0 60px; }
}