﻿:root[data-ui-style="flavor"] {
    --hc-font: "DM Sans", "Segoe UI", sans-serif;
    --hc-head: "Syne", "DM Sans", sans-serif;
    --hc-bg: #0a0a0f;
    --hc-bg-2: #101018;
    --hc-surface: #111118;
    --hc-surface-2: #18181f;
    --hc-border: rgba(255, 255, 255, 0.08);
    --hc-border-strong: rgba(255, 255, 255, 0.14);
    --hc-text: #f0f0f5;
    --hc-muted: #8b8ba2;
    --hc-accent: #7c5cfc;
    --hc-accent-2: #5b3fd4;
    --hc-success: #22d3a0;
    --hc-warning: #f0a832;
    --hc-danger: #f05454;
    --hc-shadow: 0 22px 52px -28px rgba(0, 0, 0, 0.8);
    --hc-radius-xl: 18px;
    --hc-radius-lg: 14px;
    --hc-radius-md: 10px;
    --v2-safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
    --v2-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
    --v2-header-shift: 0px;
    --v2-shell-shift: 0px;
}

html.tg-webapp-detected[data-ui-style="flavor"],
html[data-ui-style="flavor"] body.tg-webapp,
html.pwa-standalone-mode[data-ui-style="flavor"] {
    --v2-header-shift: 24px;
    --v2-shell-shift: 20px;
}

@media (max-width: 768px) {
    html.tg-webapp-detected[data-ui-style="flavor"],
    html[data-ui-style="flavor"] body.tg-webapp,
    html.pwa-standalone-mode[data-ui-style="flavor"] {
        --v2-header-shift: 32px;
        --v2-shell-shift: 28px;
    }
}

:root[data-ui-style="flavor"][data-theme="dark"],
:root[data-ui-style="flavor"][data-theme="blue"] {
    --hc-bg: #07070c;
    --hc-bg-2: #0f1017;
    --hc-surface: #12141c;
    --hc-surface-2: #1a1d29;
    --hc-border: rgba(178, 187, 216, 0.13);
    --hc-border-strong: rgba(178, 187, 216, 0.24);
    --hc-text: #f2f4ff;
    --hc-muted: #97a1be;
    --hc-accent: #6e8dff;
    --hc-accent-2: #8a6bff;
}

:root[data-ui-style="flavor"][data-theme="purple"] {
    --hc-bg: #12091d;
    --hc-bg-2: #1d0f2e;
    --hc-surface: #201135;
    --hc-surface-2: #2a1844;
    --hc-border: rgba(224, 161, 255, 0.2);
    --hc-border-strong: rgba(224, 161, 255, 0.3);
    --hc-text: #fbf2ff;
    --hc-muted: #c8b0de;
    --hc-accent: #c770ff;
    --hc-accent-2: #7f7dff;
}

:root[data-ui-style="flavor"][data-theme="gold"] {
    --hc-bg: #171108;
    --hc-bg-2: #241a0b;
    --hc-surface: #2f220f;
    --hc-surface-2: #3a2a13;
    --hc-border: rgba(255, 214, 136, 0.22);
    --hc-border-strong: rgba(255, 214, 136, 0.36);
    --hc-text: #fff5df;
    --hc-muted: #dbc395;
    --hc-accent: #f0b84f;
    --hc-accent-2: #f09a3a;
}

:root[data-ui-style="flavor"][data-theme="christmas"],
:root[data-ui-style="flavor"][data-theme="neon"] {
    --hc-bg: #07150f;
    --hc-bg-2: #0f2219;
    --hc-surface: #133126;
    --hc-surface-2: #194131;
    --hc-border: rgba(131, 237, 178, 0.21);
    --hc-border-strong: rgba(131, 237, 178, 0.34);
    --hc-text: #effff5;
    --hc-muted: #aad4ba;
    --hc-accent: #28f0a6;
    --hc-accent-2: #2dd4bf;
}

:root[data-ui-style="flavor"] body {
    font-family: var(--hc-font);
    color: var(--hc-text);
    background:
        radial-gradient(1200px 560px at -10% -20%, color-mix(in srgb, var(--hc-accent) 18%, transparent), transparent 72%),
        radial-gradient(860px 460px at 110% -10%, color-mix(in srgb, var(--hc-accent-2) 14%, transparent), transparent 74%),
        linear-gradient(160deg, var(--hc-bg), var(--hc-bg-2));
}

