#editAppModal .modal-tab-content[data-tab-content="history"] .app-modal-body {
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #f3f4f6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #ffffff;
    --bg-gray: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(12px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: #f0f4f8;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

html.login-page-html,
html.login-page-html body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: #f0f4f8;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

body.login-page-body {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body.success-open {
    overflow: hidden;
}

/* Crypto icons */
.crypto-icon {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 50%;
    background: transparent;
}

/* ===== LOGIN LAYOUT (ensure full-height on mobile) ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-consent,
.consent-note {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-simple {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Mobile menu toggle (hamburger) */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.menu-toggle .menu-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle.open .menu-bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}
.menu-toggle.open .menu-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open .menu-bar:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-danger {
    background: white;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--secondary);
    color: var(--text-primary);
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 120px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-badge svg {
    color: #fbbf24;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-features {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.hero-feature:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.hero-feature svg {
    color: #fbbf24;
    flex-shrink: 0;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-buttons .btn-large {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-stats {
    display: flex;
    gap: 64px;
    justify-content: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== PRIVACY BANNER ===== */
.privacy-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 48px 0;
    color: white;
}

.privacy-content {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.privacy-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.privacy-icon svg {
    color: white;
}

.privacy-text h3 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 700;
}

.privacy-text p {
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.6;
}

/* ===== SECTIONS ===== */
.features, .networks, .cta {
    padding: 100px 0;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 64px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header .section-title {
    margin-bottom: 12px;
}

.section-header .section-subtitle {
    margin-bottom: 0;
}

/* ===== FEATURES ===== */
.features {
    background: var(--bg-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg);
    padding: 32px;
    border-radius: 16px;
    border: 2px solid var(--border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card.featured {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: var(--primary);
}

.feature-card.featured::before {
    opacity: 1;
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon-wrapper svg {
    color: white;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== NETWORKS ===== */
.networks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 48px;
}

.network-badge {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    height: 56px;
    box-sizing: border-box;
}

.network-badge-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.network-badge span {
    white-space: nowrap;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.network-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== CTA ===== */
.cta {
    background: var(--primary);
    color: white;
}

/* Pricing card - minimal, high-contrast on CTA */
.cta .pricing-card {
    background: var(--bg);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 24px;
    margin: 16px auto 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-width: 720px;
    text-align: center;
}

.cta .pricing-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 12px;
}

.cta .price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bg-gray);
    min-width: 160px;
}

.cta .price-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    white-space: nowrap;
}

.cta .price-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cta .price-plus {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.cta .pricing-note {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

@media (max-width: 599px) {
    .cta .pricing-card {
        padding: 20px;
        margin-top: 12px;
    }
    .cta .pricing-row {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .cta .price-item {
        min-width: 0;
        padding: 8px 10px;
        flex: 1 1 0;
    }
    .cta .price-value {
        font-size: 22px;
    }
}

.cta-content {
    text-align: center;
}

.cta h2 {
    font-size: 40px;
    margin-bottom: 16px;
}

.cta p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-gray);
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.footer-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.footer-text p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f0f4f8;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    overflow: hidden;
    min-height: 0;
}

.login-box {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 24px;
    box-shadow: 
        0 20px 60px -15px rgba(31, 38, 135, 0.08),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-width: 460px;
    width: 100%;
    position: relative;
    overflow: visible;
    animation: fadeInUp 0.6s ease-out;
    margin: auto;
    flex-shrink: 0;
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.login-box h1 {
    font-size: 32px;
    margin-bottom: 6px;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 28px;
    font-size: 15px;
    font-weight: 500;
}

/* ===== AUTH BUTTONS ===== */
.auth-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-button {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-button svg,
.auth-button img {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.auth-button span {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ===== DIVIDER ===== */
.divider {
    text-align: center;
    position: relative;
    margin: 16px 0;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
}

.divider span {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    padding: 0 20px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1e293b;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    color: #64748b;
    font-size: 14px;
    padding-bottom: 0;
}

.link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
}

.link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    transition: width 0.3s ease;
}

.link:hover {
    color: #2563eb;
}

.link:hover::after {
    width: 100%;
}

.login-consent {
    margin-top: 12px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.login-consent .link {
    font-weight: 600;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 20px rgba(0,0,0,0.01);
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.sidebar-header .logo img {
    height: 36px;
    width: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.nav-item:hover {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.3);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.3);
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

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

.user-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    background: var(--bg-gray);
    padding: 40px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 32px;
    margin-bottom: 4px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== APPS GRID ===== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.app-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 
        0 4px 20px rgba(31, 38, 135, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
    border-color: white;
}

/* ===== PAYMENT HISTORY ===== */
.payment-history-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 2px solid var(--border);
}

.payment-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    text-align: left;
}

.payment-history-section .section-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

/* Payment history in modal */
.modal-tab-content .payment-history-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.modal-tab-content .payment-history-section .section-header {
    margin-bottom: 16px;
}

.modal-tab-content .payment-history-section .section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-tab-content .payment-history-list {
    gap: 10px;
}

.general-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 14px;
}

@media (max-width: 960px) {
    .general-layout {
        grid-template-columns: 1fr;
    }
}

.general-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.general-card.narrow {
    max-width: 420px;
}

.card-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

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

.general-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.general-form .form-control {
    width: 100%;
}

.actions-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-gray);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px dashed var(--border);
    padding: 10px;
    border-radius: 10px;
}

.key-row code {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pill-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #0f5132;
    background: #d1fae5;
    border: 1px solid #bbf7d0;
}

.pill-status.inactive {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.switch.slim {
    width: 34px;
    height: 18px;
}

.switch.slim .slider {
    height: 18px;
}

.switch.slim .slider:before {
    height: 14px;
    width: 14px;
    bottom: 2px;
    left: 2px;
}

.switch.slim input:checked + .slider:before {
    transform: translateX(16px);
}

.cta-button {
    width: auto;
    min-width: 180px;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
}

.invoice-backend-message {
    display: none;
}

.payment-history-item {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.payment-history-item.compact {
    padding: 12px 16px;
    border-width: 1px;
    border-radius: 8px;
}

.payment-history-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.payment-history-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 16px;
}

.payment-history-item.compact .payment-history-main {
    gap: 12px;
    margin-bottom: 10px;
}

.payment-history-info {
    flex: 1;
}

.payment-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.payment-history-item.compact .payment-history-header {
    margin-bottom: 6px;
    gap: 12px;
}

.payment-history-app {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.payment-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.payment-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.payment-app-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.payment-amount-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.payment-history-item.compact .payment-amount-display {
    font-size: 16px;
}

.payment-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.payment-history-item.compact .payment-status-badge {
    padding: 4px 10px;
    font-size: 12px;
}

.payment-status-badge .status-icon {
    font-size: 14px;
}

.payment-history-item.compact .payment-status-badge .status-icon {
    font-size: 12px;
}

.status-completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-failed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.payment-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.payment-history-item.compact .payment-description {
    font-size: 13px;
    margin-bottom: 6px;
}

.payment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.payment-history-item.compact .payment-meta {
    gap: 12px;
    font-size: 11px;
}

.payment-date,
.payment-expires {
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-history-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.payment-history-item.compact .payment-history-actions {
    gap: 6px;
}

.payment-link-preview {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.payment-history-item.compact .payment-link-preview {
    padding-top: 10px;
}

.payment-link-code {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-gray);
    padding: 8px 12px;
    border-radius: 8px;
    display: block;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
}

.payment-history-item.compact .payment-link-code {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
}

.invoice-raw {
    display: none;
}

.invoice-raw.visible {
    display: block;
    animation: fadeIn 0.2s ease;
}

.invoice-raw pre {
    margin-top: 12px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 11px;
    max-height: 180px;
    overflow: auto;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    border: 1px solid var(--border);
}

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

/* Enhanced minimal modal styles */
.modal-content {
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.8);
}

.modal-header h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-nav {
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    gap: 24px;
    background: rgba(248,250,252,0.5);
}

.app-nav-item {
    padding: 16px 4px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.app-nav-item:hover {
    color: var(--text-primary);
}

.app-nav-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.modal-body {
    padding: 32px;
}

/* Form refinements */
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border);
    background: var(--bg-gray);
    transition: all 0.2s;
}

.form-control:focus {
    background: var(--bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Invoice list refinement */
.payment-history-item {
    border: 1px solid var(--border);
    box-shadow: none;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #fff;
}

.payment-history-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.payment-history-header {
    margin-bottom: 8px;
    align-items: center;
}

.payment-amount-display {
    font-size: 16px;
    letter-spacing: -0.01em;
}

.payment-meta {
    font-size: 12px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-raw-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-raw-btn:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

/* ===== GLOBAL SUCCESS OVERLAY ===== */
.global-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 26, 0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.global-success-overlay.active {
    display: flex;
}

.success-modal {
    width: min(520px, 100%);
    background: var(--bg);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 24px 80px rgba(54, 60, 107, 0.25);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.success-icon {
    font-size: 48px;
    line-height: 1;
}

.success-modal h2 {
    font-size: 28px;
    margin: 0;
    color: var(--text-primary);
}

.success-modal p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.success-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.success-info .info-block {
    background: var(--bg-gray);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.success-info .info-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.success-info .info-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== EDIT BUSINESS MODAL (REDESIGN) ===== */
#editAppModal .modal-overlay {
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(8px);
}

#editAppModal .modal-content.edit-modal {
    max-width: 980px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, #ffffff, #f5f7ff);
    box-shadow:
        0 24px 80px rgba(54, 60, 107, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

#editAppModal .edit-modal-header {
    position: relative;
    padding: 26px 28px 10px 28px;
    padding-right: 72px;
    border: 0;
    background: radial-gradient(circle at 20% 20%, rgba(99,102,241,0.12), transparent 45%), radial-gradient(circle at 80% 0%, rgba(45,212,191,0.1), transparent 36%);
}

#editAppModal .edit-hero {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

#editAppModal .edit-hero-actions {
    margin-left: auto;
}

#editAppModal .edit-hero-actions .ghost-button {
    position: absolute;
    right: 18px;
    top: 22px;
}

#editAppModal .edit-hero-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#editAppModal .edit-hero-title h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.01em;
}

#editAppModal .edit-hero-sub {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.eyebrow-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow-chip.subtle {
    background: rgba(17,24,39,0.05);
    color: var(--text-secondary);
}

#editAppModal .edit-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#editAppModal .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

#editAppModal .meta-chip.subtle {
    background: rgba(255,255,255,0.45);
}

#editAppModal .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

#editAppModal .dot.live {
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(99,102,241,0.14);
}

#editAppModal .dot.muted {
    background: rgba(148,163,184,0.9);
}

#editAppModal .ghost-button {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

#editAppModal .ghost-button:hover {
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(54,60,107,0.12);
}

#editAppModal .app-navbar.edit-navbar {
    background: transparent;
    border-bottom: 0;
    padding: 16px 24px 6px 24px;
    gap: 12px;
    width: 100%;
}

