/* ==========================================================================
   ru-openrouter.ru — Публичный сайт
   Глобальные стили (подключаются в public/layout.twig)
   Паттерн: глобальные стили здесь, страничные — в public-<page>.css
   ========================================================================== */

:root {
    color-scheme: dark;
    /* ==== Бренд ==== */
    --accent: #0ea5e9;
    --accent-2: #38bdf8;
    --accent-3: #22d3ee;

    /* ==== Тёмная тема (default) ==== */
    --bg: #252525;
    --bg-2: #0d1424;
    --text: #eef2f7;
    --text-muted: #9aa7bd;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);

    /* ==== Стекло (Apple frosted glass) ==== */
    --glass-bg: rgba(255, 255, 255, 0.055);
    --glass-bg-strong: rgba(23, 34, 58, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.10);
    --glass-blur: 26px;

    /* ==== Поверхности (полупрозрачное стекло) ==== */
    --surface: var(--glass-bg);
    --surface-2: rgba(255, 255, 255, 0.035);
    --surface-3: rgba(255, 255, 255, 0.02);

    /* ==== Цвет кода (тёмная тема) ==== */
    --code-text: #e6edf3;

    /* ==== Пилюля пользователя и баланс (стиль старой админки) ==== */
    --pill-bg: var(--glass-bg-strong);
    --balance-green: #4ade80;
    --balance-warn: #f59e0b;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2f9;
    --bg-2: #dfe7f3;
    --text: #0b3a5c;
    --text-muted: #5c6b82;
    --border: rgba(18, 45, 75, 0.12);
    --shadow: 0 20px 50px rgba(40, 70, 120, 0.18);

    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-strong: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-hi: rgba(255, 255, 255, 0.85);

    --surface: var(--glass-bg);
    --surface-2: rgba(255, 255, 255, 0.35);
    --surface-3: rgba(255, 255, 255, 0.25);

    --code-text: #1e3a5f;

    /* ==== Пилюля пользователя и баланс (светлая тема) ==== */
    --pill-bg: #ffffff;
    --balance-green: #16a34a;
    --balance-warn: #d97706;
}

* { box-sizing: border-box; }
/* clip (не hidden): не создаёт scroll-контейнер, поэтому position: sticky шапки работает.
   reveal-анимации (translateX(56px)) иначе расширяют прокрутку документа вправо на мобильных. */
html { scroll-behavior: smooth; overflow-x: clip; }

body {
    margin: 0;
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    transition: background .45s ease, color .35s ease;
    overflow-x: hidden; /* fallback для браузеров без clip: прокидывается на viewport, sticky не ломает */
    overflow-x: clip;
}

/* ==== Цветные блобы за стеклом (дают свечение glass) ==== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 12% 8%, rgba(14,165,233,0.34) 0%, transparent 60%),
        radial-gradient(50% 40% at 88% 12%, rgba(56,189,248,0.28) 0%, transparent 55%),
        radial-gradient(65% 55% at 50% 100%, rgba(34,211,238,0.20) 0%, transparent 60%),
        linear-gradient(160deg, var(--bg-2) 0%, var(--bg) 55%);
    transition: background .45s ease;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { filter: brightness(1.08); }

/* ===== Стеклянная кнопка ===== */
.btn {
    backdrop-filter: blur(10px);
}
.btn-primary, .btn-accent {
    background: linear-gradient(135deg, rgba(14,165,233,0.9), rgba(2,132,199,0.85));
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff !important;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(14,165,233,0.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(14,165,233,0.45); }
.btn-outline-light {
    border-radius: 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--glass-bg);
    border-color: var(--glass-border);
    backdrop-filter: blur(10px);
}
.btn-outline-light:hover { background: var(--glass-hi); color: var(--text); }

/* ===== Баннер ===== */
.site-banner {
    position: relative; z-index: 9998;
    box-shadow: 0 2px 20px rgba(14,165,233,0.4);
    padding: 10px 20px;
    backdrop-filter: blur(12px);
}
.site-banner-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; position: relative; padding-right: 32px;
}
.site-banner-text { font-size: 0.95rem; line-height: 1.4; }
.site-banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.site-banner-close {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: inherit; font-size: 1.5rem; line-height: 1;
    cursor: pointer; padding: 4px 8px; opacity: 0.8;
}
.site-banner-close:hover { opacity: 1; }