:root[data-ui-style="flavor"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(120deg, transparent 0, rgba(255, 255, 255, 0.04) 44%, transparent 58%),
        linear-gradient(300deg, transparent 0, rgba(255, 255, 255, 0.03) 42%, transparent 56%);
    background-size: 180% 180%;
    animation: v2Flow 18s ease-in-out infinite;
}

@keyframes v2Flow {
    0% { background-position: 0% 0%, 100% 0%; }
    50% { background-position: 100% 80%, 0% 100%; }
    100% { background-position: 0% 0%, 100% 0%; }
}

:root[data-ui-style="flavor"] .v2-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1300;
    border-bottom: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 90%, transparent);
    backdrop-filter: blur(12px) saturate(130%);
}

:root[data-ui-style="flavor"] .v2-topbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(74px + var(--v2-header-shift));
    padding: calc(var(--v2-safe-top) + 8px + var(--v2-header-shift)) 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

:root[data-ui-style="flavor"] .v2-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--hc-text);
    text-decoration: none;
    min-width: 0;
}

:root[data-ui-style="flavor"] .v2-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--hc-accent) 40%, var(--hc-border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--hc-accent) 78%, #fff 8%), color-mix(in srgb, var(--hc-accent-2) 82%, #fff 8%));
    box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--hc-accent) 70%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

:root[data-ui-style="flavor"] .v2-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:root[data-ui-style="flavor"] .v2-brand-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}

:root[data-ui-style="flavor"] .v2-brand-text strong {
    font-family: var(--hc-head);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

:root[data-ui-style="flavor"] .v2-brand-text small {
    font-size: 0.68rem;
    color: var(--hc-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

:root[data-ui-style="flavor"] .v2-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

:root[data-ui-style="flavor"] .v2-icon-btn,
:root[data-ui-style="flavor"] .theme-toggle-btn,
:root[data-ui-style="flavor"] .v2-mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--hc-border);
    background: var(--hc-surface-2);
    color: var(--hc-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

:root[data-ui-style="flavor"] .v2-icon-btn:hover,
:root[data-ui-style="flavor"] .theme-toggle-btn:hover,
:root[data-ui-style="flavor"] .v2-mobile-menu-btn:hover {
    transform: translateY(-1px);
    border-color: var(--hc-border-strong);
    background: color-mix(in srgb, var(--hc-surface-2) 85%, var(--hc-accent) 15%);
}

:root[data-ui-style="flavor"] .v2-user-btn {
    min-width: 0;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--hc-border);
    background: var(--hc-surface-2);
    color: var(--hc-text);
}

:root[data-ui-style="flavor"] .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hc-accent), var(--hc-accent-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hc-head);
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 8px;
}

:root[data-ui-style="flavor"] .user-email {
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hc-text);
    font-size: 0.9rem;
}

:root[data-ui-style="flavor"] .dropdown-arrow {
    margin-left: 8px;
    color: var(--hc-muted);
}

:root[data-ui-style="flavor"] .v2-user-dropdown,
:root[data-ui-style="flavor"] .v2-theme-dropdown,
:root[data-ui-style="flavor"] .theme-modal,
:root[data-ui-style="flavor"] .notifications-modal {
    border: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 94%, transparent);
    color: var(--hc-text);
    box-shadow: var(--hc-shadow);
    backdrop-filter: blur(16px);
}

:root[data-ui-style="flavor"] .v2-theme-dropdown {
    border-radius: 12px;
}

:root[data-ui-style="flavor"] .theme-dropdown-item,
:root[data-ui-style="flavor"] .theme-option {
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--hc-text);
}

:root[data-ui-style="flavor"] .theme-dropdown-item:hover,
:root[data-ui-style="flavor"] .theme-dropdown-item.active,
:root[data-ui-style="flavor"] .theme-option:hover,
:root[data-ui-style="flavor"] .theme-option.active {
    border-color: var(--hc-border-strong);
    background: color-mix(in srgb, var(--hc-accent) 18%, transparent);
}

:root[data-ui-style="flavor"] .v2-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: calc(90px + var(--v2-safe-top) + var(--v2-shell-shift)) 16px 20px;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 14px;
    position: relative;
    z-index: 1;
}

/* Auth pages do not render sidebar, so force a single-column shell on desktop. */
:root[data-ui-style="flavor"] .v2-shell.v2-shell-auth {
    grid-template-columns: minmax(0, 1fr);
    max-width: 980px;
}

