/* --- Home Grid (Sub Images) --- */
.sub-images-grid { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 25px; 
    overflow-x: auto; 
    padding-bottom: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sub-images-grid::-webkit-scrollbar { display: none; }
.sub-image-card { 
    flex: 0 0 46%; 
    background: var(--bg-card); 
    border-radius: 12px; 
    padding: 15px; 
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.sub-image-card i { font-size: 1.2rem; color: var(--primary-accent); }
.sub-image-card .title { font-size: 0.8rem; font-weight: 700; color: #fff; }
.sub-image-card .desc { font-size: 0.65rem; color: var(--text-secondary); line-height: 1.3; }

:root {
    --bg-main: #0a0a0a;
    --bg-card: #141414;
    --bg-input: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border: #262626;
    --primary-accent: #BBEB01; 
    --primary-accent-hover: #a3cc01;
    --on-accent: #000000;
    --success: #2ebd85;
    --danger: #f6465d;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Loader --- */
.app-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(187, 235, 1, 0.05);
    border-top: 2px solid var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(187, 235, 1, 0.1);
}

.loader-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: loaderTextPulse 2s ease-in-out infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes loaderTextPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 90px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

::selection {
    background: var(--primary-accent);
    color: var(--on-accent);
}

/* --- Header --- */
header {
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-actions { display: flex; gap: 12px; }

.btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-login { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-signup { background: var(--primary-accent); color: var(--on-accent); }

/* --- View Management --- */
.view-content { display: none; width: 100%; overflow-x: hidden; }
.view-content.active { display: block; }

main {
    flex: 1;
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

/* --- Home Tab Components --- */
.hero-slider {
    width: 100%;
    height: 200px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.hero-track { display: flex; height: 100%; transition: transform 0.6s ease; }

.hero-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(90deg, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.2) 100%);
}

.hero-slide h2 { font-size: 1.8rem; color: var(--primary-accent); margin-bottom: 5px; }

.sub-slider-wrap { margin-bottom: 25px; overflow: hidden; position: relative; }
.sub-slider-track { display: flex; gap: 12px; }
.sub-slide {
    min-width: calc(50% - 6px);
    height: 110px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.sub-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.sub-slide-label { position: absolute; bottom: 10px; left: 10px; font-size: 0.8rem; font-weight: 600; }

.create-card {
    background: var(--bg-card);
    border-radius: 0 0 24px 24px;
    padding: 35px 28px 28px;
    margin-bottom: 30px;
    position: relative;
    transition: var(--transition);
}

.create-card.protection-border {
    border: 8px solid #1a1a1a; /* Frame Border */
    border-top: none; /* Connect to model card */
}

/* The separate but attached model card */
.model-attached-card {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 8px solid #1a1a1a;
    border-radius: 24px 24px 0 0;
    padding: 14px 24px;
    position: relative;
    z-index: 10;
    cursor: pointer;
    transition: var(--transition);
}

.m-icon {
    width: 32px;
    height: 32px;
    background: #262626;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-accent);
    font-size: 1rem;
}

.m-details { display: flex; flex-direction: column; flex: 1; margin-left: 12px; }
.m-details .m-label { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }
.m-details .m-value { font-size: 0.95rem; font-weight: 700; color: #fff; }

.model-dropdown-list {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 2px solid #262626;
    border-radius: 12px;
    padding: 8px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: slideDown 0.25s ease-out;
}

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

.model-dropdown-list.active { display: flex; }

.model-opt {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    color: var(--text-secondary);
}

.model-opt:hover {
    background: rgba(187, 235, 1, 0.1);
    color: #fff;
}

.model-opt.selected {
    background: rgba(187, 235, 1, 0.15);
    color: var(--primary-accent);
}

.model-opt i { font-size: 0.75rem; opacity: 0; }
.model-opt.selected i { opacity: 1; }

.metric { display: flex; flex-direction: column; gap: 2px; }
.create-card h2 { font-size: 1.2rem; margin-bottom: 15px; }

.risk-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.risk-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
}
.risk-item.active { background: var(--primary-accent); color: var(--on-accent); }
.btn-launch { width: 100%; padding: 15px; background: var(--primary-accent); color: var(--on-accent); border: none; border-radius: 10px; font-weight: 700; margin-top: 15px; }

.trades-container { margin-bottom: 30px; }
.trades-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.trades-row-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.trades-row-title span { font-size: 0.7rem; background: var(--bg-input); padding: 2px 10px; border-radius: 12px; color: var(--primary-accent); font-weight: 700; }
.nav-arrows { display: flex; gap: 8px; }
.arrow-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.scroller-viewport { overflow: hidden; width: 100%; }
.scroller-track { display: flex; gap: 12px; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); width: max-content; }
.trader-card { width: 200px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.trader-header { display: flex; flex-direction: column; }
.trader-header .name { font-size: 0.9rem; font-weight: 700; }
.trader-header .uid { font-size: 0.65rem; color: var(--text-secondary); }
.pnl-row { display: flex; justify-content: space-between; align-items: center; }
.pnl-value { font-size: 1rem; font-weight: 800; }
.pnl-value.positive { color: var(--success); }
.unrealized-label { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; }

.cta-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 30px; text-align: center; margin-bottom: 40px; }
.cta-section h2 { font-size: 1.5rem; margin-bottom: 12px; font-weight: 700; }
.cta-section p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; justify-content: center; gap: 16px; }

/* --- Trades Tab Components --- */
.trades-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.trades-filter-bar::-webkit-scrollbar { display: none; }
.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
}

.running-trades-list { display: flex; flex-direction: column; gap: 12px; }
.running-trade-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: var(--transition); cursor: pointer; }
.trade-card-compact { display: flex; justify-content: space-between; align-items: center; }
.pair-label { font-weight: 700; font-size: 0.95rem; }
.pnl-label-compact { font-weight: 800; color: var(--success); font-size: 0.95rem; }
.trade-card-details { display: none; margin-top: 15px; border-top: 1px solid var(--border); padding-top: 15px; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.running-trade-card.expanded .trade-card-details { display: grid; }
.expand-btn { background: var(--bg-input); border: 1px solid var(--border); width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.running-trade-card.expanded .expand-btn { transform: rotate(180deg); border-color: var(--primary-accent); color: var(--primary-accent); }
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 0.65rem; color: var(--text-secondary); text-transform: uppercase; }
.metric-value { font-size: 0.85rem; font-weight: 600; }
.more-info-btn { grid-column: span 2; padding: 10px; background: rgba(187, 235, 1, 0.1); color: var(--primary-accent); border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 700; margin-top: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* --- Agents Tab Components --- */
.agent-setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.setup-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #121212;
}
.setup-header h3 { font-size: 1rem; color: var(--primary-accent); }

.setup-body {
    display: none;
    padding: 24px;
    border-top: 1px solid var(--border);
}
.agent-setup-card.expanded .setup-body { display: block; }
.agent-setup-card.expanded .setup-header i { transform: rotate(180deg); color: var(--primary-accent); }

.input-group { margin-bottom: 16px; position: relative; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}
.eye-btn {
    position: absolute;
    right: 12px;
    bottom: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.config-list-header { margin: 30px 0 15px; font-size: 1.1rem; font-weight: 700; }

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-info { display: flex; align-items: center; gap: 12px; }
.exchange-icon {
    width: 36px; height: 36px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-accent);
    font-size: 1.1rem;
}

.config-details h4 { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.config-subtitle-row { display: flex; align-items: center; gap: 4px; }

.mini-badge {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.52rem;
    font-weight: 800;
    color: #efefef;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0.2px;
}

.model-badge {
    background: #262626;
    border-color: #444;
    color: #ffffff;
}

.status-badge-green {
    background: #2ebd85; /* Hard Solid Green */
    border-color: #2ebd85;
    color: #000000;
}
.status-badge-red {
    background: #f6465d; /* Hard Solid Red */
    border-color: #f6465d;
    color: #ffffff;
}

.config-actions { display: flex; align-items: center; gap: 12px; }

/* Square Rounded Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-input);
    transition: .4s;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 3px;
}
input:checked + .slider { background-color: var(--primary-accent); border-color: var(--primary-accent); }
input:checked + .slider:before { transform: translateX(20px); background-color: var(--on-accent); }

.btn-signup:hover { background-color: var(--primary-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(187, 235, 1, 0.2); }

.btn-google {
    background: #fff !important;
    color: #000 !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    border: 1px solid #e0e0e0 !important;
    transition: var(--transition) !important;
    width: 100% !important;
    padding: 12px !important;
    border-radius: 12px !important;
}
.btn-google:hover {
    background: #f8f8f8 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.btn-google img {
    width: 20px;
    height: 20px;
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    opacity: 0.3;
}
.auth-separator::before, .auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--text-secondary);
}
.auth-separator span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.btn-edit-config {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center; justify-content: center;
    transition: var(--transition);
}
.btn-edit-config:hover { border-color: var(--primary-accent); color: var(--primary-accent); }

.disclaimer-box {
    background: rgba(255,255,255,0.03);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.disclaimer-box p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }

.sheet-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

/* --- Bottom Sheet --- */
.bottom-sheet-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 2000; display: none; opacity: 0; transition: opacity 0.3s ease; }
.bottom-sheet-overlay.active { display: block; opacity: 1; }
.bottom-sheet { position: fixed; bottom: -100%; left: 0; width: 100%; background: var(--bg-card); border-top-left-radius: 24px; border-top-right-radius: 24px; padding: 24px 5% 40px; z-index: 2001; transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-top: 2px solid var(--border); max-height: 85vh; overflow-y: auto; }
.bottom-sheet.active { bottom: 0; }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 20px; }
.sheet-header { margin-bottom: 24px; text-align: center; }
.sheet-header h3 { font-size: 1.2rem; font-weight: 700; color: var(--primary-accent); }
.sheet-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.sheet-metric { border: 1px solid var(--border); padding: 16px; border-radius: 12px; background: var(--bg-input); }
.sheet-metric .label { font-size: 0.65rem; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; }
.sheet-metric .value { font-size: 1rem; font-weight: 700; }
.sheet-metric .value.tp { color: var(--success); }
.sheet-metric .value.sl { color: var(--danger); }

/* --- Footer --- */
.main-footer { background: var(--bg-main); border-top: 1px solid var(--border); padding: 50px 5% 100px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; margin-bottom: 40px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand .logo { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 16px; display: block; }
.footer-brand p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; max-width: 300px; margin-bottom: 24px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 24px; text-transform: none; letter-spacing: 0.5px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { text-decoration: none; color: var(--text-secondary); font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary-accent); }

.sheet-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 2500;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.sheet-close-btn:hover { background: rgba(0, 0, 0, 0.7); border-color: var(--primary-accent); }

/* --- Profile Tab Components --- */
.profile-user-card {
    background: transparent;
    border: none;
    padding: 0 0 30px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    overflow: hidden;
}
.profile-avatar {
    flex-shrink: 0;
    width: 70px; height: 70px;
    position: relative;
    background: #1a1a1a;
    border: 2px solid var(--primary-accent);
    border-radius: 50%;
    padding: 3px;
}
.profile-avatar img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.profile-meta { flex: 1; min-width: 0; overflow: hidden; }
.profile-meta h2 { font-size: 1.25rem; margin-bottom: 2px; font-weight: 700; color: #fff; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.profile-meta .email { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 2px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.profile-meta .uid { font-size: 0.75rem; color: var(--primary-accent); font-weight: 600; opacity: 0.8; }

.stat-card-premium { background: #141a1f; border-radius: 24px; padding: 25px; margin-bottom: 20px; }
.stat-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.stat-card-header h4 { font-size: 1rem; font-weight: 800; color: #fff; margin: 0; }

.gauge-container { position: relative; width: 100%; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 10px 0 20px; }
.gauge-svg { width: 100%; max-width: 280px; height: auto; }
.gauge-bg { fill: none; stroke: #1e2329; stroke-width: 14; stroke-dasharray: 4, 1.5; }
.gauge-bar { fill: none; stroke: var(--primary-accent); stroke-width: 14; stroke-dasharray: 4, 1.5; transition: stroke-dashoffset 1.5s ease; }

.gauge-center-text { position: absolute; bottom: 0; text-align: center; width: 100%; }
.gauge-value { font-size: 2.4rem; font-weight: 900; color: #fff; line-height: 1; margin-bottom: 5px; }
.gauge-label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }

.pnl-mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.pnl-mini-card { background: #0b0e11; padding: 15px; border-radius: 16px; border: 1px solid #1e2329; }
.pnl-mini-card .label { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 10px; display: block; font-weight: 600; }
.pnl-mini-card .val { font-size: 1.15rem; font-weight: 900; color: #fff; display: block; margin-bottom: 5px; }
.pnl-mini-card .change { font-size: 0.75rem; font-weight: 700; color: var(--success); display: flex; align-items: center; gap: 4px; }

.mini-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 10px; }
.mini-data-card { background: #0e0e0e; border: 1px solid #1a1a1a; padding: 12px; border-radius: 12px; text-align: left; overflow: hidden; }
.mini-data-card .label { font-size: 0.65rem; color: var(--text-secondary); margin-bottom: 8px; white-space: nowrap; }
.mini-data-card .value-row { display: flex; align-items: baseline; gap: 8px; }
.mini-data-card .value { font-size: 0.95rem; font-weight: 700; color: #fff; }
.mini-data-card .change { font-size: 0.65rem; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.change.up { color: var(--success); }
.change.down { color: var(--danger); }

.profile-menu-section { margin-bottom: 20px; }
.menu-list { list-style: none; }
.menu-item {
    display: flex; align-items: center; gap: 15px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}
.menu-item:last-child { border-bottom: none; }
.menu-item i { width: 20px; color: var(--text-secondary); font-size: 1.1rem; }
.menu-item span { flex: 1; font-size: 0.95rem; font-weight: 500; }
.menu-item .arrow-right { font-size: 0.8rem; color: var(--border); }
.menu-item:hover { color: var(--primary-accent); }
.menu-item:hover i { color: var(--primary-accent); }

.profile-actions-wrap { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; padding: 0 5px; }
.btn-logout-prof { background: #f6465d; color: #fff; border: none; width: 100%; padding: 20px; border-radius: 18px; font-weight: 800; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: var(--transition); margin-bottom: 15px; }
.btn-logout-prof:hover { background: #e03e52; transform: translateY(-2px); }

.btn-delete-prof { background: transparent; color: #f6465d; border: 1px solid #1e2329; width: 100%; padding: 18px; border-radius: 18px; font-weight: 800; font-size: 0.95rem; cursor: pointer; text-align: center; transition: var(--transition); }
.btn-delete-prof:hover { border-color: #f6465d; background: rgba(246, 70, 93, 0.05); }

.logout-group { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 20px; }

/* --- Binance Style Analytics --- */
.analytics-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0b0e11;
    z-index: 3000;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 100px;
}
.analytics-overlay.active { display: block; }
.analytics-header-binance { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 15px 16px; position: sticky; top: 0; background: #0b0e11; z-index: 10;
}
.header-title-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-left: auto; }
.header-title-wrap h2 { font-size: 1.1rem; font-weight: 600; color: #fff; }
.header-title-wrap i { font-size: 0.8rem; color: var(--text-secondary); }

.analytics-tabs-row { display: flex; gap: 24px; padding: 0 16px; margin-bottom: 25px; border-bottom: 1px solid #1e2329; }
.ana-tab { padding: 12px 0; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); position: relative; cursor: pointer; }
.ana-tab.active { color: #fff; }
.ana-tab.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 3px; background: var(--primary-accent); border-radius: 2px; }

.ana-pnl-section { margin-bottom: 40px; }
.pnl-stats-row { display: flex; justify-content: space-between; margin-top: 20px; }
.stat-item { text-align: left; }
.pnl-value-large { font-size: 2.2rem; font-weight: 800; color: #f6465d; margin-bottom: 25px; letter-spacing: -1px; }
@media (max-width: 767px) { .pnl-value-large { font-size: 1.6rem !important; margin-bottom: 15px !important; } }
.stat-text { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }

.binance-chart-container { width: 100%; height: 180px; padding: 0; margin-bottom: 40px; position: relative; }
.chart-grid-line { stroke: #1e2329; stroke-width: 0.5; }
.chart-step-line { fill: none; stroke: var(--primary-accent); stroke-width: 2; }
.chart-axis-label { font-size: 10px; fill: var(--text-secondary); }
.chart-legend { display: flex; gap: 15px; margin-top: 12px; justify-content: center; }
.chart-legend-item { font-size: 0.65rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 2px; border-radius: 1px; }

.perf-stacked-stats { width: 100%; display: flex; flex-direction: column; gap: 15px; }
.perf-row { display: flex; justify-content: space-between; align-items: center; padding: 0; }
.perf-row .left { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; color: #fff; font-weight: 600; }
.perf-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.perf-row .val { font-size: 1rem; font-weight: 800; color: #fff; }
.win-rate-row { border-top: 1px solid #1e2329; padding-top: 15px; margin-top: 10px; }

/* Arrow Button in Growth Section */
.arrow-btn { 
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.arrow-btn:hover { background: var(--primary-accent) !important; color: #000 !important; border-color: var(--primary-accent) !important; }

/* ---- Desktop Analytics Overrides ---- */
@media (min-width: 1024px) {
    .analytics-overlay {
        left: 260px !important;
        top: 64px !important;
        width: calc(100% - 260px) !important;
        height: calc(100% - 64px) !important;
        padding: 0 0 60px;
    }
    .analytics-header-binance {
        padding: 20px 40px;
        border-bottom: 1px solid #1e2329;
    }
    .ana-desktop-content {
        max-width: 1100px;
        margin: 0 auto;
        padding: 0 40px;
    }
    .analytics-tabs-row { padding: 0 40px; }
    .pnl-summary-section { padding: 0; }
    .ana-desktop-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        align-items: start;
        margin-top: 30px;
    }
    .ana-pnl-col {}
    .ana-summary-col {
        background: #1e2329;
        border-radius: 16px;
        padding: 24px;
        height: 100%;
    }
    .trades-summary-wrap {
        padding: 0 !important;
        margin-top: 0 !important;
    }
    .pnl-value-large { font-size: 2.2rem !important; }
    .pnl-label { font-size: 1.05rem !important; }
    .binance-chart-container { height: 220px !important; }
    .ana-desktop-footer {
        max-width: 1100px;
        margin: 0 auto;
        padding: 20px 40px 0;
    }
    .ana-back-label {
        display: inline;
        font-size: 0.9rem;
        font-weight: 600;
        color: #fff;
    }
    .stat-label-short { display: none !important; }
    .stat-label-full { display: inline !important; }
}

/* ---- Mobile Analytics: Trades Summary Card ---- */
@media (max-width: 1023px) {
    .ana-desktop-content { padding: 0 16px; }
    .ana-desktop-grid { display: flex; flex-direction: column; gap: 0; }
    .ana-summary-col {
        margin: 24px 0 0;
        background: #141a1f;
        border: 1px solid #1e2329;
        border-radius: 16px;
        padding: 20px;
        overflow: hidden;
    }
    .trades-summary-wrap { padding: 0 !important; margin-top: 0 !important; }
    .ana-desktop-footer { padding: 16px 0 0; text-align: center; }
    .ana-return-btn { margin: 0 auto !important; display: block !important; }
    .stat-label-full { display: none !important; }
    .stat-label-short { display: inline !important; }
    .pnl-stats-row {
        justify-content: center !important;
        gap: 24px !important;
    }
    .pnl-stats-row .stat-value {
        font-size: 1.2rem !important;
    }
    .pnl-stats-row .stat-text {
        font-size: 0.72rem !important;
    }
}

.footer-bottom { border-top: 1px solid var(--border); padding: 30px 16px 100px; display: flex; flex-direction: column; gap: 20px; background: var(--bg-main); }
.risk-disclosure { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.6; opacity: 0.6; }
.footer-legal { display: flex; flex-direction: column; gap: 20px; align-items: center; }
@media (min-width: 768px) { .footer-legal { flex-direction: row; justify-content: space-between; } }
.copyright { font-size: 0.75rem; color: var(--text-secondary); }
.social-links { display: flex; gap: 16px; }
.social-links a { width: 36px; height: 36px; background: var(--bg-input); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: var(--transition); }
.social-links a:hover { background: var(--primary-accent); color: var(--on-accent); transform: translateY(-3px); }

/* --- Bottom Nav --- */
.bottom-nav { 
    position: fixed; 
    bottom: 0; left: 0; 
    width: 100%; 
    height: 75px; 
    background: var(--bg-main); 
    border-top: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    z-index: 1000; 
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-link { 
    text-decoration: none; 
    color: var(--text-secondary); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 4px; 
    flex: 1;
    height: 40px;
    border-right: 1px solid var(--border);
    transition: var(--transition);
}
.nav-link:last-child { border-right: none; }
.nav-link.active { color: var(--primary-accent); }
.nav-link i { font-size: 1.2rem; }
.nav-link span { font-size: 0.65rem; font-weight: 600; }

/* --- Auth Sheet Styles --- */
#authSheet { border-top: none !important; }
.auth-step { display: none; }
.auth-step.active { display: block; animation: authFadeIn 0.4s ease; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.auth-banner { 
    width: 100%; 
    height: 180px; 
    position: relative; 
    background: var(--bg-card);
    overflow: hidden;
}
.auth-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fog attached to bottom, fading into the sheet background */
    background: linear-gradient(0deg, var(--bg-card) 0%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5) 100%);
    z-index: 2;
    pointer-events: none;
}
.auth-banner img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.9; 
    z-index: 1;
    display: block;
}

.auth-body-header { margin-bottom: 25px; text-align: left; }
.auth-body-header h3 { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.auth-body-header p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }

.auth-body-wrap { padding: 25px 20px 40px; }

.oken-field { margin-bottom: 16px; }
.oken-field label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px; display: block; font-weight: 600; }

.token-display-box { 
    background: #000; 
    border: 1px dashed var(--primary-accent); 
    padding: 16px; 
    border-radius: 10px; 
    margin: 15px 0; 
    position: relative; 
    font-family: monospace; 
    font-size: 0.85rem; 
}

/* --- Credits & Pricing --- */
.credits-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}
.credits-stats { display: flex; gap: 12px; }
.credit-item { display: flex; flex-direction: column; gap: 2px; }
.credit-item .label { font-size: 0.65rem; color: var(--text-secondary); letter-spacing: 0.5px; white-space: nowrap; }
.credit-item .val { font-size: 1rem; font-weight: 800; color: #fff; }
.credit-item .val.remaining { color: var(--primary-accent); }

.pricing-hero { text-align: center; margin-bottom: 40px; }
.pricing-hero h2 { font-size: 1.8rem; margin-bottom: 10px; }
.pricing-hero p { color: var(--text-secondary); font-size: 0.9rem; }

.purchase-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}
.calc-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; gap: 20px; }
.calc-input-wrap { flex: 1; }
.calc-input-wrap label { font-size: 0.8rem; color: var(--text-secondary); display: block; margin-bottom: 10px; }
.calc-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 15px; color: #fff; font-size: 1.1rem; font-weight: 700; outline: none; }
.calc-input:focus { border-color: var(--primary-accent); }

.price-display { text-align: right; }
.price-display .label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 5px; display: block; }
.price-display .total { font-size: 2rem; font-weight: 900; color: var(--primary-accent); }

.benefits-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 30px; }
@media (min-width: 768px) { .benefits-grid { grid-template-columns: 1fr 1fr; } }
.benefit-item { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-secondary); }
.benefit-item i { color: var(--success); font-size: 0.9rem; }

.token-display-box {
    color: var(--primary-accent); 
    word-break: break-all; 
    line-height: 1.5;
    cursor: pointer;
}
.token-display-box i { position: absolute; right: 12px; top: 12px; color: var(--text-secondary); }

.security-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
.sec-card { background: #1a1a1a; border: 1px solid #333; padding: 12px; border-radius: 8px; text-align: center; }
.sec-card .label { font-size: 0.6rem; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; }
.sec-card .val { font-size: 0.9rem; font-weight: 700; color: #fff; }

.terms-wrap { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; }
.terms-wrap input { margin-top: 3px; }
.terms-wrap span { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
.terms-wrap span b { color: var(--primary-accent); cursor: pointer; }

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #444;
    font-size: 0.7rem;
    font-weight: 700;
}
.auth-separator::before, .auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #1e2329;
}
.auth-separator:not(:empty)::before { margin-right: 15px; }
.auth-separator:not(:empty)::after { margin-left: 15px; }

.btn-google {
    background: #fff;
    color: #000;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-google img { width: 18px; height: 18px; }
.btn-google:hover { background: #f0f0f0; }

/* --- Guest CTA Card --- */
.guest-cta-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    animation: authFadeIn 0.5s ease;
}
.guest-cta-card i.main-icon {
    font-size: 3rem;
    color: var(--primary-accent);
    margin-bottom: 10px;
    opacity: 0.8;
}
.guest-cta-card h2 { font-size: 1.5rem; font-weight: 800; color: #fff; }
.guest-cta-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; max-width: 320px; }
.guest-cta-buttons { display: flex; gap: 12px; width: 100%; max-width: 300px; }
.guest-cta-buttons .btn { flex: 1; padding: 14px; font-size: 0.95rem; }

/* =========================================================
   DESKTOP LAYOUT  (>= 1024px)
========================================================= */
@media (min-width: 1024px) {

    /* Hide mobile-only elements */
    .bottom-nav  { display: none !important; }
    header       { display: none !important; }

    /* Remove mobile body padding */
    body { padding-bottom: 0; flex-direction: row; align-items: stretch; min-height: 100vh; }

    /* App root wrapper */
    .app-layout {
        display: flex;
        flex-direction: row;
        flex: 1;
        min-height: 100vh;
    }

    /* ---- Left Sidebar ---- */
    .desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        width: 260px;
        min-width: 260px;
        background: #0d0d0d;
        border-right: 1px solid var(--border);
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        padding: 0;
        z-index: 900;
    }

    .sidebar-brand {
        padding: 24px 20px 20px;
        border-bottom: 1px solid var(--border);
        font-size: 1.4rem;
        font-weight: 800;
        color: #fff;
        letter-spacing: -0.5px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .sidebar-brand span { color: var(--primary-accent); }

    /* Mode switcher pill */
    .sidebar-mode-switch {
        margin: 14px 16px;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 4px;
        display: flex;
        gap: 4px;
    }
    .mode-pill {
        flex: 1;
        padding: 10px 0;
        text-align: center;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: 9px;
        cursor: pointer;
        color: var(--text-secondary);
        transition: var(--transition);
        letter-spacing: 0.2px;
    }
    .mode-pill.active { background: var(--primary-accent); color: #000; }

    /* Nav groups */
    .sidebar-nav { flex: 1; padding: 8px 0; }

    .sidebar-section-label {
        font-size: 0.6rem;
        color: #444;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        padding: 16px 20px 6px;
        font-weight: 700;
    }

    .sidebar-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        cursor: pointer;
        color: var(--text-secondary);
        font-size: 0.87rem;
        font-weight: 600;
        border-radius: 0;
        transition: var(--transition);
        border-left: 3px solid transparent;
    }
    .sidebar-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
    .sidebar-item.active { color: var(--primary-accent); border-left-color: var(--primary-accent); background: rgba(187,235,1,0.05); }

    .sidebar-item-left { display: flex; align-items: center; gap: 12px; }
    .sidebar-item-left i { font-size: 0.95rem; width: 18px; text-align: center; }

    .sidebar-chevron { font-size: 0.65rem; transition: transform 0.3s ease; }
    .sidebar-chevron.open { transform: rotate(180deg); }

    /* Sub items */
    .sidebar-sub {
        display: none;
        background: rgba(0,0,0,0.2);
        border-left: 2px solid var(--border);
        margin: 0 16px 4px 36px;
        border-radius: 0 8px 8px 0;
        overflow: hidden;
    }
    .sidebar-sub.open { display: block; }

    .sidebar-sub-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 16px;
        font-size: 0.8rem;
        color: #666;
        cursor: pointer;
        transition: var(--transition);
    }
    .sidebar-sub-item:hover { color: #fff; }
    .sidebar-sub-item.active { color: var(--primary-accent); }
    .sidebar-sub-item i { font-size: 0.75rem; width: 14px; }

    /* Sidebar footer */
    .sidebar-footer {
        padding: 16px 20px;
        border-top: 1px solid var(--border);
    }
    .sidebar-user {
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        padding: 10px;
        border-radius: 10px;
        transition: var(--transition);
        border: 1px solid var(--border);
    }
    .sidebar-user:hover { border-color: var(--primary-accent); }
    .sidebar-user-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1px solid var(--primary-accent); }
    .sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .sidebar-user-info { flex: 1; }
    .sidebar-user-info .name { font-size: 0.8rem; font-weight: 700; color: #fff; }
    .sidebar-user-info .status { font-size: 0.65rem; color: var(--success); }

    /* Content area */
    .app-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow-y: auto;
    }

    /* Desktop header bar — full width, spans sidebar + content */
    .desktop-topbar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: #0d0d0d;
        border-bottom: 1px solid var(--border);
        align-items: center;
        padding: 0 32px 0 20px;
        justify-content: space-between;
        z-index: 1100;
    }
    .desktop-topbar-brand {
        font-size: 1.4rem;
        font-weight: 800;
        color: #fff;
        letter-spacing: -0.5px;
        flex-shrink: 0;
        padding-left: 10px;
    }
    .desktop-topbar-actions { display: flex; align-items: center; gap: 14px; }
    .desktop-topbar-actions .btn-login {
        padding: 10px 24px;
        font-size: 0.95rem;
        border-color: var(--border);
    }
    .desktop-topbar-actions .btn-signup {
        padding: 10px 24px;
        font-size: 0.95rem;
    }

    /* Push sidebar below the fixed topbar */
    .desktop-sidebar {
        top: 64px;
        height: calc(100vh - 64px);
    }

    /* Push main body below the fixed topbar */
    body { padding-top: 64px; }

    /* Main content centering */
    main {
        max-width: 900px;
        margin: 0 auto;
        width: 100%;
        padding: 32px 32px;
        padding-bottom: 80px;
    }

    /* Desktop: Bottom sheets become centered modals */
    .bottom-sheet {
        bottom: auto !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
        width: 480px !important;
        max-width: 95vw !important;
        border-radius: 20px !important;
        border-top: none !important;
        border: 1px solid var(--border) !important;
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s ease !important;
        opacity: 0;
        pointer-events: none;
    }
    .bottom-sheet.active {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .sheet-handle { display: none !important; }

    /* Auth sheet on desktop */
    #authSheet {
        width: 480px !important;
        padding: 0 !important;
    }
}

/* Hide sidebar on mobile */
.desktop-sidebar { display: none; }
.desktop-topbar { display: none; }
.ana-back-label { display: none; }
