/* Корпоративные цвета */
:root {
    --menu-bg: #262a2b;
    --menu-bg-start: #2c5740;
    --menu-bg-end: #2c5740;
    --menu-surface: #ffffff;
    --menu-surface-strong: #e2e8ee;
    --menu-border: #d9e1e8;
    --menu-hover: #2c5740;
    --active-light: #2c5740;
    --menu-text: #e0e0e0;
    --menu-muted: #617185;
    --menu-icon: #748597;
    --menu-text-hover: #ffffff;
    --menu-accent: #176b54;
    --menu-accent-strong: #2c5740;
    --menu-accent-soft: rgba(44, 87, 64, 0.16);
    --menu-gold: #d8b95c;
    --shell-bg: #f1f4f7;
    --sidebar-width: 288px;
    --sidebar-overlap: 28px;
    --sidebar-row-pad-x: 0.55rem;
    --sidebar-icon-rail: 2.4rem;
    --sidebar-icon-gap: 0.45rem;
}

/* Сброс отступов и растягивание на всю высоту */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--shell-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.analytics-pixel {
    left: -9999px;
    position: absolute;
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1060;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.cookie-consent__body {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.95rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(35, 79, 56, 0.18);
    border-radius: 8px;
    background: #ffffff;
    color: #173b2a;
    box-shadow: 0 18px 42px rgba(24, 35, 28, 0.18);
    pointer-events: auto;
}

.cookie-consent__icon {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(44, 87, 64, 0.1);
    color: #234f38;
    font-size: 1.2rem;
}

.cookie-consent__copy {
    min-width: 0;
}

.cookie-consent__copy strong {
    display: block;
    color: #163322;
    font-size: 1rem;
    line-height: 1.25;
}

.cookie-consent__copy p {
    margin: 0.25rem 0 0;
    color: #4f6157;
    font-size: 0.92rem;
    line-height: 1.5;
}

.cookie-consent__copy a {
    color: #176b54;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.cookie-consent__button {
    min-height: 2.45rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.cookie-consent__button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 87, 64, 0.18);
}

.cookie-consent__button-primary {
    background: #234f38;
    color: #ffffff;
}

.cookie-consent__button-primary:hover {
    background: #163322;
}

.cookie-consent__button-secondary {
    border-color: rgba(35, 79, 56, 0.18);
    background: #f5f8f6;
    color: #234f38;
}

.cookie-consent__button-secondary:hover {
    border-color: rgba(35, 79, 56, 0.32);
    background: #ffffff;
}

@media (max-width: 767px) {
    .cookie-consent {
        right: 0.6rem;
        bottom: 0.6rem;
        left: 0.6rem;
    }

    .cookie-consent__body {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .cookie-consent__icon {
        display: none;
    }

    .cookie-consent__actions {
        justify-content: stretch;
    }

    .cookie-consent__button {
        flex: 1 1 12rem;
    }
}

/* Убираем старые лишние правила для .main-content и .wrapper, если они конфликтуют */
.wrapper {
    flex: 1;
    display: flex;
    min-height: 0; /* позволяет дочерним элементам сжиматься */
    height: 100%;
    background: var(--shell-bg);
}

.sidebar,
.app-topbar,
.app-mobile-menu {
    --menu-bg: #dfe6e2;
    --menu-bg-start: #d6dfda;
    --menu-bg-end: #ffffff;
    --menu-border: #c5d0ca;
    --menu-hover: #d1dbd6;
    --active-light: #cbd8d1;
    --menu-text: #173b2a;
    --menu-muted: #66786d;
    --menu-icon: #728277;
    --menu-text-hover: #0f2c1f;
}

/* Левое меню (десктоп) */
.sidebar {
    width: var(--sidebar-width);
    box-sizing: border-box;
    background: var(--menu-bg);
    color: var(--menu-text);
    padding: 1.15rem 0.95rem 1rem;
    transition: all 0.3s;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 2;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 8px 0 28px rgba(36, 53, 70, 0.06), 1px 0 0 rgba(207, 217, 227, 0.8);
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 133, 151, 0.24) transparent;
}

.sidebar::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb {
    background: rgba(116, 133, 151, 0.24);
    border-radius: 999px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--menu-accent-strong);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.app-brand-main {
    color: var(--menu-accent-strong);
}

.app-brand-light {
    color: #2c3e2b;
    font-weight: 400;
}

.sidebar .app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.05rem 0 1.45rem;
    padding: 0 var(--sidebar-row-pad-x);
    font-size: 1.38rem;
    text-shadow: none;
}

.sidebar-profile-card {
    padding: 0.15rem var(--sidebar-row-pad-x) 0.1rem;
}

.sidebar-user-row {
    display: block;
    min-width: 0;
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-user-avatar {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #ffffff;
    background: #607083;
    font-weight: 800;
    box-shadow: none;
    justify-self: center;
}

.sidebar-profile-card small {
    display: block;
    max-width: 100%;
    color: var(--menu-text);
    font-size: 0.9rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.sidebar-menu-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--menu-border);
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-nav-link,
.sidebar-logout-button {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--menu-text);
    text-decoration: none;
    min-height: 2.85rem;
    padding: 0.72rem var(--sidebar-row-pad-x);
    display: grid;
    grid-template-columns: var(--sidebar-icon-rail) minmax(0, 1fr);
    column-gap: var(--sidebar-icon-gap);
    align-items: center;
    border-radius: 8px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-nav-link:hover,
.sidebar-nav-link:focus,
.sidebar-logout-button:hover,
.sidebar-logout-button:focus {
    background: var(--menu-hover);
    color: var(--menu-text-hover);
    transform: none;
    outline: none;
}

.sidebar-nav-link i,
.sidebar-logout-button i {
    width: auto;
    margin-right: 0;
    color: var(--menu-icon);
    text-align: center;
    transition: color 0.2s ease;
    justify-self: center;
}

.sidebar-nav-link.active,
.sidebar-nav-link.active:hover,
.sidebar-nav-link.active:focus {
    background: var(--active-light);
    color: var(--menu-text-hover);
    box-shadow: inset 3px 0 0 var(--menu-accent-strong);
}

.sidebar-nav-link.active i,
.sidebar-logout-button:hover i,
.sidebar-logout-button:focus i,
.sidebar-nav-link:hover i,
.sidebar-nav-link:focus i {
    color: var(--menu-accent-strong);
}

.sidebar-balance-link {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    max-width: 10.85rem;
}

.sidebar-balance-link:hover,
.sidebar-balance-link:focus {
    color: inherit;
    text-decoration: none;
    outline: none;
}

.sidebar-balance-link:focus-visible {
    box-shadow: 0 0 0 3px var(--menu-accent-soft);
}

.menu-link-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: 1 / -1;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.menu-link-label > span:first-child {
    display: grid;
    grid-template-columns: var(--sidebar-icon-rail) minmax(0, 1fr);
    column-gap: var(--sidebar-icon-gap);
    align-items: center;
    min-width: 0;
}

.menu-link-label > span:first-child i {
    width: auto;
    margin-right: 0;
    justify-self: center;
}

.menu-notice-badge {
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #d74747;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(215, 71, 71, 0.28);
}

.sidebar-balance {
    padding: 0.62rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(44, 87, 64, 0.14);
    box-shadow: none;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.sidebar-balance-link:hover .sidebar-balance,
.sidebar-balance-link:focus .sidebar-balance {
    color: var(--menu-accent);
    background: rgba(255, 255, 255, 0.34);
    border-color: rgba(44, 87, 64, 0.22);
}

.sidebar-balance-mobile {
    max-width: 18rem;
    margin: 0;
}

.sidebar-balance-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--menu-muted);
    margin-bottom: 0.25rem;
}

