/* * Custom Stylesheet for Emerging Crypto Trends
 * Version: 6.5.0
 * FIXES: Added styles for 'Last Updated' SEO timestamp.
 */

/* --- v5.0: THEME VARIABLES --- */
:root {
    --ect-font: 'Inter', sans-serif;
    
    --ect-green-500: #22C55E;
    --ect-green-400: #4ADE80;
    --ect-amber-500: #F59E0B;
    --ect-red-500: #EF4444;
    --ect-red-400: #F87171;
    --ect-blue-600: #2563eb;
    --ect-blue-700: #1d4ed8;
    --ect-blue-400: #60a5fa;
    --ect-blue-300: #93c5fd;
    --ect-purple-400: #c084fc;
    --ect-pink-400: #f472b6;
    --ect-teal-400: #2dd4bf;
}

#ect-wrapper[data-theme="dark"] {
    --ect-bg-primary: #0F172A;     /* slate-900 (Wrapper) */
    --ect-bg-secondary: #1e293b;   /* slate-800 (Cards) */
    --ect-bg-tertiary: #334155;    /* slate-700 */
    --ect-bg-hover: #475569;       /* slate-600 */
    --ect-border: #334155;         /* slate-700 */
    --ect-border-hover: #475569;   /* slate-600 */
    --ect-text-primary: #f1f5f9;   /* slate-100 */
    --ect-text-secondary: #cbd5e1; /* slate-300 */
    --ect-text-tertiary: #94a3b8;  /* slate-400 */
    --ect-text-placeholder: #64748b; /* slate-500 */
    --ect-blue-tag-bg: rgba(30, 58, 138, 0.5);
    --ect-green-bg: rgba(34, 197, 94, 0.1);
    --ect-red-bg: rgba(239, 68, 68, 0.1);
    --ect-amber-bg: rgba(245, 158, 11, 0.1);
    --ect-gauge-track: #334155;
    --ect-chart-gradient-start: rgba(255, 255, 255, 0.05);
    --ect-chart-gradient-end: rgba(255, 255, 255, 0);
    --ect-tooltip-bg: #f1f5f9; 
    --ect-tooltip-text: #0F172A;
    --ect-arrow-bg: rgba(30, 41, 59, 0.9);
    --ect-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --ect-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

#ect-wrapper[data-theme="light"] {
    /* UPDATED LIGHT THEME FOR BETTER CONTRAST */
    --ect-bg-primary: #f1f5f9;     /* slate-100 (Wrapper - Soft Grey) */
    --ect-bg-secondary: #ffffff;   /* White (Cards - Pop out) */
    --ect-bg-tertiary: #e2e8f0;    /* slate-200 */
    --ect-bg-hover: #cbd5e1;       /* slate-300 */
    --ect-border: #e2e8f0;         /* slate-200 */
    --ect-border-hover: #cbd5e1;   /* slate-300 */
    --ect-text-primary: #0F172A;   /* slate-900 (Sharp Black) */
    --ect-text-secondary: #334155; /* slate-700 (Dark Grey) */
    --ect-text-tertiary: #64748b;  /* slate-500 */
    --ect-text-placeholder: #94a3b8;/* slate-400 */
    --ect-blue-tag-bg: rgba(30, 58, 138, 0.1);
    --ect-green-bg: rgba(34, 197, 94, 0.1);
    --ect-red-bg: rgba(239, 68, 68, 0.1);
    --ect-amber-bg: rgba(245, 158, 11, 0.1);
    --ect-gauge-track: #e2e8f0;
    --ect-chart-gradient-start: rgba(0, 0, 0, 0.05);
    --ect-chart-gradient-end: rgba(0, 0, 0, 0);
    --ect-tooltip-bg: #0F172A; 
    --ect-tooltip-text: #f1f5f9;
    --ect-arrow-bg: rgba(255, 255, 255, 0.9);
    --ect-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ect-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- SCOPED RESET --- */
#ect-wrapper, #ect-wrapper * {
    box-sizing: border-box;
}

