/* ============================================
   Quotex Coin — Professional UI Polish
   ============================================ */

:root {
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
    --shadow-accent: 0 2px 10px rgba(0, 0, 0, 0.08);
    --glass: rgba(255, 255, 255, 0.94);
    --glass-border: rgba(0, 0, 0, 0.06);
}

.trading-app {
    background: var(--bg-app);
    box-shadow: none;
}

.app-header {
    padding: 10px 14px;
    padding-top: calc(10px + var(--safe-top));
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.live-dot-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-balance {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 12px;
    min-width: 96px;
    box-shadow: var(--shadow-sm);
}

.bal-label {
    font-size: 8px;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.bal-amount {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 38px;
    height: 38px;
}

.icon-btn:active {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--accent-light);
}

.asset-strip {
    padding: 10px 14px;
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.asset-tab {
    padding: 8px 14px;
    font-weight: 700;
    background: var(--bg-card);
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.asset-tab.active {
    background: var(--bg-panel);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chart-toolbar-asset {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.chart-feed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.chart-zone {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.price-overlay {
    top: 12px;
    left: 14px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.live-price {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-shadow: none;
}

.trade-panel {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 14px 8px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.panel-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.amount-display input {
    font-size: 22px;
    padding: 12px;
    padding-left: 28px;
    border-radius: 12px;
}

.amount-display input:focus {
    border-color: #a8a29e;
    box-shadow: none;
}

.amt-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-input);
}

.qk {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    background: var(--bg-input);
}

.qk.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--text-primary);
}

.payout-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 6px;
    margin-bottom: 8px;
}

.trade-btn-up,
.trade-btn-down {
    padding: 16px;
    border-radius: 14px;
    font-size: 15px;
    letter-spacing: 1px;
}

.trade-btn-up {
    box-shadow: 0 6px 20px var(--green-glow);
}

.trade-btn-down {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff;
    box-shadow: 0 6px 20px var(--red-glow);
}

.bottom-nav {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

.chat-btn .notification-badge {
    display: none !important;
}

.wallet-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.wallet-btn.deposit {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
}

.panel-section {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.profile-stat-card {
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.empty-state .empty-icon {
    font-size: 0;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--bg-input);
    border-radius: 50%;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state .empty-icon::after {
    content: '—';
    font-size: 20px;
    color: var(--text-dim);
}

.history-drawer,
.menu-drawer {
    box-shadow: var(--shadow-lg);
}

.toast {
    border-radius: 12px;
    backdrop-filter: blur(12px);
    font-weight: 600;
    font-size: 13px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.1);
}

.btn-primary {
    border-radius: 12px;
    font-weight: 700;
}

.landing-page {
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--glass-border);
}

.nav-brand .brand-name {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.btn-nav-primary {
    color: #fff !important;
    font-weight: 700;
}

.trust-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.trust-pill svg {
    color: var(--accent-light);
}

.feature-card-lg {
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.feature-card-lg h3 {
    color: var(--text-primary);
}

.feature-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0;
    background: var(--accent-bg);
    border: 1px solid rgba(15, 118, 110, 0.2);
    position: relative;
}

.feature-icon-lg::before {
    content: '';
    position: absolute;
    inset: 12px;
    background: var(--accent-light);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.feature-icon-lg.ico-chart::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'/%3E%3C/svg%3E");
}

.feature-icon-lg.ico-bolt::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 10V3L4 14h7v7l9-11h-7z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 10V3L4 14h7v7l9-11h-7z'/%3E%3C/svg%3E");
}

.feature-icon-lg.ico-shield::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z'/%3E%3C/svg%3E");
}

.feature-icon-lg.ico-wallet::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z'/%3E%3C/svg%3E");
}

.chart-preview-card {
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.site-footer {
    background: var(--bg-panel);
}

/* === Profile Page (Trader) === */
#page-profile.page-content.active {
    padding: 16px 16px 100px;
    overflow-y: auto;
}

.profile-email {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.profile-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(37, 99, 235, 0.35);
}

.profile-role-badge.sm {
    font-size: 9px;
    padding: 3px 8px;
}

.profile-role-badge.admin {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.35);
}

.profile-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-status-badge.verified {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.profile-status-badge.pending {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.profile-status-badge.suspended {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.profile-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.profile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.profile-info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
}

.profile-info-value.accent {
    color: var(--accent-light);
}

.profile-info-value.green {
    color: var(--green);
}

.profile-stats-4 {
    grid-template-columns: repeat(2, 1fr);
}

.profile-stat-value.green {
    color: var(--green);
}

.profile-stat-value.red {
    color: var(--red);
}

.invitation-code-block {
    margin-bottom: 16px;
}

.invitation-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.invitation-code {
    flex: 1;
    display: block;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent-light);
    text-align: center;
}

.profile-copy-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.profile-copy-btn:active {
    transform: scale(0.97);
}

.profile-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 10px 0 0;
    line-height: 1.45;
}

.profile-empty-note {
    padding: 12px;
    background: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 14px;
}

.profile-empty-note p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 6px 0 0;
    line-height: 1.45;
}

