/* --- METRIC CARD ENHANCEMENTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
.metric-description {
    font-size: 11px;
    color: #718096;
    margin-top: 8px;
    line-height: 1.3;
    font-style: italic;
}

.confidence-display {
    width: 100%;
}

.sentiment-counts {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
}

.confidence-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.confidence-bar-container {
    position: relative;
    height: 25px;
    background: linear-gradient(to right, #e53e3e 0%, #718096 50%, #38a169 100%);
    border-radius: 12px;
    margin: 10px 0;
}

.confidence-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    z-index: 1;
}

.confidence-indicator {
    position: absolute;
    top: -3px;
    width: 8px;
    height: 31px;
    background: #2d3748;
    border: 2px solid white;
    border-radius: 6px;
    z-index: 2;
    transform: translateX(-50%);
}

.confidence-values {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #718096;
}

/* Centered Confidence Bar for Modal */
.confidence-bar-centered {
    position: relative;
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #f7fafc;
    margin-bottom: 8px;
    border: 2px solid #e2e8f0;
    justify-content: center;
    align-items: center;
}

.center-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: #4a5568;
    z-index: 10;
    transform: translateX(-50%);
}

.bearish-half {
    position: absolute;
    right: 50%;
    height: 100%;
    background: linear-gradient(270deg, #fc8181, #e53e3e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 11px;
    transition: width 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.bullish-half {
    position: absolute;
    left: 50%;
    height: 100%;
    background: linear-gradient(90deg, #68d391, #38a169);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 11px;
    transition: width 0.3s ease;
    border-radius: 0 12px 12px 0;
}

.confidence-labels-centered {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
}

.center-neutral {
    color: #4a5568;
    font-weight: 700;
    font-size: 16px;
}

.bearish-label {
    color: #e53e3e;
}

.bullish-label {
    color: #38a169;
}

.mentions-list-clean, .sources-list-clean {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mention-item-clean, .source-item-clean {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
}

.mention-source, .source-name {
    font-weight: 500;
    color: #2d3748;
}

.mention-time, .source-mentions {
    color: #718096;
    font-size: 13px;
}

/* --- GLOBAL RESPONSIVE ENHANCEMENTS --- */
@media (max-width: 1024px) {
    .container, .main-content, .footer-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .navbar-brand span {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container, .main-content, .footer-content {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    .navbar, .nav-menu, .section-header, .footer-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    .main-content {
        min-height: unset;
    }
    .hero-title, .section-header h2 {
        font-size: 1.3rem !important;
    }
    .hero-content, .cta-content {
        padding: 0.5rem !important;
    }
    .subscribe-card, .stock-metrics, .criteria-grid, .feature-grid, .tech-details, .advantages-grid {
        grid-template-columns: 1fr !important;
    }
    .modal-content {
        margin: 10% auto !important;
        width: 98% !important;
        max-width: 99vw !important;
        padding: 1rem !important;
    }

/* Small action button used next to mention sentiment (Ask Grok) */
.ask-grok-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    /* Match mention badge sizing & weight */
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background-color 0.12s ease, transform 0.06s ease;
}
.ask-grok-btn:hover {
    transform: translateY(-1px);
}
.ask-grok-btn:focus {
    outline: 2px solid rgba(99,102,241,0.14);
    outline-offset: 2px;
}

/* Sentiment color variants for Ask Grok (match mention badges) */
.ask-grok-btn.sentiment-bullish {
    background-color: var(--success-color);
    color: white;
}
.ask-grok-btn.sentiment-bearish {
    background-color: var(--bearish-color);
    color: white;
}
.ask-grok-btn.sentiment-neutral {
    background-color: var(--gray-400);
    color: white;
}

/* Mobile: use a neutral fixed grey background for the Ask Grok button only */
@media (max-width: 768px) {
    .ask-grok-btn {
        background-color: var(--neutral-bg-mobile, #e6e9ee) !important;
        color: var(--neutral-text-mobile, #1f2937) !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.2rem 0.48rem !important;
        border-radius: 10px !important;
        font-weight: 700 !important;

        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        font-size: 0.85rem;
    }
}
    .calculation-table {
        min-width: 600px;
    }
    .responsive-table-container {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }
    .footer {
        padding: 1rem 0 !important;
    }
    .footer-links {
        /* Keep footer links inline on narrow screens; allow horizontal scroll if needed */
        flex-direction: row !important;
        gap: 0.75rem !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow-x: auto !important; 
    }

    .footer-links a:focus {
        outline: none;
    }

    .footer-links a:focus-visible {
        outline: 2px solid #4da3ff;
        outline-offset: 2px;
        border-radius: 4px;
    }

    .flash-messages {
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: 60px !important;
    }
    .stock-details-header {
        font-size: 1rem !important;
    }
    .empty-state {
        padding: 2rem 0.5rem !important;
    }
    .email-preview, .tech-card, .feature-card, .advantage-item {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        font-size: 1.05rem !important;
    }
    .modal-content {
        padding: 0.5rem !important;
    }
    .hero-title, .section-header h2 {
        font-size: 1rem !important;
    }
    .footer-content {
        padding: 0.25rem !important;
    }
    .responsive-table-container {
        margin: 0 -0.25rem;
        padding: 0 0.25rem;
    }
    /* Hide the hero icon on very small screens to keep the title on a single line */
    .hero-title i { display: none; }
}
/* Modern, minimalistic CSS with excellent color theory */
:root {
    /* Primary Colors - Based on modern design principles */
    --primary-color: #243c5a;
    --primary-dark: #1a2a40;
    --primary-light: #4e6e99;
    
    /* Secondary Colors */
    --secondary-color: #3b5998;
    --accent-color: #4e6e99;
    
    /* Semantic Colors */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --info-color: #4299e1;
    
    /* Red Colors */
    --red-600: #e53e3e;
    --red-700: #c53030;
    
    /* Sentiment Colors */
    --bullish-color: #38a169;
    --bearish-color: #e53e3e;
    --neutral-color: #718096;
    /* Estimated navbar height; used to place overlays/modals below the navbar on small screens */
    --navbar-height: 64px;
    
    /* Grayscale */
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;
    
    /* Layout */
    --max-width: 1200px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* Global CTA button styles (modern, lighter primary) */
.cta-btn {
    background: var(--primary-light);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: background 160ms ease, transform 120ms ease;
}
.cta-btn:hover { background: var(--primary-color); transform: translateY(-1px); }
.cta-secondary {
    background: transparent;
    border: 2px solid rgba(160,167,180,0.6);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    color: var(--gray-800);
}

/* Section separators used in subscribe card */
.section-sep {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
    margin: 18px 0;
}
.section-sep.short { width: 40%; margin-left: 0; margin-top:8px; margin-bottom:12px; }

/* Fancy select styling */
.fancy-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(180deg, white, #fbfdff);
    border: 1px solid var(--gray-200);
    padding: 8px 36px 8px 12px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    font-size: var(--font-size-sm);
    color: var(--gray-800);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'><path fill='%23718096' d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.fancy-select:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.08); }

/* Ticker chip styles and disabled close button when alerts are off */
.ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px solid var(--gray-100);
    margin-right: 6px;
}
.ticker-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--gray-600);
    width: 20px;
    height: 20px;
    line-height: 18px;
    display:inline-flex;
    justify-content:center;
    align-items:center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
.ticker-close:hover { background: var(--gray-100); color: var(--gray-800); transform: translateY(-1px); }
.ticker-close[disabled], .ticker-close.disabled {
    opacity: 0.45; cursor: default; pointer-events: none; color: var(--gray-400);
}

/* Elegant inline flash messages for page sections */
#subscribe-flash-container { margin-top: 12px; margin-bottom: 12px; }
.flash-msg {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    color: white;
    margin-right: 8px;
}
.flash-info { background: linear-gradient(90deg, #2b6cb0, #3182ce); }
.flash-success { background: linear-gradient(90deg, #48bb78, #38a169); }
.flash-warning { background: linear-gradient(90deg, #f6ad55, #ed8936); }
.flash-error { background: linear-gradient(90deg, #f56565, #e53e3e); }

/* Make flash messages more visible on small screens */
@media (max-width: 768px) {
    .flash-msg { display:block; width:100%; margin-bottom:8px; }
}


/* Make the secondary CTA used for Read more visually match other CTAs but subtler */
.cta-secondary {
    background: transparent;
    border: 1px solid rgba(160,167,180,0.18);
    color: var(--primary-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 120ms ease, transform 120ms ease;
}
.cta-secondary:hover { background-color: rgba(36,60,90,0.04); transform: translateY(-1px); }

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family), 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: #e2e8f0 !important; /* slightly darker subtle gray */
    font-size: var(--font-size-base);
}

/* lock background scrolling when mobile panel is open */
html.no-scroll, body.no-scroll {
    overflow: hidden; /* prevent scroll on most browsers */
    height: 100%;
    touch-action: none; /* disable touch gestures that may scroll */
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    /* keep navbar above mobile overlay and nav panel so it remains visible */
    z-index: 1160;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-xl);
    font-weight: 700;
}

/* icon spacing handled by .nav-logo and .brand-icon; no extra rules needed */

/* --------------------------
   Dashboard styles
   -------------------------- */
.dashboard-page {
    max-width: var(--max-width);
    margin: 1.5rem auto;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Account page specific styles */
.account-page {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}
.account-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
.account-panel {
    background: var(--gray-50);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 6px 18px rgba(17,24,39,0.04);
}
.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.profile-panel .muted { color: var(--gray-600); }
.security-panel input[type="password"],
.security-panel input[type="text"],
.security-panel input[type="email"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
}
.danger-zone {
    margin-top: 1.5rem;
    background: linear-gradient(180deg, rgba(229,62,62,0.03), rgba(255,255,255,0));
    border-left: 4px solid rgba(229,62,62,0.16);
    padding: 1rem;
    border-radius: 8px;
}
.danger-zone .panel-title { color: var(--red-600); }
.danger-zone input {
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .account-grid { grid-template-columns: 1fr; }
    .account-title { font-size: 1.5rem; }
}

/* Additional mobile tweaks for account page */
@media (max-width: 480px) {
    .account-panel { padding: 0.9rem; }
    .security-panel input[type="password"],
    .security-panel input[type="text"],
    .security-panel input[type="email"] {
        padding: 0.55rem 0.6rem;
    }
    .cta-btn, .cancel-refresh-btn { width: 100%; }
    .nav-user-badge { width: 24px; height: 24px; font-size: 0.75rem; }
    .nav-sep { height: 22px; }
}

/* Controls row above leaderboard (e.g., Read more button) */
.dashboard-controls {
    margin-bottom: 12px;
}

.dashboard-page h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    border: 1px solid var(--gray-100);
    padding: 0.75rem;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item .item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.leaderboard-item .symbol {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.leaderboard-item .meta {
    flex: 1 1 auto;
    margin-left: 0.75rem;
}

.leaderboard-item .company {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.leaderboard-item .mentions {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.leaderboard-item .expand-btn {
    background: transparent;
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

.leaderboard-item .item-chart {
    margin-top: 0.4rem;
    padding-top: 6px;
    border-top: 1px solid var(--gray-100);
    overflow: hidden;
}

/* Leaderboard item sentiment highlights (subtle and accessible) */
.leaderboard-item.bullish {
    background: linear-gradient(90deg, rgba(56,161,105,0.06), rgba(56,161,105,0.03));
    border-color: rgba(56,161,105,0.16);
}
.leaderboard-item.bearish {
    background: linear-gradient(90deg, rgba(229,62,62,0.06), rgba(229,62,62,0.03));
    border-color: rgba(229,62,62,0.16);
}


.chart-canvas {
    width: 100% !important;
    max-width: 520px;
    height: 160px !important;
    display: block;
    margin: 0.25rem auto;
}

@media (max-width: 768px) {
    .dashboard-page { padding: 0.6rem; margin: 0.6rem; }
    .leaderboard-item { padding: 0.5rem; }
    .chart-canvas { height: 140px !important; }
    .dashboard-controls { margin-bottom: 8px; }
}

.navbar-brand {
    color: white;
    text-decoration: none;
    font-size: var(--font-size-xl);
    font-weight: 700;
    font-family: var(--font-family);
}

.navbar-brand:hover {
    color: white;
    text-decoration: none;
}

.navbar-brand span {
    color: white;
    font-size: 1.4rem; /* increased site title size */
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* tighter spacing between nav items */
}

/* Pin the nav menu to the right edge of the viewport on wide screens
   so it ignores the centered `.nav-container` padding and stays flush right. */
@media (min-width: 900px) {
    .nav-menu {
        position: fixed;
        /* inset a little from the viewport right so the menu isn't flush to the absolute edge
           (approx two small tabs worth of visual space) while staying safe-area aware */
        right: calc(env(safe-area-inset-right, 0) + 2.25rem);
        top: calc(var(--navbar-height, 64px) / 2 + 2px);
        transform: translateY(-50%);
        background: transparent;
        /* restore slightly larger left padding and overall sizing from earlier styles */
        padding-left: 0.6rem; /* restore previous comfortable padding */
        padding-right: 0.6rem; /* provide symmetric padding so it looks balanced */
        gap: 0.6rem;
        z-index: 1170;
    }
    /* Remove reserved padding so header content can use full width; nav menu is flush to viewport */
    .nav-container { padding-right: 0; }

    /* also remove navbar's right padding so there is no visual gap */
    .navbar { padding-right: 0; }

    /* Slightly larger link padding on wide screens for comfortable click targets */
    .nav-menu .nav-link {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    /* Keep the last visible link from adding extra visual offset */
    .nav-menu .nav-link:last-child {
        padding-right: 0.6rem;
        margin-right: 0;
    }
}

/* Ensure the nav items align to the right side of the navbar on wide screens */
.nav-menu {
    margin-left: auto;
}

/* Small vertical separator before account link and user badge */
.nav-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.12);
    display: inline-block;
    margin: 0 8px;
}

.nav-account {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-user-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent; /* remove button-like background */
    padding: 0.15rem 0.25rem; /* much smaller padding */
    border-radius: 0; /* remove pill shape */
    font-weight: 600; /* slightly bolder for clarity */
    color: var(--gray-50); /* lighter label color on hero background */
    text-transform: none;
    font-size: 0.95rem;
}

/* Ensure hero stat labels can wrap on narrow screens */
.hero-stats .stat-item {
    display: flex;            /* allow flex child shrinking */
    min-width: 0;            /* important to allow child to shrink inside flex container */
    align-items: center;
}
.hero-stats .stat-item span {
    display: inline-block;
    white-space: normal;     /* allow wrapping */
    word-break: break-word;  /* break long words if necessary */
    max-width: 8.5rem;       /* cap width so label wraps early on narrow screens */
    text-align: left;
}

.stat-item i {
    opacity: 0.95;
    font-size: 1.05rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-2xl);
    color: var(--gray-800);
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.force-refresh-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.force-refresh-btn:hover:not(:disabled) {
    background: var(--primary-color-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.force-refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.force-refresh-btn i {
    font-size: 0.9rem;
}

.cancel-refresh-btn {
    background: var(--red-600);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    margin-left: 0.5rem;
}

.cancel-refresh-btn:hover {
    background: var(--red-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cancel-refresh-btn i {
    font-size: 0.9rem;
}



.last-updated {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* Stock Cards */
.stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stock-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.stock-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stock-symbol h3 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.stock-badges {
    display: flex;
    gap: 0.5rem;
}

.mentions-badge {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sentiment-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.sentiment-bullish {
    background: rgba(56, 161, 105, 0.1);
    color: var(--bullish-color);
}

.sentiment-bearish {
    background: rgba(229, 62, 62, 0.1);
    color: var(--bearish-color);
}

.sentiment-neutral {
    background: rgba(113, 128, 150, 0.1);
    color: var(--neutral-color);
}

.stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
}

.metric-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
}

.sentiment-score.sentiment-bullish {
    color: var(--bullish-color);
}

.sentiment-score.sentiment-bearish {
    color: var(--bearish-color);
}

.sentiment-score.sentiment-neutral {
    color: var(--neutral-color);
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

.stock-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.last-mention {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.view-details-btn {
    /* Match global CTA: lighter primary by default, stronger on hover */
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: background 160ms ease, transform 120ms ease;
}

.view-details-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 3rem;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.cta-content h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: var(--font-size-lg);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Subscribe Page */
.subscribe-section {
    padding: 2rem 0;
}

.subscribe-header {
    text-align: center;
    margin-bottom: 3rem;
}

.subscribe-header h1 {
    font-size: var(--font-size-3xl);
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.subscribe-subtitle {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.subscribe-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
}

.subscribe-form-section {
    padding: 2rem;
}

.subscribe-form-section h2 {
    font-size: var(--font-size-2xl);
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.subscribe-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subscribe-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.subscribe-info h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.benefits-list {
    list-style: none;
}

.benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.benefits-list i {
    color: var(--primary-color);
    width: 16px;
}

.alert-preview-section {
    background: var(--gray-50);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Alert search UI styles */
.alert-search-wrapper {
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 1rem 0 1.5rem 0;
}
.alert-search { position: relative; max-width: 640px; }
.alert-search input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: var(--bg-secondary);
    color: var(--neutral-color);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.alert-search input[type="text"]:hover {
    border-color: var(--gray-300);
}
.alert-search input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(102,126,234,0.08);
}
.suggestions {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    background: #ffffff; /* solid white for readability */
    border: 1px solid var(--gray-200);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    z-index: 50;
    max-height: 320px;
    overflow: auto;
    padding: 6px 0;
    display: none; /* hide by default; JS will show when there are results */
}
.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-800);
    background: transparent;
    opacity: 1; /* ensure full opacity for readability */
}
.suggestion-item:hover { background: #f8fafc; }
.selected-tickers { margin-top:10px; color: var(--gray-600); }
.selected-count { font-weight:600; margin-bottom:6px; color: var(--gray-700); }
.selected-list { display:flex; gap:8px; flex-wrap:wrap; }
.ticker-chip { background: white; border:1px solid var(--gray-200); color:var(--gray-800); padding:6px 8px; border-radius:999px; cursor:pointer; box-shadow: var(--shadow-sm); }
.ticker-close { margin-left:6px; color:var(--gray-500); }

/* Disabled state for alert editing */
.alert-search input[disabled], .alert-frequency select[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

#toggle-small-msg {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Toggle button (nice visual) */
.toggle-btn{
    width: 54px;
    height: 30px;
    background: var(--gray-200);
    border-radius: 999px;
    border: none;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 160ms ease;
    position: relative;
}
.toggle-btn.on{ background: linear-gradient(90deg,var(--primary-color),var(--secondary-color)); }
.toggle-track{ display:block; width:100%; height:100%; position:relative; }
.toggle-thumb{ width:24px; height:24px; background:white; border-radius:50%; box-shadow:0 2px 6px rgba(0,0,0,0.15); position:absolute; left:3px; top:50%; transition: transform 140ms ease; transform: translateY(-50%) translateX(0); }
.toggle-btn.on .toggle-thumb { transform: translateY(-50%) translateX(24px); }
.alert-frequency { margin-top:8px; display:flex; gap:8px; align-items:center; }

.alert-preview-section h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.email-preview {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.email-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: 600;
}

.email-body {
    padding: 1rem;
}

.stock-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.alert-stock-symbol {
    font-weight: 700;
    color: var(--gray-800);
}

.alert-details {
    text-align: right;
    font-size: var(--font-size-sm);
}

.alert-sentiment {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}

.alert-mentions, .alert-score {
    color: var(--gray-600);
}

.alert-settings {
    margin-top: 3rem;
}

.alert-settings h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--gray-800);
}

.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.criteria-item {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.criteria-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.criteria-item h3 {
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.criteria-item p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.privacy-section {
    background: var(--gray-100);
    padding: 2rem 0;
    margin-top: 3rem;
}

.privacy-content {
    text-align: center;
    color: var(--gray-600);
}

.privacy-content h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.privacy-content i {
    color: var(--success-color);
    margin-right: 0.5rem;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    /* place just below the navbar, with a small gap */
    top: calc(var(--navbar-height, 64px) + 12px);
    right: 1rem;
    /* ensure flash messages appear above the navbar and overlays */
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash-message {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.flash-success {
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.flash-error {
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.5;
    padding: 0.25rem;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    /* default z-index above most page content but below sticky navbar (which is 1160) */
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    /* place modal content slightly below the navbar on larger screens */
    margin: calc(var(--navbar-height, 64px) + 24px) auto 2rem;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
    transform: translateY(0);
    transition: transform 0.2s ease;
}

/* Stock details modal should appear above normal page content but below the navbar.
   On small screens we position it fixed and below the navbar to avoid being masked. */
#stock-details-modal {
    z-index: 1135; /* below navbar (1160) but above nav panel (1110) and overlay (1105) */
}

/* Slight nudge for the dashboard info modal so it doesn't touch browser extensions or the top of the viewport */
.dashboard-modal .modal-content {
    margin-top: calc(var(--navbar-height, 64px) + 48px);
}

@media (max-width: 768px) {
    /* make the modal-content fixed so it doesn't get clipped by underlying stacking contexts
       and ensure it sits below the navbar using the --navbar-height variable */
    #stock-details-modal {
        z-index: 1135;
    }

    #stock-details-modal .modal-content {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: calc(var(--navbar-height) + 8px) !important;
        margin: 0 !important; /* reset margin when fixed */
        width: calc(100% - 32px) !important;
        max-width: calc(100% - 32px) !important;
        max-height: calc(100vh - (var(--navbar-height) + 24px)) !important;
        border-radius: 10px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    }

    /* Mobile-specific positioning for disclaimer & contacts modals so they sit below navbar */
    #disclaimer-modal .modal-content,
    #contacts-modal .modal-content {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        /* small extra gap to avoid touching the navbar on mobile */
        top: calc(var(--navbar-height) + 20px) !important;
        margin: 0 !important;
        width: calc(100% - 32px) !important;
        max-width: calc(100% - 32px) !important;
        max-height: calc(100vh - (var(--navbar-height) + 28px)) !important;
        border-radius: 10px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    }
}

/* Ensure dashboard modal also has a slightly larger top offset on mobile */
@media (max-width: 768px) {
    .dashboard-modal .modal-content {
        top: calc(var(--navbar-height) + 20px) !important;
        margin-top: 0 !important;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray-400);
}

.close:hover {
    color: var(--gray-800);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Specific nudges for disclaimer and contacts modals to avoid touching the navbar */
#disclaimer-modal .modal-content,
#contacts-modal .modal-content {
    /* nudge a bit further down so the modal content doesn't touch the navbar */
    margin-top: calc(var(--navbar-height, 64px) + 64px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: var(--font-size-lg);
}

/* Footer */
.footer {
    background: var(--gray-800);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    white-space: nowrap; /* prevent links from wrapping to new lines */
    overflow-x: auto; /* allow horizontal scroll on very narrow screens */
    -webkit-overflow-scrolling: touch;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap; /* ensure each link doesn't wrap internally */
}

.footer-links a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: var(--font-size-3xl);
        flex-direction: column;
        gap: 0.5rem;
    }
    /* Keep hero stats inline while there is room; center the whole row and ensure wrapped lines are centered */
    .hero-stats {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center; /* center items and wrapped lines */
        gap: 0.9rem;
    }

    /* Allow stat items to size naturally (not full width) so multiple can sit inline; center content within each */
    .hero-stats .stat-item {
        display: inline-flex;
        width: auto;
        padding: 0.25rem 0.6rem; /* slightly larger touch area */
        text-align: center;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .subscribe-card {
        grid-template-columns: 1fr;
    }
    
    .stock-metrics {
        grid-template-columns: 1fr;
    }
    
    .flash-messages {
        left: 1rem;
        right: 1rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

/* Stock Details Modal Styles */
.stock-details-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Slightly lower the stock details modal so it doesn't appear too high on the viewport */
#stock-details-modal .modal-content {
    margin: 6% auto; /* bumped down 2% on desktop so it appears lower */
}

@media (max-width: 768px) {
    /* on small screens, give it more top space so it doesn't overlap the fixed navbar */
    #stock-details-modal .modal-content {
        margin: 12% auto;
    }
    /* Ensure stock details modal sits below the navbar on narrow viewports */
    #stock-details-modal .modal-content {
        margin-top: calc(var(--navbar-height) + 8px);
        max-height: calc(100vh - (var(--navbar-height) + 16px));
    }

    /* Make the inner content of the stock details modal scrollable on mobile so the
       user can reach the bottom content without the modal being cropped by the viewport */
    #stock-details-content {
        max-height: calc(100vh - (var(--navbar-height) + 120px)); /* leave space for header and close */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* smooth momentum scrolling on iOS */
        padding-right: 8px; /* avoid content touching the right edge when scrollbar visible */
        box-sizing: border-box;
    }

    /* Ensure modal-content doesn't prevent inner scrolling by keeping it auto-sized */
    #stock-details-modal .modal-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

.stock-details-header h2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.sentiment-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.sentiment-badge.sentiment-bullish {
    background-color: var(--success-color);
    color: white;
}

.sentiment-badge.sentiment-bearish {
    background-color: var(--bearish-color);
    color: white;
}

.sentiment-badge.sentiment-neutral {
    background-color: var(--gray-400);
    color: white;
}



.details-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.metric-card h3 {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.metric-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.metric-number.sentiment-bullish {
    color: var(--success-color);
}

.metric-number.sentiment-bearish {
    color: var(--bearish-color);
}

.sentiment-breakdown .sentiment-bar {
    display: flex;
    height: 35px;
    border-radius: 17px;
    overflow: hidden;
    margin-top: 0.5rem;
    background-color: #f0f0f0;
    border: 2px solid #e0e0e0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.sentiment-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.bullish-label {
    color: var(--bullish-color);
}

.bearish-label {
    color: var(--bearish-color);
}

.neutral-label {
    color: var(--neutral-color);
}

/* Confidence Section */
.confidence-section {
    margin: 1.5rem 0;
}

.confidence-card {
    width: 100%;
    max-width: none;
}

/* Confidence Bars */
.confidence-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.confidence-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.confidence-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.confidence-bar {
    position: relative;
    height: 20px;
    background-color: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.confidence-fill.bullish {
    background: linear-gradient(90deg, var(--bullish-color), #2d7a47);
}

.confidence-fill.bearish {
    background: linear-gradient(90deg, var(--bearish-color), #c53030);
}

.confidence-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 1;
}

.sentiment-bar .bullish {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    min-width: 0;
}

.sentiment-bar .bearish {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    min-width: 0;
}

.sentiment-bar .neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    min-width: 0;
}

.sentiment-bar .bullish:hover,
.sentiment-bar .bearish:hover,
.sentiment-bar .neutral:hover {
    transform: scaleY(1.05);
    z-index: 1;
}

/* Sentiment percentage labels */
.sentiment-percentages {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.percentage-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.percentage-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.bullish-color {
    background: linear-gradient(135deg, #10b981, #059669);
}

.bearish-color {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.neutral-color {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.details-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.details-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mentions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mention-item {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.mention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mention-source {
    font-weight: bold;
    color: var(--primary-color);
}

.mention-time {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.mention-sentiment {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.mention-sentiment.sentiment-bullish {
    background-color: var(--success-color) !important;
    color: white !important;
}

.mention-sentiment.sentiment-bearish {
    background-color: var(--bearish-color) !important;
    color: white !important;
}

.mention-sentiment.sentiment-neutral {
    background-color: var(--gray-400) !important;
    color: white !important;
}

/* Re-assert base mention-sentiment sizing to avoid accidental overrides */
.mention-sentiment {
    padding: 0.2rem 0.5rem !important;
    border-radius: 12px !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
}

/* Desktop: make Ask Grok button visually match the mention sentiment badge
   without touching `.mention-sentiment` itself. Placed after the badge rules
   to ensure it applies on desktop. */
.ask-grok-btn {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    background: transparent; /* default neutral */
    color: inherit;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.ask-grok-btn.sentiment-bullish {
    background-color: var(--success-color) !important;
    color: white !important;
}
.ask-grok-btn.sentiment-bearish {
    background-color: var(--bearish-color) !important;
    color: white !important;
}
.ask-grok-btn.sentiment-neutral {
    background-color: var(--gray-400) !important;
    color: white !important;
}

/* Force Ask Grok to use a fixed background color regardless of sentiment */
.ask-grok-btn {
    --grok-bg: var(--neutral-bg-mobile, #e6e9ee);
    --grok-text: var(--neutral-text-mobile, #1f2937);
    background-color: var(--grok-bg) !important;
    color: var(--grok-text) !important;
}

/* Ensure sentiment-specific variants do not change Ask Grok's color */
.ask-grok-btn.sentiment-bullish,
.ask-grok-btn.sentiment-bearish,
.ask-grok-btn.sentiment-neutral {
    background-color: var(--grok-bg) !important;
    color: var(--grok-text) !important;
}


.sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.source-name {
    font-weight: bold;
    color: var(--primary-color);
}

.source-mentions {
    color: var(--gray-600);
}

.source-sentiment {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.action-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.retry-btn, .debug-btn, .close-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
}

.debug-btn {
    background: var(--warning-color);
    color: white;
}

.close-btn {
    background: var(--gray-400);
    color: white;
}

.error-state, .loading-state, .debug-info {
    text-align: center;
    padding: 2rem;
}

.error-details {
    text-align: left;
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.error-details ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Mobile Navigation Hamburger Menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    /* keep the hamburger lines white so they remain visible on the colored navbar */
    background: white;
    transition: 0.3s ease;
    border-radius: 2px;
}

/* Hamburger animation */
.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hamburger animation */
.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        /* nudge the toggle a bit to the left so it sits closer to the brand like the original layout */
        margin-left: -0.6rem;
    }

    /* increase spacing between the hamburger lines to match previous look */
    .nav-toggle .hamburger-line {
        margin: 3.5px 0; /* vertical gap between lines */
    }

    /* Partial slide-in panel anchored to the right */
    .nav-menu {
        position: fixed;
        top: 70px; /* Height of navbar */
        right: 0;
        width: min(420px, 92%);
        height: calc(100vh - 70px);
        /* Use theme primary/secondary variables for the mobile panel background */
        background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 1rem 0.75rem;
        transform: translateX(110%); /* hidden to the right */
        transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
    z-index: 1110;
    /* softer shadow so underlying base content remains visible */
    box-shadow: -6px 10px 24px rgba(0,0,0,0.12);
        overflow-y: auto; /* allow scrolling when menu is tall */
        -webkit-overflow-scrolling: touch;
        border-radius: 8px 0 0 8px;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: calc(100% - 2rem);
        padding: 0.85rem 1rem;
        margin: 0.35rem 1rem;
        color: white;
        text-decoration: none;
        font-size: 1.05rem;
        font-weight: 500;
        background: rgba(255, 255, 255, 0.06);
        border-radius: 10px;
        transition: background 0.18s ease, transform 0.18s ease;
        backdrop-filter: blur(8px);
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.14);
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    }

    .nav-link i {
        margin-right: 0.75rem;
        font-size: 1.2rem;
    }

    /* Ensure navbar container handles mobile properly */
    .nav-container {
        justify-content: space-between;
    }

    /* overlay element placed as a sibling to the nav; we style it here */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: calc(100% - min(420px, 92%));
        height: calc(100vh - 70px);
        /* make overlay transparent so it doesn't visually mask base content; it still captures clicks */
        background: transparent;
        z-index: 1105; /* under the panel (1110) but above page content */
        /* no blur so base remains crisp */
        backdrop-filter: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* ensure the hamburger toggle sits above everything */
    .nav-toggle {
        z-index: 1120;
    }

    /* persistent close button inside the panel */
    .nav-close {
        background: transparent;
        color: white;
        border: none;
        font-size: 1.6rem;
        line-height: 1;
        padding: 0.15rem 0.5rem;
        position: absolute;
        top: 8px;
        right: 12px;
        cursor: pointer;
        z-index: 1125;
    }
    .nav-close:hover { color: #fffb; }
}

/* Brand icon styling */
.brand-icon {
    margin-right: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-icon:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.nav-logo {
    display: flex;
    align-items: center;
}

/* Make the brand anchor align items and control spacing */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem; /* small gap between logo and text */
}

/* Reduce the default right margin on brand-icon when used inside .navbar-brand */
.navbar-brand .brand-icon {
    margin-right: 0.25rem;
}

/* Optional: if you want the text even closer, uncomment the next rule (small negative nudges) */
/* .navbar-brand .brand-text { margin-left: -0.15rem; } */

/* Site logo image sizing */
.site-logo-img {
    width: 46px; /* slightly reduced default */
    height: auto;
    display: inline-block;
    object-fit: contain;
}

/* Larger logo on wide screens */
@media (min-width: 1025px) {
    .site-logo-img {
        width: 54px;
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .site-logo-img {
        width: 34px;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-link i {
        margin-right: 0.5rem;
    }
    
    .brand-icon {
        width: 26px;
        height: 26px;
    }
}

/* Mobile brand icon */
@media (max-width: 768px) {
    .brand-icon {
        width: 28px;
        height: 28px;
        margin-right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        gap: 1rem;
        justify-content: center;
    }
    .stat-item {
        display: inline-flex;
        padding: 0.2rem 0.4rem;
        font-size: 0.95rem;
    }
}

/* Disclaimer modal styling - make it tight and authoritative */
.disclaimer-modal {
    max-width: 680px;
    padding: 1.25rem 1.5rem;
    border-left: 6px solid #e53e3e; /* red accent */
}
.disclaimer-title {
    color: #2d3748;
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}
.disclaimer-lead {
    margin-bottom: 0.5rem;
    color: #c53030;
}
.disclaimer-body p {
    margin-bottom: 0.5rem;
    color: #2d3748;
    line-height: 1.4;
}
.disclaimer-list {
    margin: 0.5rem 0;
    padding-left: 1.1rem;
    color: #2d3748;
}
.disclaimer-list li {
    margin-bottom: 0.45rem;
}
.disclaimer-action {
    margin-top: 0.6rem;
    color: #2d3748;
}

.disclaimer-modal .close-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}
.disclaimer-modal .close-btn:hover {
    background: #c53030;
}

/* Contact email styling (used in contacts modal) */
/* ------------------ Auth pages ------------------ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(16,24,40,0.08);
    padding: 2rem;
    border: 1px solid var(--gray-100);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

/* scoped logo for auth cards (keeps navbar logo unchanged) */
.auth-brand .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: inline-block;
    margin: 0 auto;
}

.auth-brand h1 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    color: var(--gray-800);
}

.auth-brand .muted {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.auth-brand .brand-icon {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.9));
    padding: 8px;
    box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}

.auth-form .muted { margin-top: 0.25rem; }

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(102,126,234,0.06);
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102,126,234,0.12);
}

.btn-lg {
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    border-radius: 10px;
}

.btn:focus {
    outline: 3px solid rgba(102,126,234,0.18);
    outline-offset: 2px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card { padding: 1rem; }
    .auth-page { padding: 2rem 1rem; }
}

/* Auth flash messages (inline) */
.auth-flash-messages { margin-bottom: 1rem; }
.auth-flash-messages .flash-message { max-width: 100%; box-shadow: none; border-radius: 8px; padding: 0.6rem 0.9rem; }
.auth-flash-messages .flash-success { background: #f0fff4; border-left-color: var(--success-color); color: var(--success-color); }
.auth-flash-messages .flash-error { background: #fff5f5; border-left-color: var(--error-color); color: var(--error-color); }

.contact-email {
    display: inline-block;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    color: var(--gray-800);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(45,55,72,0.06);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16,24,40,0.04);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.contact-email:hover, .contact-email:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16,24,40,0.08);
    text-decoration: none;
}
.contact-email:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}

/* Keep hero stats on a single line on small screens; allow horizontal scroll instead of wrapping */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap; /* allow wrapping */
        justify-content: center;
        gap: 0.75rem; /* tighter gaps on small screens */
    }

    .hero-stats .stat-item {
        flex: 1 1 auto; /* allow shrinking + wrapping */
        min-width: 80px; /* prevents items becoming unreadable */
        text-align: center;

        /* progressive shrinking */
        font-size: clamp(0.75rem, 2.5vw, 1rem);

        /* allow line breaks when needed */
        white-space: normal;
        line-height: 1.2;
        word-break: break-word; /* break long words if needed */
    }
}

/* Ensure modal close is always on top and clickable */
.modal .close {
  position: absolute;       /* keep it positioned relative to .modal-content */
  right: 1rem;
  top: 1rem;
  z-index: 3000;            /* high z-index so it sits above content */
  pointer-events: auto;
  background: transparent;
}

/* Make the modal header title reserve space for the close button and ellipsize if too long */
.stock-details-header h2,
.modal .modal-content h2 {
  display: block;
  font-size: clamp(1rem, 4vw, 1.5rem); /* smoothly shrink */
  max-width: calc(100% - 60px);
  overflow-wrap: break-word; /* wrap long words */
  word-break: break-word;    /* additional safety */
}


/* Small screens: reduce title size so it fits better */
@media (max-width: 480px) {
    .stock-details-header h2,
    .modal .modal-content h2 {
        /* keep slightly larger than before, allow wrapping and reserve space for the close button */
        display: block;
        font-size: 1.15rem;
        max-width: calc(100% - 72px);
        white-space: normal; /* allow wrapping */
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    /* Ensure header area reserves room on the right for the absolute-positioned close icon */
    .stock-details-header {
        padding-right: 3.5rem; /* gives breathing room so the title won't overlap the close button */
    }
}

/* Subscribe page - status badges and confirm-modal tweaks moved from inline template */
.subscribe-section .status.active{
    color: #155724; /* dark green text */
    background: #d4edda; /* pale green bg */
    padding:4px 8px;
    border-radius:12px;
    font-weight:600;
}
.subscribe-section .status.inactive{
    color: #721c24; /* dark red text */
    background: #f8d7da; /* pale red bg */
    padding:4px 8px;
    border-radius:12px;
    font-weight:600;
}

/* Confirm modal specific styles */
#confirm-modal { position: fixed; inset: 0; z-index: 1200; display:flex; align-items:center; justify-content:center; }
#confirm-modal .modal-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.45); }
#confirm-modal .modal-content { position:relative; background:white; padding:20px; border-radius:8px; width:100%; max-width:480px; box-shadow:0 8px 30px rgba(0,0,0,0.15); }
#confirm-modal h3{ margin-top:0; }
#confirm-email-input{ width:100%; padding:12px 10px; font-size:1.05rem; border:1px solid #ddd; border-radius:6px; box-sizing:border-box; }
.modal-actions{ display:flex; gap:8px; justify-content:flex-end; }
.modal-actions .subscribe-btn{ padding:8px 12px; font-size:0.95rem; }
.modal-actions .subscribe-btn#confirm-cancel{ background:#e2e8f0; color:#111; }

/* Lock overlay for top 3 stocks when user is not logged in */
.stock-card.locked{ position: relative; pointer-events: none; opacity: 0.92; }
.stock-card.locked .view-details-btn{ opacity: 0.6; cursor: not-allowed; }
.stock-card .lock-overlay{ position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.85)); display:flex; align-items:center; justify-content:center; border-radius: inherit; padding: 16px; }
.stock-card .lock-overlay { flex-direction: column; }
.stock-card .lock-content{ text-align:center; color: var(--gray-700); display:flex; flex-direction:column; align-items:center; gap:6px; font-weight:700; justify-content:center; }
.stock-card .lock-content i{ font-size:1.2rem; color: var(--gray-600); }
.stock-card .lock-content div{ font-size:0.95rem; }

/* Hide underlying card content entirely for locked cards so names/metrics aren't readable */
.stock-card.locked > :not(.lock-overlay) {
    visibility: hidden;
}

/* Make locked cards same visual height as regular cards; responsive tweaks */
.stock-card.locked {
    /* matches a typical stock card height with header, metrics and footer */
    min-height: 260px;
    display: block; /* ensure block formatting */
}

@media (max-width: 768px) {
    .stock-card.locked {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .stock-card.locked {
        min-height: 200px;
    }
}

/* Skeleton placeholder inside locked overlay */
.lock-skeleton { width: 70%; max-width: 320px; margin-bottom: 8px; display:flex; flex-direction:column; gap:8px; }
.lock-skeleton .s-line { height: 10px; background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.03)); border-radius:6px; position:relative; overflow:hidden; }
.lock-skeleton .s-line.l1{ width: 100%; height: 12px; }
.lock-skeleton .s-line.l2{ width: 85%; }
.lock-skeleton .s-line.l3{ width: 60%; }

/* shimmer animation */
.s-line::after { content: ''; position: absolute; left: -150px; top: 0; height: 100%; width: 150px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(300px); } }