/* --- Base Wrapper --- */
#ect-wrapper {
    font-family: var(--ect-font);
    color: var(--ect-text-secondary);
    background-color: var(--ect-bg-primary);
    
    /* Layout & Sizing */
    width: 100%;
    max-width: 1200px; 
    margin: 2rem auto;
    padding: 1.5rem;
    
    /* Visual Containment */
    border: 1px solid var(--ect-border);
    border-radius: 0.75rem; 
    box-shadow: var(--ect-shadow-lg); 
    
    position: relative;
    isolation: isolate;
    overflow: visible; 
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

#ect-wrapper .hidden { display: none !important; }

@media (max-width: 768px) {
    #ect-wrapper {
        padding: 1rem;
        margin: 1rem auto;
        border-radius: 0.5rem;
    }
}

/* --- CLICKABLE/HOVER STYLES --- */
.ect-clickable-item, .ect-clickable-tag, #ect-search-mode-toggle, #ectSearchButton, #ect-theme-toggle, .ect-nav-tab, .ect-suggestion-item, .ect-arrow-nav {
    cursor: pointer !important;
    user-select: none; 
}

.ect-carousel-item.ect-clickable-item:hover, .ect-suggestion-item:hover, .ect-tx-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--ect-blue-400);
}
.ect-carousel-item, .ect-suggestion-item, .ect-tx-card {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.ect-clickable-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- TOOLTIP MANAGEMENT --- */
[data-tooltip] { position: relative; }
[data-tooltip]::before, [data-tooltip]::after {
    visibility: hidden; opacity: 0; pointer-events: none; transition: all 0.15s ease; z-index: 10001;
}

.ect-info-icon {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%;
    background-color: var(--ect-text-tertiary); color: var(--ect-bg-secondary);
    font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 16px;
    margin-left: 0.5rem; position: relative; top: -2px;
}

[data-tooltip]:hover::before, [data-tooltip]:hover::after {
    visibility: visible; opacity: 1; bottom: 125%;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
    padding: 0.35rem 0.65rem; border-radius: 0.375rem;
    background: var(--ect-tooltip-bg); color: var(--ect-tooltip-text);
    font-size: 0.8rem; font-weight: 600; white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
[data-tooltip]::after {
    content: ''; position: absolute; bottom: 120%; left: 50%;
    transform: translate(-50%, 8px); border: 5px solid transparent;
    border-top-color: var(--ect-tooltip-bg);
}

/* --- FIX 2: Tooltip positioning on Mobile (Refined) --- */
@media (max-width: 600px) {
    [data-tooltip]::before {
        /* Anchor to the right edge with padding */
        left: auto;
        right: 1rem; 
        /* Reset X transform to align the right edge */
        transform: translateX(0); 
        /* Allow text to wrap for long tooltips */
        white-space: normal;
        min-width: 150px; 
        max-width: 95%; /* Use percentage to respect wrapper boundaries */
    }
    
    [data-tooltip]::after {
        /* Move the arrow to match the new anchor point */
        left: auto;
        right: 1.5rem; /* 0.5rem past the right anchor */
        transform: translate(0, 8px); 
    }
}
/* --- END FIX 2 --- */

.ect-main-header [data-tooltip]::before { top: 100%; bottom: auto; margin-top: 10px; }
.ect-main-header [data-tooltip]::after {
    top: 100%; bottom: auto; border-bottom-color: var(--ect-tooltip-bg); border-top-color: transparent; margin-top: 0;
}
.ect-main-header [data-tooltip]:hover::before, .ect-main-header [data-tooltip]:hover::after {
    top: 100%; bottom: auto; opacity: 1; visibility: visible;
}

/* --- Error Modal --- */
#ect-error-modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
}
.ect-modal-content {
    background-color: var(--ect-bg-secondary); color: var(--ect-text-primary);
    margin: 15% auto; padding: 1.5rem; border: 1px solid var(--ect-border);
    border-radius: 0.5rem; width: 90%; max-width: 500px; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.ect-modal-title { font-size: 1.5rem; font-weight: 700; color: var(--ect-red-400); margin-top: 0; }
#ect-modal-close-btn {
    color: var(--ect-text-placeholder); float: right; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1;
}

/* --- Main Header & Search Bar --- */
.ect-main-header {
    display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ect-border); padding-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .ect-main-header { flex-direction: row; align-items: center; justify-content: space-between; }
}
/* Header Group for Title and Last Updated */
.ect-header-group {
    display: flex; flex-direction: column; gap: 0.25rem;
}
.ect-header-title {
    font-size: 1.5rem; font-weight: 700; color: var(--ect-text-primary);
    display: flex; align-items: center; gap: 0.75rem; margin: 0; white-space: nowrap;
}
.ect-header-title svg { color: var(--ect-blue-400); }

