/* ===== Base & Background ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #050505;
    --accent: #fcd34d;
    --accent-rgb: 252, 211, 77;
    --card: #121212;
    --card-alt: #1a1a1a;
    --border: rgba(255, 255, 255, 0.06);
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
}

* { box-sizing: border-box; }

html {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    color: #fff;
    margin: 0;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.background-layer { position: fixed; inset: 0; z-index: -2; }
.bg-gradient {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 199, 44, 0.22), transparent 50%),
        radial-gradient(circle at 80% 65%, rgba(218, 41, 28, 0.18), transparent 50%),
        #050505;
}
.grid-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(255, 199, 44, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 199, 44, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0;
    pointer-events: none;
}
.background-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
}
.bg-gradient {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 199, 44, 0.22), transparent 50%),
        radial-gradient(circle at 80% 65%, rgba(218, 41, 28, 0.18), transparent 50%),
        #050505;
}

/* ===== Liquid Glass ===== */
.liquid-glass {
    backdrop-filter: blur(2px) saturate(1.6) brightness(1.1) contrast(1.05);
    -webkit-backdrop-filter: blur(2px) saturate(1.6) brightness(1.1) contrast(1.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.liquid-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 45%, rgba(255, 199, 44, 0.14) 85%);
    opacity: 0.55;
    pointer-events: none;
    border-radius: inherit;
}
.liquid-glass:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        inset 0 0 12px rgba(255, 255, 255, 0.20),
        0 16px 45px rgba(255, 199, 44, 0.22);
}

