* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #000000; color: #f3f4f6; padding-bottom: 50px; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* THE PWA (APPLE DYNAMIC ISLAND) FIX */
@media (display-mode: standalone) {
    /* Targets the container directly instead of the body */
    #mainAppContainer { 
        padding-top: max(60px, env(safe-area-inset-top)) !important; 
    }
}

.top-bar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #1f2937; margin-bottom: 20px; }
.logo { font-size: 1.5rem; font-weight: bold; letter-spacing: -0.5px; cursor: pointer; transition: opacity 0.2s;}
.logo:hover { opacity: 0.8; }
.logo span { color: #2563eb; }
.search-group { display: flex; gap: 20px; align-items: center; }
.search-container { display: flex; gap: 10px; width: 350px; }
.search-input { flex: 1; padding: 10px 15px; border-radius: 8px; border: 1px solid #374151; background: #111827; color: white; outline: none; transition: border 0.2s; }
.search-input:focus { border-color: #2563eb; }
.search-btn { padding: 0 20px; border-radius: 8px; border: none; background: #2563eb; color: white; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.search-btn:hover { background: #1d4ed8; }
.auth-btn { background: transparent; border: 1px solid #4b5563; color: white; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.auth-btn:hover { background: #1f2937; border-color: #9ca3af; }
.plan-selector { background: #1f2937; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: bold; border: 1px solid #374151; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.plan-selector:hover { background: #374151; border-color: #4b5563; }
.plan-badge { background: #10b981; color: #000; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; text-transform: uppercase; }
.finnhub-banner { background: #fbbf24; color: #000; padding: 12px 20px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 24px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.finnhub-banner button { background: #000; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.finnhub-banner button:hover { background: #1f2937; }
.ad-container { background: #111827; border: 1px dashed #4b5563; display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; position: relative; overflow: hidden; }
.ad-container::after { content: "ADVERTISEMENT"; position: absolute; top: 5px; right: 5px; font-size: 0.6rem; opacity: 0.5; }
.ad-leaderboard { width: 100%; height: 90px; margin-bottom: 24px; } 
.ad-sidebar { width: 100%; height: 250px; margin-bottom: 24px; } 

.hero-section { text-align: center; padding: 90px 20px 80px; border-bottom: 1px solid #1f2937; margin-bottom: 30px; background: radial-gradient(ellipse at 50% -10%, #0f172a 0%, #000000 65%); border-radius: 12px; position: relative; overflow: hidden;}
.hero-section::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(37,99,235,0.07) 0%, transparent 65%); pointer-events: none; }
.hero-title { font-size: 3.5rem; font-weight: 800; margin-bottom: 18px; letter-spacing: -1.5px; line-height: 1.1; }
.hero-title-accent { background: linear-gradient(90deg, #3b82f6, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.15rem; color: #6b7280; max-width: 520px; margin: 0 auto 36px auto; line-height: 1.65; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 16px; border-radius: 30px; background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.35); color: #c084fc; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 24px; box-shadow: 0 0 15px rgba(139, 92, 246, 0.15); animation: pulseGlow 3s infinite alternate;}
@keyframes pulseGlow { 0% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.1); } 100% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.35); } }

.hero-cta-group { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hero-cta-primary { padding: 13px 26px; border-radius: 8px; border: none; background: #2563eb; color: white; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: background 0.2s, transform 0.15s, box-shadow 0.2s; box-shadow: 0 0 0 0 rgba(37,99,235,0); letter-spacing: 0.01em; }
.hero-cta-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.35); }
.hero-cta-secondary { padding: 12px 22px; border-radius: 8px; border: 1px solid #374151; background: transparent; color: #d1d5db; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; }
.hero-cta-secondary:hover { background: #111827; border-color: #4b5563; color: white; }
.hero-cta-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 8px; background: transparent; color: #4b5563; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: color 0.2s; cursor: pointer; }
.hero-cta-ghost:hover { color: #9ca3af; }

.market-pulse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.pulse-card { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; }
.pulse-card:hover { border-color: #374151; transform: translateY(-2px); }
.pulse-name { font-size: 0.9rem; color: #9ca3af; margin-bottom: 5px; text-transform: uppercase; font-weight: bold; }
.pulse-symbol { font-size: 1.5rem; font-weight: bold; }
.pulse-price { font-size: 1.5rem; font-weight: bold; text-align: right; }
.pulse-change { font-size: 0.9rem; text-align: right; font-weight: 600; margin-top: 5px; }
.home-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.ai-market-banner { background: linear-gradient(135deg, #1e3a8a, #2563eb); border: 1px solid #3b82f6; border-radius: 12px; padding: 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.ai-market-text h3 { font-size: 1.4rem; margin-bottom: 5px; color: #ffffff; display: flex; align-items: center; gap: 8px;}
.ai-market-text p { color: #bfdbfe; font-size: 0.95rem; line-height: 1.5; max-width: 500px; }
.ai-market-btn { background: #ffffff; color: #1d4ed8; padding: 12px 24px; border-radius: 8px; font-weight: bold; border: none; cursor: pointer; font-size: 1rem; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.ai-market-btn:hover { background: #f3f4f6; }
.ai-market-btn.locked { background: #374151; color: #9ca3af; cursor: not-allowed; border: 1px solid #4b5563; }

.home-copilot-widget { background: #111827; border: 1px solid #4c1d95; border-radius: 12px; padding: 15px 20px; display: flex; gap: 15px; align-items: center; margin-bottom: 24px; box-shadow: 0 4px 15px rgba(109, 40, 217, 0.15);}
.home-copilot-input { flex: 1; background: transparent; border: none; color: white; font-size: 1rem; outline: none; }
.home-copilot-btn { background: linear-gradient(135deg, #6d28d9, #2563eb); color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s;}
.home-copilot-btn:hover { transform: translateY(-2px); opacity: 0.9;}

.lists-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }
.list-container { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.list-header { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #1f2937; display: flex; justify-content: space-between; align-items: center;}
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-radius: 8px; cursor: pointer; transition: 0.2s; border-bottom: 1px solid #1f2937; }
.list-item:hover { background: #1f2937; }
.list-sym { font-weight: bold; font-size: 1.1rem; }
.list-sub { font-size: 0.8rem; color: #9ca3af; margin-top: 2px;}
.list-price { font-weight: bold; }
.view-all-btn { width: 100%; padding: 10px; background: transparent; border: 1px solid #374151; color: #9ca3af; border-radius: 6px; cursor: pointer; margin-top: auto; font-weight: bold; transition: 0.2s; }
.view-all-btn:hover { background: #1f2937; color: white; }
.pricing-section { max-width: 1000px; margin: 40px auto; }
.pricing-header { text-align: center; margin-bottom: 50px; }
.pricing-header h1 { font-size: 3rem; margin-bottom: 10px; }
.comp-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 15px; }
.comp-table th, .comp-table td { padding: 20px; text-align: center; border-bottom: 1px solid #1f2937; }
.comp-table th { font-size: 1.2rem; font-weight: bold; color: #f3f4f6; }
.comp-table td:first-child, .comp-table th:first-child { text-align: left; font-weight: bold; font-size: 1.1rem; color: #d1d5db; }
#tierTable th:nth-child(4), #tierTable td:nth-child(4) { background-color: #111827; border-left: 1px solid #2563eb; border-right: 1px solid #2563eb; }
#tierTable th:nth-child(4) { border-top: 1px solid #2563eb; border-radius: 12px 12px 0 0; position: relative; }
#tierTable tr:last-child td:nth-child(4) { border-bottom: 1px solid #2563eb; border-radius: 0 0 12px 12px; }
.best-value-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #fbbf24; color: #000; padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.svg-check { width: 24px; height: 24px; stroke: #10b981; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.svg-dash { width: 24px; height: 24px; stroke: #4b5563; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.panel { background: #111827; border-radius: 12px; border: 1px solid #1f2937; padding: 20px; }
.stock-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.symbol { font-size: 2.5rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.company { color: #9ca3af; font-size: 1rem; }
.price { font-size: 2.5rem; font-weight: 700; line-height: 1; text-align: right; margin-bottom: 4px; transition: color 0.3s ease; }
.change { font-size: 1.1rem; text-align: right; font-weight: 500; }
.company-logo { width: 48px; height: 48px; min-width: 48px; max-width: 48px; border-radius: 50%; margin-right: 15px; background: white; padding: 2px; object-fit: contain; flex-shrink: 0; }
.action-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;}
.action-btn { padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 0.9rem; }
.btn-watch { background: #374151; color: white; }
.btn-ai { background: linear-gradient(135deg, #4f46e5, #9333ea); color: white; display: flex; align-items: center; gap: 6px; }
.btn-copilot { background: rgba(30, 27, 75, 0.6); color: #ffffff; border: 1px solid #6d28d9; backdrop-filter: blur(4px); display: flex; align-items: center; gap: 6px; box-shadow: 0 0 10px rgba(109, 40, 217, 0.2); transition: all 0.2s;}
.btn-copilot:hover { transform: translateY(-2px); background: rgba(30, 27, 75, 0.9); box-shadow: 0 0 20px rgba(109, 40, 217, 0.5); border-color: #8b5cf6;}
.btn-locked { background: #374151; color: #9ca3af; cursor: not-allowed; box-shadow: none !important; border:none;}
.chart-container { height: 400px; width: 100%; background: #000000; border-radius: 8px; overflow: hidden; border: 1px solid #1f2937; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric-box { border-top: 1px solid #374151; padding-top: 12px; }
.m-label { color: #9ca3af; font-size: 0.8rem; margin-bottom: 4px; text-transform: uppercase; }
.m-value { font-size: 1.1rem; font-weight: 600; }
.section-title { font-size: 1.1rem; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid #1f2937; margin-bottom: 15px; color: #f3f4f6; }
.news-item { display: block; text-decoration: none; color: inherit; padding: 12px 0; border-bottom: 1px solid #1f2937; cursor: pointer; }
.news-item:hover h4 { color: #2563eb; }
.news-headline { font-size: 0.95rem; margin-bottom: 6px; line-height: 1.4; transition: color 0.2s; }
.news-meta { font-size: 0.8rem; color: #6b7280; }
.watch-item { display: flex; justify-content: space-between; padding: 10px; background: #000; border-radius: 6px; border: 1px solid #1f2937; margin-bottom: 8px; }

/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-box { background: #111827; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; border: 1px solid #374151; text-align: center; max-height: 90vh; overflow-y: auto;}
.auth-input { width: 100%; padding: 12px; margin: 8px 0; background: #000; border: 1px solid #374151; color: white; border-radius: 6px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: white; color: #000; border: none; padding: 10px; border-radius: 6px; width: 100%; font-weight: 600; cursor: pointer; margin-top: 15px; transition: background 0.2s; }
.google-btn:hover { background: #f3f4f6; }

/* CHECKOUT & T&C MODALS */
.checkout-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 9999; justify-content: center; align-items: center; }
.checkout-modal-content { background-color: #ffffff; color: #333333; padding: 30px; border-radius: 12px; max-width: 450px; text-align: center; font-family: sans-serif; box-shadow: 0px 10px 30px rgba(0,0,0,0.5); }
.modal-text { font-size: 16px; margin-bottom: 15px; line-height: 1.5; text-align: left; }
.red-warning { color: #cc0000; font-weight: bold; background-color: #ffeeee; padding: 10px; border-radius: 6px; border-left: 4px solid #cc0000; }
.modal-button-container { display: flex; justify-content: space-between; margin-top: 25px; }
.btn-cancel { background-color: #dddddd; color: #333; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-cancel:hover { background-color: #cccccc; }
.btn-continue { background-color: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-continue:hover { background-color: #0056b3; }
.tc-content h4 { color: white; margin-top: 20px; margin-bottom: 8px; font-size: 1.05rem; }
.tc-content p, .tc-content ul { color: #9ca3af; margin-bottom: 10px; font-size: 0.9rem; line-height: 1.6; }
.tc-content ul { padding-left: 20px; }
.tc-content li { margin-bottom: 6px; }
.view-hidden { display: none !important; }
.pos { color: #10b981; } .neg { color: #ef4444; }
.spinner { border: 3px solid #1f2937; border-top: 3px solid #2563eb; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* =========================================
   PERFECT COPILOT MODAL & CENTERING
   ========================================= */
#copilotModal {
    z-index: 2147483647 !important;
    background-color: #0b0f19 !important;
    backdrop-filter: none !important;
}

#copilotModal .copilot-box {
    background-color: #0b0f19 !important;
    width: 90%; 
    max-width: 800px; 
    height: 80vh; 
    max-height: 800px; 
    border-radius: 16px; 
    border: 1px solid #6d28d9; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: 0 25px 50px -12px rgba(109, 40, 217, 0.25); 
    text-align: left;
    margin: auto !important; /* <--- This permanently fixes the desktop left-align bug! */
}

.copilot-header { padding: 20px 24px; border-bottom: 1px solid rgba(139, 92, 246, 0.3); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); }
.copilot-title { font-size: 1.3rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; }
.copilot-close { background: transparent; border: none; color: #9ca3af; font-size: 1.5rem; cursor: pointer; transition: color 0.2s; line-height: 1;}
.copilot-close:hover { color: #fff; }
.copilot-chat-area { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth; }
.copilot-welcome { text-align: center; margin: auto 0; padding: 20px;}
.copilot-greeting { font-size: 2.5rem; font-weight: 800; background: linear-gradient(to right, #c084fc, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px; }
.copilot-sub-greeting { color: #9ca3af; font-size: 1.1rem; margin-bottom: 30px; }
.copilot-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 600px; margin: 0 auto; }
.chip { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(139, 92, 246, 0.4); color: #e5e7eb; padding: 12px 18px; border-radius: 20px; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; font-weight: 500;}
.chip:hover { background: rgba(139, 92, 246, 0.2); border-color: #a78bfa; transform: translateY(-2px); }
.chat-bubble { max-width: 85%; padding: 15px 20px; border-radius: 12px; font-size: 1rem; line-height: 1.5; position: relative;}
.chat-user { background: #2563eb; color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-ai { background: rgba(255,255,255,0.05); border: 1px solid rgba(139, 92, 246, 0.2); color: #e5e7eb; align-self: flex-start; border-bottom-left-radius: 2px; }
.copilot-input-area { padding: 20px 24px; border-top: 1px solid rgba(139, 92, 246, 0.3); background: rgba(0,0,0,0.5); display: flex; gap: 15px; align-items: center;}
.copilot-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(139, 92, 246, 0.4); color: white; padding: 15px 20px; border-radius: 30px; font-size: 1rem; outline: none; transition: 0.2s; }
.copilot-input:focus { border-color: #a78bfa; background: rgba(255,255,255,0.1); }
.copilot-send { background: linear-gradient(135deg, #c084fc, #3b82f6); color: white; border: none; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; flex-shrink: 0;}


/* =========================================
   MOBILE RESPONSIVENESS & FULLSCREEN
   ========================================= */
@media (max-width: 850px) {
    .top-bar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .search-group { width: 100%; flex-wrap: wrap; justify-content: space-between; }
    .search-container { width: 100%; margin-bottom: 10px; }
    .home-content-grid, .lists-grid, .dashboard-grid, .profile-grid { grid-template-columns: 1fr; }
    .market-pulse-grid { grid-template-columns: 1fr; gap: 15px; }
    .ai-market-banner { flex-direction: column; align-items: flex-start; gap: 15px; text-align: left; }
    .ai-market-btn { width: 100%; justify-content: center; }
    .stock-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .price, .change { text-align: left; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }

    /* Hero mobile fix */
    .hero-section { padding: 50px 20px; }
    .hero-title { font-size: 2rem; letter-spacing: -0.5px; }
    .hero-subtitle { font-size: 1rem; }
    .hero-section .preview-btn { width: auto; }

    /* Pricing tables: scroll-wrap on mobile */
    .pricing-section { padding: 0 5px; }
    .comp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
    .comp-table { min-width: 560px; }

    /* Tier table card layout on small screens */
    #tierTable { display: none; }
    .tier-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 15px; }
    .stack-ai-blurb { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
    #copilotModal .copilot-box { 
        width: 100vw !important;
        height: 100dvh !important; 
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important; 
        box-shadow: inset 0 0 40px rgba(167, 139, 250, 0.4) !important;
    }

    /* Adds padding exactly for the notch */
    #copilotModal .copilot-header {
        padding-top: max(20px, env(safe-area-inset-top)) !important; 
    }

    /* Puts the X button safely back in the natural flow */
    #copilotModal .copilot-close {
        position: static !important;
        margin: 0 !important;
    }

    #copilotModal .copilot-chat-area {
        flex-grow: 1 !important;
        height: auto !important; 
        max-height: none !important;
    }
}
@supports (-webkit-touch-callout: none) {
  .ios-standalone #mainAppContainer {
    padding-top: max(60px, env(safe-area-inset-top)) !important;
  }
}
/* =========================================
   APPLE iOS HOME SCREEN ONLY
   Dynamic Island Safe Area Fix
========================================= */

@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {

    #mainAppContainer {
      padding-top: env(safe-area-inset-top);
    }

  }
}
@supports (-webkit-touch-callout: none) {
  .ios-standalone #mainAppContainer {
    padding-top: env(safe-area-inset-top);
  }
}
/* =========================================
   EOY PREDICTION WIDGET
   ========================================= */
.prediction-container {
    padding: 15px 0;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.prediction-unclear {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6b7280;
    font-style: italic;
    /* Forces Windows/Desktop to use a clean, modern font stack */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.prediction-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 5px;
    line-height: 1;
}

.prediction-metrics {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prediction-disclaimer {
    font-size: 0.75rem;
    color: #4b5563;
    text-align: center;
    border-top: 1px solid #1f2937;
    padding-top: 12px;
    margin-top: 10px;
    line-height: 1.4;
}
/* =========================================
   RESTORE PROFILE PAGE LAYOUT
   ========================================= */
.profile-header { font-size: 2rem; font-weight: bold; margin-bottom: 20px; border-bottom: 1px solid #1f2937; padding-bottom: 15px; }
.profile-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.profile-detail { color: #9ca3af; margin-bottom: 15px; font-size: 1.1rem; }
.profile-detail span { color: white; font-weight: bold; }
.danger-btn { background: transparent; border: 1px solid #ef4444; color: #ef4444; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; margin-top: 20px; transition: 0.2s; }
.danger-btn:hover { background: #ef4444; color: white; }

/* Constrain Profile Page Width on Desktop */
#view-profile {
    max-width: 900px;
    margin: 0 auto;
}

/* =========================================
   FORCE DESKTOP MODAL TO CENTER
   ========================================= */
#copilotModal {
    align-items: center !important;
    justify-content: center !important;
}
/* =========================================
   MOBILE RESPONSIVENESS: PROFILE PAGE
   ========================================= */
@media screen and (max-width: 768px) {

    /* #view-profile sits OUTSIDE .container so has no padding — add it back */
    #view-profile {
        padding: 0 16px;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }

    /* Switch the grid to a simple stacking flex column — much more reliable
       than trying to override grid-template-columns from outside the container */
    .profile-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px;
        width: 100%;
    }

    /* Both column wrappers fill the full width */
    .profile-grid > div {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Every panel fills its column */
    .profile-grid .panel {
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        margin-bottom: 0 !important;   /* gap on parent handles spacing */
        margin-top: 0 !important;
    }

    /* Inputs fill their panel */
    #profileEmail,
    #profileApiKeyInput,
    .auth-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Buttons fill width */
    #view-profile button,
    #billingManageBtn,
    #view-profile a.auth-btn {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 10px;
    }
}
/* --- PREVIEW BUTTON (Main Page Hero) --- */
.preview-btn {
    background: transparent;
    color: #3b82f6; /* StockUp Blue */
    border: 2px solid #3b82f6;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin-left: 10px; /* Adds space if it sits next to another button */
    cursor: pointer;
}

.preview-btn:hover {
    background: rgba(59, 130, 246, 0.1); /* Slight blue glow on hover */
    color: #60a5fa;
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

@media screen and (max-width: 768px) {
    .preview-btn {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* --- PROMO CODE BOXES --- */
.promo-box {
    margin-top: 12px;
    background: rgba(31, 41, 55, 0.5); /* Subtle dark background */
    border: 1px dashed #4b5563; /* Dashed border for a 'coupon' feel */
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.promo-label {
    color: #9ca3af;
    margin-right: 5px;
}

.promo-code {
    color: #fbbf24; /* Defaults to yellow for Essentials */
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-grow: 1;
    text-align: left;
}

.copy-btn {
    background: #374151;
    color: #f3f4f6;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.copy-btn:hover {
    background: #4b5563;
}

.copy-btn.copied {
    background: #10b981; /* Turns green when clicked */
    color: #000;
}

/* --- LIVE SEARCH DROPDOWN --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    margin-top: 5px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: #374151;
}

.search-item-sym {
    color: white;
    font-weight: bold;
}

.search-item-desc {
    color: #9ca3af;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

/* =========================================
   PREMIUM UI UPGRADES
   ========================================= */

/* 1. SKELETON LOADING SCREENS */
@keyframes skeletonPulse {
    0% { background-color: #1f2937; }
    50% { background-color: #374151; }
    100% { background-color: #1f2937; }
}
.skeleton-box { 
    animation: skeletonPulse 1.5s infinite ease-in-out; 
    border-radius: 8px; 
}
.skel-header { height: 60px; width: 40%; margin-bottom: 20px; }
.skel-chart { height: 400px; width: 100%; margin-bottom: 20px; }
.skel-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.skel-metric { height: 60px; width: 100%; }

/* 2. WEBSOCKET PRICE FLASHES */
@keyframes flashGreen { 
    0% { background-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); border-radius: 8px; } 
    100% { background-color: transparent; box-shadow: none; border-radius: 8px; } 
}
@keyframes flashRed { 
    0% { background-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); border-radius: 8px;} 
    100% { background-color: transparent; box-shadow: none; border-radius: 8px;} 
}
.flash-pos { animation: flashGreen 0.6s ease-out; padding: 0 10px; margin-right: -10px; }
.flash-neg { animation: flashRed 0.6s ease-out; padding: 0 10px; margin-right: -10px; }

/* 3. AI SENTIMENT GAUGE */
.gauge-wrapper { display: flex; flex-direction: column; align-items: center; margin: 15px 0 25px 0; }
.gauge-arc { 
    width: 200px; height: 100px; 
    background: conic-gradient(from 270deg at 50% 100%, #ef4444 0deg, #ef4444 60deg, #fbbf24 60deg, #fbbf24 120deg, #10b981 120deg, #10b981 180deg); 
    border-radius: 100px 100px 0 0; 
    position: relative; display: flex; justify-content: center; align-items: flex-end; 
}
.gauge-inner { 
    width: 160px; height: 80px; 
    background: #111827; /* Matches modal background */
    border-radius: 80px 80px 0 0; position: absolute; bottom: 0; 
}
.gauge-needle { 
    width: 4px; height: 90px; background: #ffffff; position: absolute; bottom: 0; 
    transform-origin: bottom center; border-radius: 4px; 
    transition: transform 1.2s cubic-bezier(0.4, 2.0, 0.2, 1); 
}
.gauge-needle::after { 
    content: ''; width: 14px; height: 14px; background: #ffffff; 
    border-radius: 50%; position: absolute; bottom: -5px; left: -5px; 
}
.gauge-label { font-size: 1.6rem; font-weight: 800; margin-top: 15px; letter-spacing: 1px;}

/* --- PORTFOLIO UI ADDITIONS --- */
.btn-portfolio { 
    background: rgba(16, 185, 129, 0.1); 
    border-color: #10b981 !important; 
    color: #10b981 !important; 
    transition: 0.2s;
}
.btn-portfolio:hover { 
    background: #10b981; 
    color: black !important; 
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); 
}
.port-header { margin-bottom: 30px; }
.port-title { color: #9ca3af; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.port-balance { font-size: 3.5rem; font-weight: 800; line-height: 1; margin-bottom: 10px; }
.port-return { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.return-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.9rem; }
.holding-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #1f2937; }
.holding-item:last-child { border-bottom: none; }
.account-badge { background: #374151; color: #d1d5db; font-size: 0.7rem; padding: 3px 8px; border-radius: 6px; margin-left: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

@media (max-width: 768px) {
    /* Forces the 3 buttons to sit on the same line and share space equally */
    .search-group { 
        display: flex; 
        flex-wrap: wrap; 
        gap: 8px; 
        justify-content: space-between; 
        width: 100%;
    }
    
    .plan-selector { 
        order: 1; 
        flex: 1; 
        justify-content: center; 
        padding: 8px 5px;
        font-size: 0.85rem;
    }
    
    .btn-portfolio { 
        order: 2; 
        flex: 1; 
        display: flex; /* Overrides the old block display */
        justify-content: center;
        align-items: center;
        padding: 8px 5px;
        font-size: 0.85rem;
        margin-top: 0 !important; /* Kills the top margin */
        width: auto !important; 
    }
    
    #authToggleBtn { 
        order: 3; 
        flex: 1; 
        padding: 8px 5px;
        font-size: 0.85rem;
    }
}
#view-portfolio {
    max-width: 1100px;
    margin: 0 auto;
}

/* These views sit outside .container so need their own mobile padding */
@media (max-width: 768px) {
    #view-portfolio,
    #view-pricing,
    #view-compare {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }
}



/* --- COPILOT VERSION DROPDOWN --- */
.version-dropdown-container {
    position: relative;
    margin: 0 15px;
}
.version-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.version-btn:hover { background: rgba(255,255,255,0.1); border-color: #a78bfa; }
.version-btn:active { background: rgba(139, 92, 246, 0.2); border-color: #a78bfa; }
.version-dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    width: 280px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 3000;
    overflow: hidden;
}
.version-dropdown-menu.show { display: block; }
.version-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    cursor: pointer;
    border-bottom: 1px solid #1f2937;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    min-height: 48px;
}
.version-option:last-child { border-bottom: none; }
.version-option:hover { background: rgba(139, 92, 246, 0.1); }
.version-option:active { background: rgba(139, 92, 246, 0.2); }
@media (max-width: 480px) {
    .version-dropdown-menu {
        left: auto;
        right: 0;
        transform: none;
        width: 260px;
    }
}
/* =========================================
   "HOW WE STACK UP" AI BLURB
   ========================================= */
.stack-ai-blurb {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(109, 40, 217, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 28px;
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.6;
}
.stack-ai-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #6d28d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: 2px;
}
.stack-ai-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #60a5fa;
    margin-bottom: 4px;
}
.stack-ai-text strong { color: #f3f4f6; }
.stack-ai-text em { color: #a78bfa; font-style: normal; font-weight: 600; }

/* =========================================
   TIER CARD LAYOUT (mobile only)
   ========================================= */
.tier-cards { display: none; }

.tier-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
}
.tier-card.tier-pro {
    border-color: #2563eb;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}
.tier-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tier-card-name {
    font-size: 1.2rem;
    font-weight: 800;
}
.tier-card-price {
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: right;
}
.tier-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #0d1117;
    font-size: 0.9rem;
}
.tier-card-row:last-child { border-bottom: none; }
.tier-card-feature { color: #d1d5db; font-weight: 500; }
.tier-card-val { display: flex; align-items: center; }
.tier-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #1f2937;
    background: rgba(0,0,0,0.3);
}

/* Wrapper for scrollable competitor table */
.comp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

@media (max-width: 850px) {
    #tierTable { display: none; }
    .tier-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 15px; }
    .comp-table-wrap { overflow-x: auto; border-radius: 10px; }
    .comp-table-wrap .comp-table { min-width: 560px; }
}

/* =========================================
   MSN-STYLE STOCK PAGE ENHANCEMENTS
   ========================================= */

/* Stats category label */
.stats-cat-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 10px;
    margin-top: 4px;
}

/* News items with images */
.news-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.news-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #1f2937;
}
.news-text {
    flex: 1;
    min-width: 0;
}

/* Async section placeholder pulse */
.async-section-loader {
    min-height: 2px;
}

/* Peer cards scroll */
#peers-cards::-webkit-scrollbar { height: 4px; }
#peers-cards::-webkit-scrollbar-track { background: transparent; }
#peers-cards::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

/* Valuation 3-col grid */
@media (max-width: 850px) {
    .metrics-grid[style*="repeat(3"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .metrics-grid[style*="repeat(4"] {
        grid-template-columns: 1fr 1fr !important;
    }
    #section-earnings > div > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #section-insiders .insider-grid {
        grid-template-columns: 1fr auto auto !important;
    }
}

/* =========================================
   SIDEBAR WIDGETS (Price Target, EPS, Peers)
   ========================================= */
.side-widget {
    margin-bottom: 24px;
    animation: fadeInWidget 0.3s ease-out;
}

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

.widget-title {
    font-size: 0.82rem !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af !important;
    margin-bottom: 14px !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================
   DAY STATS STRIP
   ========================================= */
.day-stats-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.day-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-right: 1px solid #1f2937;
    gap: 3px;
}

.day-stat:last-child { border-right: none; }

.day-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 700;
}

.day-stat-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
}

@media (max-width: 850px) {
    .day-stats-strip {
        grid-template-columns: repeat(3, 1fr);
    }
    .day-stat:nth-child(3) { border-right: none; }
    .day-stat:nth-child(4), .day-stat:nth-child(5), .day-stat:nth-child(6) {
        border-top: 1px solid #1f2937;
    }
}

/* =========================================
   ACCENT SECTION TITLES
   ========================================= */
.section-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #1f2937 !important;
    margin-bottom: 15px !important;
    color: #f3f4f6 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Override: widget titles don't get the accent bar */
.widget-title::before { display: none; }

/* =========================================
   METRIC BOX POLISH
   ========================================= */
.metric-box {
    border-top: 1px solid #1a2332 !important;
    padding: 12px 10px 10px 10px !important;
    background: #0a0f1a;
    border-radius: 8px;
    transition: background 0.15s;
}

.metric-box:hover { background: #0d1117; }

.m-label {
    color: #6b7280 !important;
    font-size: 0.72rem !important;
    margin-bottom: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
}

.m-value {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

/* =========================================
   SECTION DIVIDER (subtle horizontal rule)
   ========================================= */
.section-divider {
    border: none;
    border-top: 1px solid #1f2937;
    margin: 28px 0 24px 0;
}

/* Peers widget rows scrollbar */
#widget-peers-content::-webkit-scrollbar { width: 3px; }
#widget-peers-content::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

/* =========================================
   SEARCH BAR HIDDEN — overrides any inline style
   ========================================= */
.search-bar-hidden { display: none !important; }

/* =========================================
   PORTFOLIO SUMMARY CARDS
   ========================================= */
#portfolioSummaryRow {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card { padding: 18px 20px; }
.mobile-perf-cards { display: none !important; }

@media (max-width: 900px) {
    /* Collapse top row to 1 column so 'Total Invested' is full width */
    #portfolioSummaryRow { grid-template-columns: 1fr !important; }
    
    /* Hide the top-row Best/Worst cards */
    .desktop-perf-card { display: none !important; }
    
    /* Reveal the mobile Best/Worst cards under the chart */
    .mobile-perf-cards { display: flex !important; }
}

@media (max-width: 600px) {
    /* Stack Best/Worst vertically on standard phone screens */
    .mobile-perf-cards { flex-direction: column; }
}
/* =========================================
   FUTURE VALUE WIDGET
   ========================================= */
.fv-expand-btn {
    background: none;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.2s, color 0.2s;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.fv-expand-btn:hover { border-color: #6b7280; color: #d1d5db; }
.fv-year-select {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* =========================================
   REFRESH BUTTON
   ========================================= */
.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.refresh-btn:hover { color: #9ca3af; }
.refresh-btn.spinning svg { animation: spin-once 0.65s ease-in-out; }
@keyframes spin-once { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =========================================
   LAST UPDATED LABEL
   ========================================= */
.port-last-updated {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
    min-height: 1em;
}
/* =========================================
   TOGGLE SWITCHES (Profile Preferences)
   ========================================= */
.pref-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #1f2937; color: #d1d5db; font-weight: 500; font-size: 0.95rem; }
.pref-row:last-child { border-bottom: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #374151; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(20px); }

/* =========================================
   MARKET STATUS REPORT MODAL
   ========================================= */
.report-modal-box {
    background-color: #0d1117; 
    width: 95%;
    max-width: 850px; 
    max-height: 85vh;
    border-radius: 12px;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    margin: auto;
}

.report-header {
    padding: 20px 24px;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111827; 
}

.report-content {
    padding: 30px;
    overflow-y: auto;
    background: #0d1117;
}

/* =========================================
   MARKET STATUS MODAL — MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    #marketStatusModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .report-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        /* Fill from bottom all the way up to just below the dynamic island / notch */
        max-height: calc(100dvh - env(safe-area-inset-top)) !important;
        height: calc(100dvh - env(safe-area-inset-top)) !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Push the header content below the notch */
    .report-header {
        padding-top: calc(20px + env(safe-area-inset-top)) !important;
    }

    .report-content {
        padding: 20px 18px !important;
    }

    .report-content h3 {
        font-size: 1.4rem !important;
    }

    .report-content p {
        font-size: 1rem !important;
    }
}

/* =========================================
   COMPARE BUTTON (action bar)
   ========================================= */
.btn-compare {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 0 rgba(8, 145, 178, 0);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-compare::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.btn-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
    background: linear-gradient(135deg, #0f766e, #0e7490);
}
.btn-compare:active { transform: translateY(0); }

/* =========================================
   COMPARE PAGE — LAYOUT & CHROME
   ========================================= */
#view-compare {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.compare-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1f2937;
}

.compare-page-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-back-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.compare-back-btn:hover { background: #374151; color: white; border-color: #4b5563; }

/* =========================================
   COMPARE — INPUT ROW
   ========================================= */
.compare-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.compare-input-card {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compare-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
}

.compare-slot-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.compare-slot-a { background: rgba(14,165,233,0.15); color: #0ea5e9; border: 1px solid rgba(14,165,233,0.35); }
.compare-slot-b { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.35); }

.compare-ticker-input {
    width: 100%;
    padding: 11px 14px;
    background: #000;
    border: 1px solid #374151;
    border-radius: 8px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s;
}
.compare-ticker-input:focus { border-color: #0ea5e9; }
.compare-ticker-input::placeholder { color: #374151; font-weight: 400; letter-spacing: 0; }

.compare-vs-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
    padding: 0 4px;
}

.compare-run-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(8,145,178,0.3);
    position: relative;
    overflow: hidden;
}
.compare-run-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.compare-run-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(8,145,178,0.45); }
.compare-run-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =========================================
   COMPARE — COLUMN LAYOUT (header + chart paired per stock)
   ========================================= */
.compare-columns-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    align-items: start;
}

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

.compare-chart-panel {
    /* inherits .panel base styles */
}

/* Keep old class name aliases in case any JS still references them */
.compare-stock-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.compare-header-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: border-color 0.2s;
}
.compare-header-a { border-top: 2px solid #0ea5e9; }
.compare-header-b { border-top: 2px solid #f97316; }

.compare-header-slot-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}

/* =========================================
   COMPARE — CHART LABEL
   ========================================= */
.compare-chart-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* =========================================
   COMPARE — STATS TABLE
   ========================================= */
.compare-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #1f2937;
    flex-wrap: wrap;
    gap: 8px;
}

.compare-stats-col-labels {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #0d1117;
    border-bottom: 1px solid #1f2937;
    gap: 0;
}

.compare-stat-col-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.compare-stat-row {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    border-bottom: 1px solid #0d1117;
    gap: 0;
    transition: background 0.15s;
}
.compare-stat-row:last-of-type { border-bottom: none; }
.compare-stat-row:hover { background: rgba(255,255,255,0.02); }
.compare-stat-row-alt { background: rgba(13,17,23,0.5); }

.compare-stat-label {
    flex: 2;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.compare-stat-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #4b5563;
    margin-top: 1px;
}

.compare-stat-val {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.compare-stat-winner {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #f3f4f6;
}

.compare-win-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* =========================================
   COMPARE — MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 850px) {
    .compare-input-row { flex-direction: column; align-items: stretch; padding: 16px; }
    .compare-vs-badge { flex-direction: row; padding: 4px 0; justify-content: center; }
    .compare-run-btn { width: 100%; justify-content: center; }
    /* Stack the two columns: A header → A chart → B header → B chart */
    .compare-columns-row { grid-template-columns: 1fr; }
    .compare-stats-col-labels .compare-stat-col-label:first-of-type { display: none; }
    .compare-stat-label { flex: 1.5; }
    .compare-stat-val { flex: 1; }
}

@media (max-width: 500px) {
    .compare-stat-row { padding: 10px 12px; }
    .compare-stats-header { padding: 12px; }
    .compare-stats-col-labels { padding: 8px 12px; }
}

/* =========================================
   PHASE 1.2 — ACCOUNT FILTER PILLS
   ========================================= */
#accountPillsContainer {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 18px;
}

.account-pill {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
}
.account-pill:hover {
    border-color: #6b7280;
    color: #d1d5db;
}
.account-pill.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

/* =========================================
   PHASE 2 — ANALYTICS WIDGETS
   ========================================= */
.analytics-widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.analytics-widget {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px 18px;
}
.analytics-widget-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 900px) {
    .analytics-widgets-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PHASE 3.1 — HOLDINGS NEWS FEED
   ========================================= */
.holdings-news-item {
    display: block;
    padding: 11px 0;
    border-bottom: 1px solid #1f2937;
    text-decoration: none;
    transition: 0.15s;
}
.holdings-news-item:last-child {
    border-bottom: none;
}
.holdings-news-item:hover .h-news-hl {
    color: #60a5fa;
}
.h-news-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}
.h-news-ticker {
    background: #2563eb;
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.h-news-hl {
    color: #e5e7eb;
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s;
}

/* =========================================
   PHASE 3.2 — AI HEALTH CHECK BUTTON
   ========================================= */
.btn-health-check {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #10b981;
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-health-check:hover {
    background: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

/* ============================================================
   FEATURE 1: CORPORATE-SPEAK TRANSLATOR + AI POWER TOOLS PANEL
   ============================================================ */

/* AI Power Tools panel — homepage right sidebar */
.ai-tools-panel .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-tools-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.ai-tool-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.15s;
    text-align: left;
    width: 100%;
    color: inherit;
    font-family: inherit;
}

.ai-tool-btn:hover:not(.ai-tool-coming-soon) {
    border-color: #374151;
    background: #111827;
    transform: translateX(3px);
}

.ai-tool-coming-soon {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.ai-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-tool-info {
    flex: 1;
    min-width: 0;
}

.ai-tool-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-tool-desc {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-tool-soon-badge {
    font-size: 0.62rem;
    color: #4b5563;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #1f2937;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Corporate-Speak Translator textarea */
.corp-translator-textarea {
    width: 100%;
    padding: 14px 44px 14px 16px; /* right padding for char counter */
    border: 1px solid #374151;
    border-radius: 8px;
    background: #0d1117;
    color: #f3f4f6;
    font-size: 0.88rem;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    min-height: 200px;
    display: block;
    box-sizing: border-box;
}

.corp-translator-textarea:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.corp-translator-textarea::placeholder {
    color: #2d3748;
    font-size: 0.82rem;
    line-height: 1.7;
}

/* Spin Intensity badge — rendered inside Copilot chat output.
   The AI outputs the text label; these classes are available for
   future rich rendering if the stream interceptor is enhanced. */
.spin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.spin-accurate  { background: rgba(16,185,129,0.12);  color: #10b981; border: 1px solid rgba(16,185,129,0.4); }
.spin-mild      { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.spin-moderate  { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.spin-heavy     { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.4); }
.spin-critical  { background: rgba(239,68,68,0.18);   color: #ef4444; border: 1px solid rgba(239,68,68,0.6); animation: pulseGlow 2s infinite alternate; }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .ai-tools-list { gap: 8px; }
    .corp-translator-textarea { min-height: 160px; font-size: 0.85rem; }
    .ai-tool-btn { padding: 10px 12px; }
}

/* ============================================================
   FEATURE 5: CAPITOL HILL SCANNER
   Scan mode toggle + performance grade badge styles
   ============================================================ */

/* Scan mode toggle buttons — Politician / Ticker */
.scan-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #0d1117;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.scan-mode-btn:hover {
    border-color: #4b5563;
    color: #9ca3af;
    background: #111827;
}

.scan-mode-btn.scan-mode-active {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    color: #fbbf24;
}

/* Performance grade badges — rendered in Copilot output.
   The AI outputs the grade letter; these classes are available
   for future rich rendering enhancements. */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.grade-a { background: rgba(16,185,129,0.15);  color: #10b981; border: 1px solid rgba(16,185,129,0.4); }
.grade-b { background: rgba(132,204,22,0.12);  color: #84cc16; border: 1px solid rgba(132,204,22,0.4); }
.grade-c { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.grade-d { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.grade-f { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.4); }

@media (max-width: 768px) {
    .scan-mode-btn { padding: 7px 12px; font-size: 0.78rem; }
}

/* ============================================================
   FEATURE 3: HYPE VS. REALITY DIVERGENCE SCANNER
   Verdict badge + divergence score indicator styles.
   ============================================================ */

/* Hype scanner ticker input — monospace, uppercase lock */
.hype-ticker-input {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    letter-spacing: 2px;
}

/* Verdict badges — rendered inside Copilot chat output.
   Available for future rich rendering when stream interceptor
   is enhanced to parse the AI's verdict label. */
.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.verdict-bull-trap {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.4);
}

.verdict-bear-trap {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.4);
}

.verdict-aligned-bullish {
    background: rgba(37,99,235,0.12);
    color: #60a5fa;
    border: 1px solid rgba(37,99,235,0.35);
}

.verdict-aligned-bearish {
    background: rgba(107,114,128,0.12);
    color: #9ca3af;
    border: 1px solid rgba(107,114,128,0.35);
}

.verdict-inconclusive {
    background: rgba(251,191,36,0.1);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
}

/* Divergence score bar — a visual 1-10 meter.
   Rendered by a future stream post-processor;
   base styles defined here for forward compatibility. */
.divergence-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.divergence-meter-track {
    flex: 1;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}

.divergence-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    /* width set inline as a % of 10, e.g. score 7 = 70% */
}

/* Score 1-3: low divergence — blue */
.divergence-low  { background: linear-gradient(90deg, #2563eb, #3b82f6); }
/* Score 4-6: moderate — amber */
.divergence-mid  { background: linear-gradient(90deg, #d97706, #fbbf24); }
/* Score 7-10: high to extreme — red */
.divergence-high { background: linear-gradient(90deg, #dc2626, #ef4444); }

@media (max-width: 768px) {
    .hype-ticker-input { font-size: 0.95rem; }
}

/* ============================================================
   FEATURE 4: SYMPATHY PLAY ENGINE
   Conviction badge, catalyst magnitude, and timing lag styles.
   ============================================================ */

/* Conviction badges — HIGH / MEDIUM / LOW */
.conviction-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conviction-high   { background: rgba(16,185,129,0.15);  color: #10b981; border: 1px solid rgba(16,185,129,0.35); }
.conviction-medium { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.35); }
.conviction-low    { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Catalyst magnitude tier labels */
.catalyst-tier {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.catalyst-tier-1 { background: rgba(239,68,68,0.12);   color: #ef4444; border: 1px solid rgba(239,68,68,0.35); }
.catalyst-tier-2 { background: rgba(249,115,22,0.12);  color: #f97316; border: 1px solid rgba(249,115,22,0.35); }
.catalyst-tier-3 { background: rgba(107,114,128,0.1);  color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Sympathy lag labels */
.sympathy-lag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(56,189,248,0.1);
    color: #38bdf8;
    border: 1px solid rgba(56,189,248,0.25);
}

@media (max-width: 768px) {
    .conviction-badge, .catalyst-tier, .sympathy-lag { font-size: 0.65rem; }
}

/* ============================================================
   FEATURE 2: PORTFOLIO STRESS TESTER
   Scenario selector grid + stress rating badge styles.
   ============================================================ */

/* Six-scenario selector grid */
.stress-scenario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stress-scenario-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    background: #0d1117;
    border: 1px solid rgba(107,114,128,0.3);
    border-radius: 9px;
    cursor: pointer;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
    font-family: inherit;
    line-height: 1.3;
}

.stress-scenario-btn:hover {
    border-color: rgba(129,140,248,0.45);
    color: #e5e7eb;
    transform: translateY(-1px);
}

.stress-scenario-btn.stress-scenario-active {
    color: #f3f4f6;
    font-weight: 700;
}

/* Portfolio stress rating badges — rendered in Copilot chat output */
.stress-rating {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stress-critical  { background: rgba(239,68,68,0.14);  color: #ef4444; border: 1px solid rgba(239,68,68,0.45); }
.stress-high      { background: rgba(249,115,22,0.12); color: #f97316; border: 1px solid rgba(249,115,22,0.4); }
.stress-moderate  { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.stress-low       { background: rgba(132,204,22,0.1);  color: #84cc16; border: 1px solid rgba(132,204,22,0.35); }
.stress-resilient { background: rgba(16,185,129,0.1);  color: #10b981; border: 1px solid rgba(16,185,129,0.35); }

@media (max-width: 768px) {
    .stress-scenario-grid { grid-template-columns: 1fr; }
    .stress-scenario-btn  { font-size: 0.78rem; padding: 9px 12px; }
}

/* ============================================================
   FEATURE 6: DCA VISUALIZER
   Chart container, summary metrics row, and metric cell styles.
   Rendered inside the Copilot chat bubble by renderDcaChart().
   ============================================================ */

/* Outer wrapper injected after AI bubble text */
.dca-chart-container {
    margin-top: 18px;
    padding: 16px;
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
}

/* Header row: green arrow icon + title + optional subtitle */
.dca-chart-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f2937;
}

/* Three-column summary stats row below the chart */
.dca-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.dca-metric {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.dca-metric-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    margin-bottom: 5px;
}

.dca-metric-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f3f4f6;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .dca-summary-row   { grid-template-columns: 1fr 1fr; }
    .dca-metric-value  { font-size: 0.92rem; }
    .dca-chart-container { padding: 12px; }
}

/* ── DCA Expand button (inside chart container header) ── */
.dca-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #111827;
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}
.dca-expand-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,0.06);
}

/* ── DCA Expand Modal ──
   z-index sits ONE above copilotModal's max integer so it overlays
   the Copilot panel directly. Background is a very dark semi-transparent
   scrim rather than solid black, so the user can see Copilot behind it.
   Closing the modal returns the user straight back to the Copilot chat. ── */
#dcaExpandModal {
    z-index: 2147483648 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.dca-expand-box {
    background: #0a0a0a;
    border: 1px solid #1f2937;
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -10px rgba(0,0,0,0.8);
}

.dca-expand-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 24px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.dca-expand-body::-webkit-scrollbar { width: 5px; }
.dca-expand-body::-webkit-scrollbar-track { background: transparent; }
.dca-expand-body::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }

/* Six-column stats grid in expand modal */
.dca-expand-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.dca-expand-stat {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

/* Milestone callouts row */
.dca-milestones-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dca-milestone {
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px;
    padding: 10px 18px;
    text-align: center;
    min-width: 80px;
}

/* Year-by-year data table */
.dca-expand-table-wrap {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #1f2937;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.dca-expand-table-wrap::-webkit-scrollbar { width: 4px; }
.dca-expand-table-wrap::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

.dca-expand-table-el {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dca-expand-table-el thead th {
    position: sticky;
    top: 0;
    background: #111827;
    color: #6b7280;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #1f2937;
}

.dca-expand-table-el thead th:first-child { text-align: left; }

.dca-expand-table-el tbody tr {
    border-bottom: 1px solid #0d1117;
    transition: background 0.1s;
}

.dca-expand-table-el tbody tr:hover { background: #111827; }
.dca-expand-table-el tbody tr:nth-child(even) { background: rgba(31,41,55,0.25); }
.dca-expand-table-el tbody tr:nth-child(even):hover { background: #111827; }

.dca-expand-table-el tbody td {
    padding: 7px 12px;
    text-align: right;
    color: #d1d5db;
    font-variant-numeric: tabular-nums;
}

.dca-expand-table-el tbody td:first-child {
    text-align: left;
    font-weight: 600;
}

@media (max-width: 768px) {
    .dca-expand-stats      { grid-template-columns: repeat(3, 1fr); }
    .dca-expand-box        { max-height: 95vh; border-radius: 12px; }
    .dca-expand-body       { padding: 0 14px 20px; }
}

/* ============================================================
   PROFILE — STOCKUP CONNECT PANEL
   Social icon buttons + quick navigation link buttons
   ============================================================ */

/* Circular social icon buttons */
.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #374151;
    background: #111827;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.social-icon-btn:hover {
    transform: translateY(-2px);
}

/* X / Twitter — white icon, blue-tinted hover */
.social-btn-x {
    color: #f3f4f6;
}
.social-btn-x:hover {
    border-color: #1d9bf0;
    background: rgba(29,155,240,0.1);
    color: #1d9bf0;
}

/* LinkedIn — white icon, LinkedIn blue hover */
.social-btn-li {
    color: #f3f4f6;
}
.social-btn-li:hover {
    border-color: #0a66c2;
    background: rgba(10,102,194,0.1);
    color: #0a66c2;
}

/* Quick navigation link buttons */
.profile-nav-link-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: inherit;
}

.profile-nav-link-btn:hover {
    border-color: #374151;
    background: #1f2937;
    color: #f3f4f6;
}