.sidebar-balance-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: var(--menu-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-balance-value i {
    color: var(--menu-gold);
}

/* Мобильная навигация */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1035;
    padding: 0.6rem 0.35rem;
    border-bottom: 1px solid var(--menu-border);
    box-shadow: 0 10px 26px rgba(36, 53, 70, 0.08);
}

.navbar.bg-primary {
    background: var(--menu-bg) !important;
}

.navbar .navbar-brand {
    color: var(--menu-accent-strong) !important;
    margin: 0;
}

.app-menu-toggle {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    color: var(--menu-icon);
    background: transparent;
    border: 1px solid transparent;
}

.app-menu-toggle:hover,
.app-menu-toggle:focus {
    color: var(--menu-text);
    background: var(--menu-hover);
    border-color: var(--menu-border);
}

/* Offcanvas меню (мобильное) */
.app-mobile-menu {
    width: min(88vw, 360px) !important;
    border: none;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    overflow: hidden;
    color: var(--menu-text);
    background: var(--menu-bg);
    box-shadow: 24px 0 48px rgba(36, 53, 70, 0.16);
}

.offcanvas-header {
    padding: 1rem;
    border-bottom: 1px solid var(--menu-border);
}

.offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 133, 151, 0.24) transparent;
}

.offcanvas .offcanvas-title {
    color: var(--menu-accent-strong);
    font-size: 1.05rem;
}

.offcanvas .btn-close {
    opacity: 0.72;
}

.app-menu-close {
    border-radius: 8px;
    background-size: 0.7rem;
}

.offcanvas-body .sidebar-profile-card {
    padding-top: 0;
}

.offcanvas-body .sidebar-nav-link,
.offcanvas-body .sidebar-logout-button {
    min-height: 2.95rem;
}

.offcanvas-body .sidebar-logout-button {
    color: var(--menu-text);
}

/* Контейнер для контента и подвала — общее поведение */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Для страниц с боковым меню (profile, instructions и т.д.) */
.main-content.with-sidebar {
    height: 100vh; /* фиксированная высота */
    overflow-y: auto; /* прокрутка только внутри */
    margin-left: calc(var(--sidebar-overlap) * -1);
    padding-left: var(--sidebar-overlap);
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-top-left-radius: 24px;
    box-shadow: -1px 0 0 rgba(217, 225, 232, 0.8), -18px 0 36px rgba(36, 53, 70, 0.05);
}

/* Основной контент */
.content {
    flex: 1;
    padding: 20px;
}

/* Для неавторизованных — полная ширина */
.full-width {
    width: 100%;
    padding: 20px;
}

/* Подвал */
footer {
    background-color: #ffffff;
    text-align: center;
    padding: 10px 0;
    flex-shrink: 0;
    color: #173b2a;
}

/* Карточки ключей (общие) */
.key-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    width: 100%;
}

.key-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

/* Плитка для покупки ключа (общие стили) */
.key-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 280px;
    height: 220px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background-color: #ffffff;
    color: #9e9e9e;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin: 0 auto;
}

.key-tile i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #b0b0b0;
}

.key-tile span {
    font-size: 16px;
    text-align: center;
    color: #6c757d;
}

.key-tile:hover {
    border-color: var(--active-light);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.key-tile:hover i {
    color: var(--active-light);
}

/* Центрирование плитки на странице без ключей */
.d-flex.justify-content-center .key-tile {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Кнопка "Купить новый ключ" и другие первичные кнопки */
.btn-primary {
    background-color: var(--active-light);
    border-color: var(--active-light);
    color: #252a1a;
}
.btn-primary:hover {
    background-color: #c0d0a0;
    border-color: #c0d0a0;
    color: #252a1a;
}

/* Переопределение цвета аккордеона Bootstrap (страница инструкций) */
.accordion-button:not(.collapsed) {
    background-color: var(--active-light) !important;
    color: #ffffff !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(172, 183, 142, 0.25) !important;
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23252a1a'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
}

/* Стили для карточек тарифов (страница выбора тарифа) */
.tariff-card {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.tariff-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(37, 42, 26, 0.15);
    border-color: var(--active-light);
}

.tariff-icon {
    font-size: 2.2rem;
    color: var(--menu-bg);
    margin-bottom: 0.5rem;
}

.tariff-card .card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--menu-bg);
    margin-bottom: 0.75rem;
}

.price-container {
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.current-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--menu-bg);
}

.old-price {
    font-size: 0.9rem;
    color: #adb5bd;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.discount-badge {
    font-size: 0.8rem;
    background-color: #ffc107;
    color: #212529;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.25rem;
    font-weight: 600;
}

.tariff-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.tariff-card .btn {
    width: 100%;
    border-radius: 50px;
    padding: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    background: linear-gradient(135deg, var(--menu-bg) 0%, #3a4230 100%);
    color: white;
    transition: all 0.3s;
}

.tariff-card .btn:hover {
    background: linear-gradient(135deg, #3a4230 0%, var(--menu-bg) 100%);
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(37, 42, 26, 0.3);
}

.tariff-card.popular {
    border: 2px solid var(--active-light);
    background: linear-gradient(145deg, #ffffff, #f1f3e9);
    transform: scale(1.02);
    box-shadow: 0 12px 25px rgba(172, 183, 142, 0.2);
}

.tariff-card.popular::before {
    content: "🔥 Популярный";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--active-light);
    color: #ffffff; /* цвет надписи */
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 1rem;
    border-radius: 50px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===== Стили из login.html ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.2);
}

.login-icon {
    margin-bottom: 1.5rem;
    color: var(--active-light);
}

.login-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1a2e1a;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.login-message {
    color: #495057;
    margin-bottom: 2rem;
}

.btn-login {
    background: linear-gradient(135deg, #1a2e1a, #2b4a2b);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

.btn-login i {
    font-size: 1.2rem;
}

.auth-link {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

/* ===== Стили из profile.html ===== */
.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 70vh;
    padding: 20px 0;
}

.profile-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 900px;
    border: 1px solid rgba(255,255,255,0.2);
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-icon {
    font-size: 3rem;
    color: var(--active-light);
    margin-bottom: 1rem;
}

.profile-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--menu-bg-start);
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
}

.profile-section-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--menu-bg-start);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(172, 183, 142, 0.3);
}