.inviter-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 12px;
}

.inviter-card.platform-admin-card {
    border-color: rgba(168, 85, 247, 0.25);
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.08), var(--bg-input));
}

.inviter-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.inviter-avatar.admin {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    font-size: 13px;
}

.inviter-details {
    flex: 1;
    min-width: 0;
}

.inviter-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-white);
    margin: 4px 0 6px;
}

.inviter-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.inviter-meta.muted {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.profile-logout-btn {
    display: block;
    padding: 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    text-decoration: none;
    color: var(--red);
    font-weight: 700;
    text-align: center;
    font-size: 14px;
}

/* === Deposit / Withdraw Modal === */
.deposit-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.deposit-modal.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.deposit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
}

.deposit-modal-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.deposit-modal.open .deposit-modal-panel {
    transform: translateY(0);
}

.deposit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.deposit-modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-white);
    margin: 0;
}

.deposit-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.deposit-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.deposit-modal-footer {
    padding: 12px 18px 20px;
    border-top: 1px solid var(--border);
}

.deposit-ok-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.deposit-ok-btn:active {
    transform: scale(0.98);
}

.deposit-loading,
.deposit-info-text,
.deposit-instructions {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.deposit-instructions {
    padding: 12px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    margin-bottom: 14px;
    color: var(--accent-light);
    font-size: 13px;
}

.deposit-wallet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deposit-wallet-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.dw-type {
    font-size: 16px;
    font-weight: 800;
    color: var(--green);
}

.dw-type-sub {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.dw-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 13px;
}

.dw-row span {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    min-width: 52px;
}

.dw-row strong {
    color: var(--text-white);
    font-weight: 700;
    flex: 1;
}

.dw-copy {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--accent-light);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.dw-extra {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.45;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.wallet-deposit-section .wallet-deposit-body {
    padding: 0 4px;
}

.deposit-file-input {
    padding: 8px;
    font-size: 13px;
}

.deposit-request-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.deposit-request-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-white);
    margin: 0 0 8px;
}

.deposit-wallet-submit {
    margin-top: 12px;
}

.wallet-deposit-section .deposit-wallet-submit {
    width: 100%;
}

/* === Withdraw form === */
.withdraw-balance-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 14px;
}

.withdraw-balance-hint strong {
    color: var(--accent-light);
    font-weight: 800;
}

.withdraw-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.withdraw-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 8px;
}

.withdraw-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.withdraw-textarea {
    resize: vertical;
    min-height: 64px;
}

.withdraw-form-error {
    color: var(--red);
    font-size: 13px;
    margin: 8px 0 0;
    font-weight: 600;
}

.withdraw-modal-footer {
    display: flex;
    gap: 10px;
}

.withdraw-modal-footer .deposit-ok-btn {
    width: auto;
    flex: 1;
}

.withdraw-cancel-btn {
    background: var(--bg-input) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}

.bottom-nav .nav-item span {
    font-size: 9px;
}

/* === App Home page === */
#page-home.page-content.active {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 100px;
}

.app-home {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-home-hero {
    padding: 4px 0 8px;
}

.app-home-greeting {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 4px;
}

.app-home-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.app-home-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.app-home-balance-card {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.25);
}

.app-home-balance-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.app-home-balance-value {
    display: block;
    font-size: 32px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 6px;
}

.app-home-balance-hint {
    font-size: 11px;
    opacity: 0.8;
}

.app-home-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.app-home-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.app-home-stat-val {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.app-home-stat-val.green { color: var(--green); }
.app-home-stat-val.red { color: var(--red); }

.app-home-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-home-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.app-home-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.app-home-action svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: var(--accent-light);
}