/* Last Updated Timestamp */
.ect-last-updated {
    font-size: 0.8rem; color: var(--ect-text-tertiary); font-weight: 500;
    margin-left: 2.5rem; /* Aligns with text start of title icon+text combo approximately */
}

.ect-theme-toggle {
    background: var(--ect-bg-secondary); border: 1px solid var(--ect-border);
    color: var(--ect-text-tertiary); border-radius: 0.5rem; padding: 0.5rem;
    line-height: 0; margin-left: auto;
}
.ect-theme-toggle:hover { background: var(--ect-bg-tertiary); }
#ect-wrapper[data-theme="dark"] .ect-theme-toggle .moon { display: none; }
#ect-wrapper[data-theme="light"] .ect-theme-toggle .sun { display: none; }

.ect-search-container { position: relative; flex-grow: 1; max-width: 600px; width: 100%; }
.ect-search-bar {
    flex-grow: 1; display: flex; align-items: center;
    background-color: var(--ect-bg-secondary); border: 1px solid var(--ect-border);
    border-radius: 0.5rem; box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ect-search-bar:focus-within { border-color: var(--ect-blue-600); box-shadow: 0 0 0 2px var(--ect-blue-600); }

#ect-search-mode-toggle {
    background: var(--ect-bg-tertiary); border: none; padding: 0.5rem;
    margin: 0.375rem; border-radius: 0.375rem; color: var(--ect-text-tertiary); line-height: 0;
}
#ect-search-mode-toggle:hover { background: var(--ect-bg-hover); }

.ect-search-input {
    width: 100%; background-color: transparent; padding: 0.75rem;
    color: var(--ect-text-primary); border: none; outline: none; font-size: 1rem;
}
.ect-search-input::placeholder { color: var(--ect-text-placeholder); }

.ect-button-primary {
    background-color: var(--ect-blue-600); color: #ffffff; margin: 0.375rem;
    padding: 0.5rem 1.25rem; border-radius: 0.375rem; min-width: 100px;
    position: relative; border: none; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.ect-button-primary:hover { background-color: var(--ect-blue-700); }
.ect-button-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.spinner-small {
    width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 3px solid var(--ect-bg-hover);
    border-top-color: var(--ect-text-primary); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading Bar */
#ect-loading-bar-container { display: flex; flex-direction: column; gap: 0.5rem; margin: -0.5rem 0 1rem 0; }
.ect-loading-instance {
    display: flex; align-items: center; gap: 0.75rem;
    background-color: var(--ect-bg-secondary); color: var(--ect-text-tertiary);
    font-size: 0.875rem; padding: 0.5rem 1rem; border-radius: 0.25rem;
    border-left: 4px solid var(--ect-blue-400);
}
.ect-loading-dynamic-text { flex-grow: 1; }
.ect-loading-query-name { font-weight: 600; color: var(--ect-text-secondary); }

/* Search Suggestions */
#ect-search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background-color: var(--ect-bg-secondary); border: 1px solid var(--ect-border-hover);
    border-top: none; border-radius: 0 0 0.5rem 0.5rem; z-index: 100;
    max-height: 300px; overflow-y: auto; box-shadow: var(--ect-shadow-md);
}
.ect-suggestion-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; }
.ect-suggestion-item:hover { background-color: var(--ect-bg-tertiary); }
.ect-suggestion-item img { width: 24px; height: 24px; border-radius: 50%; }
.ect-suggestion-item div { display: flex; flex-direction: column; }
.ect-suggestion-item strong { color: var(--ect-text-primary); font-weight: 600; }
.ect-suggestion-item span { color: var(--ect-text-tertiary); font-size: 0.875rem; }