.profile-key-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.03);
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.02);
}

.profile-key-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(37, 42, 26, 0.1);
}

/* Верхняя строка карточки: имя + статус */
.key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.key-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.key-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--menu-bg-start);
    cursor: default;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-icon {
    font-size: 0.9rem;
    color: #6c757d;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.key-name-container:hover .edit-icon {
    opacity: 1;
}

.key-name-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
}

.key-status {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.key-status .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Блок с ключом и кнопкой "Показать" */
.key-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.profile-key-value {
    display: block;
    width: 100%;
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.profile-key-value.blurred-key {
    filter: blur(4px);
    transition: filter 0.2s ease;
    cursor: default;
}

.show-key-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 2;
    pointer-events: auto;
}

.show-key-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.profile-key-value.blurred-key.unblurred {
    filter: blur(0);
}

.profile-key-value.blurred-key.unblurred + .show-key-btn {
    opacity: 0;
    pointer-events: none;
}

/* Нижняя панель карточки */
.key-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.key-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-btn-copy {
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 30px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    transition: 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.profile-btn-copy:hover {
    background: #dee2e6;
    color: #212529;
}

.profile-btn-renew {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    border-radius: 30px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    transition: 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.profile-btn-renew:hover {
    background: #28a745;
    color: white;
}

/* Плитка покупки в профиле */
.profile-purchase-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 280px;
    height: 220px;
    border: 2px dashed #cbd5e0;
    border-radius: 30px;
    background: rgba(255,255,255,0.8);
    color: #718096;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
    margin: 0 auto;
}

.profile-purchase-tile i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #a0aec0;
}

.profile-purchase-tile span {
    font-size: 1rem;
    color: #4a5568;
}

.profile-purchase-tile:hover {
    border-color: var(--active-light);
    background: #fafdf6;
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(172, 183, 142, 0.15);
}

.profile-purchase-tile:hover i {
    color: var(--active-light);
}

/* Пустое состояние */
.profile-empty-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.2);
}

.profile-empty-icon {
    font-size: 4rem;
    color: var(--active-light);
    margin-bottom: 1.5rem;
}

.profile-empty-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--menu-bg-start);
    margin-bottom: 1rem;
}

.profile-empty-text {
    color: #6c757d;
    margin-bottom: 2rem;
}

.profile-btn-primary {
    background: linear-gradient(135deg, #1a2e1a, #2b4a2b);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    text-decoration: none;
    display: inline-block;
}

.profile-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

.profile-btn-primary i {
    margin-right: 0.5rem;
}

.btn-disabled {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #aaa;
    color: #fff;
    font-weight: bold;
    text-align: center;
    cursor: not-allowed;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-disabled:hover {
    background-color: #999; 
}

/* Адаптация для мобильных — сбрасываем фиксированное поведение */
@media (max-width: 767px) {
    .wrapper {
        flex-direction: column;
        height: auto; /* UPDATED: сброс высоты */
    }

    .sidebar {
        position: static; /* UPDATED: отключаем sticky */
        height: auto; /* UPDATED: сброс высоты */
        width: 100%;
        overflow-y: visible; /* UPDATED: возвращаем обычное поведение */
    }

    .main-content,
    .main-content.with-sidebar {
        height: auto; /* UPDATED: сброс высоты */
        overflow-y: visible; /* UPDATED: отключаем независимый скролл */
        min-height: auto;
        margin-left: 0;
        padding-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .key-header {
        flex-wrap: wrap;
    }
    .key-name-container {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    .key-name {
        max-width: 100%;
    }
    .key-actions {
        flex-wrap: wrap;
    }
}

/* Стили для раскрывающегося меню "Юридическая информация" */
.sidebar-section .dropdown-toggle {
    cursor: pointer;
    color: var(--menu-text);
    text-decoration: none;
    min-height: 2.75rem;
    padding: 0.72rem var(--sidebar-row-pad-x);
    display: grid;
    grid-template-columns: var(--sidebar-icon-rail) minmax(0, 1fr) auto;
    column-gap: var(--sidebar-icon-gap);
    align-items: center;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-section .dropdown-toggle:hover,
.sidebar-section .dropdown-toggle:focus {
    background: var(--menu-hover);
    color: var(--menu-text-hover);
    transform: none;
    outline: none;
}

.sidebar-section .dropdown-toggle i {
    width: auto;
    margin-right: 0;
    color: var(--menu-icon);
    text-align: center;
    justify-self: center;
}

.sidebar-section .dropdown-toggle::after {
    justify-self: center;
    margin-left: 0;
}

.sidebar-section .dropdown-toggle.active {
    color: var(--menu-text-hover);
    background: var(--active-light);
    box-shadow: inset 3px 0 0 var(--menu-accent-strong);
}

.sidebar-section .dropdown-toggle.active i,
.sidebar-section .dropdown-toggle:hover i,
.sidebar-section .dropdown-toggle:focus i {
    color: var(--menu-accent-strong);
}

.sidebar-section .collapse,
.sidebar-section .collapsing {
    padding: 0.35rem 0 0 calc(var(--sidebar-row-pad-x) + var(--sidebar-icon-rail) + var(--sidebar-icon-gap));
}

.sidebar-section .collapse a,
.sidebar-section .collapsing a {
    min-height: 2.35rem;
    padding: 0.55rem var(--sidebar-row-pad-x);
    display: grid;
    grid-template-columns: 1.15rem minmax(0, 1fr);
    column-gap: 0.5rem;
    align-items: center;
    border-radius: 8px;
    color: var(--menu-muted);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar-section .collapse a:hover,
.sidebar-section .collapse a:focus,
.sidebar-section .collapse a.active,
.sidebar-section .collapsing a:hover,
.sidebar-section .collapsing a:focus,
.sidebar-section .collapsing a.active {
    background: var(--menu-hover);
    color: var(--menu-text-hover);
    outline: none;
}

.sidebar-section .collapse a i,
.sidebar-section .collapsing a i {
    width: auto;
    margin-right: 0;
    color: var(--menu-icon);
    text-align: center;
    justify-self: center;
}

.sidebar-section .collapse a:hover i,
.sidebar-section .collapse a:focus i,
.sidebar-section .collapse a.active i,
.sidebar-section .collapsing a:hover i,
.sidebar-section .collapsing a:focus i,
.sidebar-section .collapsing a.active i {
    color: var(--menu-accent-strong);
}

/* Класс для кнопки "Назад" на странице приложений (стандартный Bootstrap) */
.btn-apps-back {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #6c757d;
    color: #6c757d;
    background: transparent;
}
.btn-apps-back:hover {
    background: #6c757d;
    color: #fff;
}

#temp-key-display {
    max-height: 300px;        /* Ограничиваем высоту */
    overflow-y: auto;          /* Включаем внутреннюю прокрутку */
    padding-right: 10px;       /* Немного отступа для скролла */
}

#temp-key-display code {
    word-break: break-all;     /* Перенос длинных ссылок */
    white-space: pre-wrap;     /* Сохраняем пробелы и переносим */
}

/* ===== Улучшения для страницы входа (компактный вид) ===== */

/* Убираем min-height и центрирование по вертикали */
.login-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* прижимаем карточку к верху */
    flex: 1;
    padding: 20px 0; /* небольшие отступы сверху и снизу */
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 2rem 1.5rem; /* уменьшенные отступы */
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.2);
    margin: 0 auto; /* центрирование по горизонтали */
}

/* Уменьшаем отступы внутри карточки */
.login-icon {
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.login-message {
    margin-bottom: 1.5rem;
}

.btn-login {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    max-width: 240px;
    margin: 0 auto;
}

.auth-link {
    margin-top: 1.5rem;
    padding: 0.75rem;
}

/* Делаем аккордеон компактнее */
#tempAccessAccordion {
    margin-top: 0.5rem;
}

.accordion-button {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.accordion-body {
    padding: 1rem;
}

/* Ограничиваем максимальную высоту блока с ключом и добавляем внутренний скролл */
#temp-key-display {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

#temp-key-display code {
    word-break: break-all;
    white-space: pre-wrap;
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.6rem;
    }

    .btn-login {
        max-width: 100%;
        padding: 0.5rem 1rem;
    }

    #temp-key-display {
        max-height: 200px;
    }

    .accordion-button {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .accordion-body {
        padding: 0.75rem;
    }

    #temp-key-display code {
        font-size: 0.8rem;
    }
}