#editAppModal .app-navbar.edit-navbar .app-nav-item {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    color: var(--text-secondary);
    margin-bottom: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    text-align: center;
}

#editAppModal .app-navbar.edit-navbar .app-nav-item:hover {
    color: var(--text-primary);
    border-color: rgba(99,102,241,0.3);
}

#editAppModal .app-navbar.edit-navbar .app-nav-item.active {
    color: var(--primary);
    background: linear-gradient(120deg, rgba(99,102,241,0.14), rgba(45,212,191,0.12));
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 10px 24px rgba(99,102,241,0.12);
}

#editAppModal .modal-tab-content {
    padding: 0 24px 12px;
}

#editAppModal .modal-tab-content.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#editAppModal .edit-body {
    padding: 14px 24px 12px;
    background: transparent;
    flex: 1;
    min-height: 0;
    overflow: auto;
}

#editAppModal .edit-columns.edit-grid {
    display: grid;
    grid-template-areas:
        "profile callbacks";
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

#editAppModal .profile-card { grid-area: profile; }
#editAppModal .callbacks-card { grid-area: callbacks; }

#editAppModal .edit-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#editAppModal .edit-column.slim {
    max-width: none;
    margin-left: 0;
}

#editAppModal .edit-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 26px rgba(54,60,107,0.1);
    backdrop-filter: blur(8px);
}

#editAppModal .edit-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

#editAppModal .edit-card-head h3 {
    margin: 4px 0 2px 0;
    font-size: 18px;
    letter-spacing: -0.01em;
}

#editAppModal .edit-card h4 {
    margin: 4px 0 2px 0;
    font-size: 17px;
}

#editAppModal .edit-card-head.space-between {
    align-items: flex-start;
}

#editAppModal .field-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#editAppModal .field-grid.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

#editAppModal .form-field .floating-label {
    font-size: 11px;
}

#editAppModal .form-field .form-control,
#editAppModal .form-field textarea {
    background: rgba(248,250,252,0.7);
    border-color: rgba(148,163,184,0.5);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    width: 100%;
}

#editAppModal .form-field textarea {
    min-height: 88px;
    resize: vertical;
}

#editAppModal .key-card .key-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#editAppModal .key-row.elevated {
    background: #fff;
    border: 1.5px dashed rgba(148,163,184,0.55);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

#editAppModal .info-hint.small {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

#editAppModal .status-row.glass {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(120deg, rgba(99,102,241,0.08), rgba(45,212,191,0.06));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

#editAppModal .status-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#editAppModal .status-note {
    font-size: 12px;
    color: var(--text-secondary);
}

#editAppModal .edit-actions-row {
    padding: 12px 24px 0 24px;
    display: flex;
    justify-content: center;
}

#editAppModal .networks-panel {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding: 4px 2px;
}

#editAppModal .section-header.tight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin-bottom: 16px;
}

#editAppModal .section-header.tight h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.01em;
}

#editAppModal .edit-card.danger-card {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(255,255,255,0.9);
}

#editAppModal .edit-card.danger-card.critical {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 26px rgba(54,60,107,0.1);
}

#editAppModal .security-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#editAppModal .security-action-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

#editAppModal .security-stack > .security-action-line:first-child {
    justify-content: space-between;
}

#editAppModal .security-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
}

#editAppModal .slim-btn {
    padding: 10px 14px;
    border-radius: 10px;
}

#editAppModal .modal-tab-content[data-tab-content="security"] .edit-body {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 10px;
}

#editAppModal .modal-tab-content[data-tab-content="security"] .edit-card {
    width: 100%;
}

#editAppModal .edit-footer {
    border-top: 1px solid rgba(148,163,184,0.3);
    padding: 16px 24px 18px;
    background: rgba(255,255,255,0.92);
}

@media (max-width: 960px) {
    #editAppModal .edit-columns {
        grid-template-columns: 1fr;
    }
    
    #editAppModal .edit-column.slim {
        max-width: 100%;
    }
}

.success-info .info-code {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
}

.success-info .info-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.success-actions .btn-secondary {
    min-width: 160px;
}

.success-actions .btn-primary {
    min-width: 180px;
}