:root[data-ui-style="flavor"] .v2-sidebar {
    position: sticky;
    top: calc(84px + var(--v2-safe-top) + var(--v2-shell-shift));
    height: calc(100vh - 106px - var(--v2-safe-top) - var(--v2-shell-shift));
    border-radius: var(--hc-radius-xl);
    border: 1px solid var(--hc-border);
    background: linear-gradient(165deg, color-mix(in srgb, var(--hc-surface) 94%, transparent), color-mix(in srgb, var(--hc-surface-2) 96%, transparent));
    box-shadow: var(--hc-shadow);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:root[data-ui-style="flavor"] .v2-side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--hc-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all .18s ease;
}

:root[data-ui-style="flavor"] .v2-side-link:hover {
    color: var(--hc-text);
    border-color: var(--hc-border-strong);
    background: color-mix(in srgb, var(--hc-accent) 12%, transparent);
}

:root[data-ui-style="flavor"] .v2-side-link.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--hc-accent), var(--hc-accent-2));
    box-shadow: 0 14px 28px -20px color-mix(in srgb, var(--hc-accent) 78%, transparent);
}

:root[data-ui-style="flavor"] .v2-sidebar-support {
    margin-top: auto;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface-2) 80%, transparent);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:root[data-ui-style="flavor"] .v2-sidebar-support p {
    margin: 0;
    color: var(--hc-muted);
    font-size: 0.82rem;
}

:root[data-ui-style="flavor"] .v2-main-content {
    padding-top: 0;
}

:root[data-ui-style="flavor"] .v2-content-shell {
    max-width: 100%;
    border-radius: var(--hc-radius-xl);
    border: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 86%, transparent);
    box-shadow: var(--hc-shadow);
    padding: 14px;
}

:root[data-ui-style="flavor"] .v2-mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 3px;
}

:root[data-ui-style="flavor"] .v2-mobile-menu-btn span {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

:root[data-ui-style="flavor"] .v2-mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

:root[data-ui-style="flavor"] .v2-mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

:root[data-ui-style="flavor"] .v2-mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

:root[data-ui-style="flavor"] .v2-mobile-sheet,
:root[data-ui-style="flavor"] .v2-bottom-nav {
    display: none;
}

:root[data-ui-style="flavor"] .v2-mobile-sheet {
    position: fixed;
    top: calc(78px + var(--v2-safe-top) + var(--v2-shell-shift));
    left: 10px;
    right: 10px;
    z-index: 1280;
    border-radius: 14px;
    border: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 95%, transparent);
    box-shadow: var(--hc-shadow);
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 170px);
    overflow: auto;
}

:root[data-ui-style="flavor"] .v2-mobile-sheet.show {
    display: flex;
}

:root[data-ui-style="flavor"] .v2-mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--hc-muted);
    font-weight: 600;
    transition: all .18s ease;
}

:root[data-ui-style="flavor"] .v2-mobile-link:hover,
:root[data-ui-style="flavor"] .v2-mobile-link.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--hc-accent), var(--hc-accent-2));
}

:root[data-ui-style="flavor"] .v2-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1250;
    border-top: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 95%, transparent);
    padding-bottom: var(--v2-safe-bottom);
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px 8px;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    transform: none;
    color: var(--hc-muted);
    text-decoration: none;
    font-size: 10px;
    position: relative;
    transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-item:hover {
    color: var(--hc-text);
    background: color-mix(in srgb, var(--hc-accent) 14%, transparent);
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-icon {
    font-size: 1.1rem;
    filter: none;
    transition: transform .18s ease;
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--hc-accent), var(--hc-accent-2));
    box-shadow: 0 14px 24px -18px color-mix(in srgb, var(--hc-accent) 80%, transparent);
    transform: translateY(-1px);
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.08);
}

:root[data-ui-style="flavor"] .v2-bottom-nav .bottom-nav-item.active::before {
    content: none;
}

:root[data-ui-style="flavor"] .theme-modal-overlay,
:root[data-ui-style="flavor"] .notifications-modal-overlay {
    background: rgba(5, 8, 14, 0.72);
    backdrop-filter: blur(7px);
}

:root[data-ui-style="flavor"] .theme-modal,
:root[data-ui-style="flavor"] .notifications-modal {
    border-radius: 16px;
}

:root[data-ui-style="flavor"] .flash {
    border: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 92%, transparent);
    border-radius: 10px;
}

:root[data-ui-style="flavor"] .v2-footer {
    border-top: 1px solid var(--hc-border);
    background: color-mix(in srgb, var(--hc-surface) 92%, transparent);
}

:root[data-ui-style="flavor"] .v2-footer p {
    color: var(--hc-muted);
}