/* Футер по умолчанию (без меню) */
footer {
    background-color: #ffffff;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    color: #173b2a;
}

/* Футер на страницах с боковым меню */
footer.with-sidebar {
    margin-left: 0;
    width: 100%;
    border-top: 1px solid rgba(44, 87, 64, 0.08);
}

/* На мобильных отключаем отступ */
@media (max-width: 767px) {
    footer.with-sidebar {
        margin-left: 0;
        width: 100%;
    }
}

body.layout-document-flow {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
}

body.layout-document-flow .wrapper {
    flex: 1 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
}

body.layout-document-flow .main-content,
body.layout-document-flow .main-content.with-sidebar {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

body.layout-document-flow .content {
    flex: 1 0 auto;
}

@media (min-width: 768px) {
    body.layout-document-flow .wrapper {
        display: block;
    }

    body.layout-document-flow .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
        height: 100vh;
        overflow-y: auto;
    }

    body.layout-document-flow .main-content.with-sidebar {
        width: calc(100% - var(--sidebar-width) + var(--sidebar-overlap));
        margin-left: calc(var(--sidebar-width) - var(--sidebar-overlap));
    }
}

/* Стили для страницы входа (в конец файла) */
.temp-key-code {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    display: inline-block;
    width: 100%;
    border-right: none;
}

.timer-badge {
    background-color: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.info-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.btn-copy {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.accordion-item.border-0 {
    border: none;
}

.accordion-button.bg-light {
    background-color: #f8f9fa;
    color: #212529;
}

.accordion-button.bg-light:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,0.125);
}

/* Отступ для стрелки аккордеона временного доступа */
#tempAccessAccordion .accordion-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#tempAccessAccordion .accordion-button .button-text {
    flex: 1; /* занимает всё доступное место */
    margin-right: 1rem; /* отступ между текстом и стрелкой */
    text-align: left;
}

/* Социальные иконки (квадратные кнопки) */
.social-icons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: auto;
    padding: 0.75rem var(--sidebar-row-pad-x) 0;
    border-top: 1px solid var(--menu-border);
}

.social-icons .icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 4.2rem;
    background: transparent;
    border-radius: 8px;
    color: var(--menu-text);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    gap: 0.3rem;
    padding: 0.35rem;
}

.social-icons .icon-link:hover,
.social-icons .icon-link:focus {
    background: var(--menu-hover);
    border-color: var(--menu-border);
    color: var(--menu-text-hover);
    transform: none;
    outline: none;
}

.social-icons .icon-link i {
    font-size: 1.35rem;
    line-height: 1;
    display: block;
    margin: 0;
    color: var(--menu-icon);
}

.social-icons .icon-link span {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    display: block;
    width: 100%;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.profile-stat-tile {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 237, 0.95));
    border: 1px solid rgba(76, 97, 66, 0.08);
    border-radius: 20px;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 25px rgba(37, 42, 26, 0.06);
}

.profile-stat-label {
    display: block;
    color: #6c757d;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.profile-stat-value {
    font-size: 1.8rem;
    color: var(--menu-bg-start);
    line-height: 1;
}

.profile-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.profile-tab-button-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.profile-panel-notice {
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #d74747;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(215, 71, 71, 0.24);
}

.profile-primary-action {
    margin-bottom: 1.5rem;
}

.profile-keys-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-radius: 26px;
    text-decoration: none;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, #17412c 0%, #24583a 52%, #2f7350 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 40px rgba(23, 65, 44, 0.22);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-keys-cta:hover,
.profile-keys-cta:focus {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(23, 65, 44, 0.28);
    border-color: rgba(255, 255, 255, 0.26);
}

.profile-keys-cta-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.profile-keys-cta-label {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(233, 244, 236, 0.78);
}

.profile-keys-cta-title {
    font-size: 1.35rem;
    line-height: 1.1;
}

.profile-keys-cta-text {
    color: rgba(244, 250, 245, 0.88);
    max-width: 36rem;
}

.profile-keys-cta-icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-container .btn-primary {
    background: linear-gradient(135deg, #24583a, #2f7350);
    border-color: #24583a;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(36, 88, 58, 0.18);
}

.profile-container .btn-primary:hover,
.profile-container .btn-primary:focus,
.profile-container .btn-primary:active {
    background: linear-gradient(135deg, #1e4a31, #285f43);
    border-color: #1e4a31;
    color: #ffffff;
}

.profile-container .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(36, 88, 58, 0.2);
    color: #24583a;
}

.profile-container .btn-outline-secondary:hover,
.profile-container .btn-outline-secondary:focus,
.profile-container .btn-outline-secondary:active {
    background: rgba(36, 88, 58, 0.08);
    border-color: rgba(36, 88, 58, 0.28);
    color: #1e4a31;
}

.profile-panel {
    display: none;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(76, 97, 66, 0.1);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.profile-panel.is-active {
    display: block;
}

.profile-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.profile-panel-description {
    color: #6c757d;
    margin: -0.35rem 0 0;
}

.profile-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-data-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(37, 42, 26, 0.05);
    border: 1px solid rgba(76, 97, 66, 0.07);
}

.promo-card.is-highlighted {
    background:
        radial-gradient(circle at top right, rgba(222, 244, 226, 0.9), transparent 34%),
        linear-gradient(180deg, rgba(248, 253, 248, 0.98), rgba(255, 255, 255, 0.98));
    border-color: rgba(58, 131, 76, 0.22);
    box-shadow: 0 12px 30px rgba(36, 92, 49, 0.09);
}

.profile-card-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--menu-bg-start);
}