/* ===== Sidebar ===== */
.sidebar {
    background: rgb(0, 0, 0);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    height: 100%;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: sticky;
    top: 0;
    align-self: stretch;
    -webkit-overflow-scrolling: touch;
}
.nav-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s ease;
    color: #a1a1aa;
    cursor: pointer;
}
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fcd34d;
    box-shadow: 0 0 0 1px rgba(252, 211, 77, 0.3);
}
.nav-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.sidebar-profile { width: 100%; padding: 0 6px; margin-bottom: 2.5rem !important; transform: translateY(18px); }
.sidebar-profile-inner {
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-avatar:hover {
    border-color: rgba(252, 211, 77, 0.5);
    transform: scale(1.05);
}
.sidebar-avatar .avatar-box {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px !important;
    border: none !important;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-name { display: none !important; }

/* ===== Common ===== */
.main-content { max-width: 980px; margin-left: auto; margin-right: auto; }
.balance {
    font-size: 2.45rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    white-space: nowrap;
    background: linear-gradient(to right, #ffffff 75%, rgba(255, 255, 255, 0.4) 88%, rgba(255, 255, 255, 0.05) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.pie-container { position: relative; width: 230px; height: 230px; }
.center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}
.plan-option { transition: all 0.3s ease; }
.price-amount { font-size: 1.75rem; line-height: 1; white-space: nowrap; }

/* ===== Profile / Settings ===== */
.profile-page { max-width: 520px; margin: 0 auto; padding-bottom: 40px; }
.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-top: 8px;
}
.profile-header img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.profile-header h1 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.profile-user-card {
    background: var(--card);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.profile-user-card img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-user-card .name { font-size: 1.1rem; font-weight: 600; line-height: 1.25; }
.profile-user-card .email { font-size: 0.85rem; color: var(--text-muted); }
.profile-user-card .email-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.profile-settings-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}
.profile-settings-btn:hover {
    color: var(--accent);
    background: rgba(252, 211, 77, 0.15);
    border-color: rgba(252, 211, 77, 0.3);
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}
.status-badge.premium,
.status-badge.plan-premium {
    background: rgba(83, 189, 235, 0.15);
    color: #53bdeb;
    border: 1px solid rgba(83, 189, 235, 0.35);
}
.status-badge.plan-base {
    background: rgba(252, 211, 77, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(252, 211, 77, 0.35);
}
.status-badge.plan-free {
    background: rgba(161, 161, 170, 0.12);
    color: #a1a1aa;
    border: 1px solid rgba(161, 161, 170, 0.28);
}
.profile-menu {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 14px;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: rgba(255, 255, 255, 0.04); }
.profile-menu-item .icon-wrap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4e4e7;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.profile-menu-item .label { flex: 1; font-size: 0.95rem; font-weight: 500; color: #f4f4f5; }
.profile-menu-item .badge { font-size: 0.8rem; font-weight: 500; margin-right: 8px; }
.profile-menu-item .badge.green { color: #4ade80; }
.profile-menu-item .chevron { color: var(--text-dim); font-size: 0.85rem; }
.profile-logout {
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #f87171;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.profile-logout:hover { background: rgba(248, 113, 113, 0.08); }

/* ===== Achievements ===== */
.achievements-board {
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}
.achievements-board h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.achievement-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.achievement-item:last-child { border-bottom: none; padding-bottom: 0; }
.achievement-item:first-child { padding-top: 0; }
.achievement-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.achievement-icon.done { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.achievement-icon.progress { background: rgba(252, 211, 77, 0.12); color: #fcd34d; }
.achievement-icon.locked { background: rgba(113, 113, 122, 0.15); color: #71717a; }
.achievement-info { flex: 1; min-width: 0; }
.achievement-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 2px; }
.achievement-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.progress-bar.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.progress-bar.yellow { background: linear-gradient(90deg, #eab308, #fcd34d); }
.progress-bar.gray { background: #52525b; }
.progress-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Wallet / Cards ===== */
.wallet-page { max-width: 480px; margin: 0 auto; padding-bottom: 40px; }
.wallet-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.card-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.card-item {
    background: var(--card-alt);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
}
.card-item:hover { background: #222; }
.card-brand {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.card-brand.visa { background: linear-gradient(135deg, #1a1f71, #2a3a9e); color: #fff; }
.card-brand.mc { background: linear-gradient(135deg, #eb001b, #f79e1b); color: #fff; font-size: 0.6rem; }
.card-info { flex: 1; min-width: 0; }
.card-number {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f4f4f5;
    letter-spacing: 0.03em;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.card-meta .primary-badge {
    background: rgba(252, 211, 77, 0.12);
    color: var(--accent);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
}
.card-menu {
    color: var(--text-dim);
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s;
}
.card-menu:hover { color: #e4e4e7; }

.wallet-balance-card {
    background: var(--card-alt);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.wallet-balance-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.wallet-balance-amount {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}
.wallet-topup-btn {
    background: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 22px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.wallet-topup-btn:hover { background: #fde68a; transform: scale(1.02); }
.wallet-topup-btn:active { transform: scale(0.98); }

.history-section { margin-bottom: 20px; }
.history-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e4e4e7;
}
.history-list {
    background: var(--card-alt);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.history-item:last-child { border-bottom: none; }
.history-amount { font-size: 0.95rem; font-weight: 600; color: #4ade80; }
.history-date { font-size: 0.85rem; color: var(--text-dim); }

.security-banner {
    background: var(--card-alt);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.security-banner .shield {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.security-banner .sec-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.security-banner .sec-text { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

/* ===== Particles animation ===== */
@keyframes rise {
    to {
        transform: translateY(-120vh);
        opacity: 0;
    }
}

/* ===== Utility ===== */
.glass-card { /* alias used in templates */ }

/* ========== AUTH ========== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 28px;
    /* same feel as dashboard glass blocks */
    background: rgba(12, 12, 14, 0.55);
}
.auth-card.liquid-glass:hover {
    transform: none;
}
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.auth-logo img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 24px;
}
.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.auth-tab.active {
    background: rgba(252, 211, 77, 0.15);
    color: var(--accent);
    box-shadow: 0 0 0 1px rgba(252, 211, 77, 0.25);
}
.auth-tab:hover:not(.active) {
    color: #e4e4e7;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #d4d4d8;
    margin-bottom: 6px;
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrap > i {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 0.9rem;
    pointer-events: none;
}
.input-wrap input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 13px 44px 13px 40px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap input::placeholder {
    color: #52525b;
}
.input-wrap input:focus {
    border-color: rgba(252, 211, 77, 0.5);
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.12);
}
.toggle-pass {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 0.95rem;
}
.toggle-pass:hover { color: #e4e4e7; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -4px;
}
.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #a1a1aa;
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: #fcd34d;
    cursor: pointer;
}
.auth-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: center;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #fcd34d;
    color: #000;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 20px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    margin-top: 4px;
}
.auth-submit:hover {
    background: #fde68a;
    transform: translateY(-1px);
}
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.auth-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #52525b;
    margin: 20px 0 0;
    line-height: 1.5;
}
.auth-hint code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 0.72rem;
}

body.auth-mode .app-shell {
    display: none !important;
}
body.auth-mode {
    overflow: auto;
    height: auto;
    min-height: 100%;
    max-height: none;
}
#auth-root {
    display: none;
    position: relative;
    z-index: 20;
}
body.auth-mode #auth-root {
    display: block;
}

/* support read receipts */
.msg-checks { color: #71717a; font-size: 0.7rem; margin-left: 4px; letter-spacing: -1px; }
.msg-checks.read { color: #38bdf8; }
.msg-checks i { font-size: 0.65rem; }
.typing-dots { color: #a1a1aa; font-size: 0.75rem; }
.typing-dots span { animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.2} 40%{opacity:1} }




.auth-site-footer {
    text-align: center;
    font-size: 0.72rem;
    color: #52525b;
    margin: 18px 0 0;
    letter-spacing: 0.02em;
}
.auth-site-footer em {
    font-style: italic;
    color: #52525b;
}


/* App shell — mobile scroll + safe areas */
.app-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden !important;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
}
.app-main-scroll {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.app-site-footer {
    flex-shrink: 0 !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #71717a;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-align: center;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}
.app-site-footer-brand { color: #a1a1aa; font-weight: 600; }
.app-site-footer-copy { color: #71717a; }
.app-site-footer-slogan { color: #52525b; font-style: italic; }
.app-site-footer-slogan::before {
    content: "·";
    margin-right: 10px;
    font-style: normal;
    color: #3f3f46;
}
body.auth-mode .app-site-footer { display: none; }
@media (max-width: 768px) {
    #main-content-area {
        padding-bottom: 32px !important;
    }
    .app-site-footer {
        padding-top: 20px !important;
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)) !important;
        flex-direction: column;
        gap: 4px;
    }
    .app-site-footer-slogan::before { display: none; }
}


/* —— Admin panel —— */
.adm-tabs {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #a1a1aa;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  touch-action: manipulation;
}
.adm-tab:hover { color: #fff; border-color: rgba(255,255,255,0.18); }
.adm-tab.active {
  background: rgba(252,211,77,0.15);
  color: #fcd34d;
  border-color: rgba(252,211,77,0.35);
  font-weight: 600;
}
.adm-card {
  border: 1px solid rgba(255,255,255,0.08);
}
.adm-card .adm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.adm-btn-sec, .adm-btn-ghost, .adm-btn-danger, .adm-control {
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.2;
  touch-action: manipulation;
  min-height: 34px;
}
.adm-btn-sec {
  background: rgba(255,255,255,0.08);
  color: #e4e4e7;
  border: 1px solid rgba(255,255,255,0.1);
}
.adm-btn-sec:hover { background: rgba(255,255,255,0.12); }
.adm-btn-ghost {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid rgba(255,255,255,0.1);
}
.adm-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.adm-btn-danger {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.25);
}
.adm-btn-danger:hover { background: rgba(239,68,68,0.25); }
.adm-control {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #fff;
  max-width: 100%;
}
@media (max-width: 640px) {
  .adm-tabs { gap: 6px; }
  .adm-tab { padding: 8px 11px; font-size: 12px; }
  .adm-card { padding: 14px !important; }
  .adm-actions { width: 100%; }
  .adm-actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
}


/* Guide button next to profile */
.sidebar-profile-inner {
    gap: 10px;
}
.sidebar-guide-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a1a1aa;
    font-size: 1.25rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.12);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.sidebar-guide-btn:hover {
    color: #fcd34d;
    border-color: rgba(252,211,77,0.5);
    background: rgba(252,211,77,0.12);
    transform: scale(1.05);
}

/* Guide page */
.guide-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.guide-tab {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a1a1aa;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s;
}
.guide-tab.active {
    color: #000;
    background: #fcd34d;
    border-color: #fcd34d;
}
.plat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #d4d4d8;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s;
}
.plat-pill.active {
    color: #fcd34d;
    border-color: rgba(252,211,77,0.4);
    background: rgba(252,211,77,0.1);
}
.app-card {
    display: block;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.app-card:hover {
    border-color: rgba(252,211,77,0.35);
    background: rgba(252,211,77,0.06);
}
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq[open] summary i { transform: rotate(180deg); }
.guide-faq summary i { transition: transform 0.2s; }


/* —— Sidebar never moves with content scroll —— */
body:not(.auth-mode) {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
}
body:not(.auth-mode) .app-shell {
    overflow: hidden !important;
}
body:not(.auth-mode) .sidebar {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    height: 100% !important;
    max-height: 100dvh !important;
}
body:not(.auth-mode) .app-main-scroll {
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

/* —— Subscription freeze —— */
.sub-frozen {
    border-color: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 0 28px rgba(56, 189, 248, 0.12);
    animation: freezeGlow 2.4s ease-in-out infinite;
}
@keyframes freezeGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 0 18px rgba(56, 189, 248, 0.08); }
    50% { box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 0 32px rgba(56, 189, 248, 0.2); }
}
.freeze-pill-pulse {
    animation: freezePill 1.6s ease-in-out infinite;
}
@keyframes freezePill {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.freeze-box {
    border-radius: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(14, 165, 233, 0.06));
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.freeze-box.muted {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}
.freeze-box-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7dd3fc;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.freeze-box.muted .freeze-box-title { color: #a1a1aa; }
.freeze-box-text {
    font-size: 0.7rem;
    color: #a1a1aa;
    line-height: 1.4;
    margin: 0 0 10px;
}
.freeze-btn-freeze, .freeze-btn-unfreeze {
    width: 100%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.freeze-btn-freeze {
    background: rgba(255,255,255,0.08);
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,0.12);
}
.freeze-btn-unfreeze {
    background: #38bdf8;
    color: #0c4a6e;
}

.sup-quick-chip {
    font-size: 0.68rem;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #d4d4d8;
    cursor: pointer;
    transition: all 0.15s;
}
.sup-quick-chip:hover {
    border-color: rgba(252,211,77,0.4);
    color: #fcd34d;
    background: rgba(252,211,77,0.08);
}


/* Recommended app card (HAPP) */
.app-card-recommended {
    position: relative;
    border: 1px solid rgba(252,211,77,0.55) !important;
    background: linear-gradient(145deg, rgba(252,211,77,0.14), rgba(255,255,255,0.04) 55%) !important;
    box-shadow: 0 0 0 1px rgba(252,211,77,0.2), 0 8px 28px rgba(252,211,77,0.12);
}
.app-card-recommended:hover {
    border-color: rgba(252,211,77,0.85) !important;
    background: linear-gradient(145deg, rgba(252,211,77,0.2), rgba(255,255,255,0.05) 55%) !important;
    box-shadow: 0 0 0 1px rgba(252,211,77,0.35), 0 12px 36px rgba(252,211,77,0.2);
}
.app-rec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
    background: linear-gradient(90deg, #fde68a, #fcd34d, #fbbf24);
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(252,211,77,0.45);
    animation: recBadgePulse 2s ease-in-out infinite;
}
@keyframes recBadgePulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(252,211,77,0.4); transform: scale(1); }
    50% { box-shadow: 0 2px 16px rgba(252,211,77,0.7); transform: scale(1.04); }
}


/* ===== Telegram Mini App layout fixes ===== */
body.tg-webapp {
  --tg-safe-top: env(safe-area-inset-top, 0px);
  --tg-safe-bottom: env(safe-area-inset-bottom, 0px);
  --tg-extra-top: 8px;
  overflow-x: hidden;
  min-height: 100dvh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
}
body.tg-webapp .app-shell {
  min-height: 100dvh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  align-items: stretch;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  padding-top: 0 !important;
  box-sizing: border-box;
}
body.tg-webapp .sidebar {
  position: sticky !important;
  top: 0 !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 100dvh !important;
  min-height: var(--tg-viewport-stable-height, 100dvh) !important;
  width: 4rem !important;
  max-width: 4rem !important;
  flex-shrink: 0 !important;
  transform: none !important;
  padding-top: 10px !important;
  padding-bottom: calc(10px + var(--tg-safe-bottom)) !important;
  margin: 0 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 20;
}
body.tg-webapp .sidebar-profile {
  transform: none !important;
  margin-bottom: 0.35rem !important;
  padding-bottom: 0 !important;
}
/* Main scroll + content: compact top */
body.tg-webapp .app-main-scroll {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden;
  padding-top: calc(var(--tg-safe-top) + var(--tg-extra-top)) !important;
  box-sizing: border-box;
}
body.tg-webapp #main-content-area {
  padding: 8px 12px calc(12px + var(--tg-safe-bottom)) 12px !important;
}
body.tg-webapp #page-content,
body.tg-webapp #main-content-area > * {
  max-width: 100%;
}
/* Tighter blocks on all pages */
body.tg-webapp #main-content-area > .mb-6,
body.tg-webapp #main-content-area .mb-6 {
  margin-bottom: 0.85rem !important;
}
body.tg-webapp #main-content-area > .mb-8,
body.tg-webapp #main-content-area .mb-8 {
  margin-bottom: 1rem !important;
}
body.tg-webapp #main-content-area h1 {
  font-size: 1.25rem !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}
body.tg-webapp #main-content-area h1 + p {
  margin-top: 0.15rem !important;
  margin-bottom: 0 !important;
  font-size: 0.8rem !important;
}
body.tg-webapp .glass-card {
  max-width: 100%;
  padding: 0.9rem 1rem !important;
  margin-bottom: 0.75rem !important;
  border-radius: 1.1rem !important;
}
body.tg-webapp .glass-card.rounded-3xl {
  border-radius: 1.1rem !important;
}
body.tg-webapp .balance,
body.tg-webapp #balance,
body.tg-webapp [data-live-balance] {
  font-size: 1.35rem !important;
  line-height: 1.2 !important;
}
/* History */
body.tg-webapp .history-page h1,
body.tg-webapp #main-content-area .text-2xl {
  font-size: 1.2rem !important;
}
/* Profile ("Я") */
body.tg-webapp .profile-page {
  max-width: 100%;
  padding-top: 0 !important;
}
body.tg-webapp .profile-header {
  margin-bottom: 0.65rem !important;
  padding-top: 0 !important;
}
body.tg-webapp .profile-header h1 {
  font-size: 1.2rem !important;
}
body.tg-webapp .profile-user-card {
  padding: 0.85rem !important;
  margin-bottom: 0.75rem !important;
  border-radius: 1.1rem !important;
}
body.tg-webapp .profile-menu-item {
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
}
body.tg-webapp .achievements-board {
  margin-top: 0.5rem !important;
}