/* --- Tabs Navigation --- */
.ect-tabs-navigation { position: relative; }
.ect-nav-tabs-container { overflow: hidden; position: relative; }
.ect-nav-tabs {
    display: flex; flex-wrap: nowrap; gap: 0.25rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ect-border); overflow-x: auto; padding-bottom: 5px;
    -ms-overflow-style: none; scrollbar-width: none;
}
.ect-nav-tabs::-webkit-scrollbar { display: none; }
.ect-nav-tab {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem;
    border: none; background-color: transparent; color: var(--ect-text-tertiary);
    font-size: 0.9rem; font-weight: 600; border-bottom: 3px solid transparent;
    transition: all 0.2s ease; white-space: nowrap; position: relative; top: 1px;
}
.ect-nav-tab:hover { color: var(--ect-text-primary); background-color: var(--ect-bg-secondary); }
.ect-nav-tab.active {
    color: var(--ect-blue-400); border-bottom-color: var(--ect-blue-400);
    background-color: var(--ect-bg-secondary);
}
.ect-tab-close {
    font-size: 1.25rem; margin-left: 0.5rem; padding: 0.1rem 0.25rem; border-radius: 50%;
}
.ect-tab-close:hover { background-color: var(--ect-bg-hover); color: var(--ect-text-primary); }

.ect-arrow-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background-color: var(--ect-arrow-bg); backdrop-filter: blur(2px);
    color: var(--ect-text-primary); border: 1px solid var(--ect-border-hover);
    border-radius: 50%; width: 2.25rem; height: 2.25rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ect-arrow-nav:hover { background-color: var(--ect-bg-hover); }
.ect-arrow-nav.disabled { opacity: 0.3; cursor: not-allowed; background-color: var(--ect-bg-tertiary); }
.ect-arrow-nav.visible { opacity: 1; visibility: visible; }
.ect-tabs-arrow-nav { top: 1.1rem; }
#ect-tabs-arrow-left { left: -0.75rem; }
#ect-tabs-arrow-right { right: -0.75rem; }
.ect-carousel-arrow-nav.left { left: 0.5rem; }
.ect-carousel-arrow-nav.right { right: 0.5rem; }

.ect-tab-content-wrapper { position: relative; }
.ect-tab-content { display: none; }
.ect-tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Skeletons & Empty States --- */
.ect-skeleton-card, .ect-skeleton-carousel-item {
    background-color: var(--ect-bg-secondary); border: 1px solid var(--ect-border);
    border-radius: 0.5rem; padding: 1.25rem; position: relative; overflow: hidden;
}
.ect-skeleton-card { min-height: 180px; }
.ect-skeleton-carousel-item { width: 280px; height: 150px; }
.ect-skeleton-card::after, .ect-skeleton-carousel-item::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--ect-bg-tertiary), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }
.ect-no-data { color: var(--ect-text-tertiary); font-style: italic; padding: 1rem; text-align: center; }

/* --- Dashboard Widgets --- */
.ect-widget-card {
    background-color: var(--ect-bg-secondary); border: 1px solid var(--ect-border);
    border-radius: 0.5rem; padding: 1.25rem; margin-bottom: 1.5rem;
    box-shadow: var(--ect-shadow-md);
}
.ect-widget-title {
    font-size: 1.25rem; font-weight: 700; color: var(--ect-text-primary);
    margin-top: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--ect-border);
    padding-bottom: 0.75rem; border-left: 4px solid var(--ect-blue-400);
    padding-left: 0.75rem;
}
.ect-widget-content { flex-grow: 1; }

/* Sentiment Widget */
.ect-sentiment-content {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center;
}
@media (min-width: 640px) { .ect-sentiment-content { grid-template-columns: 250px 1fr; } }
.ect-sentiment-chart-container {
    position: relative; width: 100%; max-width: 250px; height: 150px;
    margin: 0 auto; margin-bottom: 4.5rem;
}
.ect-sentiment-chart-text {
    position: absolute; left: 50%; top: 100%; transform: translate(-50%, 0.5rem);
    text-align: center; width: 100%;
}
.ect-sentiment-value {
    font-size: 2rem; font-weight: 900; margin-bottom: 0.1rem; line-height: 1.1;
}
.ect-sentiment-score { font-size: 0.875rem; color: var(--ect-text-tertiary); }
.ect-sentiment-summary { font-size: 1rem; color: var(--ect-text-tertiary); margin: 0; max-width: 600px; line-height: 1.6; }