.profile-card-subtitle {
    margin: 0.25rem 0 0;
    color: #6c757d;
}

.payment-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.profile-meta-item {
    background: rgba(245, 248, 242, 0.95);
    border-radius: 16px;
    padding: 0.85rem 1rem;
}

.profile-meta-item-wide {
    grid-column: 1 / -1;
}

.profile-meta-label {
    display: block;
    font-size: 0.82rem;
    color: #71806b;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-empty-state {
    text-align: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 245, 0.98));
    border: 1px dashed rgba(76, 97, 66, 0.2);
    border-radius: 24px;
    padding: 2rem 1.5rem;
}

.profile-empty-state-rich {
    text-align: left;
}

.profile-empty-state-icon {
    font-size: 2.2rem;
    color: var(--active-light);
    margin-bottom: 1rem;
}

.profile-alert-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.profile-alert {
    margin: 0;
    border-radius: 18px;
    border: none;
    box-shadow: 0 10px 24px rgba(37, 42, 26, 0.07);
}

.achievement-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.achievement-balance-card,
.achievement-redeem-card {
    height: 100%;
}

.achievement-balance-card {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 36%),
        linear-gradient(135deg, #173f2c 0%, #23573a 52%, #2f7350 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.achievement-balance-card .profile-meta-label,
.achievement-balance-card .profile-card-subtitle {
    color: rgba(232, 244, 236, 0.78);
}

.achievement-balance-card .profile-meta-item {
    background: rgba(255, 255, 255, 0.1);
}

.achievement-balance-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.achievement-balance-icon {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.13);
    color: #f3d56b;
    font-size: 1.3rem;
}

.achievement-balance-value {
    display: block;
    font-size: 1.75rem;
    line-height: 1.1;
}

.achievement-balance-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.achievement-balance-progress {
    margin-top: auto;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.achievement-balance-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.achievement-balance-progress-head strong {
    text-align: right;
}

.achievement-balance-progress-bar {
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
    margin-bottom: 0.7rem;
}

.achievement-balance-progress-fill {
    display: block;
    width: var(--achievement-progress-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f3d56b 0%, #f8e79a 100%);
    box-shadow: 0 0 18px rgba(243, 213, 107, 0.25);
}

.achievement-balance-progress-copy {
    margin: 0;
    color: rgba(241, 248, 243, 0.9);
}

.achievement-redeem-head {
    margin-bottom: 1rem;
}

.achievement-redeem-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.achievement-redeem-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.achievement-redeem-input {
    max-width: 9rem;
    min-height: 3rem;
    border-radius: 16px;
    border-color: rgba(36, 88, 58, 0.18);
}

.achievement-redeem-note {
    margin: 0;
    color: #6c757d;
}

.achievement-redeem-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.achievement-task-section {
    margin-bottom: 1rem;
    padding: 1.15rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(193, 225, 205, 0.18), transparent 28%),
        linear-gradient(160deg, rgba(246, 250, 244, 0.98), rgba(238, 245, 239, 0.96));
    border: 1px solid rgba(76, 97, 66, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.achievement-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.achievement-section-note {
    margin: 0.4rem 0 0;
    color: #5d6b5f;
    font-size: 0.92rem;
}

.achievement-section-count {
    flex-shrink: 0;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(36, 88, 58, 0.08);
    color: #24583a;
    font-weight: 700;
}

.achievement-grid-shell {
    max-height: 36rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
}

.achievement-category-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.achievement-category-block {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.achievement-category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.achievement-category-pill,
.achievement-category-summary {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(44, 87, 64, 0.08);
    border: 1px solid rgba(44, 87, 64, 0.12);
    color: var(--menu-bg-start);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.achievement-category-summary {
    background: rgba(198, 40, 40, 0.08);
    border-color: rgba(198, 40, 40, 0.14);
    color: #9b1f1f;
}

.achievement-category-pill-easy {
    background: rgba(44, 87, 64, 0.08);
    border-color: rgba(44, 87, 64, 0.12);
    color: var(--menu-bg-start);
}

.achievement-category-pill-medium {
    background: rgba(198, 113, 29, 0.1);
    border-color: rgba(198, 113, 29, 0.18);
    color: #a35312;
}

.achievement-category-pill-hard {
    background: rgba(172, 52, 52, 0.1);
    border-color: rgba(172, 52, 52, 0.18);
    color: #982e2e;
}

.achievement-category-pill-very_hard {
    background: rgba(87, 40, 124, 0.1);
    border-color: rgba(87, 40, 124, 0.18);
    color: #5d257f;
}

.achievement-category-pill-swifted {
    background: rgba(186, 132, 21, 0.12);
    border-color: rgba(186, 132, 21, 0.2);
    color: #8c6508;
}

.achievement-category-progress {
    margin: 0.55rem 0 0;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.achievement-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 242, 0.98));
    border: 1px solid rgba(76, 97, 66, 0.12);
    border-radius: 22px;
    padding: 0.95rem;
    box-shadow: 0 10px 24px rgba(37, 42, 26, 0.05);
}

.achievement-grid .profile-empty-state {
    grid-column: 1 / -1;
}

.achievement-card.is-completed {
    border-color: rgba(36, 88, 58, 0.18);
    background:
        radial-gradient(circle at top right, rgba(193, 225, 205, 0.32), transparent 34%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(236, 245, 238, 0.98));
}

.achievement-card.is-claimable {
    border-color: rgba(215, 71, 71, 0.2);
    background:
        radial-gradient(circle at top right, rgba(255, 224, 224, 0.38), transparent 36%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 244, 0.98));
    box-shadow: 0 16px 32px rgba(215, 71, 71, 0.08);
}

.achievement-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.achievement-card-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(36, 88, 58, 0.1);
    color: #24583a;
    font-size: 0.95rem;
}

.achievement-card .profile-card-title {
    font-size: 1rem;
}

.achievement-card .profile-card-subtitle {
    font-size: 0.92rem;
    line-height: 1.35;
}

.achievement-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.achievement-card-reward {
    color: #24583a;
}

.achievement-card-date {
    color: #6c757d;
    font-size: 0.92rem;
}

.achievement-claim-form {
    margin-top: 0.25rem;
}

.achievement-claim-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: none;
    border-radius: 16px;
    padding: 0.8rem 0.95rem;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 34%),
        linear-gradient(135deg, #c94545 0%, #d95c5c 100%);
    box-shadow: 0 12px 24px rgba(201, 69, 69, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.achievement-claim-button:hover,
.achievement-claim-button:focus {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 14px 28px rgba(201, 69, 69, 0.24);
}

.achievement-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.achievement-history-list-wide {
    gap: 0.75rem;
}

.achievement-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(245, 248, 242, 0.95);
    border: 1px solid rgba(76, 97, 66, 0.08);
}

.achievement-history-item-wide {
    align-items: flex-start;
}

.achievement-history-main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
}