.app-home-action.primary {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border-color: #99f6e4;
    color: #0f766e;
}

.app-home-action.primary svg {
    stroke: #0f766e;
}

.app-home-action:active {
    transform: scale(0.98);
}

.app-home-section-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.app-home-markets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-home-market {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    text-align: left;
}

.app-home-market-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.app-home-market-payout {
    font-size: 12px;
    font-weight: 600;
    color: #0f766e;
    background: #f0fdfa;
    padding: 4px 10px;
    border-radius: 999px;
}

.app-home-vip-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.app-home-vip-note.is-active {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.app-home-vip-note.is-off {
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    color: #a8a29e;
}

/* === My Trades page === */
#page-history.page-content.active {
    padding: 16px 16px 100px;
    overflow-y: auto;
}

.history-page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 4px;
}

.history-page-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.history-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.history-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.history-summary-card.win .hsc-value { color: var(--green); }
.history-summary-card.lose .hsc-value { color: var(--red); }

.hsc-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
}

.hsc-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.history-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 0;
    overflow: hidden;
}

.history-row-page {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.history-row-page:last-child {
    border-bottom: none;
}

.history-go-trade-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* === VIP badge & crown === */
.header-vip-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    vertical-align: middle;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.header-vip-tag.is-active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.header-vip-tag.is-off {
    background: #f5f5f4;
    color: #a8a29e;
    border: 1px solid #e7e5e4;
    box-shadow: none;
}

.profile-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    flex-shrink: 0;
}

.profile-avatar-large.is-vip {
    box-shadow: 0 0 0 3px #fbbf24, 0 4px 16px rgba(245, 158, 11, 0.25);
}

.profile-avatar-crown {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.profile-avatar-crown-icon {
    width: 17px;
    height: 17px;
    display: block;
}

.profile-avatar-crown.is-active {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.45);
}

.profile-avatar-crown.is-off {
    background: #f5f5f4;
    color: #d6d3d1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.profile-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.profile-vip-badge.is-active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.profile-vip-badge.is-off {
    background: #f5f5f4;
    color: #a8a29e;
    border: 1px solid #e7e5e4;
    box-shadow: none;
}

.profile-vip-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.profile-vip-inline.is-active {
    color: #d97706;
}

.profile-vip-inline.is-off {
    color: #a8a29e;
}

.profile-info-value.vip-active {
    color: #d97706;
}

.profile-info-value.vip-off {
    color: #a8a29e;
}

.profile-vip-card.is-active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
    border-color: rgba(245, 158, 11, 0.35);
}

.profile-vip-card.is-off {
    background: #fafaf9;
    border-color: #e7e5e4;
}

.profile-vip-banner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-vip-crown {
    line-height: 1;
    flex-shrink: 0;
}

.profile-vip-crown.is-active {
    color: #f59e0b;
}

.profile-vip-crown.is-off {
    color: #d6d3d1;
}

.profile-vip-banner strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-vip-banner p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* === VIP hover / tap tooltips === */
.vip-tip {
    cursor: help;
    -webkit-tap-highlight-color: transparent;
}

.vip-tip:not(.profile-avatar-crown) {
    position: relative;
}

.profile-avatar-crown.vip-tip {
    position: absolute;
    right: -2px;
    bottom: 2px;
}

.vip-tip::before {
    content: '';
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 200;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.vip-tip::after {
    content: attr(data-vip-tip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 260px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    color: #fff;
    background: #334155;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 201;
    white-space: normal;
}

.vip-tip-bottom::before {
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #334155;
}

.vip-tip-bottom::after {
    top: calc(100% + 8px);
}

.vip-tip-top::before {
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #334155;
}

.vip-tip-top::after {
    bottom: calc(100% + 8px);
}

.vip-tip:hover::before,
.vip-tip:hover::after,
.vip-tip:focus::before,
.vip-tip:focus::after,
.vip-tip.vip-tip-show::before,
.vip-tip.vip-tip-show::after {
    opacity: 1;
    visibility: visible;
}

.header-vip-tag.vip-tip::after {
    min-width: 180px;
    font-size: 10px;
}

.profile-vip-inline.vip-tip::after {
    min-width: 220px;
}

/* === Theme toggle === */
.theme-toggle-row {
    display: flex;
    gap: 10px;
}

.theme-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.theme-toggle-btn.active {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent-light);
}

.theme-toggle-btn:active {
    transform: scale(0.98);
}