/* ===== Шапка (стекло) ===== */
.site-header {
    position: sticky; top: 0; z-index: 9990;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-bottom: 1px solid var(--glass-border);
    transition: background .45s ease;
}
.site-header .container {
    display: flex; align-items: center; gap: 18px;
    min-height: 68px; flex-wrap: nowrap;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text);
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.logo img { height: 34px; }
.logo .logo-badge {
    font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #fff; vertical-align: super;
}

.logo .logo-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.logo-ru    { color: #ffffff; }
.logo-open  { color: #0062ea; }
.logo-router{ color: #ffffff; }
html[data-theme="light"] .logo-ru     { color: #737373; }
html[data-theme="light"] .logo-open   { color: #0062ea; }
html[data-theme="light"] .logo-router { color: #737373; }

.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; }
.site-nav .nav-link {
    color: var(--text-muted); padding: 8px 12px; border-radius: 8px;
    font-size: 0.95rem; font-weight: 500;
    transition: color .15s, background .15s;
}
.site-nav .nav-link:hover { color: var(--text); background: var(--surface-2); }
.site-nav .nav-link.active { color: var(--text); }

/* ==== Кнопки справа (шрифт-тулбар) ==== */
.header-tools {
    display: flex; align-items: center; gap: 8px;
    margin-left: auto; flex-shrink: 0;
}
.auth-actions { display: flex; align-items: center; gap: 8px; }

/* ==== Мини-профиль пользователя и баланс в шапке (стиль старой админки) ==== */
.user-mini-profile {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 12px;
    background: var(--pill-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text);
    transition: background .2s ease, border-color .2s;
}
.user-mini-profile:hover { background: var(--glass-hi); border-color: var(--accent); }
.user-profile-link {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
    transition: opacity .2s;
}
.user-profile-link:hover { opacity: 0.8; }
.user-avatar,
.user-avatar-placeholder {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
}
.user-avatar-placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
}
.user-name {
    font-size: 0.875rem; font-weight: 500; color: var(--text);
    max-width: 150px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-balance-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(16, 185, 129, 0.14));
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 20px;
    font-size: 0.875rem; font-weight: 600;
    color: var(--balance-green);
    white-space: nowrap;
    text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s;
}
.user-balance-badge:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(16, 185, 129, 0.22));
}
.user-balance-badge .balance-value { color: inherit; }
.user-balance-badge.is-low {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.12));
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--balance-warn);
}
.logout-form { display: inline-flex; margin: 0; }
.logout-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 12px; border: 1px solid var(--glass-border); border-radius: 20px;
    background: var(--pill-bg); color: var(--text-muted);
}
.logout-btn:hover { color: #fda4a4; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); }
.logout-icon { width: 18px; height: 18px; }

/* На мобильной скрываем имя пользователя (как в старой версии) */
@media (max-width: 991.98px) {
    .user-mini-profile .user-name { display: none; }
}

/* ===== Переключатель темы ===== */
.theme-toggle {
    position: relative;
    width: 42px; height: 42px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .25s ease, transform .2s ease, border-color .25s;
}
.theme-toggle:hover { background: var(--glass-hi); transform: translateY(-1px); }
.theme-toggle .icon {
    position: absolute;
    display: inline-flex;
    transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.icon-moon, .icon-sun, .icon-monitor { opacity: 0; transform: rotate(-90deg) scale(0.4); }
html[data-theme-pref="auto"]  .icon-monitor { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme-pref="light"] .icon-sun     { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme-pref="dark"]  .icon-moon    { opacity: 1; transform: rotate(0) scale(1); }

/* ===== Индикатор режима обслуживания ===== */
.maintenance-indicator {
    width: 42px; height: 42px;
    border: 1px solid rgba(255,193,7,.35);
    border-radius: 12px;
    background: rgba(255,193,7,.12);
    color: #ffc107;
    cursor: help;
    backdrop-filter: blur(10px);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.maintenance-indicator svg { width: 18px; height: 18px; }

/* ==== Бургер (анимированный) ==== */
.burger {
    width: 42px; height: 42px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: inline-flex; align-items: center; justify-content: center;
    position: relative;
    padding: 0; flex-shrink: 0;
    transition: background .25s ease;
}
.burger:hover { background: var(--glass-hi); }
.burger .line {
    position: absolute; left: 11px; right: 11px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: all .35s cubic-bezier(.4,0,.2,1);
}
.burger .line-1 { top: calc(50% - 7px); }
.burger .line-2 { top: calc(50% - 1px); }
.burger .line-3 { top: calc(50% + 5px); }
.burger.active .line-1 { top: calc(50% - 1px); transform: rotate(45deg); }
.burger.active .line-2 { opacity: 0; transform: translateX(-8px); }
.burger.active .line-3 { top: calc(50% - 1px); transform: rotate(-45deg); }

/* Мобильная панель меню: скрыта на десктопе, включается в media-запросе */
.mobile-drawer { display: none; }

/* ===== Основной контент ===== */
.site-main { flex: 1; }
.site-main > .container { padding-top: 45px; padding-bottom: 64px; }

/* ===== Подвал ===== */
.site-footer {
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 48px 0 32px;
    color: var(--text-muted); font-size: 0.9rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.footer-col h5 { color: var(--text); font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid var(--glass-border); margin-top: 32px; padding-top: 20px; font-size: 0.82rem; }

/* ===== Flash-тосты ===== */
.toast-stack {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 10500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 40px 13px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    animation: toastIn .3s cubic-bezier(.21,1.02,.55,1) both;
}

.toast-item.is-leaving {
    animation: toastOut .25s ease-in both;
}

@keyframes toastIn {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(40px); opacity: 0; }
}

.toast-item .toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.toast-item--success .toast-icon { color: #34d399; }
.toast-item--error .toast-icon { color: #f87171; }

.toast-item--success { border-color: rgba(52, 211, 153, 0.45); }
.toast-item--error { border-color: rgba(248, 113, 113, 0.45); }

.toast-item .toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.toast-item .toast-close:hover { color: var(--text); }

.toast-item .toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

.toast-item--success .toast-progress { background: rgba(52, 211, 153, 0.6); }
.toast-item--error .toast-progress { background: rgba(248, 113, 113, 0.6); }

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 575.98px) {
    .toast-stack {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* ==== Адаптивность ==== */
@media (max-width: 575.98px) {
    .site-header .container { gap: 10px; }
    .logo span { display: none; }
    .site-header .nav-header-cta { display: none; }
}

/* ==== Выдвижная панель меню (drawer) — на всех разрешениях ==== */
.mobile-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(320px, 86vw);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-left: 1px solid var(--glass-border);
    box-shadow: -24px 0 60px rgba(0,0,0,0.35);
    padding: 0;
    margin: 0;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    z-index: 10000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.mobile-drawer.show { transform: translateX(0); }
.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}
.drawer-title { font-weight: 800; font-size: 1.05rem; color: var(--text); }
.drawer-close {
    width: 36px; height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text);
    font-size: 1.3rem; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.drawer-close:hover { background: var(--glass-hi); }
.mobile-drawer .navbar-nav { flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px; }
.mobile-drawer .nav-link { padding: 13px 14px; border-radius: 10px; }
/* На десктопе пункты «Главная/Модели/…» не дублируем — они уже в шапке */
@media (min-width: 992px) {
    .mobile-drawer .drawer-nav-main { display: none; }
}
.drawer-section-label {
    padding: 14px 24px 2px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 6px;
}
.drawer-logout { padding: 4px 12px 12px; margin: 0; }
.drawer-logout .nav-link--danger {
    width: 100%; text-align: left;
    background: none; border: none; cursor: pointer;
    font-size: 0.95rem; font-weight: 500; font-family: inherit;
    color: #fda4a4;
    display: inline-flex; align-items: center; gap: 10px;
}
.drawer-logout .nav-link--danger:hover { background: rgba(239,68,68,0.1); }
.drawer-logout .logout-icon { width: 18px; height: 18px; }
.mobile-actions { margin: 4px 12px 20px; padding-top: 12px; border-top: 1px solid var(--glass-border); display: flex; flex-direction: column; gap: 10px; }
.drawer-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* ===== Шторка быстрого доступа (квадратные иконки) ===== */
.drawer-curtain {
    margin: 12px 16px 8px;
    padding: 0;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.curtain-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.curtain-icon {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s ease, transform .15s ease, border-color .2s, opacity .2s, color .2s;
    text-decoration: none;
    padding: 0;
}
.curtain-icon:hover { background: var(--glass-hi); transform: translateY(-1px); }
.curtain-icon.is-off { opacity: .45; color: var(--text-muted); }
.curtain-icon.is-on { opacity: 1; color: #0ea5e9; border-color: rgba(14,165,233,.4); }
.curtain-icon.theme-toggle .icon {
    position: absolute;
    display: inline-flex;
    transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.curtain-agent__logo {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    background-color: aliceblue;
}
.curtain-agent__fallback {
    display: none;
    align-items: center;
    justify-content: center;
}

.nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 9999;
}
.nav-backdrop.show { opacity: 1; visibility: visible; }

@media (max-width: 991.98px) {
    .site-header .container { flex-wrap: wrap; min-height: 64px; }
    .header-tools { margin-left: auto; }
    .header-login-btn { display: none; }
}

/* ===== Compact mobile overrides (must stay last to win by source order) ===== */
@media (max-width: 575.98px) {
    .site-header .container { flex-wrap: nowrap; gap: 8px; }
    .header-tools { gap: 6px; }
    .auth-actions { gap: 6px; }
    .user-mini-profile { padding: 4px 8px; gap: 6px; }
    .user-avatar,
    .user-avatar-placeholder { width: 28px; height: 28px; font-size: 12px; }
    .user-balance-badge { padding: 4px 8px; font-size: 0.75rem; }
    .user-balance-badge .balance-value { display: none; }
    .logout-btn { padding: 4px 8px; }
    .logo img { height: 28px; }
    .burger { width: 36px; height: 36px; }
    .theme-toggle { width: 36px; height: 36px; }
    .maintenance-indicator { width: 36px; height: 36px; }
    .curtain-icon,
    .curtain-icon.theme-toggle { width: 100%; height: auto; }
}

@media (max-width: 991.98px) {
    .site-nav { flex: 0 0 auto; }
}

/* ===== Cookie Consent Bar ===== */
.cookie-consent-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9995;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    padding: 16px 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
}
.cookie-consent-bar.visible { transform: translateY(0); }
.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-consent-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    min-width: 240px;
}
.cookie-consent-text svg { color: var(--accent); flex-shrink: 0; }
.cookie-consent-text a { color: var(--accent-2); text-decoration: underline; }
.cookie-consent-text a:hover { text-decoration: none; }
.cookie-consent-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-consent-actions .btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cookie-consent-text {
        flex-direction: column;
        text-align: center;
    }
    .cookie-consent-actions { justify-content: center; }
}

/* ===== Модальное окно пополнения баланса (iframe) ===== */
.deposit-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.deposit-modal[hidden] { display: none; }
.deposit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.deposit-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    background: var(--surface, #1a2234);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: depositModalIn 0.25s ease-out;
}
.deposit-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    border-radius: 50%;
    color: var(--text-muted, #9aa7bd);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.deposit-modal-close:hover {
    background: var(--surface-3, rgba(255, 255, 255, 0.12));
    color: var(--text, #e5e9f0);
    transform: rotate(90deg);
}
.deposit-modal-iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: 0;
}
@keyframes depositModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
    .deposit-modal { padding: 0; }
    .deposit-modal-dialog {
        max-height: 100vh;
        border-radius: 0;
        border: 0;
    }
}


/* ===== Колокольчик уведомлений в шторке ===== */
.curtain-bell { position: relative; }
.curtain-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--bg);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
html[data-theme="light"] .curtain-bell-badge { border-color: #f5f5f5; }