.achievement-history-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

.achievement-history-icon.is-positive {
    background: rgba(29, 107, 65, 0.12);
    color: #1d6b41;
}

.achievement-history-icon.is-negative {
    background: rgba(140, 47, 47, 0.1);
    color: #8c2f2f;
}

.achievement-history-note {
    margin: 0.35rem 0 0;
    color: #5d6b5f;
}

.achievement-history-item code {
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    background: #ffffff;
    color: var(--menu-bg-start);
    font-size: 0.9rem;
}

.achievement-history-note code {
    padding: 0.2rem 0.45rem;
    font-size: 0.82rem;
}

.achievement-activity-card {
    margin-top: 0;
}

.profile-coin-amount {
    font-weight: 700;
    white-space: nowrap;
}

.profile-coin-amount.is-positive {
    color: #1d6b41;
}

.profile-coin-amount.is-negative {
    color: #8c2f2f;
}

.profile-empty-state-compact {
    padding: 1.4rem 1.25rem;
}

@media (max-width: 991px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .achievement-overview-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 767px) {
    .profile-keys-cta {
        align-items: flex-start;
        padding: 1.2rem 1.15rem;
    }

    .profile-keys-cta-title {
        font-size: 1.2rem;
    }

    .profile-keys-cta-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 16px;
    }

    .profile-panel-head,
    .payment-card-top {
        flex-direction: column;
    }

    .profile-meta-grid,
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-panel {
        padding: 1.15rem;
    }

    .achievement-balance-meta,
    .achievement-redeem-summary {
        grid-template-columns: 1fr;
    }

    .achievement-balance-progress-head {
        flex-direction: column;
    }

    .achievement-balance-progress-head strong {
        text-align: left;
    }

    .achievement-redeem-controls,
    .achievement-history-item {
        flex-direction: column;
        align-items: stretch;
    }

    .achievement-section-head,
    .achievement-history-main {
        flex-direction: column;
    }

    .achievement-category-head {
        flex-direction: column;
        align-items: stretch;
    }

    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .achievement-grid-shell {
        max-height: 28rem;
        padding-right: 0;
    }

    .achievement-redeem-input {
        max-width: none;
    }
}

.referral-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.referral-stats-grid .profile-stat-value {
    word-break: break-word;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 34%),
        linear-gradient(135deg, #173f2c 0%, #23573a 52%, #2f7350 100%);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(21, 55, 38, 0.16);
}

.dashboard-hero-compact {
    grid-template-columns: 1fr;
}

.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(239, 248, 242, 0.88);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-title {
    margin: 0.65rem 0 0.4rem;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.05;
}

.dashboard-subtitle {
    margin: 0;
    color: rgba(232, 244, 236, 0.82);
    max-width: 48rem;
}

.dashboard-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.dashboard-back-link:hover {
    color: #ffffff;
}

.dashboard-search-form {
    align-self: end;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-search-label {
    display: block;
    margin-bottom: 0.55rem;
    color: rgba(239, 248, 242, 0.88);
    font-size: 0.92rem;
}

.dashboard-search-controls {
    display: flex;
    gap: 0.75rem;
}

.dashboard-search-controls .form-control {
    min-width: 0;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-kpi-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-kpi-card {
    padding: 1.2rem 1.25rem;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(76, 97, 66, 0.08);
    box-shadow: 0 10px 26px rgba(37, 42, 26, 0.05);
}

.dashboard-kpi-card.is-accent {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 38%),
        linear-gradient(135deg, #204f36 0%, #2f7350 100%);
    color: #ffffff;
}

.dashboard-kpi-card.is-warning {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 38%),
        linear-gradient(135deg, #8e3333 0%, #c95b5b 100%);
    color: #ffffff;
}

.dashboard-kpi-label {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71806b;
}

.dashboard-kpi-card.is-accent .dashboard-kpi-label,
.dashboard-kpi-card.is-warning .dashboard-kpi-label,
.dashboard-kpi-card.is-accent .dashboard-kpi-hint,
.dashboard-kpi-card.is-warning .dashboard-kpi-hint {
    color: rgba(243, 247, 244, 0.82);
}

.dashboard-kpi-value {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.7rem;
    line-height: 1.08;
    color: var(--menu-bg-start);
}

.dashboard-kpi-card.is-accent .dashboard-kpi-value,
.dashboard-kpi-card.is-warning .dashboard-kpi-value {
    color: #ffffff;
}

.dashboard-kpi-hint {
    margin: 0.55rem 0 0;
    color: #6e7d70;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-trends-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-section {
    padding: 1.25rem;
    border-radius: 26px;
    background: #ffffff;
    border: 1px solid rgba(76, 97, 66, 0.08);
    box-shadow: 0 10px 26px rgba(37, 42, 26, 0.05);
}

.dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-section-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--menu-bg-start);
}

.dashboard-section-subtitle {
    margin: 0.25rem 0 0;
    color: #6c757d;
}

.dashboard-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dashboard-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(245, 248, 242, 0.95);
    border: 1px solid rgba(76, 97, 66, 0.08);
}

.dashboard-stat-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dashboard-stat-row span {
    color: #6f7e70;
}

.dashboard-attention-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.dashboard-attention-item,
.dashboard-inline-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(245, 248, 242, 0.95);
    border: 1px solid rgba(76, 97, 66, 0.08);
}

.dashboard-inline-card.is-highlighted,
.promo-card.is-highlighted {
    background:
        radial-gradient(circle at top right, rgba(222, 244, 226, 0.9), transparent 34%),
        linear-gradient(180deg, rgba(248, 253, 248, 0.98), rgba(255, 255, 255, 0.98));
    border-color: rgba(58, 131, 76, 0.22);
    box-shadow: 0 12px 30px rgba(36, 92, 49, 0.09);
}

.dashboard-trend-chart {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 0.6rem;
    align-items: end;
    min-height: 15rem;
}

.dashboard-trend-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.dashboard-trend-value,
.dashboard-trend-label {
    font-size: 0.75rem;
    color: #6f7e70;
    text-align: center;
}

.dashboard-trend-bar {
    position: relative;
    width: 100%;
    min-height: 8.5rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(241, 245, 239, 0.92), rgba(247, 249, 245, 0.98));
    overflow: hidden;
}

.dashboard-trend-bar span {
    width: calc(100% - 0.5rem);
    display: block;
    border-radius: 14px 14px 10px 10px;
    background: linear-gradient(180deg, #27543a 0%, #3f8a5f 100%);
}

.dashboard-user-grid,
.dashboard-inline-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-user-card {
    padding: 1.15rem;
    border-radius: 22px;
    background: rgba(248, 250, 247, 0.98);
    border: 1px solid rgba(76, 97, 66, 0.08);
}

.dashboard-user-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-user-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--menu-bg-start);
}

.dashboard-user-subtitle {
    margin: 0.25rem 0 0;
    color: #6f7e70;
}