/* Carousel Widgets */
.ect-carousel-widget { padding: 0; position: relative; }
.ect-carousel-widget:hover .ect-carousel-arrow-nav.visible { opacity: 1; }
.ect-carousel-widget .ect-carousel-arrow-nav { opacity: 0; }
.ect-carousel-widget .ect-widget-title {
    padding: 1.25rem 1.25rem 0.75rem 1.25rem; margin-bottom: 0.75rem; border-left-width: 4px;
}
.ect-carousel-wrapper {
    overflow-x: auto; padding: 0.5rem 1.25rem 1.25rem 1.25rem; scroll-behavior: smooth;
    -ms-overflow-style: none; scrollbar-width: none;
}
.ect-carousel-wrapper::-webkit-scrollbar { display: none; }
.ect-carousel-grid { display: flex; flex-wrap: nowrap; gap: 1rem; }
.ect-carousel-item {
    width: 280px; flex-shrink: 0;
    background-color: var(--ect-bg-primary); /* In light mode: Wrapper is Grey, Card is White */
    border: 1px solid var(--ect-border-hover);
    border-radius: 0.5rem; padding: 1rem; display: flex; flex-direction: column;
    justify-content: space-between; min-height: 160px;
}
#ect-wrapper[data-theme="light"] .ect-carousel-item {
    background-color: #ffffff; /* Force white cards in light mode */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ect-carousel-item img { width: 32px; height: 32px; border-radius: 50%; margin-bottom: 0.5rem; }
.ect-carousel-item strong { color: var(--ect-text-primary); font-weight: 600; }
.ect-carousel-item span { color: var(--ect-text-tertiary); font-size: 0.875rem; }
.ect-carousel-rank { font-size: 0.875rem; color: var(--ect-text-tertiary); margin-top: 0.25rem; }
.ect-carousel-title { font-size: 1.125rem; font-weight: 700; color: var(--ect-text-primary); margin: 0 0 0.5rem 0; }
.ect-carousel-description {
    font-size: 0.875rem; color: var(--ect-text-tertiary); margin: 0 0 1rem 0;
    flex-grow: 1; line-height: 1.5;
}

.ect-social-item { gap: 0.5rem; align-items: flex-start; }
.ect-social-header { display: flex; align-items: center; gap: 0.5rem; font-size: 1.125rem; font-weight: 700; color: var(--ect-text-primary); }
.ect-social-header img { width: 24px; height: 24px; margin: 0; }
.ect-social-platform {
    font-size: 0.75rem; font-weight: 500; color: var(--ect-text-tertiary);
    background-color: var(--ect-bg-tertiary); padding: 0.15rem 0.4rem; border-radius: 0.25rem;
}
.ect-social-velocity {
    font-size: 1.5rem; font-weight: 900; color: var(--ect-green-400);
    margin-top: auto; padding-top: 0.5rem;
}

.ect-card-footer { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.875rem; margin-top: 0.5rem; }
.ect-stat-velocity { font-size: 1rem; font-weight: 700; }
[data-speculation="High"] { color: var(--ect-red-500); }
[data-speculation="Medium"] { color: var(--ect-amber-500); }
[data-speculation="Low"] { color: var(--ect-green-500); }

/* --- Deep Analysis Page --- */
.ect-analysis-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.ect-analysis-header h2 { font-size: 2rem; font-weight: 900; color: var(--ect-text-primary); margin: 0; }
.ect-analysis-tag {
    font-size: 0.75rem; font-weight: 500; color: var(--ect-blue-300);
    background-color: var(--ect-blue-tag-bg); padding: 0.25rem 0.5rem;
    border-radius: 9999px; height: fit-content;
}
.ect-analysis-tag[data-confidence="High"] { color: var(--ect-green-400); background-color: var(--ect-green-bg); }
.ect-analysis-tag[data-confidence="Low"] { color: var(--ect-amber-500); background-color: var(--ect-amber-bg); }
.ect-address-tag {
    font-family: monospace; font-size: 0.875rem; color: var(--ect-amber-500);
    background-color: var(--ect-amber-bg);
}
.ect-analysis-description {
    font-size: 1.125rem; color: var(--ect-text-secondary); margin-bottom: 2rem; line-height: 1.6;
}