:root[data-ui-style="flavor"] .v2-haunt-signature {
    display: none;
}

html.tg-webapp-detected[data-ui-style="flavor"] .v2-haunt-signature,
html[data-ui-style="flavor"] body.tg-webapp .v2-haunt-signature {
    display: inline;
}

@media (max-width: 1120px) {
    :root[data-ui-style="flavor"] .v2-shell {
        grid-template-columns: 1fr;
        padding: calc(88px + var(--v2-safe-top) + var(--v2-shell-shift)) 10px calc(88px + var(--v2-safe-bottom));
    }

    :root[data-ui-style="flavor"] .v2-sidebar {
        display: none;
    }

    :root[data-ui-style="flavor"] .v2-mobile-menu-btn {
        display: inline-flex;
    }

    :root[data-ui-style="flavor"] .v2-content-shell {
        padding: 10px;
        border-radius: 14px;
    }

    :root[data-ui-style="flavor"] .v2-bottom-nav {
        display: block;
    }

    :root[data-ui-style="flavor"] .v2-footer {
        display: none;
    }
}

@media (max-width: 720px) {
    :root[data-ui-style="flavor"] .v2-topbar-inner {
        min-height: calc(72px + var(--v2-header-shift));
        padding-left: 12px;
        padding-right: 12px;
    }

    :root[data-ui-style="flavor"] .v2-brand-text small,
    :root[data-ui-style="flavor"] .user-email {
        display: none;
    }

    :root[data-ui-style="flavor"] .v2-user-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
    }

    :root[data-ui-style="flavor"] .v2-user-btn .dropdown-arrow {
        display: none;
    }

    :root[data-ui-style="flavor"] .v2-user-btn .user-avatar {
        margin: 0;
    }

    :root[data-ui-style="flavor"] .v2-content-shell {
        border-radius: 12px;
    }
}



/* telegram mini app: flatten nested shells (version02 only) */
html.tg-webapp-detected[data-ui-style="flavor"] .v2-content-shell,
html[data-ui-style="flavor"] body.tg-webapp .v2-content-shell,
html.pwa-standalone-mode[data-ui-style="flavor"] .v2-content-shell,
html[data-ui-style="flavor"] body.pwa-standalone .v2-content-shell {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

html.tg-webapp-detected[data-ui-style="flavor"] .flavor-page-context,
html[data-ui-style="flavor"] body.tg-webapp .flavor-page-context,
html.pwa-standalone-mode[data-ui-style="flavor"] .flavor-page-context,
html[data-ui-style="flavor"] body.pwa-standalone .flavor-page-context {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

html.tg-webapp-detected[data-ui-style="flavor"] .v2-user-menu,
html[data-ui-style="flavor"] body.tg-webapp .v2-user-menu {
    display: none !important;
}

/* flavor runtime safe-area adjustments */
html[data-ui-style="flavor"] {
    --flavor-safe-top: max(var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
}
html.tg-webapp-detected[data-ui-style="flavor"] .topbar {
    padding-top: calc(var(--flavor-safe-top) + 8px);
    height: calc(60px + var(--flavor-safe-top) + 8px);
    align-items: flex-end;
}
html.tg-webapp-detected[data-ui-style="flavor"] .page-content {
    padding-top: calc(var(--space-5) + 2px);
}
html.pwa-standalone-mode[data-ui-style="flavor"] .topbar,
html[data-ui-style="flavor"] body.pwa-standalone .topbar {
    --flavor-pwa-safe-top: min(env(safe-area-inset-top, 0px), 10px);
    padding-top: var(--flavor-pwa-safe-top);
    height: calc(60px + var(--flavor-pwa-safe-top));
    min-height: calc(60px + var(--flavor-pwa-safe-top));
}
html.pwa-standalone-mode[data-ui-style="flavor"] .bottom-nav,
html[data-ui-style="flavor"] body.pwa-standalone .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}
html.pwa-standalone-mode[data-ui-style="flavor"] .page-content,
html[data-ui-style="flavor"] body.pwa-standalone .page-content {
    padding-top: var(--space-3);
}

/* flavor telegram mini app: force mobile shell even on wide viewport */
html.tg-webapp-detected[data-ui-style="flavor"] .main-content,
html[data-ui-style="flavor"] body.tg-webapp .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
}

html.tg-webapp-detected[data-ui-style="flavor"] .fl-sidebar,
html[data-ui-style="flavor"] body.tg-webapp .fl-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: min(86vw, 320px);
}