.dashboard-user-meta,
.dashboard-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.dashboard-user-meta div,
.dashboard-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(76, 97, 66, 0.06);
}

.dashboard-user-meta span,
.dashboard-detail-item span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6f7e70;
}

.dashboard-detail-item-wide,
.dashboard-table-wide {
    grid-column: 1 / -1;
}

.dashboard-code-block {
    display: block;
    margin-top: 0.15rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    background: #f4f7f2;
    color: #204f36;
    white-space: pre-wrap;
    word-break: break-word;
}

.dashboard-table {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dashboard-table-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(245, 248, 242, 0.95);
    border: 1px solid rgba(76, 97, 66, 0.08);
}

.dashboard-table-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dashboard-table-row span {
    color: #6f7e70;
}

@media (max-width: 1199px) {
    .dashboard-kpi-grid,
    .dashboard-kpi-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero,
    .dashboard-grid,
    .dashboard-trends-grid,
    .dashboard-user-grid,
    .dashboard-inline-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .dashboard-search-controls,
    .dashboard-user-top,
    .dashboard-stat-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-kpi-grid,
    .dashboard-kpi-grid-compact,
    .dashboard-user-meta,
    .dashboard-detail-grid,
    .dashboard-attention-grid,
    .dashboard-table-row {
        grid-template-columns: 1fr;
    }

    .dashboard-trend-chart {
        gap: 0.35rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }

    .dashboard-trend-column {
        min-width: 2.8rem;
    }
}

.referral-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 220px));
    justify-content: center;
}

.referral-stat-code {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.referral-panel {
    display: block;
}

.referral-share-grid,
.referral-rewards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.referral-share-card,
.referral-reward-card,
.referral-relationship-card {
    height: 100%;
}

.referral-inviter-compact-card {
    padding: 1rem 1.15rem;
}

.referral-inviter-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.referral-inviter-compact-copy {
    min-width: 0;
}

.referral-inviter-compact-label {
    display: block;
    color: var(--menu-bg-start);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.referral-inviter-compact-name {
    display: block;
    color: var(--menu-bg-start);
    font-size: 1rem;
}

.referral-inline-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.referral-inline-tag {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(44, 87, 64, 0.08);
    border: 1px solid rgba(44, 87, 64, 0.12);
    color: var(--menu-bg-start);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}

.referral-inline-tag.is-success {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.18);
    color: #186744;
}

.referral-inline-tag.is-warning {
    background: rgba(255, 193, 7, 0.16);
    border-color: rgba(255, 193, 7, 0.22);
    color: #8a6a00;
}

.referral-inline-tag.is-muted {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.16);
    color: #596169;
}

.referral-reward-summary-card {
    display: grid;
    gap: 1rem;
}

.referral-reward-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.referral-tier-list {
    display: grid;
    gap: 0.75rem;
}

.referral-tier-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(242, 247, 237, 0.92), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(76, 97, 66, 0.12);
}

.referral-tier-term strong {
    color: var(--menu-bg-start);
    font-size: 1rem;
}

.referral-tier-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    color: #4e5b55;
}

.referral-tier-values strong {
    color: var(--menu-bg-start);
}

.referral-note-accent {
    color: var(--menu-bg-start);
}

.referral-share-card-full {
    grid-column: 1 / -1;
}

.referral-copy-box {
    margin: 0.75rem 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(242, 247, 237, 0.95), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(76, 97, 66, 0.12);
    word-break: break-all;
}

.referral-copy-box code {
    color: var(--menu-bg-start);
    font-size: 0.95rem;
}

.referral-copy-box-compact code {
    font-size: 1.15rem;
    letter-spacing: 0.08em;
}

