/* Profile page styles — extracted from profile.html for browser caching */
:root { --accent-green: #00ff88; }
.content-main { padding-top: 0; padding-left: 0; padding-right: 0; }
    /* Hide outlines for mouse clicks, preserve for keyboard (WCAG 2.4.7) */
    a:focus:not(:focus-visible),
    a:active,
    button:focus:not(:focus-visible),
    button:active {
        outline: none;
    }

    .chat-header { background: transparent !important; }

    .profile-container {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 20px;
        padding-top: 60px;
        background: linear-gradient(180deg, #0a0e17 0%, #0d1520 50%, #111a28 100%);
    }

    .profile-content {
        max-width: 800px;
        margin: 0 auto;
    }

    .profile-card {
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 20px;
    }

    .profile-header {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 150, 255, 0.2);
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        font-weight: 600;
        color: var(--bg-primary);
        position: relative;
        cursor: pointer;
        overflow: hidden;
    }

    .profile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    .profile-avatar .avatar-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s ease;
        border-radius: 50%;
        gap: 2px;
    }

    .profile-avatar:hover .avatar-overlay {
        opacity: 1;
    }

    .avatar-overlay svg {
        width: 20px;
        height: 20px;
        color: #fff;
    }

    .avatar-overlay span {
        font-size: 9px;
        color: #fff;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .profile-info h1 {
        font-size: 24px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
    }

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

    .section-title {
        font-family: 'JetBrains Mono', monospace;
        font-size: 14px;
        font-weight: 600;
        color: var(--accent-cyan);
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .section-title svg {
        width: 20px;
        height: 20px;
    }

    .section-title.collapsible {
        cursor: pointer;
        user-select: none;
        transition: opacity 0.15s;
    }
    .section-title.collapsible:hover { opacity: 0.8; }
    .section-collapse-icon {
        margin-left: auto;
        font-size: 16px;
        font-weight: 400;
        color: rgba(255,255,255,0.4);
        transition: transform 0.2s;
        line-height: 1;
    }
    .section-collapsible-body {
        overflow: hidden;
        transition: max-height 0.25s ease, opacity 0.2s ease;
        max-height: 500px;
        opacity: 1;
    }
    .section-collapsible-body.collapsed {
        max-height: 0;
        opacity: 0;
    }

    .refresh-balance-btn {
        margin-left: auto;
        background: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        padding: 4px 6px;
        cursor: pointer;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        transition: color 0.2s, border-color 0.2s;
    }
    .refresh-balance-btn:hover {
        color: var(--accent-cyan);
        border-color: var(--accent-cyan);
    }
    .refresh-balance-btn.spinning svg {
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    .form-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .form-group input {
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.35);
        border-radius: 8px;
        padding: 14px 16px;
        font-family: var(--font-mono);
        font-size: 14px;
        color: var(--text-primary);
        transition: all 0.3s ease;
    }

    .form-group input:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--accent-cyan);
        box-shadow: 0 0 20px rgba(0, 200, 255, 0.2);
    }

    .form-group input:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

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

    .save-btn {
        background: linear-gradient(135deg, #00cfff, #0088ff);
        border: none;
        border-radius: 12px;
        padding: 14px 28px;
        font-family: var(--font-mono);
        font-size: 14px;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        transition: all 0.2s ease;
        width: 100%;
    }

    .save-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 20px rgba(0, 207, 255, 0.4);
    }

    .save-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

    .message {
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 20px;
        font-size: 14px;
        display: none;
    }

    .message.show {
        display: block;
    }

    .message.success {
        background: rgba(0, 255, 157, 0.1);
        border: 1px solid rgba(0, 255, 157, 0.3);
        color: var(--accent-green);
    }

    .message.error {
        background: rgba(255, 100, 100, 0.1);
        border: 1px solid rgba(255, 100, 100, 0.3);
        color: #ff6464;
    }

    /* Markets List */
    .markets-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .market-item {
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 10px;
        padding: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.2s ease;
    }

    .market-item:hover {
        border-color: var(--accent-cyan);
        background: rgba(0, 50, 100, 0.4);
    }

    .market-info {
        flex: 1;
    }

    .market-title {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
        font-size: 14px;
    }

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

    .market-status {
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .market-status.active {
        background: rgba(0, 255, 157, 0.15);
        color: var(--accent-green);
    }

    .market-status.resolved {
        background: rgba(100, 100, 255, 0.15);
        color: #8080ff;
    }

    .market-status.pending {
        background: rgba(255, 200, 0, 0.15);
        color: #ffc800;
    }

    /* Share Buttons */
    .market-share-buttons {
        display: flex;
        gap: 0.5rem;
        margin-left: 1rem;
        flex-shrink: 0;
    }

    .market-share-buttons button {
        background: rgba(0, 100, 150, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.3);
        border-radius: 6px;
        padding: 0.4rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        color: #00cfff;
    }

    .market-share-buttons button:hover {
        background: rgba(0, 150, 255, 0.4);
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(0, 150, 255, 0.3);
    }

    .market-share-buttons button svg {
        width: 16px;
        height: 16px;
    }

    .market-share-buttons .twitter-btn:hover {
        color: #1DA1F2;
        border-color: rgba(29, 161, 242, 0.5);
    }

    .market-share-buttons .telegram-btn:hover {
        color: #0088cc;
        border-color: rgba(0, 136, 204, 0.5);
    }

    .market-share-buttons .copy-btn:hover {
        color: #00ff88;
        border-color: rgba(0, 255, 157, 0.5);
    }

    /* Toast notification */
    .toast-notification {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 200, 100, 0.95);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        font-size: 0.875rem;
        font-weight: 500;
        z-index: 10000;
        box-shadow: 0 4px 20px rgba(0, 200, 100, 0.4);
        animation: fadeInOut 2s ease-in-out forwards;
    }

    @keyframes fadeInOut {
        0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
        10%, 90% { opacity: 1; transform: translateX(-50%) translateY(0); }
        100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    }

    .empty-state {
        text-align: center;
        padding: 40px 20px;
        color: var(--text-secondary);
    }

    .empty-state svg {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
    }

    .empty-state p {
        margin-bottom: 16px;
    }

    .empty-state a {
        color: var(--accent-cyan);
        text-decoration: none;
    }

    .empty-state a:hover {
        text-decoration: underline;
    }

    /* Note: Header styling is handled by the standard chat-header partial */

    .loading-spinner {
        display: none;
        width: 20px;
        height: 20px;
        border: 2px solid rgba(255,255,255,0.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 0 auto;
    }

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

    .wallet-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(0, 255, 157, 0.1);
        border: 1px solid rgba(0, 255, 157, 0.3);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        color: var(--accent-green);
        margin-top: 8px;
    }

    .wallet-badge.not-set {
        background: rgba(255, 200, 0, 0.1);
        border-color: rgba(255, 200, 0, 0.3);
        color: #ffc800;
    }

    .wallet-copy-btn {
        background: none;
        border: none;
        padding: 2px;
        cursor: pointer;
        color: inherit;
        display: inline-flex;
        align-items: center;
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .wallet-copy-btn:hover {
        opacity: 1;
    }

    .wallet-badge.not-set .wallet-copy-btn {
        display: none;
    }

    /* Email verification badge */
    .email-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        margin-top: 8px;
        margin-right: 8px;
    }

    .email-badge.verified {
        background: rgba(0, 255, 157, 0.1);
        border: 1px solid rgba(0, 255, 157, 0.3);
        color: var(--accent-green);
    }

    .email-badge.unverified {
        background: rgba(255, 100, 100, 0.1);
        border: 1px solid rgba(255, 100, 100, 0.3);
        color: #ff6464;
    }

    .resend-verification-btn {
        background: rgba(0, 150, 255, 0.2);
        border: 1px solid rgba(0, 150, 255, 0.4);
        color: var(--accent-cyan);
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 11px;
        cursor: pointer;
        margin-left: 8px;
        transition: all 0.2s;
    }

    .resend-verification-btn:hover {
        background: rgba(0, 150, 255, 0.3);
    }

    .resend-verification-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .badges-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
    }

    /* Portfolio Overview Card */
    .portfolio-overview {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .portfolio-stats-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

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

    .portfolio-stat-label {
        font-size: 11px;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 6px;
    }

    .portfolio-stat-value {
        font-size: 24px;
        font-weight: 700;
        font-family: var(--font-mono);
        color: var(--text-primary);
    }

    .portfolio-stat-value.positive { color: var(--accent-green); }
    .portfolio-stat-value.negative { color: #ff6464; }

    .portfolio-stat-sub {
        font-size: 12px;
        color: var(--text-secondary);
        margin-top: 2px;
    }

    .portfolio-stat-sub.positive { color: var(--accent-green); }
    .portfolio-stat-sub.negative { color: #ff6464; }

    .portfolio-chart-container {
        position: relative;
        height: 120px;
        width: 100%;
    }

    .portfolio-chart-container svg {
        width: 100%;
        height: 100%;
    }

    .portfolio-funding {
        display: flex;
        gap: 12px;
        margin-top: 4px;
    }

    .portfolio-funding-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        background: transparent;
        border: 1px solid rgba(0, 150, 255, 0.3);
        border-radius: 8px;
        color: #00D4FF;
        font-size: 0.875rem;
        font-weight: 500;
        font-family: var(--font-mono);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .portfolio-funding-btn:hover {
        background: rgba(0, 150, 255, 0.1);
        border-color: rgba(0, 150, 255, 0.5);
    }

    .portfolio-funding-btn.deposit {
        border-color: rgba(16, 185, 129, 0.5);
        color: #10B981;
    }

    .portfolio-funding-btn.deposit:hover {
        background: rgba(16, 185, 129, 0.1);
        border-color: #10B981;
    }

    .portfolio-funding-btn.withdraw {
        border-color: rgba(239, 68, 68, 0.3);
        color: #EF4444;
    }

    .portfolio-funding-btn.withdraw:hover {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.5);
    }

    .period-selector {
        display: flex;
        gap: 4px;
        justify-content: center;
    }

    .period-btn {
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 6px;
        padding: 6px 14px;
        font-family: var(--font-mono);
        font-size: 12px;
        font-weight: 600;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .period-btn:hover {
        background: rgba(0, 100, 200, 0.3);
        color: var(--text-primary);
    }

    .period-btn.active {
        background: rgba(0, 150, 255, 0.3);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    /* My Agents (AI Bots) */
    .agents-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .agent-card, .agent-card:visited {
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 10px;
        padding: 16px;
        transition: all 0.2s ease;
        text-decoration: none;
        display: block;
        color: var(--text-primary);
    }

    .agent-card:hover {
        border-color: var(--accent-cyan);
        background: rgba(0, 50, 100, 0.4);
        transform: translateY(-2px);
    }

    .agent-card-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .agent-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        color: #0a0f1c;
        flex-shrink: 0;
    }

    .agent-name {
        font-weight: 600;
        font-size: 13px;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .agent-symbol {
        font-size: 11px;
        color: var(--text-secondary);
    }

    .agent-stats {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        margin-bottom: 8px;
    }

    .agent-stats-label {
        color: var(--text-secondary);
    }

    .agent-stats-value {
        font-family: var(--font-mono);
        font-weight: 600;
        color: var(--text-primary);
    }

    .agent-stats-value.positive { color: var(--accent-green); }
    .agent-stats-value.negative { color: #ff6464; }

    .agent-sparkline {
        width: 100%;
        height: 40px;
        margin: 6px 0;
        border-radius: 6px;
        background: rgba(0, 30, 60, 0.2);
        border: 1px solid rgba(0, 150, 255, 0.1);
        overflow: hidden;
    }
    .agent-sparkline svg { display: block; width: 100%; height: 100%; }
    .agent-card:hover .agent-sparkline {
        border-color: rgba(0, 150, 255, 0.2);
        box-shadow: 0 0 8px rgba(0, 150, 255, 0.1);
    }

    .agent-fund-row {
        display: flex;
        gap: 6px;
        padding: 4px 0 8px;
    }
    .agent-fund-btn {
        flex: 1;
        padding: 5px 0;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid rgba(0, 150, 255, 0.3);
        background: rgba(0, 50, 100, 0.4);
        color: #60a5fa;
        transition: all 0.15s ease;
    }
    .agent-fund-btn:hover {
        background: rgba(0, 80, 160, 0.5);
        border-color: #3b82f6;
    }
    .agent-fund-btn.withdraw {
        color: #f87171;
        border-color: rgba(248, 113, 113, 0.3);
        background: rgba(100, 20, 20, 0.3);
    }
    .agent-fund-btn.withdraw:hover {
        background: rgba(120, 30, 30, 0.4);
        border-color: #f87171;
    }

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

    .agent-trading-badge {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        padding: 2px 8px;
        border-radius: 4px;
    }

    .agent-trading-badge.active {
        background: rgba(0, 255, 157, 0.15);
        color: var(--accent-green);
    }

    .agent-trading-badge.inactive {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
    }

    .agent-team {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    /* Agent trading toggle switch */
    .agent-toggle {
        position: relative;
        display: inline-block;
        width: 36px;
        height: 20px;
        cursor: pointer;
        margin: 0;
    }
    .agent-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    .agent-toggle-slider {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        transition: 0.2s;
    }
    .agent-toggle-slider::before {
        content: "";
        position: absolute;
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background: #fff;
        border-radius: 50%;
        transition: 0.2s;
    }
    .agent-toggle input:checked + .agent-toggle-slider {
        background: var(--accent-green, #00ff88);
    }
    .agent-toggle input:checked + .agent-toggle-slider::before {
        transform: translateX(16px);
    }

    /* Time & Sales (Clone Bot Trades) */
    .pts-section {
        margin-top: 16px;
        background: rgba(10, 15, 25, 0.7);
        border: 1px solid rgba(0, 150, 255, 0.15);
        border-radius: 10px;
        overflow: hidden;
    }
    .pts-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .pts-title {
        font-size: 12px;
        font-weight: 600;
        color: #66ddff;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .pts-stats {
        display: flex;
        gap: 12px;
    }
    .pts-stat {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 10px;
    }
    .pts-stat-label {
        color: #7B8794;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .pts-stat-val {
        color: #E5E7EB;
        font-family: 'JetBrains Mono', monospace;
        font-weight: 600;
    }
    .pts-columns {
        display: grid;
        grid-template-columns: 56px minmax(50px,1fr) 36px 36px 60px 50px;
        gap: 4px;
        padding: 5px 12px;
        font-size: 9px;
        color: #7B8794;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .pts-trade-list {
        max-height: 280px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.1) transparent;
    }
    .pts-trade-list::-webkit-scrollbar { width: 4px; }
    .pts-trade-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
    .pts-row {
        display: grid;
        grid-template-columns: 56px minmax(50px,1fr) 36px 36px 60px 50px;
        gap: 4px;
        padding: 5px 12px;
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
        align-items: center;
        transition: background 0.15s;
        border-bottom: 1px solid rgba(255,255,255,0.02);
    }
    .pts-bot-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #60a5fa;
        font-size: 10px;
    }
    .pts-row:hover { background: rgba(255,255,255,0.03); }
    .pts-row.pts-buy { color: #10B981; }
    .pts-row.pts-sell { color: #EF4444; }
    .pts-row.pts-large { border-left: 3px solid #00cfff; background: rgba(245,158,11,0.05); }
    .pts-row.pts-new {
        animation: pts-flash 0.6s ease-out;
    }
    .pts-row.pts-buy.pts-new { animation: pts-flash-buy 0.6s ease-out; }
    .pts-row.pts-sell.pts-new { animation: pts-flash-sell 0.6s ease-out; }
    @keyframes pts-flash-buy { 0% { background: rgba(16,185,129,0.25); } 100% { background: transparent; } }
    @keyframes pts-flash-sell { 0% { background: rgba(239,68,68,0.25); } 100% { background: transparent; } }
    @keyframes pts-flash { 0% { background: rgba(255,255,255,0.1); } 100% { background: transparent; } }
    .pts-time { color: #9CA3AF; font-size: 10px; }
    .pts-asset { font-weight: 600; color: #E5E7EB; }
    .pts-side { font-weight: 700; font-size: 10px; text-transform: uppercase; }
    .pts-amount { text-align: right; color: #E5E7EB; }
    .pts-pnl { text-align: right; font-weight: 600; }
    .pts-pnl.positive { color: #10B981; }
    .pts-pnl.negative { color: #EF4444; }
    .pts-pnl.neutral { color: #7B8794; }
    .pts-tx a {
        color: rgba(0,207,255,0.5);
        text-decoration: none;
        transition: color 0.15s;
    }
    .pts-tx a:hover { color: #00cfff; }
    .pts-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 12px;
        font-size: 10px;
        color: #7B8794;
        border-top: 1px solid rgba(255,255,255,0.04);
    }
    .pts-live-dot {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 9px;
        font-weight: 700;
        color: #10B981;
        letter-spacing: 0.05em;
        margin-left: 6px;
    }
    .pts-live-pulse {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #10B981;
        animation: pts-pulse 1.5s ease-in-out infinite;
    }
    @keyframes pts-pulse {
        0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
        50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(16,185,129,0); }
    }
    .pts-loading {
        padding: 24px;
        text-align: center;
        color: #7B8794;
        font-size: 11px;
    }
    .pts-no-trades {
        padding: 24px;
        text-align: center;
        color: #7B8794;
        font-size: 12px;
    }
    @media (max-width: 480px) {
        .pts-columns, .pts-row {
            grid-template-columns: 46px minmax(40px,1fr) 30px 30px 50px 42px;
            gap: 2px;
            padding: 5px 8px;
            font-size: 9px;
        }
        .pts-bot-name { font-size: 8px; }
    }

    .agent-team.blue { color: #3b82f6; }
    .agent-team.red { color: #ff6464; }

    /* Skills & Tools */
    @media (max-width: 768px) {
        .agents-grid {
            grid-template-columns: 1fr;
        }
    }

    /* Launch Market Button */
    .profile-actions {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(0, 200, 255, 0.15);
    }

    .launch-market-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        background: linear-gradient(135deg, #00cfff, #0088ff);
        color: #fff;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none;
        border-radius: 12px;
        transition: all 0.2s ease;
        font-family: var(--font-mono);
    }

    .launch-market-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 20px rgba(0, 207, 255, 0.4);
    }

    .launch-market-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Markets section header with button */
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

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

    .launch-market-btn-small {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: linear-gradient(135deg, #00cfff, #0088ff);
        color: #fff;
        font-weight: 600;
        font-size: 0.75rem;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.2s ease;
        font-family: var(--font-mono);
    }

    .launch-market-btn-small:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 20px rgba(0, 207, 255, 0.4);
    }

    .launch-market-btn-small svg {
        width: 14px;
        height: 14px;
    }

    /* Enhanced empty state */
    .empty-state .launch-market-btn {
        margin-top: 1rem;
    }

    /* Quick Links Grid */
    .quick-links-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        margin-bottom: 30px;
    }

    .links-category h3 {
        font-size: 12px;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 0 12px 0;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(0, 150, 255, 0.2);
    }

    .links-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .quick-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        background: rgba(0, 50, 100, 0.3);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .quick-link:hover {
        background: rgba(0, 150, 255, 0.2);
        border-color: var(--accent-cyan);
        transform: translateX(4px);
    }

    .quick-link.featured {
        background: linear-gradient(135deg, rgba(196, 255, 0, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
        border-color: rgba(196, 255, 0, 0.4);
    }

    .link-icon {
        font-size: 20px;
        width: 32px;
        text-align: center;
    }

    .link-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .link-title {
        color: var(--text-primary);
        font-weight: 600;
        font-size: 13px;
    }

    .link-desc {
        color: var(--text-secondary);
        font-size: 11px;
    }

    /* Resources Section */
    .resources-section {
        border-top: 1px solid rgba(0, 150, 255, 0.2);
        padding-top: 20px;
    }

    .resources-section h3 {
        font-size: 12px;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 0 15px 0;
    }

    .resources-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .resource-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 15px 10px;
        background: rgba(0, 50, 100, 0.2);
        border: 1px solid rgba(0, 150, 255, 0.2);
        border-radius: 10px;
        text-decoration: none;
        text-align: center;
        transition: all 0.2s ease;
    }

    .resource-card:hover {
        background: rgba(0, 150, 255, 0.2);
        border-color: var(--accent-cyan);
    }

    .resource-icon {
        font-size: 22px;
    }

    .resource-card span:last-child {
        color: var(--text-primary);
        font-size: 12px;
    }

    @media (max-width: 768px) {
        .portfolio-stats-row {
            grid-template-columns: 1fr;
            gap: 12px;
        }

        .portfolio-stat-value {
            font-size: 20px;
        }

        .profile-header {
            flex-direction: column;
            text-align: center;
        }

        .quick-links-grid {
            grid-template-columns: 1fr;
        }

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

        .market-item {
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
        }

        .market-item > a {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        .market-status {
            align-self: flex-start;
        }

        .market-share-buttons {
            margin-left: 0;
            margin-top: 8px;
            justify-content: flex-start;
        }

        .launch-market-btn {
            width: 100%;
            justify-content: center;
            padding: 1rem;
        }

        .section-header {
            flex-direction: column;
            gap: 1rem;
            align-items: stretch;
        }

        .launch-market-btn-small {
            width: 100%;
            justify-content: center;
        }
    }

    /* Skills & Algorithms Discovery Panels (inline) */
    .sap-skills-grid, .sap-agents-grid {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .sap-skills-grid::-webkit-scrollbar,
    .sap-agents-grid::-webkit-scrollbar { display: none; }

    .sap-skill-chip {
        flex-shrink: 0;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 8px 12px;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
    }
    .sap-skill-chip:hover {
        background: rgba(0, 150, 255, 0.15);
        border-color: rgba(0, 180, 255, 0.3);
    }
    .sap-skill-emoji { font-size: 16px; }
    .sap-skill-name {
        font-size: 12px;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
    }
    .sap-skill-cat {
        font-size: 9px;
        color: rgba(255, 255, 255, 0.4);
        text-transform: uppercase;
        white-space: nowrap;
    }
    .sap-skill-info {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }
    .sap-agent-card {
        flex-shrink: 0;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 10px 12px;
        min-width: 120px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
    }
    .sap-agent-card:hover {
        background: rgba(0, 150, 255, 0.15);
        border-color: rgba(0, 180, 255, 0.3);
    }
    .sap-agent-symbol {
        font-family: 'JetBrains Mono', monospace;
        font-size: 14px;
        font-weight: 700;
        color: #00cfff;
        margin-bottom: 2px;
    }
    .sap-agent-name {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 4px;
        white-space: nowrap;
    }
    .sap-agent-wr {
        font-family: 'JetBrains Mono', monospace;
        font-size: 12px;
        font-weight: 600;
        padding: 2px 6px;
        border-radius: 4px;
        display: inline-block;
    }
    .sap-agent-wr.good {
        color: #00ff88;
        background: rgba(0, 255, 136, 0.1);
    }
    .sap-agent-wr.neutral {
        color: #00cfff;
        background: rgba(0, 207, 255, 0.1);
    }
    .sap-loading {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.3);
        padding: 8px;
    }

    /* P&L Transaction Breakdown Modal */
    .pnl-modal {
        width: 480px;
        max-width: 95vw;
    }
    .pnl-summary {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }
    .pnl-summary-item {
        text-align: center;
    }
    .pnl-summary-label {
        font-size: 10px;
        color: rgba(255,255,255,0.5);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    .pnl-summary-value {
        font-size: 16px;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        color: #fff;
        margin-top: 2px;
    }
    .pnl-summary-value.positive { color: #10B981; }
    .pnl-summary-value.negative { color: #EF4444; }
    .pnl-columns {
        display: grid;
        grid-template-columns: 62px minmax(60px,1fr) 40px 36px 58px 58px;
        gap: 4px;
        padding: 4px 12px;
        font-size: 10px;
        color: rgba(255,255,255,0.4);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .pnl-columns span:nth-child(5),
    .pnl-columns span:nth-child(6) { text-align: right; }
    .pnl-trade-list {
        max-height: 400px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.1) transparent;
    }
    .pnl-trade-list::-webkit-scrollbar { width: 4px; }
    .pnl-trade-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
    .pnl-row {
        display: grid;
        grid-template-columns: 62px minmax(60px,1fr) 40px 36px 58px 58px;
        gap: 4px;
        padding: 5px 12px;
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.02);
        transition: background 0.15s;
    }
    .pnl-row:hover { background: rgba(255,255,255,0.03); }
    .pnl-row-time { color: #9CA3AF; font-size: 10px; }
    .pnl-row-bot {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #60a5fa;
        font-size: 10px;
    }
    .pnl-row-asset { font-weight: 600; color: #E5E7EB; }
    .pnl-row-side { font-weight: 700; font-size: 10px; text-transform: uppercase; }
    .pnl-row-side.buy { color: #10B981; }
    .pnl-row-side.sell { color: #EF4444; }
    .pnl-row-amount { text-align: right; color: #E5E7EB; }
    .pnl-row-profit { text-align: right; font-weight: 600; }
    .pnl-row-profit.positive { color: #10B981; }
    .pnl-row-profit.negative { color: #EF4444; }
    .pnl-row-profit.neutral { color: #7B8794; }
    .pnl-footer {
        padding: 8px 12px;
        text-align: center;
    }
    .pnl-load-more {
        background: rgba(59, 130, 246, 0.15);
        border: 1px solid rgba(59, 130, 246, 0.3);
        color: #60a5fa;
        font-size: 12px;
        font-weight: 600;
        padding: 6px 16px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.15s;
    }
    .pnl-load-more:hover {
        background: rgba(59, 130, 246, 0.25);
        border-color: rgba(59, 130, 246, 0.5);
    }
    .pnl-clickable {
        cursor: pointer;
        transition: all 0.15s;
    }
    .pnl-clickable:hover {
        text-decoration: underline dotted;
        text-underline-offset: 3px;
    }
    @media (max-width: 480px) {
        .pnl-modal { width: 100%; }
        .pnl-summary { grid-template-columns: repeat(2, 1fr); }
        .pnl-columns, .pnl-row {
            grid-template-columns: 50px minmax(40px,1fr) 32px 30px 48px 48px;
            font-size: 10px;
            padding: 4px 8px;
        }
    }

    /* Balance Breakdown Modal */
    .bal-modal {
        width: 480px;
        max-width: 95vw;
    }
    .bal-section {
        margin-bottom: 12px;
    }
    .bal-section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 6px;
    }
    .bal-section-title {
        font-size: 11px;
        font-weight: 600;
        color: #66ddff;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .bal-section-total {
        font-size: 13px;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        color: #fff;
    }
    .bal-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 8px;
        font-size: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .bal-row:last-child { border-bottom: none; }
    .bal-row-label {
        color: rgba(255,255,255,0.7);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .bal-row-value {
        font-family: 'JetBrains Mono', monospace;
        font-weight: 600;
        color: #fff;
    }
    .bal-row-value.positive { color: #10B981; }
    .bal-row-value.negative { color: #EF4444; }
    .bal-row-value.muted { color: #7B8794; }
    .bal-token-symbol {
        font-size: 10px;
        font-weight: 700;
        color: #3b82f6;
        background: rgba(59, 130, 246, 0.12);
        padding: 1px 5px;
        border-radius: 3px;
        letter-spacing: 0.3px;
    }
    .bal-bot-row {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 10px;
        padding: 6px 8px;
        font-size: 12px;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .bal-bot-name {
        color: #60a5fa;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bal-bot-stat {
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
        color: #fff;
        text-align: right;
    }
    .bal-status-dot {
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        margin-right: 4px;
    }
    .bal-status-dot.active { background: #10B981; }
    .bal-status-dot.paused { background: #7B8794; }
    .bal-pos-row {
        display: grid;
        grid-template-columns: 40px 1fr 70px;
        gap: 6px;
        padding: 5px 8px;
        font-size: 11px;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .bal-pos-symbol {
        font-weight: 700;
        color: #E5E7EB;
    }
    .bal-pos-market {
        color: rgba(255,255,255,0.5);
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bal-pos-amount {
        text-align: right;
        font-family: 'JetBrains Mono', monospace;
        font-weight: 600;
        color: #fff;
    }
    .bal-grand-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 8px;
        font-size: 14px;
        font-weight: 700;
    }
    .bal-grand-total-label {
        color: rgba(255,255,255,0.7);
    }
    .bal-grand-total-value {
        font-family: 'JetBrains Mono', monospace;
        color: #fff;
        font-size: 18px;
    }
    .bal-empty {
        color: #7B8794;
        font-size: 11px;
        padding: 8px;
        text-align: center;
    }
    @media (max-width: 480px) {
        .bal-modal { width: 100%; }
    }

    /* Bot Action Modal */
    .bm-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.65);
        z-index: 9998;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }
    .bm-modal {
        background: linear-gradient(135deg, #0a1628, #0f2440);
        border: 1px solid rgba(59, 130, 246, 0.4);
        border-radius: 14px;
        padding: 18px;
        width: 320px;
        max-height: 85vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
    .bm-close {
        position: absolute;
        top: 8px; right: 10px;
        background: none; border: none;
        color: rgba(255,255,255,0.4);
        font-size: 20px;
        cursor: pointer;
        line-height: 1;
    }
    .bm-close:hover { color: #fff; }
    .bm-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 4px;
    }
    .bm-avatar {
        width: 36px; height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        color: #0a0f1c;
        flex-shrink: 0;
    }
    .bm-bot-name {
        font-size: 14px;
        font-weight: 600;
        color: #fff;
    }
    .bm-bot-name-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .bm-edit-icon {
        cursor: pointer;
        opacity: 0.4;
        font-size: 12px;
        transition: opacity 0.2s;
    }
    .bm-edit-icon:hover { opacity: 1; }
    .bm-name-input {
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(59,130,246,0.5);
        border-radius: 4px;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        padding: 2px 6px;
        width: 140px;
        outline: none;
    }
    .bm-avatar-clickable { cursor: pointer; position: relative; }
    .bm-avatar-clickable:hover::after {
        content: '\270F';
        position: absolute;
        bottom: -2px; right: -2px;
        font-size: 10px;
        background: #1d4ed8;
        border-radius: 50%;
        width: 14px; height: 14px;
        display: flex; align-items: center; justify-content: center;
    }
    .bm-emoji-picker {
        display: none;
        background: rgba(15,23,42,0.95);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        padding: 8px;
        margin-top: 8px;
        flex-wrap: wrap;
        gap: 4px;
        max-width: 280px;
    }
    .bm-emoji-picker.open { display: flex; }
    .bm-emoji-btn {
        width: 32px; height: 32px;
        display: flex; align-items: center; justify-content: center;
        font-size: 18px;
        cursor: pointer;
        border-radius: 6px;
        border: none;
        background: transparent;
        transition: background 0.15s;
    }
    .bm-emoji-btn:hover { background: rgba(59,130,246,0.25); }
    .bm-emoji-reset {
        font-size: 10px;
        color: rgba(255,255,255,0.4);
        cursor: pointer;
        padding: 4px 8px;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 4px;
        background: transparent;
        margin-left: auto;
    }
    .bm-emoji-reset:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
    .bm-bot-symbol {
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
        color: rgba(255,255,255,0.5);
    }
    .bm-divider {
        height: 1px;
        background: rgba(255,255,255,0.08);
        margin: 10px 0;
    }
    .bm-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .bm-label {
        font-size: 12px;
        color: rgba(255,255,255,0.7);
        font-weight: 500;
    }
    .bm-section-label {
        font-size: 11px;
        font-weight: 600;
        color: #66ddff;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        padding-left: 4px;
    }
    .bm-items-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .bm-item-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 8px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.05);
    }
    .bm-item-info {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }
    .bm-item-icon { font-size: 16px; flex-shrink: 0; }
    .bm-item-name {
        font-size: 12px;
        font-weight: 500;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .bm-item-cat {
        font-size: 9px;
        color: rgba(255,255,255,0.4);
        text-transform: uppercase;
    }
    .bm-item-text {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }
    .bm-empty {
        font-size: 11px;
        color: rgba(255,255,255,0.3);
        padding: 4px 0;
    }
    .bm-toggle {
        position: relative;
        display: inline-block;
        width: 36px;
        height: 20px;
        flex-shrink: 0;
    }
    .bm-toggle input { opacity: 0; width: 0; height: 0; }
    .bm-toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(255,255,255,0.12);
        border-radius: 10px;
        transition: 0.2s;
    }
    .bm-toggle-slider:before {
        content: "";
        position: absolute;
        height: 14px; width: 14px;
        left: 3px; bottom: 3px;
        background: #fff;
        border-radius: 50%;
        transition: 0.2s;
    }
    .bm-toggle input:checked + .bm-toggle-slider {
        background: #3b82f6;
    }
    .bm-toggle input:checked + .bm-toggle-slider:before {
        transform: translateX(16px);
    }
    .bm-equipped-badge {
        font-size: 10px;
        color: #10B981;
        border: 1px solid rgba(16,185,129,0.3);
        border-radius: 4px;
        padding: 2px 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .bm-item-clickable { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
    .bm-item-clickable:hover { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.25); }
    /* Model detail popup (inside bot modal) */
    .bm-detail-popup {
        display: none;
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, #0a1628, #0f2440);
        border-radius: 14px;
        z-index: 20;
        flex-direction: column;
        padding: 24px 20px;
        overflow-y: auto;
    }
    .bm-detail-popup.open { display: flex; }
    .bm-detail-back {
        background: none; border: none; color: #60a5fa; font-size: 13px;
        cursor: pointer; padding: 0; margin-bottom: 16px; text-align: left;
        font-family: inherit;
    }
    .bm-detail-back:hover { text-decoration: underline; }
    .bm-detail-desc {
        font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.5;
        flex: 1; overflow-y: auto; margin-bottom: 16px;
    }
    .bm-detail-delete {
        width: 100%; padding: 10px; background: rgba(239,68,68,0.15);
        border: 1px solid rgba(239,68,68,0.4); border-radius: 8px;
        color: #ef4444; font-size: 13px; font-weight: 600; cursor: pointer;
        font-family: inherit; transition: background 0.15s;
    }
    .bm-detail-delete:hover { background: rgba(239,68,68,0.25); }
    .bm-select {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 6px;
        padding: 5px 8px;
        color: #fff;
        font-size: 12px;
        font-family: 'JetBrains Mono', monospace;
        cursor: pointer;
    }
    .bm-select:focus {
        outline: none;
        border-color: rgba(59, 130, 246, 0.5);
    }
    .bm-backtest-btn {
        width: 100%;
        padding: 10px;
        background: linear-gradient(135deg, #1d4ed8, #3b82f6);
        border: none;
        border-radius: 8px;
        color: #fff;
        font-weight: 600;
        font-size: 13px;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    .bm-backtest-btn:hover {
        background: linear-gradient(135deg, #00cfff, #60a5fa);
    }
    .bm-view-profile {
        display: block;
        text-align: center;
        margin-top: 10px;
        font-size: 12px;
        color: rgba(0, 207, 255, 0.7);
        text-decoration: none;
    }
    .bm-view-profile:hover { color: #00cfff; }
    /* On-Chain Ratio Slider */
    .bm-range-slider {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 6px;
        background: linear-gradient(to right, rgba(255,255,255,0.15), rgba(59,130,246,0.4));
        border-radius: 3px;
        outline: none;
        cursor: pointer;
    }
    .bm-range-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #3b82f6;
        border: 2px solid #60a5fa;
        cursor: pointer;
        box-shadow: 0 0 6px rgba(59,130,246,0.4);
    }
    .bm-range-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #3b82f6;
        border: 2px solid #60a5fa;
        cursor: pointer;
        box-shadow: 0 0 6px rgba(59,130,246,0.4);
    }
    .bm-onchain-badge {
        font-size: 9px;
        font-family: 'JetBrains Mono', monospace;
        color: rgba(59,130,246,0.8);
        background: rgba(59,130,246,0.1);
        border: 1px solid rgba(59,130,246,0.2);
        border-radius: 4px;
        padding: 1px 5px;
        white-space: nowrap;
    }

    /* =============================================
       Light Mode Overrides
       ============================================= */
    [data-theme="light"] .profile-container {
        background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    }

    [data-theme="light"] .profile-card {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .profile-header {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .profile-info h1 {
        color: var(--text-heading);
    }

    [data-theme="light"] .section-collapse-icon {
        color: var(--text-dim);
    }

    [data-theme="light"] .refresh-balance-btn {
        border-color: var(--panel-border);
    }

    [data-theme="light"] .form-group input {
        background: var(--input-bg);
        border-color: var(--input-border);
        color: var(--text-primary);
    }

    [data-theme="light"] .form-group input:focus,
    [data-theme="light"] .form-group textarea:focus {
        border-color: var(--accent-cyan);
        box-shadow: var(--input-focus-glow);
    }

    [data-theme="light"] .market-item {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .market-item:hover {
        border-color: var(--accent-cyan);
        background: var(--panel-bg-hover);
    }

    [data-theme="light"] .market-share-buttons button {
        background: rgba(0, 100, 180, 0.08);
        border-color: var(--panel-border);
        color: var(--accent-cyan);
    }

    [data-theme="light"] .market-share-buttons button:hover {
        background: rgba(0, 100, 180, 0.15);
    }

    [data-theme="light"] .loading-spinner {
        border-color: rgba(0, 0, 0, 0.15);
        border-top-color: var(--accent-cyan);
    }

    [data-theme="light"] .agent-card,
    [data-theme="light"] .agent-card:visited {
        background: var(--panel-bg);
        border-color: var(--panel-border);
        color: var(--text-primary);
    }

    [data-theme="light"] .agent-card:hover {
        border-color: var(--accent-cyan);
        background: var(--panel-bg-hover);
    }

    [data-theme="light"] .agent-avatar {
        color: var(--bg-primary);
    }

    [data-theme="light"] .agent-sparkline {
        background: rgba(0, 80, 160, 0.04);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .agent-fund-btn {
        border-color: var(--panel-border);
        background: rgba(0, 100, 180, 0.06);
        color: var(--accent-cyan);
    }

    [data-theme="light"] .agent-fund-btn.withdraw {
        color: var(--negative-color);
        border-color: rgba(220, 38, 38, 0.2);
        background: rgba(220, 38, 38, 0.05);
    }

    [data-theme="light"] .agent-toggle-slider {
        background: rgba(0, 0, 0, 0.15);
    }

    [data-theme="light"] .period-btn {
        background: var(--panel-bg);
        border-color: var(--panel-border);
        color: var(--text-secondary);
    }

    [data-theme="light"] .period-btn.active {
        background: rgba(0, 130, 210, 0.12);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    [data-theme="light"] .portfolio-funding-btn {
        border-color: var(--panel-border);
        color: var(--accent-cyan);
    }

    /* Time & Sales */
    [data-theme="light"] .pts-section {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .pts-header {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .pts-title {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .pts-stat-label {
        color: var(--text-dim);
    }

    [data-theme="light"] .pts-stat-val {
        color: var(--text-primary);
    }

    [data-theme="light"] .pts-columns {
        color: var(--text-dim);
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .pts-row {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .pts-row:hover {
        background: rgba(0, 80, 160, 0.04);
    }

    [data-theme="light"] .pts-bot-name {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .pts-time {
        color: var(--text-dim);
    }

    [data-theme="light"] .pts-asset {
        color: var(--text-primary);
    }

    [data-theme="light"] .pts-amount {
        color: var(--text-primary);
    }

    [data-theme="light"] .pts-footer {
        color: var(--text-dim);
        border-top-color: var(--divider-color);
    }

    [data-theme="light"] .pts-loading,
    [data-theme="light"] .pts-no-trades {
        color: var(--text-dim);
    }

    /* Quick Links */
    [data-theme="light"] .links-category h3 {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .quick-link {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .quick-link:hover {
        background: rgba(0, 130, 210, 0.06);
        border-color: var(--accent-cyan);
    }

    [data-theme="light"] .resource-card {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .resource-card:hover {
        background: rgba(0, 130, 210, 0.06);
        border-color: var(--accent-cyan);
    }

    [data-theme="light"] .resources-section {
        border-top-color: var(--divider-color);
    }

    [data-theme="light"] .profile-actions {
        border-top-color: var(--divider-color);
    }

    /* Skills & Algorithms chips */
    [data-theme="light"] .sap-skill-chip {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .sap-skill-chip:hover {
        background: rgba(0, 130, 210, 0.06);
        border-color: var(--accent-cyan);
    }

    [data-theme="light"] .sap-skill-name {
        color: var(--text-primary);
    }

    [data-theme="light"] .sap-skill-cat {
        color: var(--text-dim);
    }

    [data-theme="light"] .sap-agent-card {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .sap-agent-card:hover {
        background: rgba(0, 130, 210, 0.06);
        border-color: var(--accent-cyan);
    }

    [data-theme="light"] .sap-agent-name {
        color: var(--text-secondary);
    }

    [data-theme="light"] .sap-loading {
        color: var(--text-dim);
    }

    /* P&L Modal */
    [data-theme="light"] .pnl-summary-label {
        color: var(--text-dim);
    }

    [data-theme="light"] .pnl-summary-value {
        color: var(--text-primary);
    }

    [data-theme="light"] .pnl-columns {
        color: var(--text-dim);
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .pnl-row {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .pnl-row:hover {
        background: rgba(0, 80, 160, 0.04);
    }

    [data-theme="light"] .pnl-row-time {
        color: var(--text-dim);
    }

    [data-theme="light"] .pnl-row-bot {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .pnl-row-asset {
        color: var(--text-primary);
    }

    [data-theme="light"] .pnl-row-amount {
        color: var(--text-primary);
    }

    [data-theme="light"] .pnl-load-more {
        background: rgba(0, 130, 210, 0.08);
        border-color: rgba(0, 130, 210, 0.2);
        color: var(--accent-cyan);
    }

    /* Balance Breakdown Modal */
    [data-theme="light"] .bal-section-title {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .bal-section-total {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-row {
        border-bottom-color: var(--divider-color);
    }

    [data-theme="light"] .bal-row-label {
        color: var(--text-secondary);
    }

    [data-theme="light"] .bal-row-value {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-bot-name {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .bal-bot-stat {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-pos-symbol {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-pos-market {
        color: var(--text-dim);
    }

    [data-theme="light"] .bal-pos-amount {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-grand-total-label {
        color: var(--text-secondary);
    }

    [data-theme="light"] .bal-grand-total-value {
        color: var(--text-primary);
    }

    [data-theme="light"] .bal-empty {
        color: var(--text-dim);
    }

    /* Bot Action Modal */
    [data-theme="light"] .bm-modal {
        background: var(--panel-bg);
        border-color: var(--panel-border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }

    [data-theme="light"] .bm-close {
        color: var(--text-dim);
    }

    [data-theme="light"] .bm-close:hover {
        color: var(--text-primary);
    }

    [data-theme="light"] .bm-bot-name {
        color: var(--text-heading);
    }

    [data-theme="light"] .bm-bot-symbol {
        color: var(--text-dim);
    }

    [data-theme="light"] .bm-divider {
        background: var(--divider-color);
    }

    [data-theme="light"] .bm-label {
        color: var(--text-secondary);
    }

    [data-theme="light"] .bm-section-label {
        color: var(--accent-cyan);
    }

    [data-theme="light"] .bm-item-row {
        background: rgba(0, 80, 160, 0.04);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .bm-item-name {
        color: var(--text-primary);
    }

    [data-theme="light"] .bm-item-cat {
        color: var(--text-dim);
    }

    [data-theme="light"] .bm-empty {
        color: var(--text-dim);
    }

    [data-theme="light"] .bm-name-input {
        background: var(--input-bg);
        border-color: var(--input-border);
        color: var(--text-primary);
    }

    [data-theme="light"] .bm-select {
        background: var(--input-bg);
        border-color: var(--input-border);
        color: var(--text-primary);
    }

    [data-theme="light"] .bm-emoji-picker {
        background: var(--panel-bg);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .bm-emoji-reset {
        color: var(--text-dim);
        border-color: var(--panel-border);
    }

    [data-theme="light"] .bm-detail-popup {
        background: var(--panel-bg);
    }

    [data-theme="light"] .bm-detail-desc {
        color: var(--text-secondary);
    }

    [data-theme="light"] .bm-toggle-slider {
        background: rgba(0, 0, 0, 0.12);
    }

    [data-theme="light"] .bm-range-slider {
        background: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 130, 210, 0.3));
    }