.ect-actionable-insight {
    padding: 1.25rem; border-radius: 0.5rem; margin-bottom: 1.5rem; border: 1px solid;
}
.ect-actionable-insight h3 { margin: 0 0 0.5rem 0; font-size: 1.25rem; color: var(--ect-text-primary); }
.ect-actionable-insight p { margin: 0; font-size: 1rem; color: var(--ect-text-primary); }
.ect-action-rating { font-weight: 900; }
.ect-action-buy, .ect-action-strong-buy, .ect-action-accumulate {
    background-color: var(--ect-green-bg); border-color: var(--ect-green-500);
}
.ect-action-buy .ect-action-rating, .ect-action-strong-buy .ect-action-rating, .ect-action-accumulate .ect-action-rating {
    color: var(--ect-green-400);
}
.ect-action-sell, .ect-action-strong-sell, .ect-action-avoid {
    background-color: var(--ect-red-bg); border-color: var(--ect-red-500);
}
.ect-action-sell .ect-action-rating, .ect-action-strong-sell .ect-action-rating, .ect-action-avoid .ect-action-rating {
    color: var(--ect-red-400);
}
.ect-action-neutral {
    background-color: var(--ect-amber-bg); border-color: var(--ect-amber-500);
}
.ect-action-neutral .ect-action-rating { color: var(--ect-amber-500); }

.ect-analysis-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 1024px) { .ect-analysis-grid { grid-template-columns: 2fr 1fr; } }
.ect-analysis-main, .ect-analysis-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.ect-analysis-columns { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) {
    .ect-analysis-main .ect-analysis-columns, .ect-analysis-sidebar .ect-analysis-columns { grid-template-columns: 1fr 1fr; }
}

.ect-stat-block {
    background-color: var(--ect-bg-secondary); border: 1px solid var(--ect-border);
    border-radius: 0.5rem; padding: 1.25rem; box-shadow: var(--ect-shadow-md);
}
.ect-stat-block h3 {
    font-size: 1.25rem; font-weight: 700; color: var(--ect-text-primary); margin: 0 0 1rem 0;
    border-bottom: 1px solid var(--ect-border); padding-bottom: 0.75rem; display: flex; align-items: center;
}

.ect-market-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.ect-market-stat-main {
    grid-column: 1 / -1; text-align: center; padding-bottom: 1rem;
    border-bottom: 1px solid var(--ect-border);
}
.ect-market-stat-main span { font-size: 0.875rem; color: var(--ect-text-tertiary); }
.ect-market-stat-main .ect-price {
    display: block; font-size: 2.5rem; font-weight: 900; color: var(--ect-text-primary);
    margin: 0.25rem 0;
}
.ect-market-stat-sub { text-align: center; }
.ect-market-stat-sub span { font-size: 0.875rem; color: var(--ect-text-tertiary); display: block; }
.ect-market-stat-sub strong {
    font-size: 1.25rem; color: var(--ect-text-primary); font-weight: 700; display: block;
}
.ect-market-kvs { margin-top: 1rem; }

.ect-chart-container {
    width: 100%; height: 200px; position: relative;
    background: linear-gradient(to top, var(--ect-chart-gradient-start), var(--ect-chart-gradient-end));
    border-radius: 0.25rem; border: 1px solid var(--ect-border); padding: 0.5rem;
}

.ect-doughnut-chart-container {
    position: relative; width: 100%; max-width: 250px; height: 250px; margin: 0 auto;
}
.ect-doughnut-chart-container canvas { filter: drop-shadow(0 3px 5px rgba(0,0,0,0.1)); }
#ect-wrapper[data-theme="dark"] .ect-doughnut-chart-container canvas { filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25)); }
.ect-doughnut-chart-text {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    text-align: center; pointer-events: none;
}
.ect-doughnut-chart-text strong {
    font-size: 1.25rem; font-weight: 900; color: var(--ect-text-primary); display: block; line-height: 1.2;
}
.ect-doughnut-chart-text span { font-size: 0.875rem; color: var(--ect-text-tertiary); line-height: 1.2; }
.ect-doughnut-legend {
    display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid var(--ect-border); width: 100%;
}
.ect-doughnut-legend-item {
    display: flex; flex-direction: column; align-items: center; font-size: 0.875rem;
    color: var(--ect-text-tertiary); line-height: 1.3;
}
.ect-doughnut-legend-item strong { font-size: 1.25rem; font-weight: 700; color: var(--ect-text-primary); }
.ect-legend-color-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
    margin-right: 0.35rem; vertical-align: middle;
}