.referral-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 991px) {
    .referral-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .referral-share-grid,
    .referral-rewards-grid {
        grid-template-columns: 1fr;
    }

    .referral-inviter-compact-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .referral-inline-tags {
        justify-content: flex-start;
    }

    .referral-reward-summary-head {
        flex-direction: column;
    }

    .referral-tier-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .referral-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Стили для блока продления на странице ключей ===== */
.renew-options {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(145deg, #f8faf8 0%, #f0f4ee 100%);
    border: 1px solid rgba(44, 87, 64, 0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 20px rgba(0,0,0,0.02);
    transition: all 0.2s ease-in-out;
}

.renew-options[style*="display: block"] {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.renew-options-inner {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tariff-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tariff-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(44, 87, 64, 0.25);
    border-radius: 16px;
    padding: 0.7rem;
    font-weight: 500;
    color: #2c5740;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.tariff-btn:hover {
    background: rgba(44, 87, 64, 0.05);
    border-color: #2c5740;
    transform: translateY(-1px);
}

.tariff-btn.selected {
    background: linear-gradient(135deg, #2c5740 0%, #1e4a31 100%);
    border-color: #1e4a31;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(44, 87, 64, 0.2);
}

.promo-field input {
    width: 100%;
    padding: 0.7rem;
    border-radius: 16px;
    border: 1px solid rgba(44, 87, 64, 0.25);
    background: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
    font-size: 0.95rem;
}

.promo-field input:focus {
    outline: none;
    border-color: #2c5740;
    box-shadow: 0 0 0 3px rgba(44, 87, 64, 0.1);
}

.renew-submit {
    background: linear-gradient(135deg, #2c5740 0%, #1e4a31 100%);
    border: none;
    border-radius: 16px;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.renew-submit:hover {
    background: linear-gradient(135deg, #1e4a31 0%, #143d28 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(44, 87, 64, 0.25);
}

.renew-submit:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* ===== Зелёные акценты в профиле ===== */
.achievement-redeem-summary .profile-meta-item strong,
.achievement-history-main strong,
.promo-card .profile-meta-item strong,
.payment-card .profile-meta-item strong,
.promo-card .profile-card-title,
.payment-card .profile-card-title {
    color: var(--menu-bg-start) !important;
}

.profile-inline-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.profile-inline-link:hover {
    color: var(--menu-bg-start);
}

.bot-control-actions {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bot-control-action-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.bot-control-action-card p {
    margin: 0;
    color: rgba(15, 23, 42, 0.72);
    font-size: 0.95rem;
}

.bot-control-action-card .btn {
    align-self: flex-start;
}

.bot-control-settings-form {
    display: grid;
    gap: 1rem;
}

.bot-control-settings-grid {
    display: grid;
    gap: 1rem;
}

.bot-control-toggle,
.bot-control-field {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.bot-control-toggle input {
    margin-top: 0.3rem;
}

.bot-control-toggle strong,
.bot-control-field span {
    display: block;
    color: #0f172a;
}

.bot-control-toggle small {
    display: block;
    margin-top: 0.35rem;
    color: rgba(15, 23, 42, 0.68);
}

.bot-control-field {
    flex-direction: column;
    gap: 0.65rem;
}

.bot-control-settings-footer {
    display: flex;
    justify-content: flex-start;
}

.bot-control-log-list {
    display: grid;
    gap: 0.85rem;
}

.bot-control-log-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.bot-control-log-item p {
    margin: 0.35rem 0 0;
    color: rgba(15, 23, 42, 0.68);
}

.bot-control-log-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    text-align: right;
}

.bot-control-log-meta code {
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .bot-control-log-item {
        flex-direction: column;
    }

    .bot-control-log-meta {
        align-items: flex-start;
        text-align: left;
    }
}

.referral-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 220px));
}

.referral-cashback-card {
    display: grid;
    gap: 1rem;
}

.referral-cashback-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.referral-cashback-value {
    display: block;
    color: var(--menu-bg-start);
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1;
    margin-top: 0.35rem;
}

.referral-cashback-tier-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.referral-cashback-tier {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(242, 247, 237, 0.92), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(76, 97, 66, 0.12);
}

.referral-cashback-tier strong {
    color: var(--menu-bg-start);
    font-size: 1.1rem;
}

@media (max-width: 991px) {
    .referral-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .referral-cashback-head {
        flex-direction: column;
    }

    .referral-cashback-tier-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .referral-stats-grid {
        grid-template-columns: 1fr;
    }

    .referral-cashback-tier-grid {
        grid-template-columns: 1fr;
    }
}

.referral-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.referral-card-title-row .profile-card-title {
    margin: 0;
}

.floating-promotion {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 3.75rem;
    height: 3.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    color: #ffffff;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(24, 35, 28, 0.24);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.floating-promotion:hover,
.floating-promotion:focus {
    color: #ffffff;
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 20px 42px rgba(24, 35, 28, 0.3);
}

.floating-promotion__icon {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #234f38 0%, #b79a4e 100%);
    font-size: 1.25rem;
    overflow: hidden;
}

.floating-promotion__wheel {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    border-radius: 50%;
    background:
        radial-gradient(circle, #ffffff 0 18%, transparent 19%),
        repeating-conic-gradient(
            from -18deg,
            #b95757 0deg 45deg,
            #b79a4e 45deg 90deg,
            #2f8f8a 90deg 135deg,
            #4f6f8f 135deg 180deg,
            #234f38 180deg 225deg,
            #d86842 225deg 270deg,
            #6b3fa0 270deg 315deg,
            #8f7530 315deg 360deg
        );
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62);
    animation: floating-promotion-spin 5s linear infinite;
}

.floating-promotion__wheel::before {
    content: "";
    position: absolute;
    inset: 0.28rem;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background:
        repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.48) 0deg 2deg, transparent 2deg 45deg);
}

.floating-promotion__wheel-center {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 0.82rem;
    height: 0.82rem;
    border: 2px solid rgba(255, 255, 255, 0.84);
    border-radius: 50%;
    background: #14331f;
    transform: translate(-50%, -50%);
}

.floating-promotion-wheel::before {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 50%;
    z-index: 2;
    width: 0;
    height: 0;
    border-right: 0.36rem solid transparent;
    border-left: 0.36rem solid transparent;
    border-top: 0.8rem solid #b95757;
    filter: drop-shadow(0 2px 3px rgba(24, 35, 28, 0.24));
    transform: translateX(-50%);
}

.floating-promotion-lottery {
    border-color: rgba(35, 79, 56, 0.2);
    background: #ffffff;
}

.floating-promotion-lottery .floating-promotion__icon {
    position: relative;
    overflow: visible;
    background: linear-gradient(135deg, #14331f 0%, #2f8f8a 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -0.35rem 0 rgba(24, 35, 28, 0.22);
}

.floating-promotion__gift {
    width: 2.42rem;
    height: 2.36rem;
    display: block;
    position: relative;
    filter:
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72))
        drop-shadow(0 0.35rem 0.36rem rgba(24, 35, 28, 0.28));
    animation: floating-promotion-gift-bounce 2.6s ease-in-out infinite;
}

.floating-promotion__gift::before {
    content: "";
    position: absolute;
    top: 0.52rem;
    left: 50%;
    z-index: 6;
    width: 0.38rem;
    height: 0.28rem;
    border-radius: 50%;
    background: #fff0a8;
    box-shadow: inset 0 0 0 1px rgba(24, 35, 28, 0.08);
    transform: translateX(-50%);
}

.floating-promotion__gift-box,
.floating-promotion__gift-lid,
.floating-promotion__gift-ribbon,
.floating-promotion__gift-bow {
    position: absolute;
    display: block;
}

.floating-promotion__gift-box {
    z-index: 1;
    left: 0.3rem;
    bottom: 0.12rem;
    width: 1.76rem;
    height: 1.14rem;
    border-radius: 0.22rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.25), transparent 42%),
        linear-gradient(135deg, #f05a57, #d83f57);
    box-shadow: inset 0 -0.26rem 0 rgba(24, 35, 28, 0.12);
}

.floating-promotion__gift-lid {
    z-index: 3;
    left: 0.18rem;
    top: 0.82rem;
    width: 2rem;
    height: 0.42rem;
    border-radius: 0.2rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), transparent 42%),
        linear-gradient(135deg, #ff866a, #e24d5c);
    box-shadow: 0 0.15rem 0 rgba(24, 35, 28, 0.12);
    transition: transform 0.2s ease;
}

.floating-promotion__gift-ribbon-vertical {
    z-index: 4;
    left: 50%;
    bottom: 0.12rem;
    width: 0.28rem;
    height: 1.52rem;
    border-radius: 0.12rem;
    background: #fff0a8;
    transform: translateX(-50%);
}

.floating-promotion__gift-ribbon-horizontal {
    z-index: 4;
    left: 0.3rem;
    top: 1.38rem;
    width: 1.76rem;
    height: 0.24rem;
    border-radius: 0.12rem;
    background: #fff0a8;
}

.floating-promotion__gift-bow {
    z-index: 5;
    top: 0.22rem;
    width: 0.64rem;
    height: 0.52rem;
    border: 0.18rem solid #fff0a8;
    background: transparent;
}

.floating-promotion__gift-bow-left {
    left: 0.55rem;
    border-radius: 0.6rem 0.38rem 0.38rem 0.6rem;
    transform: rotate(18deg);
}

.floating-promotion__gift-bow-right {
    right: 0.55rem;
    border-radius: 0.38rem 0.6rem 0.6rem 0.38rem;
    transform: rotate(-18deg);
}

.floating-promotion-lottery:hover .floating-promotion__gift-lid,
.floating-promotion-lottery:focus .floating-promotion__gift-lid {
    transform: translateY(-0.08rem) rotate(-2deg);
}

@keyframes floating-promotion-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes floating-promotion-gift-bounce {
    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-0.12rem) rotate(3deg);
    }
}

@media (max-width: 767px) {
    .floating-promotion {
        right: 0.85rem;
        bottom: 0.85rem;
        width: 3.35rem;
        height: 3.35rem;
    }

    .floating-promotion__icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.05rem;
    }
}