html.tg-webapp-detected[data-ui-style="flavor"] .fl-sidebar.open,
html[data-ui-style="flavor"] body.tg-webapp .fl-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
}

html.tg-webapp-detected[data-ui-style="flavor"] .mobile-menu-btn,
html[data-ui-style="flavor"] body.tg-webapp .mobile-menu-btn {
    display: flex !important;
}

html.tg-webapp-detected[data-ui-style="flavor"] .desktop-only,
html[data-ui-style="flavor"] body.tg-webapp .desktop-only {
    display: none !important;
}

html.tg-webapp-detected[data-ui-style="flavor"] .bottom-nav,
html[data-ui-style="flavor"] body.tg-webapp .bottom-nav {
    display: flex !important;
    height: calc(var(--bottom-nav-height) + var(--v2-safe-bottom));
    padding-bottom: var(--v2-safe-bottom);
}

html.tg-webapp-detected[data-ui-style="flavor"] .page-content,
html[data-ui-style="flavor"] body.tg-webapp .page-content {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    padding-bottom: calc(var(--bottom-nav-height) + var(--v2-safe-bottom) + var(--space-4));
}

/* flavor runtime mode split:
   - regular web: always keep desktop sidebar visible
   - telegram mini app: hide desktop sidebar and use mobile shell */
html[data-ui-style="flavor"]:not(.flavor-miniapp) .fl-sidebar,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .fl-sidebar {
    transform: none !important;
    display: flex !important;
    visibility: visible !important;
}

html[data-ui-style="flavor"]:not(.flavor-miniapp) .main-content,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

html[data-ui-style="flavor"]:not(.flavor-miniapp) .topbar,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .topbar {
    padding-top: 0 !important;
    height: var(--topbar-height) !important;
    min-height: var(--topbar-height) !important;
}

html[data-ui-style="flavor"]:not(.flavor-miniapp) .mobile-menu-btn,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .mobile-menu-btn,
html[data-ui-style="flavor"]:not(.flavor-miniapp) .sidebar-overlay,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .sidebar-overlay,
html[data-ui-style="flavor"]:not(.flavor-miniapp) .bottom-nav,
html[data-ui-style="flavor"] body:not(.flavor-miniapp) .bottom-nav {
    display: none !important;
}

html.flavor-miniapp[data-ui-style="flavor"] .fl-sidebar,
html[data-ui-style="flavor"] body.flavor-miniapp .fl-sidebar {
    transform: translateX(-100%) !important;
    box-shadow: none !important;
    width: min(86vw, 320px);
}

html.flavor-miniapp[data-ui-style="flavor"] .fl-sidebar.open,
html[data-ui-style="flavor"] body.flavor-miniapp .fl-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: var(--shadow-lg) !important;
}

html.flavor-miniapp[data-ui-style="flavor"] .main-content,
html[data-ui-style="flavor"] body.flavor-miniapp .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
}

html.flavor-miniapp[data-ui-style="flavor"] .mobile-menu-btn,
html[data-ui-style="flavor"] body.flavor-miniapp .mobile-menu-btn {
    display: flex !important;
}

html.flavor-miniapp[data-ui-style="flavor"] .desktop-only,
html[data-ui-style="flavor"] body.flavor-miniapp .desktop-only {
    display: none !important;
}

html.flavor-miniapp[data-ui-style="flavor"] .bottom-nav,
html[data-ui-style="flavor"] body.flavor-miniapp .bottom-nav {
    display: flex !important;
    height: calc(var(--bottom-nav-height) + var(--v2-safe-bottom));
    padding-bottom: var(--v2-safe-bottom);
}

html.flavor-miniapp[data-ui-style="flavor"] .topbar,
html[data-ui-style="flavor"] body.flavor-miniapp .topbar {
    padding-top: calc(var(--flavor-safe-top) + 18px) !important;
    height: auto !important;
    min-height: calc(60px + var(--flavor-safe-top) + 18px);
    align-items: flex-end;
}

html.flavor-miniapp[data-ui-style="flavor"] .page-content,
html[data-ui-style="flavor"] body.flavor-miniapp .page-content {
    padding-top: calc(var(--space-5) + 6px);
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    padding-bottom: calc(var(--bottom-nav-height) + var(--v2-safe-bottom) + var(--space-4));
}

/* Hide fallback global user menu in flavor to avoid duplicate top-right buttons */
html[data-ui-style="flavor"] .v2-user-menu,
html[data-ui-style="flavor"] .user-menu {
    display: none !important;
}