.ect-list {
    list-style-type: none; padding-left: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem;
}
.ect-list li { padding-left: 1.5rem; position: relative; line-height: 1.5; }
.ect-list li::before {
    content: '✓'; color: var(--ect-blue-400); font-weight: 700; position: absolute; left: 0; top: 0;
}
.ect-list-summary { font-size: 0.875rem; color: var(--ect-text-tertiary); margin: 0; line-height: 1.5; }
.ect-list-subheader {
    font-size: 0.875rem; font-weight: 600; color: var(--ect-text-secondary); margin: 1rem 0 0.5rem 0;
}
.ect-key-value-list {
    list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem;
}
.ect-key-value-list li { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.ect-key-value-list li span { color: var(--ect-text-tertiary); }
.ect-key-value-list li strong { color: var(--ect-text-primary); font-weight: 600; }

.ect-competitor-grid { display: flex; flex-direction: column; gap: 1rem; }
.ect-competitor-card {
    background-color: var(--ect-bg-primary); border: 1px solid var(--ect-border);
    border-radius: 0.375rem; padding: 1rem;
}
#ect-wrapper[data-theme="light"] .ect-competitor-card { background-color: #ffffff; }

.ect-competitor-card strong { color: var(--ect-text-primary); font-size: 1rem; font-weight: 600; }
.ect-competitor-card p {
    font-size: 0.875rem; color: var(--ect-text-tertiary); margin: 0.25rem 0 0 0;
}

.ect-news-feed { display: flex; flex-direction: column; gap: 1rem; }
.ect-news-item { display: flex; gap: 1rem; border-bottom: 1px solid var(--ect-border); padding-bottom: 1rem; }
.ect-news-item:last-child { border-bottom: none; padding-bottom: 0; }
.ect-news-sentiment {
    font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.5rem;
    border-radius: 9999px; height: fit-content; flex-shrink: 0; min-width: 65px; text-align: center;
}
.ect-news-content { flex-grow: 1; }
.ect-news-content strong { color: var(--ect-text-primary); font-weight: 600; }
.ect-news-content span { color: var(--ect-text-tertiary); font-size: 0.875rem; margin-left: 0.5rem; }
.ect-news-content p { font-size: 0.875rem; color: var(--ect-text-tertiary); margin: 0.25rem 0 0 0; }

.ect-score-block { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.ect-score-gauge {
    width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--score-color) calc(var(--score) * 1%), var(--ect-gauge-track) 0);
    position: relative; transition: --score 0.5s ease-out;
}
.ect-score-gauge::before {
    content: ''; position: absolute; width: 120px; height: 120px;
    background-color: var(--ect-bg-secondary); border-radius: 50%;
}
.ect-score-gauge span {
    position: relative; font-size: 2.5rem; font-weight: 900;
    color: var(--score-color, var(--ect-text-primary));
}
.ect-score-breakdown { width: 100%; padding-top: 1rem; border-top: 1px solid var(--ect-border); }
.ect-stat-box { text-align: center; }
.ect-stat-value {
    font-size: 1.5rem; font-weight: 700; color: var(--ect-text-primary);
    display: block; margin-bottom: 0.25rem;
}
[data-risk="Low"], [data-opportunity="Very High"] { color: var(--ect-green-400); }
[data-risk="Medium"], [data-opportunity="High"] { color: var(--ect-green-500); }
[data-risk="High"], [data-opportunity="Medium"] { color: var(--ect-amber-500); }
[data-risk="Very High"], [data-opportunity="Low"] { color: var(--ect-red-500); }