@media (max-width: 640px) {
    .success-modal {
        padding: 28px 24px;
        border-radius: 20px;
    }

    .success-modal h2 {
        font-size: 24px;
    }

    .success-info .info-value {
        font-size: 16px;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-actions .btn-secondary,
    .success-actions .btn-primary {
        width: 100%;
    }
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-history svg {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.empty-history p {
    margin: 8px 0;
    color: var(--text-primary);
    font-weight: 500;
}

.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification--success {
    border-left: 4px solid var(--success);
}

.notification--error {
    border-left: 4px solid var(--danger);
}

.notification--warning {
    border-left: 4px solid var(--warning);
}

.notification--info {
    border-left: 4px solid var(--primary);
}

.notification-icon {
    font-size: 18px;
    line-height: 1;
}

.notification-content {
    white-space: pre-line;
}

/* Emphasis for critical hint about one-time visibility */
.info-critical {
    color: var(--danger);
    font-weight: 600;
}

/* Ensure navbar "Get Started" remains white on primary button */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover {
    color: #ffffff;
}

.app-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
}

.app-menu {
    position: relative;
}

.app-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.app-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.app-stats {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.app-stat {
    flex: 1;
}

.app-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.app-stat-value {
    font-size: 18px;
    font-weight: 600;
}

.app-stat-value.status-muted .network-count {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

.network-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--secondary);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state > svg {
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 96vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 700px;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}

/* Policy Modal - Terms & Privacy */
.modal-policy {
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
}

.modal-policy .modal-header {
    padding: 20px 24px;
}

.modal-policy .modal-header h2 {
    font-size: 20px;
}

.modal-policy .modal-body {
    padding: 0 24px 20px;
    font-size: 14px;
    line-height: 1.6;
}

.modal-policy .modal-body ul {
    margin: 12px 0 16px 18px;
}

.modal-policy .modal-body li {
    margin-bottom: 8px;
}

.modal-policy .modal-footer {
    padding: 16px 24px;
}

@media (max-width: 600px) {
    .modal-policy {
        max-width: calc(100% - 32px) !important;
        width: calc(100% - 32px) !important;
        max-height: 80vh !important;
        height: auto !important;
        margin: 16px !important;
        border-radius: 16px !important;
    }

    .modal-policy .modal-header {
        padding: 16px 20px;
    }

    .modal-policy .modal-header h2 {
        font-size: 18px;
    }

    .modal-policy .modal-body {
        padding: 0 20px 16px;
        font-size: 13px;
        max-height: 50vh !important;
        overflow-y: auto;
    }

    .modal-policy .modal-footer {
        padding: 12px 20px;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-content form {
    padding: 24px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ===== API APP Key DISPLAY ===== */
.api-key-display {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.api-key-display code {
    flex: 1;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.api-key-meta {
    margin-top: 12px;
    display: none;
}

.api-key-meta .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
}

.api-key-meta .meta-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.api-key-meta .meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

.api-key-meta .meta-status {
    font-size: 12px;
    color: var(--success);
}

.api-key-meta .meta-status.status-error {
    color: var(--danger);
}

/* ===== NETWORKS LIST ===== */
.networks-section {
    background: var(--bg);
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.networks-section h3 {
    font-size: 17px;
    margin: 0;
    font-weight: 700;
}

.networks-section .text-muted {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.networks-list {
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    max-height: 460px;
    overflow-y: auto;
    padding: 2px;
}

.network-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    transition: all 0.2s;
}

.network-item:hover {
    border-color: rgba(59,130,246,0.25);
    box-shadow: 0 6px 14px rgba(59,130,246,0.08);
}

.network-item.active {
    border-color: rgba(59,130,246,0.35);
    box-shadow: 0 8px 18px rgba(59,130,246,0.1);
}

.network-item:not(.active) .network-icon {
    opacity: 0.6;
    filter: grayscale(0.4);
}

.network-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.network-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.network-details {
    flex: 1;
    text-align: left;
    width: 100%;
}

.network-name {
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 15px;
    color: var(--text-primary);
}

.network-symbol {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.network-item .toggle-switch {
    margin-left: auto;
    margin-top: 0;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch.active::before {
    left: 23px;
}

/* ===== RESPONSIVE ===== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero h1 {
        font-size: 64px;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1200px;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 20px;
    }
    
    .hero h1 {
        font-size: 44px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .hero-stats {
        gap: 40px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .networks-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-width: 600px;
    }
    
    .payment-box {
        max-width: 550px;
    }
}

/* Tablet Portrait & Small Tablet (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .container {
        padding: 0 20px;
    }
    
    .login-container {
        min-height: calc(100vh - 64px);
    }
    
    .nav-content {
        height: 64px;
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 40px;
    }
    
    .hero-subtitle {
        font-size: 17px;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 12px;
    }
    
    .hero-buttons a {
        flex: 1;
    }
    
    .hero-features {
        gap: 16px;
    }
    
    .hero-feature {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .hero-stats {
        gap: 32px;
        flex-wrap: wrap;
    }
    
    .privacy-content {
        gap: 24px;
    }
    
    .privacy-icon {
        width: 64px;
        height: 64px;
    }
    
    .privacy-text h3 {
        font-size: 24px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .networks-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 16px;
    }
    
    .nav-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .main-content {
        padding: 24px 20px;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        max-width: 90%;
    }
    
    .payment-box {
        max-width: 90%;
        padding: 24px;
    }
    
    .tokens-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .modal-tabs {
        padding: 0 16px;
        gap: 4px;
        overflow-x: auto;
    }
    
    .modal-tab {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .modal-tab span {
        display: none;
    }
    
    .modal-tab svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile Small (≤374px) - very narrow phones like Galaxy S22 CSS viewport 360px */
@media (max-width: 374px) {
    .container {
        padding: 0 12px;
    }
    
    .nav-content {
        height: 56px;
    }
    
    /* Show hamburger and hide full links on very small screens */
    .nav-links {
        display: none;
    }
    .menu-toggle {
        display: inline-flex;
    }
    .nav-links.open {
        display: flex;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 10px 12px 14px;
        flex-direction: column;
        gap: 10px;
        z-index: 999;
    }
    
    .hero {
        padding: 44px 0;
    }
    
    .hero h1 {
        font-size: 24px;
        line-height: 1.2;
        word-break: break-word;
        hyphens: auto;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .hero-features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    
    .btn-large {
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
    }
    
    .hero-stats {
        gap: 16px;
        padding-top: 20px;
    }
    
    .privacy-banner {
        padding: 28px 0;
    }
    
    .privacy-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .privacy-icon {
        width: 52px;
        height: 52px;
        margin: 0 auto;
    }
    
    .privacy-text h3 {
        font-size: 18px;
        line-height: 1.2;
        word-break: break-word;
        hyphens: auto;
    }
    
    .privacy-text p {
        font-size: 13px;
    }
    
    .cta .pricing-card {
        padding: 16px;
    }
    
    .cta .pricing-row {
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .cta .price-item {
        min-width: 0;
        padding: 8px 8px;
        flex: 1 1 0;
    }
    
    .cta .price-value {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
}

/* Mobile Large (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .container {
        padding: 0 16px;
    }
    
    .login-container {
        min-height: calc(100vh - 60px);
    }
    
    .nav-content {
        height: 60px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo svg {
        width: 28px;
        height: 28px;
    }
    
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: inline-flex;
    }
    
    /* Mobile dropdown */
    .nav-links.open {
        display: flex;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px 16px;
        flex-direction: column;
        gap: 12px;
        z-index: 999;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 32px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    
    .hero-feature {
        font-size: 14px;
        padding: 10px 16px;
        width: 100%;
        justify-content: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
    }
    
    .hero-stats {
        gap: 24px;
        flex-wrap: wrap;
        padding-top: 32px;
    }
    
    .privacy-banner {
        padding: 32px 0;
    }
    
    .privacy-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .privacy-icon {
        width: 64px;
        height: 64px;
        margin: 0 auto;
    }
    
    .privacy-text h3 {
        font-size: 22px;
    }
    
    .privacy-text p {
        font-size: 15px;
    }
    
    .stat {
        min-width: 120px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .features {
        padding: 60px 0;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .feature-icon {
        font-size: 32px;
    }
    
    .networks {
        padding: 60px 0;
    }
    
    .networks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .network-badge {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 52px;
        height: 52px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .section-subtitle {
        font-size: 16px;
    }
    
    /* Login Page */
    .login-container {
        padding: 24px 16px;
    }
    
    .login-box {
        padding: 32px 24px;
    }
    
    .login-box h1 {
        font-size: 28px;
    }
    
    .auth-button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Dashboard */
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px 16px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-item {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .sidebar-footer {
        padding: 12px 16px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 24px 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .text-muted {
        font-size: 13px;
    }
    
    .dashboard-header .btn-primary {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .app-card {
        padding: 20px;
    }
    
    /* Modal */
    .modal {
        padding: 16px;
    }
    
    .modal-content {
        max-width: 100%;
        width: 100%;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 20px;
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .networks-list {
        max-height: 300px;
    }
    
    .network-item {
        padding: 12px;
    }
    
    /* Payment Page */
    .payment-container {
        padding: 24px 16px;
    }
    
    .payment-box {
        padding: 24px 20px;
        max-width: 100%;
    }
    
    .merchant-info {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .merchant-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .merchant-details h2 {
        font-size: 18px;
    }
    
    .payment-amount {
        padding: 20px;
    }
    
    .amount-value {
        font-size: 32px;
    }
    
    .amount-value span:last-child {
        font-size: 20px;
    }
    
    .network-payment-item {
        padding: 14px;
        gap: 12px;
    }
    
    .network-payment-item .network-icon {
        width: 24px;
        height: 24px;
    }
    
    .tokens-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .token-item {
        padding: 12px;
        gap: 10px;
    }
    
    .token-item .token-icon {
        width: 24px;
        height: 24px;
    }
    
    .crypto-value {
        font-size: 28px;
    }
    
    .qr-code-image,
    .qr-image {
        width: 240px;
        height: 240px;
    }
    
    .timer-value {
        font-size: 24px;
    }
    
    .payment-state h2 {
        font-size: 24px;
    }
    
    .modal-tabs {
        padding: 0 12px;
        gap: 4px;
        overflow-x: auto;
    }
    
    .modal-tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .modal-tab span {
        display: none;
    }
    
    .modal-tab svg {
        width: 20px;
        height: 20px;
    }
    
    .danger-zone-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .danger-zone-item button {
        width: 100%;
        margin-left: 0;
    }
    
    .network-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .processing-steps {
        max-width: 100%;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
    }
    
    .app-navbar {
        overflow-x: auto;
    }
    
    .app-nav-item {
        flex: 0 0 auto;
        font-size: 14px;
        padding: 14px 20px;
    }
}

/* Mobile Medium (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    .container {
        padding: 0 16px;
    }
    
    .login-container {
        min-height: calc(100vh - 56px);
    }
    
    .nav-content {
        height: 56px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .logo svg {
        width: 24px;
        height: 24px;
    }
    
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: inline-flex;
    }
    
    .nav-links.open {
        display: flex;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 10px 16px 14px;
        flex-direction: column;
        gap: 10px;
        z-index: 999;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .hero-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .hero-features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    
    .hero-feature {
        font-size: 13px;
        padding: 8px 14px;
        width: 100%;
        justify-content: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 50px;
    }
    
    .btn-large {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .hero-stats {
        gap: 20px;
        padding-top: 24px;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .privacy-banner {
        padding: 32px 0;
    }
    
    .privacy-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .privacy-icon {
        width: 56px;
        height: 56px;
        margin: 0 auto;
    }
    
    .privacy-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .privacy-text h3 {
        font-size: 20px;
    }
    
    .privacy-text p {
        font-size: 14px;
    }
    
    .features,
    .networks,
    .cta {
        padding: 50px 0;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-icon {
        font-size: 28px;
        margin-bottom: 16px;
    }
    
    .feature-card h3 {
        font-size: 18px;
    }
    
    .feature-card p {
        font-size: 13px;
    }
    
    .networks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .network-badge {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 48px;
        height: 48px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 15px;
        margin-bottom: 40px;
    }
    
    .cta h2 {
        font-size: 28px;
    }
    
    .cta p {
        font-size: 16px;
    }
    
    /* Login */
    .login-page {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
    
    .navbar-simple .nav-content {
        height: 56px;
        padding: 0 16px;
    }
    
    .navbar-simple .logo img {
        height: 36px;
    }
    
    .navbar-simple .logo span {
        font-size: 20px;
    }
    
    .login-container {
        padding: 10px 16px;
        align-items: center;
        padding-bottom: 12px;
    }
    
    .login-box {
        padding: 24px 20px;
        max-width: 100%;
        margin: 0;
        border-radius: 20px;
    }
    
    .login-box h1 {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .auth-methods {
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .auth-button {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .auth-button span {
        font-size: 14px;
    }
    
    .divider {
        margin: 16px 0;
        font-size: 12px;
    }
    
    .divider span {
        padding: 0 12px;
        font-size: 12px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .btn-block {
        padding: 14px 16px;
        font-size: 15px;
        margin-top: 4px;
        border-radius: 12px;
    }
    
    .login-consent {
        font-size: 11px;
        margin-top: 12px;
        line-height: 1.4;
    }
    
    .login-footer {
        margin-top: 16px;
        font-size: 13px;
        padding-bottom: 0;
    }
    
    .login-footer {
        margin-top: 20px;
        font-size: 13px;
    }
    
    /* Dashboard */
    .dashboard-layout {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: none;
    }
    
    .sidebar-header {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-header .logo img {
        height: 32px;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 6px 10px;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 13px;
        gap: 8px;
        border-radius: 8px;
    }
    
    .nav-item span {
        white-space: nowrap;
    }
    
    .nav-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    
    .sidebar-footer {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .user-name {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .user-email {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .main-content {
        padding: 16px 12px;
        min-height: calc(100vh - 140px);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .text-muted {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .dashboard-header .btn-primary {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
        margin-top: 4px;
    }
    
    /* Balance Cards */
    .balance-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .balance-card {
        padding: 16px;
    }
    
    .total-balance-card {
        padding: 18px;
    }
    
    .total-balance-value {
        font-size: 28px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .withdraw-section-card {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .withdraw-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .withdraw-section-title {
        width: 100%;
    }
    
    .withdraw-section-icon {
        width: 40px;
        height: 40px;
    }
    
    .withdraw-section-title h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .withdraw-section-title p {
        font-size: 12px;
    }
    
    .btn-withdraw-action {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .withdraw-features {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 0;
    }
    
    .withdraw-feature-item {
        gap: 10px;
        padding: 12px 0;
    }
    
    .withdraw-feature-icon {
        width: 32px;
        height: 32px;
    }
    
    .withdraw-feature-label {
        font-size: 13px;
    }
    
    .withdraw-feature-desc {
        font-size: 11px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .balance-section {
        margin-bottom: 20px;
    }
    
    .balance-section h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    /* Apps Grid */
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .app-card {
        padding: 16px;
        transform: scale(1);
    }
    
    .app-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .app-card p {
        font-size: 13px;
    }
    
    .payment-history-section {
        margin-top: 32px;
        padding-top: 32px;
    }
    
    .payment-history-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .payment-history-item {
        padding: 16px;
    }
    
    .payment-history-main {
        flex-direction: column;
        gap: 16px;
    }
    
    .payment-history-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .payment-link-preview {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .app-stat-value {
        font-size: 16px;
    }
    
    .empty-state {
        padding: 60px 16px;
    }
    
    .empty-state svg {
        width: 64px;
        height: 64px;
    }
    
    .empty-state h3 {
        font-size: 20px;
    }
    
    /* Settings */
    .settings-container {
        gap: 16px;
    }
    
    .settings-card {
        padding: 20px;
    }
    
    .settings-card-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .settings-card-header h3 {
        font-size: 18px;
    }
    
    .settings-card-body {
        gap: 16px;
    }
    
    .settings-description {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .settings-toggle-group {
        gap: 16px;
    }
    
    .settings-toggle-item {
        padding: 12px 0;
        gap: 12px;
    }
    
    .settings-toggle-item h4 {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .settings-toggle-item p {
        font-size: 12px;
    }
    
    .promo-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .promo-input {
        width: 100%;
    }
    
    .promo-input-group button {
        width: 100%;
    }
    
    /* API Documentation */
    .container[style*="padding: 80px"] {
        padding: 16px 12px 40px !important;
    }
    
    .api-section {
        margin-bottom: 32px;
    }
    
    .api-section-title {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    .api-info-box {
        padding: 16px;
        font-size: 14px;
    }
    
    .api-info-box p {
        margin-bottom: 12px;
        line-height: 1.5;
    }
    
    .api-info-box code {
        font-size: 12px;
        word-break: break-all;
    }
    
    .api-endpoint {
        margin-bottom: 24px;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
    }
    
    .endpoint-header-clickable {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .endpoint-header-left {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .http-method {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .endpoint-path {
        font-size: 12px;
        word-break: break-all;
    }
    
    .endpoint-header-clickable h3 {
        font-size: 16px;
    }
    
    .endpoint-content {
        padding: 16px 14px;
    }
    
    .endpoint-description {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .params-section {
        margin: 16px 0;
    }
    
    .params-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .params-table {
        font-size: 12px;
        overflow-x: auto;
        display: block;
    }
    
    .params-table thead,
    .params-table tbody,
    .params-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .params-table td,
    .params-table th {
        padding: 8px 6px;
        word-break: break-word;
    }
    
    .code-tabs {
        overflow-x: auto;
        gap: 4px;
        padding: 2px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .code-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .code-tab {
        font-size: 11px;
        padding: 6px 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .code-example {
        margin-bottom: 20px;
    }
    
    .code-example-header {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .code-block {
        padding: 14px;
        font-size: 11px;
        line-height: 1.5;
    }
    
    .code-block code {
        font-size: 11px;
    }
    
    .error-example {
        margin-bottom: 16px;
    }
    
    .error-header {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
    }
    
    /* Modal */
    .modal {
        padding: 12px;
    }
    
    .modal-content {
        max-width: 100%;
        width: 100%;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .modal-body-grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
        padding: 20px;
    }
    
    .app-navbar {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .app-navbar::-webkit-scrollbar {
        display: none;
    }
    
    .app-nav-item {
        font-size: 13px;
        padding: 10px 16px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .networks-list {
        max-height: 280px;
    }
    
    .network-item {
        padding: 12px;
    }
    
    .network-name {
        font-size: 14px;
    }
    
    .network-symbol {
        font-size: 11px;
    }
    
    /* Payment Page */
    .payment-container {
        padding: 20px 16px;
        min-height: calc(100vh - 56px);
    }
    
    .payment-box {
        padding: 20px 16px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .merchant-info {
        margin-bottom: 20px;
        padding-bottom: 16px;
        gap: 12px;
    }
    
    .merchant-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .merchant-details h2 {
        font-size: 16px;
    }
    
    .merchant-description {
        font-size: 13px;
    }
    
    .payment-amount {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .amount-value {
        font-size: 28px;
    }
    
    .amount-value span:last-child {
        font-size: 18px;
    }
    
    .payment-network-selector,
    .token-selector {
        margin-bottom: 20px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .token-selector {
        overflow: visible;
    }
    
    .network-payment-item {
        padding: 12px;
        gap: 10px;
    }
    
    .network-payment-item .network-icon {
        width: 24px;
        height: 24px;
    }
    
    .network-payment-item .network-name {
        font-size: 13px;
    }
    
    .network-payment-item .chevron {
        width: 14px;
        height: 14px;
    }
    
    .tokens-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .token-item {
        padding: 10px 8px;
        gap: 8px;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .token-item .token-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .token-item .token-info {
        min-width: 0;
        overflow: hidden;
    }
    
    .token-symbol {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .token-name {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .crypto-amount-display {
        padding: 16px;
    }
    
    .crypto-value {
        font-size: 24px;
    }
    
    .crypto-value span:last-child {
        font-size: 16px;
    }
    
    .address-box {
        padding: 10px 12px;
    }
    
    .address-box code {
        font-size: 11px;
    }
    
    .qr-code-container,
    .qr-container {
        padding: 12px;
    }
    
    .qr-code-image,
    .qr-image {
        width: 200px;
        height: 200px;
    }
    
    .payment-timer {
        padding: 14px;
    }
    
    .timer-value {
        font-size: 22px;
    }
    
    .payment-status {
        padding: 20px;
    }
    
    .status-icon {
        font-size: 32px;
    }
    
    .status-text {
        font-size: 15px;
    }
    
    .status-hint {
        font-size: 13px;
    }
    
    .payment-state {
        padding: 16px;
    }
    
    .payment-state h2 {
        font-size: 22px;
    }
    
    .payment-state svg {
        width: 64px;
        height: 64px;
    }
    
    .transaction-info {
        padding: 16px;
    }
    
    .info-row {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-label {
        font-size: 12px;
    }
    
    .info-value {
        font-size: 14px;
    }
}

/* Mobile Small (320px - 374px) */
@media (max-width: 374px) {
    .container {
        padding: 0 12px;
    }
    
    .nav-content {
        height: 52px;
        padding: 0 12px;
    }
    
    .logo {
        font-size: 15px;
        gap: 8px;
    }
    
    .logo svg {
        width: 22px;
        height: 22px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }
    
    .hero-buttons {
        gap: 8px;
        margin-bottom: 50px;
    }
    
    .btn-large {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .hero-stats {
        gap: 16px;
        padding-top: 20px;
    }
    
    .stat {
        min-width: 100px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .features,
    .networks,
    .cta {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }
    
    .features-grid {
        gap: 12px;
    }
    
    .feature-card {
        padding: 16px;
    }
    
    .feature-icon {
        font-size: 24px;
    }
    
    .feature-card h3 {
        font-size: 16px;
    }
    
    .feature-card p {
        font-size: 13px;
    }
    
    .networks-grid {
        gap: 6px;
    }
    
    .network-badge {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 44px;
        height: 44px;
    }
    
    .cta h2 {
        font-size: 24px;
    }
    
    .cta p {
        font-size: 14px;
    }
    
    /* Login */
    .login-page {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
    
    .navbar-simple .nav-content {
        height: 52px;
        padding: 0 12px;
    }
    
    .navbar-simple .logo img {
        height: 32px;
    }
    
    .navbar-simple .logo span {
        font-size: 18px;
    }
    
    .login-container {
        padding: 8px 12px;
        align-items: center;
        padding-bottom: 10px;
    }
    
    .login-box {
        padding: 20px 16px;
        border-radius: 18px;
        max-height: calc(100vh - 70px);
    }
    
    .login-box h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .login-subtitle {
        font-size: 12px;
        margin-bottom: 14px;
    }
    
    .auth-methods {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .auth-button {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 12px;
    }
    
    .divider {
        margin: 12px 0;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn-block {
        padding: 12px 16px;
        font-size: 14px;
        margin-top: 2px;
    }
    
    .login-consent {
        margin-top: 8px;
        font-size: 10px;
        line-height: 1.3;
    }
    
    .login-footer {
        margin-top: 10px;
        font-size: 12px;
        padding-bottom: 0;
    }
    
    /* Dashboard */
    .sidebar-header,
    .main-content {
        padding: 12px;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .apps-grid {
        gap: 12px;
    }
    
    .app-card {
        padding: 16px;
    }
    
    /* Modal */
    .modal {
        padding: 8px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 14px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    /* Payment */
    .payment-container {
        padding: 16px 12px;
    }
    
    .payment-box {
        padding: 16px 12px;
    }
    
    .merchant-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .merchant-details h2 {
        font-size: 15px;
    }
    
    .amount-value {
        font-size: 24px;
    }
    
    .qr-code-image,
    .qr-image {
        width: 180px;
        height: 180px;
    }
    
    .network-payment-item {
        padding: 12px;
        gap: 10px;
    }
    
    .network-payment-item .network-icon {
        width: 28px;
        height: 28px;
    }
    
    .networks-payment-list {
        gap: 10px;
    }
    
    .tokens-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .token-item {
        padding: 12px;
        gap: 10px;
    }
    
    .token-item .token-icon {
        width: 24px;
        height: 24px;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for mobile */
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    .auth-button {
        min-height: 48px;
    }
    
    .network-payment-item,
    .token-item,
    .network-item {
        min-height: 52px;
        padding: 10px 8px;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .network-payment-item .network-icon,
    .token-item .token-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    
    .token-item .token-info {
        min-width: 0;
        overflow: hidden;
    }
    
    .token-symbol {
        font-size: 11px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .token-name {
        font-size: 9px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .networks-payment-list {
        gap: 8px;
    }
    
    .tokens-list {
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .nav-item {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-danger:hover {
        transform: none;
    }
    
    .feature-card:hover,
    .network-badge:hover,
    .app-card:hover {
        transform: none;
    }
    
    /* Better scrollbars on touch */
    .sidebar-nav,
    .networks-list,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .footer,
    .btn-primary,
    .btn-secondary,
    .modal-overlay {
        display: none;
    }
    
    .payment-box,
    .login-box {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000ff;
        --text-primary: #000000;
        --border: #000000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loader {
        animation: none;
        border: 4px solid var(--primary);
    }
}

/* ===== PAYMENT PAGE ===== */
.payment-page {
    min-height: 100vh;
    background: var(--bg-gray);
}

.payment-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 24px 20px;
}

.payment-box {
    background: var(--bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
}

.payment-state {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* ===== MERCHANT INFO ===== */
.merchant-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.merchant-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

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

.merchant-details h2 {
    font-size: 18px;
    margin-bottom: 3px;
}

.merchant-description {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== PAYMENT AMOUNT ===== */
.payment-amount {
    text-align: center;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.amount-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.amount-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-value span:last-child {
    font-size: 20px;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* ===== NETWORK/TOKEN SELECTION ===== */
.payment-network-selector {
    margin-bottom: 20px;
}

.payment-network-selector label,
.token-selector label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.networks-payment-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 12px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.network-payment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.network-payment-item:hover {
    border-color: #e2e8f0;
    background: #fafafa;
}

.network-payment-item .network-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.network-payment-item .network-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.network-payment-item .network-chevron {
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: auto;
}

.network-payment-item-old {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.network-payment-item .network-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
}

.network-payment-item .network-name {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    text-align: left;
}

.network-payment-item:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.network-payment-item .chevron {
    margin-left: auto;
    color: var(--text-muted);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Responsive для планшетов и ноутбуков */
@media (min-width: 768px) {
    .networks-payment-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .network-payment-item {
        padding: 14px;
        gap: 12px;
    }

    .network-payment-item .network-name {
        font-size: 14px;
    }
}

.token-selector {
    margin-bottom: 20px;
    scroll-margin-top: 20px;
}

.payment-details {
    scroll-margin-top: 20px;
}

.tokens-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.token-item .token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
}

.token-item .token-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.token-item:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.token-symbol {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-name {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive для планшетов и ноутбуков */
@media (min-width: 768px) {
    .tokens-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .token-item {
        padding: 14px;
        gap: 12px;
    }
    
    .token-symbol {
        font-size: 14px;
    }
    
    .token-name {
        font-size: 11px;
    }
}

/* ===== PAYMENT DETAILS ===== */
.payment-details {
    animation: fadeIn 0.3s ease-out;
}

.crypto-amount-display {
    text-align: center;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.amount-loading {
    display: inline-block;
    width: 60px;
    height: 24px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: amountShimmer 1s infinite;
    border-radius: 4px;
    vertical-align: middle;
}

@keyframes amountShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.crypto-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.crypto-value {
    font-size: 28px;
    font-weight: 700;
}

.crypto-value span:last-child {
    font-size: 18px;
    color: var(--text-secondary);
    margin-left: 6px;
}

.wallet-address-display {
    margin-bottom: 20px;
}

.wallet-address-display label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
}

.address-box {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 6px;
}

.address-box code {
    flex: 1;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

/* ===== QR CODE ===== */
.qr-code-section {
    text-align: center;
    margin-bottom: 20px;
}

.qr-code-container {
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: 8px;
    position: relative;
}

.qr-code-container.qr-code-small {
    padding: 10px;
}

.qr-code-container.qr-code-small .qr-code-image {
    width: 180px;
    height: 180px;
}

.qr-code-image {
    display: block;
    width: 240px;
    height: 240px;
}

/* QR Expand Button */
.qr-expand-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.qr-code-container:hover .qr-expand-btn {
    opacity: 1;
    pointer-events: auto;
}

.qr-expand-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(1.05);
}

.qr-expand-btn svg {
    flex-shrink: 0;
}

/* Mobile - always show button */
@media (max-width: 768px) {
    .qr-expand-btn {
        opacity: 0.9;
        pointer-events: auto;
    }
    
    .qr-code-container.qr-code-small .qr-code-image {
        width: 160px;
        height: 160px;
    }
}

.qr-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== QR MODAL ===== */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.qr-modal-content {
    position: relative;
    background: var(--bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.qr-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-gray);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qr-modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.qr-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.qr-modal-qr {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 16px;
    border: 2px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-modal-qr img {
    display: block;
    width: 320px;
    height: 320px;
}

.qr-modal-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 599px) {
    .qr-modal-content {
        padding: 30px 20px;
        max-width: calc(100vw - 32px);
    }
    
    .qr-modal-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .qr-modal-qr {
        padding: 16px;
    }
    
    .qr-modal-qr img {
        width: 260px;
        height: 260px;
    }
}

/* ===== Test Invoice compact UI ===== */
#testInvoice .network-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

#testInvoice .network-payment-item {
    padding: 12px;
    gap: 10px;
    border-radius: 12px;
    width: 100%;
    display: flex;
    align-items: center;
}

#testInvoice .network-payment-item .network-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

#testInvoice .network-payment-item .network-name {
    font-size: 13px;
    flex: 1;
    text-align: left;
}

#testInvoice .tokens-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

#testInvoice .token-item {
    padding: 10px 8px;
    gap: 8px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

#testInvoice .token-item .token-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#testInvoice .token-item .token-info {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

#testInvoice .token-item .token-symbol {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#testInvoice .token-item .token-name {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive для ноутбуков */
@media (min-width: 768px) {
    #testInvoice .network-select-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    #testInvoice .tokens-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== NETWORK WARNING HINT ===== */
.network-warning-hint {
    text-align: center;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    color: #92400e;
    font-size: 12px;
    line-height: 1.5;
    font-style: italic;
    font-weight: 400;
}

.network-warning-hint::first-line {
    font-weight: 500;
}

@media (max-width: 599px) {
    .network-warning-hint {
        font-size: 11px;
        padding: 10px 12px;
        margin-bottom: 16px;
    }
}

/* ===== FLOATING PAYMENT TIMER ===== */
.floating-payment-timer {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 150;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.floating-payment-timer.visible {
    opacity: 1;
    transform: translateY(0);
}

.floating-payment-timer .floating-timer-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.floating-payment-timer .timer-label {
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.floating-payment-timer .timer-value {
    font-size: 28px;
}

@media (max-width: 768px) {
    .floating-payment-timer {
        top: 16px;
        bottom: auto;
        left: auto;
        right: 16px;
        width: 92px;
        height: 92px;
        padding: 10px;
        border-radius: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .floating-payment-timer .floating-timer-content {
        align-items: center;
        gap: 4px;
    }

    .floating-payment-timer .timer-value {
        font-size: 22px;
    }

    .floating-payment-timer .timer-label {
        font-size: 10px;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        color: #6b7280;
        white-space: nowrap;
        text-align: center;
        width: 100%;
        display: block;
        align-items: unset;
        gap: 0;
    }
}

/* ===== PAYMENT TIMER ===== */
.payment-timer {
    text-align: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    transition: all 0.3s ease;
}

.payment-timer:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.timer-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.timer-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

@media (max-width: 599px) {
    .payment-timer {
        padding: 14px 16px;
        margin-bottom: 16px;
    }
    
    .timer-label {
        font-size: 12px;
    }
    
    .timer-value {
        font-size: 28px;
    }
}

/* ===== PAYMENT STATUS ===== */
.payment-status {
    text-align: center;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.status-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.status-text {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.status-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== PAYMENT STATES ===== */
.success-icon svg,
.error-icon svg,
.warning-icon svg {
    margin-bottom: 16px;
}

.payment-state h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.payment-state p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.transaction-info {
    background: var(--bg-gray);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-value {
    font-weight: 600;
}

/* ===== LOADER ===== */
.loader {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== CREATE PAYMENT SECTION ===== */
.create-payment-section {
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* ===== PAYMENT LINK DISPLAY ===== */
.payment-link-display {
    margin-bottom: 24px;
}

.link-box {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
}

.link-box code {
    flex: 1;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

.qr-code-display {
    text-align: center;
    margin-bottom: 24px;
}

.qr-container {
    display: inline-block;
    padding: 16px;
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin: 16px 0;
}

.qr-image {
    display: block;
    width: 300px;
    height: 300px;
}

.payment-info {
    background: var(--bg-gray);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

/* ===== SELECT STYLES ===== */
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    background: var(--bg);
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===== NEW DASHBOARD STYLES ===== */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.balance-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.1);
}

.total-balance-card {
    grid-column: 1 / -1; /* Span full width on larger screens */
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
}

@media (min-width: 768px) {
    .total-balance-card {
        grid-column: 1 / span 2;
    }
}

/* Expand Button in Total Balance Card */
.expand-btn {
    background: rgba(255,255,255,0.2) !important;
}

.expand-btn:hover {
    transform: scale(1.2);
    background: rgba(255,255,255,0.3) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.expand-btn:active {
    transform: scale(1.1);
}

/* ===== WITHDRAW SECTION CARD ===== */
.withdraw-section-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 28px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: 
        0 12px 40px rgba(31, 38, 135, 0.08),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.withdraw-section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6, var(--primary));
    opacity: 0.3;
}

.withdraw-section-card:hover {
    box-shadow: 
        0 16px 50px rgba(31, 38, 135, 0.12),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.withdraw-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 24px;
    flex-wrap: wrap;
}

.withdraw-section-title {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.withdraw-section-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.withdraw-section-title:hover .withdraw-section-icon {
    transform: scale(1.05) rotate(-5deg);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.35);
}

.withdraw-section-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.withdraw-section-title .text-muted {
    margin: 0;
    font-size: 14px;
}

.btn-withdraw-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-withdraw-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
}

.btn-withdraw-action:active {
    transform: translateY(0);
}

.withdraw-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 0;
    padding: 28px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.withdraw-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.withdraw-feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.withdraw-feature-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.withdraw-feature-item:hover .withdraw-feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.withdraw-feature-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.withdraw-feature-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.total-balance-card .card-title {
    color: rgba(255, 255, 255, 0.8);
}

.total-balance-value {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.balance-change {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.balance-section {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.balance-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.asset-list, .chain-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.asset-item, .chain-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-info, .chain-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-icon, .chain-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary);
    flex-shrink: 0;
    object-fit: contain;
}

.asset-icon {
    background: transparent;
}
.chain-icon {
    background: transparent;
}


.asset-symbol, .chain-name {
    font-weight: 500;
}

.asset-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.asset-balance {
    text-align: right;
}

.asset-value-crypto {
    font-weight: 500;
}

.asset-value-usd {
    font-size: 14px;
    color: var(--text-secondary);
}

.chain-assets {
    display: flex;
    gap: 8px;
}

.asset-tag {
    background: var(--secondary);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.chain-balance {
    font-weight: 500;
    margin-left: auto;
    padding-left: 16px;
}

/* ===== ENHANCED EDIT MODAL ===== */

.modal-large {
    max-width: 1200px;
    max-height: 95vh;
}

.modal-body {
    max-height: calc(95vh - 200px);
    overflow-y: auto;
}

.modal-body-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px;
}

@media (min-width: 1024px) {
    .modal-body-grid {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 48px;
    }
}

.modal-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-column h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.modal-column h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-footer-danger-zone {
    padding: 24px;
    background-color: var(--bg-gray);
    border-top: 1px solid var(--border);
}

.danger-zone {
    padding: 0;
}

.danger-zone-header {
    margin-bottom: 24px;
}

.danger-zone-header h3 {
    color: var(--danger);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.danger-zone-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.danger-zone-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== APP NAVBAR TABS ===== */
.app-navbar {
    display: flex;
    gap: 0;
    background: var(--bg-gray);
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.app-nav-item {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.app-nav-item:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.app-nav-item.active {
    color: var(--primary);
    background: white;
    border-bottom-color: var(--primary);
}

/* App Modal Body */
.app-modal-body {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    min-height: 350px;
}

.modal-tab-content {
    display: none;
    min-height: 350px;
    height: 100%;
}

.modal-tab-content.active {
    display: block;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-section {
    background: var(--bg-gray);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* App Status Toggle */
.app-status-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.status-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
    margin-top: 2px;
}

.status-value.inactive {
    color: var(--text-muted);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Security Section */
.security-section {
    max-width: 700px;
    margin: 0 auto;
}

.security-section h4 {
    font-size: 16px;
    margin-bottom: 6px;
}

.security-warning {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 13px;
}

.security-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.security-action-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: white;
    transition: all 0.2s;
}

.security-action-card:hover {
    border-color: var(--primary);
}

.security-action-card.danger:hover {
    border-color: var(--danger);
}

.security-action-info h5 {
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.security-action-info p {
    font-size: 13px;
    margin: 0;
    color: var(--text-secondary);
}

.security-action-card button {
    flex-shrink: 0;
    margin-left: 16px;
}

/* ===== SETTINGS PAGE ===== */
.settings-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.8);
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(31, 38, 135, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.settings-card-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
}

.settings-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-card-body {
    padding: 32px;
}

.settings-card-body .form-group {
    margin-bottom: 24px;
}

.settings-card-body .form-group:last-child {
    margin-bottom: 0;
}

.settings-card-body .btn-primary {
    margin-top: 8px;
}

.settings-description {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Promo Code */
.promo-badge {
    padding: 4px 12px;
    background: var(--success);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.promo-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.promo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    text-transform: uppercase;
}

.promo-input:focus {
    outline: none;
    border-color: var(--primary);
}

.promo-input:disabled {
    background: var(--bg-gray);
    color: var(--text-muted);
}

.promo-status {
    margin-top: 16px;
}

.promo-success {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 8px;
    border: 2px solid var(--success);
}

.promo-success svg {
    color: var(--success);
    flex-shrink: 0;
}

.promo-success strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.promo-success p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Settings Toggle Group */
.settings-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: 8px;
}

.settings-toggle-item h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-toggle-item p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.modal-tab-content .modal-body {
    max-height: none;
    overflow-y: visible;
    padding: 16px 20px;
}

.modal-tab-content .modal-body h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-tab-content .modal-body h3:first-child {
    margin-top: 0;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Danger Zone Improvements */
.danger-zone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.danger-zone-item:hover {
    border-color: var(--danger);
}

.danger-zone-item-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.danger-zone-item-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.danger-zone-item button {
    flex-shrink: 0;
    margin-left: 16px;
}

/* ===== WITHDRAW MODAL ===== */
.withdraw-modal {
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.withdraw-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 200px);
    padding: 32px;
    background: var(--bg);
}

.withdraw-body::-webkit-scrollbar {
    width: 8px;
}

.withdraw-body::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: 4px;
}

.withdraw-body::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

.withdraw-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.withdraw-modal .modal-content {
    border-radius: 24px;
    overflow: hidden;
}

.withdraw-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.withdraw-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
}

.withdraw-submit-btn:active {
    transform: translateY(0);
}

.amount-max-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.withdraw-step {
    display: none;
}

.withdraw-step.active {
    display: block;
}

.withdraw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border);
}

.withdraw-title {
    display: flex;
    gap: 16px;
}

.withdraw-icon {
    font-size: 32px;
}

.withdraw-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.withdraw-title p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.withdraw-body {
    padding: 32px;
}

.withdraw-section {
    margin-bottom: 24px;
}

.withdraw-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.label-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg-gray);
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
}

/* Token Cards */
.token-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.token-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.token-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.token-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.token-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.token-card.selected::before {
    opacity: 1;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
}

.token-info {
    text-align: center;
    flex: 1;
    width: 100%;
}

.token-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.token-balance {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Network Cards */
.network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.network-card {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.network-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.network-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.network-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.network-card.selected::before {
    opacity: 1;
}

.network-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: transparent;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.network-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Mixer Cards */
.mixer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mixer-card {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mixer-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.mixer-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.mixer-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.mixer-card.selected::before {
    opacity: 1;
}

.mixer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mixer-icon {
    font-size: 24px;
}

.mixer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.mixer-info {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Inputs */
.withdraw-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.withdraw-input::placeholder {
    color: var(--text-muted);
}

.withdraw-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.withdraw-input:hover:not(:focus) {
    border-color: var(--text-muted);
}

.amount-input-wrapper {
    display: flex;
    gap: 8px;
}

.amount-input {
    flex: 1;
}

.amount-max-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-max-btn:hover {
    background: var(--primary-dark);
}

.amount-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Summary */
.withdraw-summary {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.summary-total .summary-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-total .summary-value {
    font-size: 18px;
    color: var(--primary);
}

/* Submit Button */
.withdraw-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.withdraw-submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .withdraw-header {
        padding: 24px 20px 20px;
    }
    
    .withdraw-body {
        padding: 24px 20px;
    }
    
    .token-grid {
        grid-template-columns: 1fr;
    }
    
    .network-grid {
        grid-template-columns: 1fr;
    }
    
    .mixer-grid {
        grid-template-columns: 1fr;
    }
}

.text-center {
    text-align: center;
}

.text-center h2 {
    text-align: center;
}

.processing-animation {
    display: flex;
    justify-content: center;
    margin: 40px 0 24px;
}

.processing-steps {
    margin: 40px 0;
    text-align: center;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.step-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    opacity: 0.5;
    transition: all 0.3s;
}

.step-item.active {
    opacity: 1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.step-item.active .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

.step-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.success-text {
    color: var(--success) !important;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Processing Step Improvements */
.step-item.active {
    opacity: 1 !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15) !important;
}

.step-item.active .step-icon {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    animation: pulse 1.5s ease-in-out infinite;
}

.step-item:not(.active) .step-icon {
    animation: none;
}

.btn-danger-outline {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

.networks-section {
    background: var(--bg-gray);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.networks-section h3 {
    margin-bottom: 8px;
}

.networks-section .text-muted {
    margin-bottom: 20px;
    font-size: 13px;
}

/* ===== API DOCUMENTATION PAGE ===== */
.api-section {
    background: var(--bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.api-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.api-info-box {
    background: var(--bg-gray);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--primary);
}

.api-info-box p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.api-info-box p:last-child {
    margin-bottom: 0;
}

.api-url {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
}

.api-endpoint {
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.endpoint-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Collapsible Endpoint Header */
.endpoint-header-clickable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 20px;
    margin: -32px -32px 0 -32px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.endpoint-header-clickable:hover {
    background: white;
}

.endpoint-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}

.endpoint-header-left h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.endpoint-chevron {
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.endpoint-chevron.rotated {
    transform: rotate(180deg);
}

.endpoint-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.endpoint-content.expanded {
    max-height: 10000px;
    opacity: 1;
    padding: 32px 0 0;
}

.http-method {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.http-method.post {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.http-method.get {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.endpoint-path {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.endpoint-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

.code-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
}

.code-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: -1px;
}

.code-tab:hover {
    color: var(--text-primary);
}

.code-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.code-example {
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.code-example:last-child {
    margin-bottom: 0;
}

.code-example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.code-example-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-200 {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-block {
    display: none;
    margin: 0;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border);
    border-top: none;
}

.code-block.active {
    display: block;
}

.code-block code {
    color: inherit;
    background: none;
    padding: 0;
}

/* Code syntax highlighting simulation */
.code-block {
    counter-reset: line;
}

/* Parameters Section */
.params-section {
    margin: 24px 0;
}

.params-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.params-table thead {
    background: var(--bg-gray);
}

.params-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.params-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.params-table tbody tr:last-child td {
    border-bottom: none;
}

.params-table tbody tr:hover {
    background: var(--bg-gray);
}

.params-table code {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
}

.required-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.optional-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

/* Error Responses */
.error-responses {
    margin-top: 32px;
}

.error-example {
    margin-bottom: 16px;
}

.error-example:last-child {
    margin-bottom: 0;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom: none;
}

.error-header span:last-child {
    color: var(--text-secondary);
}

.status-400 {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-401 {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-404 {
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
}

.status-500 {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

@media (max-width: 768px) {
    .api-endpoint {
        padding: 20px;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .endpoint-header-clickable {
        margin: -20px -20px 0 -20px;
        padding: 16px 20px;
    }
    
    .endpoint-header-left {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .endpoint-content {
        padding: 0;
    }
    
    .endpoint-content.expanded {
        padding: 20px;
    }
    
    .code-tabs {
        gap: 4px;
    }
    
    .code-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .code-block {
        padding: 16px;
        font-size: 12px;
    }
    
    .params-table {
        font-size: 13px;
    }
    
    .params-table th,
    .params-table td {
        padding: 10px 12px;
    }
    
    .error-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.networks-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.networks-list::-webkit-scrollbar {
    width: 6px;
}

.networks-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.networks-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.networks-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.create-payment-section {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Layout adjustments */
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        display: none; /* Replaced by bottom nav */
    }

    .main-content {
        padding: 24px 16px 100px 16px; /* Bottom padding for nav */
        width: 100%;
    }

    /* Header adjustments */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-header > div {
        width: 100%;
    }
    
    .dashboard-header button {
        width: 100%;
        justify-content: center;
    }

    /* Grids to single column */
    .apps-grid, 
    .settings-container,
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Balance grid: first card full width, last two side by side */
    .balance-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    .total-balance-card {
        grid-column: 1 / -1 !important;
    }

    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        justify-content: space-around;
        z-index: 1000;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        flex: 1;
        padding: 8px;
        border-radius: 12px;
        transition: all 0.2s;
    }

    .bottom-nav-item.active {
        color: var(--primary);
        background: rgba(59, 130, 246, 0.1);
    }

    .bottom-nav-item svg {
        width: 24px;
        height: 24px;
    }

    /* Full screen modals on mobile */
    .modal-content:not(.modal-confirm):not(.modal-policy):not(#balanceStatsModal .modal-content), .withdraw-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Balance Stats Modal - compact, not full screen */
    #balanceStatsModal .modal-content {
        width: calc(100% - 32px) !important;
        height: auto !important;
        max-height: calc(100vh - 40px) !important;
        max-width: calc(100% - 32px) !important;
        border-radius: 20px !important;
        margin: 20px 16px !important;
    }
    
    .modal-content:not(.modal-confirm):not(.modal-policy) > div:not(.modal-header):not(.withdraw-header) {
        flex: 1;
        overflow-y: auto;
    }

    /* Compact confirm modals stay centered */
    .modal-confirm {
        max-width: 90% !important;
        width: auto !important;
        min-width: 280px !important;
        max-height: 80vh !important;
        margin: auto;
        border-radius: 20px !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    }
    
    .modal-confirm .modal-header {
        padding: 20px 24px 16px;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-confirm .modal-body {
        padding: 16px 24px;
        line-height: 1.6;
    }
    
    .modal-confirm .modal-footer {
        padding: 12px 24px 20px;
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-confirm .modal-footer button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
    }

    /* Confirm modals keep blur effect */
    .modal-confirm-wrapper .modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
    }

    /* Full-screen modals get white background */
    .modal:not(.modal-confirm-wrapper):not(.modal-policy-wrapper):not(#balanceStatsModal) .modal-overlay {
        background: white;
        backdrop-filter: none;
    }

    /* Policy modal - keep dark overlay */
    .modal-policy-wrapper .modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    /* Balance Stats Modal - keep blur overlay */
    #balanceStatsModal .modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .withdraw-header, .modal:not(.modal-confirm-wrapper):not(.modal-policy-wrapper):not(#balanceStatsModal) .modal-header {
        border-radius: 0;
        padding-top: max(32px, env(safe-area-inset-top));
    }
    
    #balanceStatsModal .modal-header {
        border-radius: 20px 20px 0 0 !important;
        padding-top: 16px !important;
    }
    
    /* Adjust withdraw section padding */
    .withdraw-section-card {
        padding: 20px !important;
    }
    
    .withdraw-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .btn-withdraw-action {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    .withdraw-features {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
        padding: 16px !important;
    }
    
    .withdraw-feature-item {
        padding: 12px !important;
        gap: 10px;
    }
    
    .withdraw-feature-icon {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* ===== REFINED MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Force bottom nav on top of everything with fixed size */
    .bottom-nav {
        z-index: 99999 !important;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important;
        height: auto !important;
        min-height: 60px !important;
        max-height: 80px !important;
    }
    .bottom-nav-item {
        padding: 6px 4px !important;
        gap: 4px !important;
        flex: 1 !important;
        max-width: 70px !important;
    }
    .bottom-nav-item svg {
        width: 22px !important;
        height: 22px !important;
        flex-shrink: 0 !important;
    }
    .bottom-nav-item span {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    /* Fix home page footer - compact on mobile, no extra space */
    .footer {
        padding: 20px 0 !important;
        margin-bottom: 0 !important;
    }
    .footer-content {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
    body {
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    html {
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Fix dashboard background - no grey bar */
    .dashboard-layout {
        background: #ffffff !important;
        min-height: 100vh !important;
    }
    .main-content {
        background: #ffffff !important;
    }

    /* Ensure content isn't hidden behind nav */
    body {
        padding-bottom: 90px;
    }
    
    /* Fix main content padding */
    .main-content {
        padding-bottom: 100px;
    }

    /* Reduce font sizes for mobile */
    .dashboard-header h1 {
        font-size: 24px !important;
        margin-bottom: 4px;
    }
    
    .dashboard-header .text-muted {
        font-size: 13px !important;
    }
    
    .balance-card .card-title {
        font-size: 13px !important;
    }
    
    .total-balance-value {
        font-size: 32px !important;
    }
    
    .metric-value {
        font-size: 28px !important;
    }
    
    .balance-change {
        font-size: 13px !important;
    }
    
    .withdraw-section-title h2 {
        font-size: 22px !important;
    }
    
    .withdraw-section-title p {
        font-size: 13px !important;
    }
    
    .withdraw-feature-label {
        font-size: 13px !important;
    }
    
    .withdraw-feature-desc {
        font-size: 11px !important;
    }
    
    .balance-section h2 {
        font-size: 18px !important;
        margin-bottom: 12px;
        padding: 0 4px;
    }
    
    .asset-symbol, .chain-name {
        font-size: 14px !important;
    }
    
    .asset-name {
        font-size: 12px !important;
    }
    
    .asset-value-crypto, .chain-balance {
        font-size: 15px !important;
    }
    
    .asset-value-usd {
        font-size: 12px !important;
    }
    
    /* Reduce padding in cards */
    .balance-card {
        padding: 16px !important;
    }
    
    .withdraw-section-card {
        padding: 20px !important;
    }
    
    .asset-item, .chain-item {
        padding: 12px !important;
    }

    /* Balance Stats Modal Optimization - Compact on Mobile */
    #balanceStatsModal .modal-content.modal-large {
        max-width: calc(100% - 32px) !important;
        max-height: calc(100vh - 40px) !important;
        width: calc(100% - 32px) !important;
        margin: 20px 16px !important;
        border-radius: 20px !important;
    }
    
    #balanceStatsModal .modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    #balanceStatsModal .modal-header {
        padding: 16px 20px !important;
        border-radius: 20px 20px 0 0 !important;
    }
    
    #balanceStatsModal .modal-header h2 {
        font-size: 18px !important;
    }
    
    #balanceStatsModal .modal-body {
        padding: 16px !important;
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
    }
    
    /* Analytics & Charts Optimization */
    #balanceStatsModal .analytics-grid {
        gap: 12px !important;
        grid-template-columns: 1fr !important;
    }

    #balanceStatsModal .chart-card {
        padding: 14px !important;
        border-radius: 12px !important;
    }
    
    #balanceStatsModal .chart-card h3 {
        font-size: 13px !important;
        margin-bottom: 10px !important;
        font-weight: 600 !important;
    }
    
    #balanceStatsModal #userBarChart {
        min-width: 200px !important;
        height: 140px !important;
        padding-top: 10px !important;
    }
    
    #balanceStatsModal .pie-chart {
        width: 100px !important;
        height: 100px !important;
    }
    
    #balanceStatsModal .chart-legend {
        font-size: 10px !important;
        gap: 4px !important;
    }
    
    #balanceStatsModal .chart-legend > div {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    
    /* Optimize withdraw modal forms */
    .withdraw-label {
        font-size: 12px !important;
    }
    
    .withdraw-input {
        font-size: 14px !important;
        padding: 12px 14px !important;
    }
    
    .token-card {
        padding: 16px !important;
    }
    
    .token-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .token-name {
        font-size: 14px !important;
    }
    
    .token-balance {
        font-size: 11px !important;
    }
    
    .mixer-card {
        padding: 14px !important;
    }
    
    .mixer-name {
        font-size: 13px !important;
    }
    
    .mixer-info {
        font-size: 11px !important;
    }
    
    .summary-label {
        font-size: 12px !important;
    }
    
    .summary-value {
        font-size: 13px !important;
    }
    
    .summary-total .summary-value {
        font-size: 16px !important;
    }
    
    .withdraw-submit-btn {
        font-size: 14px !important;
        padding: 14px 20px !important;
    }

    .asset-list, .chain-list {
        gap: 12px;
    }

    .asset-item, .chain-item {
        padding: 16px;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
        transition: transform 0.2s;
    }
    
    .asset-item:active, .chain-item:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.9);
    }

    .asset-info, .chain-info {
        min-width: 0; /* Enable text truncation */
    }
    
    .asset-details, .chain-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Optimize Chain Items Layout */
    .chain-item {
        flex-wrap: wrap;
    }
    
    .chain-info {
        flex: 1 1 auto;
        min-width: 40%;
    }
    
    .chain-assets {
        display: none; /* Hide assets on mobile to clean up UI */
    }
    
    .chain-balance {
        margin-left: auto;
        font-weight: 700;
        font-size: 15px;
    }
    
    /* Optimize Asset Items */
    .asset-value-crypto {
        font-size: 15px;
        font-weight: 700;
    }
    
    .asset-value-usd {
        font-size: 13px;
    }

    /* Withdraw Modal Scroll Fix */
    .withdraw-body {
        padding: 20px 16px 100px; /* Extra bottom padding for mobile scroll */
        max-height: calc(100vh - 80px); /* Account for header */
    }

    /* ===== FURTHER REFINEMENTS (FINAL TOUCHES) ===== */
    
    /* 1. Optimize Withdraw Features Grid (2x2) */
    .withdraw-features {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
    }

    .withdraw-feature-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .withdraw-feature-icon {
        margin-bottom: 8px;
        width: 36px;
        height: 36px;
    }
    
    .withdraw-feature-label {
        font-size: 13px !important;
    }
    
    .withdraw-feature-desc {
        font-size: 11px !important;
        line-height: 1.3;
    }

    /* 2. Compact Header Typography */
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .withdraw-section-title h2 {
        font-size: 22px !important;
    }
    
    .section-header h2 {
        font-size: 20px;
    }

    /* 3. Better Touch Targets & Layout */
    .modal-header .btn-icon, 
    .withdraw-header .btn-close {
        width: 44px; /* Larger touch target */
        height: 44px;
        background: rgba(0,0,0,0.03);
        border-radius: 12px;
    }

    .settings-card {
        padding: 20px !important; /* Reduce padding on mobile */
    }

    /* 4. Optimize Balance/Chain Lists */
    .asset-icon, .chain-icon {
        width: 32px;
        height: 32px;
    }
    
    .asset-list, .chain-list {
        gap: 8px;
    }

    .asset-item, .chain-item {
        padding: 12px 16px;
        min-height: 64px;
    }

    /* 5. Payment History Mobile Layout */
    .payment-history-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .payment-history-info {
        width: 100%;
    }
    
    .payment-amount {
        text-align: left;
        margin-top: 4px;
        font-size: 16px;
    }

    /* 6. Scrollable Tabs */
    .app-navbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    .app-navbar::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }
    
    .app-nav-item {
        white-space: nowrap;
        padding: 14px 20px;
        flex: 0 0 auto;
    }
}

/* Mobile Only Utility */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
}

/* ===== SMALL SCREEN OPTIMIZATIONS (< 380px) ===== */
@media (max-width: 380px) {
    /* Tighter layout for small phones (iPhone SE, older Androids) */
    
    /* Header */
    .dashboard-header h1 {
        font-size: 20px !important;
    }
    
    .dashboard-header .btn-primary {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Token Grid */
    .token-grid, .network-grid {
        grid-template-columns: 1fr 1fr !important; /* Force 2 columns */
        gap: 8px;
    }
    
    .token-card, .network-card {
        padding: 12px;
    }
    
    .token-icon, .network-card-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .token-name, .network-card-name {
        font-size: 13px;
    }
    
    .token-balance {
        font-size: 11px;
    }

    /* Withdraw Features */
    .withdraw-features {
        gap: 8px;
    }
    
    .withdraw-feature-item {
        padding: 10px;
    }
    
    .withdraw-feature-icon {
        width: 32px;
        height: 32px;
    }

    /* Balance Cards */
    .balance-card {
        padding: 16px;
    }
    
    .total-balance-value {
        font-size: 28px !important;
    }

    /* Modals */
    .withdraw-header {
        padding: 20px 20px 16px;
    }
    
    .withdraw-title h2 {
        font-size: 20px !important;
    }
    
    .withdraw-body {
        padding: 16px 12px 100px;
    }
    
    .asset-item, .chain-item {
        padding: 10px;
    }
    
    .asset-icon, .chain-icon {
        width: 28px;
        height: 28px;
    }
    
    .chain-balance, .asset-value-crypto {
        font-size: 14px;
    }
    
    /* Ensure charts fit */
    .chart-card {
        padding: 16px !important;
    }
    
    #userBarChart {
        min-width: 240px !important;
    }
}


/* ===== ANALYTICS MODALS BASE STYLES ===== */
.analytics-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.analytics-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 40px;
    padding: 60px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 80px rgba(0,0,0,0.1);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-modal-content.balance-modal {
    max-width: 800px;
}


/* ===== MOBILE RESPONSIVE MODALS & FORMS ===== */
@media (max-width: 768px) {
    /* 1. Analytics Modals (Asset Allocation, Payments Activity) */
    .analytics-overlay,
    .analytics-modal-overlay {
        padding: 0 !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .analytics-content,
    .analytics-modal-content {
        padding: 60px 20px 120px 20px !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        display: block !important;
        text-align: center !important;
    }

    .analytics-content h2,
    .analytics-modal-content h2,
    .analytics-modal-content .analytics-title {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }

    .analytics-content p,
    .analytics-modal-content p,
    .analytics-modal-content .analytics-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }

    .analytics-modal-content .analytics-badge {
        margin-bottom: 12px !important;
    }

    .analytics-modal-content .analytics-close-btn {
        top: 16px !important;
        right: 16px !important;
        width: 36px !important;
        height: 36px !important;
        z-index: 10 !important;
    }

    /* Payments Activity Modal */
    .analytics-modal-content.payments-modal .payments-chart {
        height: 160px !important;
        gap: 6px !important;
        margin-bottom: 20px !important;
    }

    .analytics-modal-content.payments-modal .payments-stats {
        flex-wrap: wrap !important;
        gap: 12px !important;
        margin-top: 20px !important;
        padding-top: 16px !important;
    }

    .analytics-modal-content.payments-modal .payments-stats .stat-item {
        flex: 1 1 45% !important;
        min-width: 100px !important;
    }

    .analytics-modal-content.payments-modal .payments-stats .stat-value {
        font-size: 20px !important;
    }

    /* Asset Allocation Modal */
    .analytics-modal-content.balance-modal .analytics-badge {
        display: inline-block !important;
        margin: 0 auto 12px auto !important;
    }

    .analytics-modal-content.balance-modal .balance-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .analytics-modal-content.balance-modal .balance-pie-container {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .analytics-modal-content.balance-modal .balance-pie {
        width: 200px !important;
        height: 200px !important;
        margin: 0 auto !important;
    }

    .analytics-modal-content.balance-modal .balance-pie-center {
        width: 130px !important;
        height: 130px !important;
    }

    .analytics-modal-content.balance-modal .pie-center-value {
        font-size: 20px !important;
    }

    .analytics-modal-content.balance-modal .balance-tokens-container {
        width: 100% !important;
        text-align: left !important;
    }

    .analytics-modal-content.balance-modal .balance-token-item {
        width: 100% !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    .analytics-modal-content.balance-modal .balance-footer {
        flex-direction: column !important;
        gap: 16px !important;
        margin-top: 24px !important;
        padding-top: 20px !important;
    }

    .analytics-modal-content.balance-modal .balance-footer-info {
        width: 100% !important;
    }

    .analytics-modal-content.balance-modal .balance-refresh-btn {
        width: 100% !important;
    }

    .analytics-grid-two-col {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .analytics-chart-container {
        width: 220px !important;
        height: 220px !important;
    }

    .analytics-chart-inner {
        width: 140px !important;
        height: 140px !important;
    }

    .analytics-chart-inner div:first-child {
        font-size: 12px !important;
    }

    .analytics-chart-inner div:last-child {
        font-size: 22px !important;
    }

    .analytics-footer {
        flex-direction: column !important;
        gap: 20px !important;
        margin-top: 32px !important;
        padding-top: 24px !important;
    }
    
    /* 2. Withdraw Modal */
    .withdraw-modal {
        max-width: 100% !important;
        width: 95% !important;
        border-radius: 32px !important;
    }
    
    .withdraw-header, .withdraw-body {
        padding: 24px !important;
    }
    
    .withdraw-body form div[style*="margin-bottom: 32px"] {
        margin-bottom: 24px !important;
    }
    
    .network-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .withdraw-summary {
        padding: 20px !important;
        border-radius: 20px !important;
    }
    
    /* 3. Business Registration & Edit Modals */
    #createAppModal .modal-content, 
    #editAppModal .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        border-radius: 32px !important;
    }
    
    #createAppModal .modal-header, 
    #createAppModal form,
    #editAppModal .modal-header,
    #editAppModal .edit-navbar,
    .modal-tab-content {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
    
    #editAppModal .modal-header {
        padding-top: 32px !important;
    }
    
    #editAppModal h2 {
        font-size: 24px !important;
    }
    
    .modal-tab-content[data-tab-content="general"] > div {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .modal-tab-content[data-tab-content="general"] > div > div {
        padding: 24px !important;
    }
    
    .modal-tab-content[data-tab-content="general"] > div:last-child {
        flex-direction: column !important;
        gap: 12px !important;
        padding-top: 24px !important;
    }
    
    .modal-tab-content[data-tab-content="general"] > div:last-child button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .edit-navbar {
        overflow-x: auto !important;
        padding-bottom: 8px !important;
        margin-bottom: 24px !important;
    }
    
    .edit-navbar button {
        padding: 10px 16px !important;
        white-space: nowrap !important;
    }
    
    /* 4. Business Created (Success) Modal */
    .global-success-overlay {
        padding: 12px !important;
    }
    
    .success-modal {
        padding: 32px 24px !important;
        border-radius: 32px !important;
    }
    
    #successModalInfo {
        padding: 20px !important;
        margin-bottom: 32px !important;
    }

    /* 5. Edit Modal Tab Navigation - Mobile Optimized */
    #editAppModal .edit-navbar,
    .edit-navbar {
        display: flex !important;
        gap: 4px !important;
        padding: 0 20px 12px 20px !important;
        margin-bottom: 20px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        flex-wrap: nowrap !important;
    }

    #editAppModal .edit-navbar::-webkit-scrollbar,
    .edit-navbar::-webkit-scrollbar {
        display: none !important;
    }

    #editAppModal .edit-navbar button,
    .edit-navbar button,
    .edit-navbar .app-nav-item {
        padding: 10px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        min-width: auto !important;
    }

    /* 6. Edit Modal Content Areas - Mobile Padding */
    #editAppModal .modal-tab-content,
    .modal-tab-content {
        padding: 0 20px 24px 20px !important;
    }

    /* 7. General Tab - Single Column Grid */
    .modal-tab-content[data-tab-content="general"] > div:first-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .modal-tab-content[data-tab-content="general"] > div:first-child > div {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    /* 8. General Tab - Action Buttons Stack */
    .modal-tab-content[data-tab-content="general"] > div:last-child {
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 20px !important;
        padding-top: 20px !important;
    }

    .modal-tab-content[data-tab-content="general"] > div:last-child > div {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .modal-tab-content[data-tab-content="general"] > div:last-child button {
        width: 100% !important;
        justify-content: center !important;
    }

    /* 9. Networks Tab - Responsive Grid */
    #networksList {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .modal-tab-content[data-tab-content="networks"] > div {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    /* 10. History Tab - Mobile Optimized */
    .modal-tab-content[data-tab-content="history"] > div {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    #historyScrollContainer {
        max-height: 320px !important;
    }

    /* 11. Security Tab - Stack Layout */
    .modal-tab-content[data-tab-content="security"] > div {
        gap: 16px !important;
    }

    .modal-tab-content[data-tab-content="security"] > div > div {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .modal-tab-content[data-tab-content="security"] > div > div > div:last-child {
        flex-direction: column !important;
        gap: 16px !important;
        align-items: stretch !important;
    }

    .modal-tab-content[data-tab-content="security"] button {
        width: 100% !important;
    }

    /* 12. Edit Modal Header - Compact */
    #editAppModal .modal-header {
        padding: 28px 20px 16px 20px !important;
    }

    #editAppModal .modal-header h2,
    #editAppModal h2#editAppTitle {
        font-size: 22px !important;
    }

    #editAppModal .modal-header > div:first-child > div:first-child {
        font-size: 11px !important;
        padding: 5px 12px !important;
        margin-bottom: 10px !important;
    }

    /* 13. Create Business Modal - Mobile */
    #createAppModal .modal-content {
        width: 95% !important;
        border-radius: 28px !important;
    }

    #createAppModal .modal-header {
        padding: 28px 20px 16px 20px !important;
    }

    #createAppModal form {
        padding: 0 20px 28px 20px !important;
    }

    #createAppModal form > div:first-child {
        gap: 16px !important;
        margin-bottom: 24px !important;
    }

    #createAppModal form > div:last-child {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #createAppModal form > div:last-child button {
        flex: none !important;
        width: 100% !important;
    }

    /* 14. Success Modal - Mobile Compact */
    .success-modal {
        padding: 28px 20px !important;
    }

    .success-modal > div:first-child {
        width: 64px !important;
        height: 64px !important;
        font-size: 28px !important;
        margin-bottom: 24px !important;
    }

    .success-modal h2 {
        font-size: 22px !important;
    }

    /* 15. Payment Link Modal - Mobile */
    #paymentLinkModal .modal-content {
        width: 95% !important;
        border-radius: 28px !important;
    }

    #paymentLinkModal .modal-header {
        padding: 28px 20px 16px 20px !important;
    }

    #paymentLinkModal .modal-body {
        padding: 0 20px 24px 20px !important;
    }

    #paymentLinkModal .modal-body > div:nth-child(2) {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }

    #paymentLinkModal .modal-body > div:nth-child(2) > div:first-child {
        width: 120px !important;
        height: 120px !important;
        padding: 12px !important;
    }

    #paymentLinkModal .modal-body > div:last-child {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #paymentLinkModal .modal-body > div:last-child button {
        flex: none !important;
        width: 100% !important;
    }

    #paymentLinkModal .modal-footer {
        padding: 20px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Networks grid single column on very small screens */
    #networksList {
        grid-template-columns: 1fr !important;
    }

    .edit-navbar button,
    .edit-navbar .app-nav-item {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    #editAppModal .modal-header h2,
    #editAppModal h2#editAppTitle {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .network-grid {
        grid-template-columns: 1fr !important;
    }
    
    .analytics-content {
        padding: 24px 20px !important;
    }
    
    .analytics-content h2 {
        font-size: 24px !important;
    }
}

/* ===== DASHBOARD SPECIFIC RESPONSIVENESS ===== */
@media (max-width: 1024px) {
    /* Withdraw Funds Section in Dashboard */
    div[style*="margin-bottom: 48px"][style*="padding: 40px"] {
        flex-direction: column !important;
        padding: 32px 24px !important;
        text-align: center !important;
        gap: 24px !important;
    }
    
    div[style*="margin-bottom: 48px"] p {
        max-width: 100% !important;
    }
    
    div[style*="margin-bottom: 48px"] div[style*="display: flex; gap: 24px"] {
        justify-content: center !important;
    }
    
    #withdrawBtn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Transactions Analytics Section */
    .balance-section {
        padding: 32px 24px !important;
    }
    
    .balance-section > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
    }
    
    .balance-section .tx-view-btn {
        padding: 8px 12px !important;
    }
    
    div[style*="display: flex; align-items: center; gap: 60px"] {
        flex-direction: column !important;
        gap: 32px !important;
        align-items: center !important;
    }
    
    #txLegendList {
        width: 100% !important;
        grid-template-columns: 1fr !important;
    }
    
    .period-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 768px) {
    /* Nav bar horizontal scroll on mobile */
    .balance-section div[style*="background: #f1f5f9; padding: 4px"] {
        overflow-x: auto !important;
        width: 100% !important;
        padding: 8px !important;
    }
}

/* ===== SANDBOX / TEST MODE ===== */

.test-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #f97316;
    color: #fff;
    text-align: center;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.test-mode-banner span {
    font-weight: 800;
    text-transform: uppercase;
}

/* No layout shifts — banner overlays the top edge */

/* Toggle row inside sidebar-footer */
.env-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.env-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

body.sandbox-mode .env-toggle-label {
    color: #ea580c;
    font-weight: 700;
}

/* iOS-style toggle switch */
.env-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    border: none;
    background: #e2e8f0;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s;
    flex-shrink: 0;
}

.env-switch.on {
    background: #f97316;
}

.env-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s;
}

.env-switch.on .env-switch-knob {
    transform: translateX(20px);
}

/* Sidebar-footer needs flex-wrap for the toggle row */
.sidebar-footer {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .test-mode-banner {
        font-size: 10px;
        padding: 4px 12px;
    }

    /* No layout shifts on mobile either */

    .env-toggle-row {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .env-switch {
        width: 38px;
        height: 22px;
    }

    .env-switch-knob {
        width: 18px;
        height: 18px;
    }

    .env-switch.on .env-switch-knob {
        transform: translateX(16px);
    }
}