.ect-tag-container { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ect-tag {
    font-size: 0.75rem; font-weight: 500; color: var(--ect-text-tertiary);
    background-color: var(--ect-bg-tertiary); padding: 0.25rem 0.5rem; border-radius: 0.25rem;
}
.ect-clickable-tag {
    background-color: var(--ect-blue-tag-bg); color: var(--ect-blue-300); transition: all 0.2s;
}
.ect-clickable-tag:hover {
    background-color: var(--ect-blue-600); color: white; transform: scale(1.05);
}
.ect-card-ticker { font-size: 0.875rem; color: var(--ect-text-tertiary); font-weight: 400; margin-left: 0.25rem; }

.ect-tx-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.ect-tx-card {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 1rem;
    background-color: var(--ect-bg-primary); padding: 0.75rem;
    border-radius: 0.375rem; border: 1px solid var(--ect-border);
}
#ect-wrapper[data-theme="light"] .ect-tx-card { background-color: #ffffff; }

.ect-tx-type { font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.5rem; border-radius: 9999px; grid-row: 1 / span 2; }
.ect-tx-type.in { background-color: var(--ect-green-bg); color: var(--ect-green-500); }
.ect-tx-type.out { background-color: var(--ect-red-bg); color: var(--ect-red-500); }
.ect-tx-token { font-weight: 600; color: var(--ect-text-primary); }
.ect-tx-time { font-size: 0.875rem; color: var(--ect-text-tertiary); text-align: right; }
.ect-tx-value { font-size: 0.875rem; color: var(--ect-text-tertiary); }
.ect-table-wrapper { overflow-x: auto; }
.ect-compare-table { width: 100%; border-collapse: collapse; }
.ect-compare-table th, .ect-compare-table td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--ect-border); text-align: left;
}
.ect-compare-table th {
    font-size: 0.875rem; font-weight: 600; color: var(--ect-text-tertiary);
    background-color: var(--ect-bg-tertiary);
}
.ect-compare-table td { font-size: 0.875rem; color: var(--ect-text-primary); }
.ect-compare-table td.error { color: var(--ect-red-400); }
.ect-verdict-list .win { color: var(--ect-green-400); }
.ect-verdict-list .lose { color: var(--ect-red-400); }
.ect-verdict-list .tie { color: var(--ect-amber-500); }

.sentiment-bullish, .sentiment-positive, .sentiment-greed, .change-positive { color: var(--ect-green-500); }
.sentiment-very-bullish, .sentiment-euphoric, .sentiment-extreme-greed { color: var(--ect-green-400); }
.sentiment-neutral { color: var(--ect-amber-500); }
.sentiment-bearish, .sentiment-negative, .sentiment-fear, .change-negative { color: var(--ect-red-500); }
.sentiment-very-bearish, .sentiment-extreme-fear { color: var(--ect-red-400); }

/* --- FIX 3: Mobile Layout Improvements (Max Width 768px) --- */
@media (max-width: 768px) {
    /* General Text Reduction */
    .ect-analysis-header h2 {
        font-size: 1.75rem; /* Reduced from 2rem */
    }
    .ect-analysis-description {
        font-size: 1rem; /* Reduced from 1.125rem */
        margin-bottom: 1.5rem;
    }
    .ect-stat-block h3 {
        font-size: 1.15rem; /* Smaller widget titles */
    }

    /* Price Font Size Reduction (Core Fix) */
    .ect-market-stat-main .ect-price {
        font-size: 2rem; /* Reduced from 2.5rem */
    }

    /* Analysis Grid: Key Drivers/Risks stack vertically */
    .ect-analysis-columns { 
        grid-template-columns: 1fr; 
    }
    
    /* Dashboard: Smaller Sentiment Layout */
    .ect-sentiment-content { 
        grid-template-columns: 1fr; /* Stack chart and summary vertically */
    }
    .ect-sentiment-chart-container {
        max-width: 200px; /* Reduce chart size */
        height: 120px;
    }
    .ect-sentiment-value {
        font-size: 1.75rem; /* Reduce sentiment text size */
    }
    
    /* Dashboard: Carousel Items (Market Movers, Trending, etc.) */
    .ect-carousel-item {
        width: 250px; /* Slightly smaller carousel width for more fit */
        min-height: 140px;
    }
    
    /* Comparison Table Styling */
    .ect-compare-table th, .ect-compare-table td {
        padding: 0.5rem 0.75rem; /* Less padding in cells */
    }
}
/* --- END FIX 3 --- */