/* Dashboard Styles - Updated: 2025-01-27-v2 */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.global-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f9d58;
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 20px 30px rgba(15, 157, 88, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1100;
    min-width: 320px;
    max-width: 520px;
}

.global-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.global-banner .banner-icon {
    font-size: 22px;
}

.global-banner.success {
    background: #0f9d58;
}

.global-banner.info {
    background: #0d74ff;
}

.global-banner.error {
    background: #d93025;
}

.global-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-banner-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.dashboard-controls {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 2rem;
    position: relative;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.controls-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
    margin: 0;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-start;
    padding-left: 0;
}

.controls-left .logo {
    height: 50px;
    width: auto;
    margin-left: 0;
}

.region-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(64, 171, 38, 0.1);
    border: 1px solid rgba(64, 171, 38, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-green);
}

.region-indicator .material-icons {
    font-size: 1rem;
    color: var(--primary-green);
}

/* Language Toggle Styles */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.language-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.813rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.language-toggle:hover .language-label {
    color: #374151;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-green);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.toggle-switch:hover .toggle-slider {
    background-color: #9ca3af;
}

.toggle-switch:hover input:checked+.toggle-slider {
    background-color: #059669;
}

.toggle-switch input:focus+.toggle-slider {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.toggle-switch:active .toggle-slider:before {
    width: 26px;
}

.toggle-switch input:checked:active+.toggle-slider:before {
    transform: translateX(18px);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    justify-content: flex-end;
    padding-right: 0;
}

.controls-right>* {
    display: flex;
    align-items: center;
}

/* Region Options in User Dropdown */
.dropdown-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 -16px 4px -16px;
}

.dropdown-section-header .material-icons {
    font-size: 14px;
    color: #9ca3af;
}

.region-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    margin: 0 0.5rem;
}

.region-option:hover {
    background: rgba(70, 104, 66, 0.05);
    color: #466842;
    transform: translateX(2px);
}

.region-option.active {
    background: rgba(70, 104, 66, 0.1);
    color: #466842;
    font-weight: 600;
}

.region-option .material-icons {
    font-size: 16px;
    color: #718096;
    transition: all 0.2s ease;
}

.region-option:hover .material-icons {
    color: #466842;
    transform: scale(1.1);
}

.region-check {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-green);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.region-option.active .region-check {
    opacity: 1;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.refresh-btn,
.back-btn,
.retry-btn,
.go-back-btn {
    background: var(--primary-green);
    border: 1px solid var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.refresh-btn:hover,
.back-btn:hover,
.retry-btn:hover,
.go-back-btn:hover {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    transform: translateY(-1px);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

/* Forecast loading state - simple and clean */
#forecastLoading {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    margin-bottom: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error State */
.error-state,
.access-denied-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-content,
.access-denied-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.error-content .material-icons,
.access-denied-content .material-icons {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-content h3,
.access-denied-content h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
}

.error-content p,
.access-denied-content p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
}

.retry-btn,
.go-back-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.retry-btn:hover,
.go-back-btn:hover {
    background: #2563eb;
}

/* Dashboard Content */
.dashboard-content {
    background: #fff;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Internal Research section styling */
.report-divider {
    border: 0;
    border-top: 2px solid #e5e7eb;
    margin: 3rem 0 2rem;
}

.quanex-research-section {
    background: #fbfdfb;
    border: 1px solid rgba(64, 171, 38, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.quanex-research-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #084c2e;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.quanex-research-section ul {
    margin: 0.5rem 0;
    padding-left: 0;
    list-style-position: inside;
}

.quanex-research-section li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.quanex-research-section strong {
    font-weight: 500;
}

.quanex-research-section .research-subheading {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    margin: 1.25rem 0 0.5rem;
    text-transform: none;
    letter-spacing: 0;
}

.research-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.research-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.research-meta span {
    display: flex;
    align-items: center;
}

.research-meta-sep {
    color: #94a3b8;
    margin: 0 0.25rem;
}

.research-download {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #047857;
    text-decoration: none;
}

.research-download .material-icons {
    font-size: 1rem;
}

.research-download:hover {
    color: #065f46;
    text-decoration: underline;
}

/* Professional Dashboard Headings - Unified Style */
.section-title {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #40ab26;
    letter-spacing: -0.025em;
    line-height: 1.2;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #40ab26, #34d399);
    border-radius: 2px;
}

/* Professional header styling */
.header-left h1 {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem !important;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
    padding: 0 1rem;
    align-items: stretch;
}

.economic-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem !important;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
    align-items: stretch;
    justify-items: stretch;
    padding: 0 1rem;
}

.dashboard-grid .index-widget,
.economic-indicators-grid .index-widget {
    width: 100%;
    height: 100%;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Economic indicators section styling */
.economic-indicators-section {
    margin-top: 2rem;
}

/* Ensure widget content doesn't get cut off */
.index-widget .widget-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.index-widget .widget-label {
    font-size: 0.875rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.index-widget .widget-change {
    font-size: 0.875rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.economic-indicators-section .section-title {
    margin-bottom: 1rem;
}

/* Index Details (expand panel) */
.index-details {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.index-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.index-details-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
}

/* New full-width layout */
.index-details-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.chart-container-full {
    position: relative;
    height: 400px;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1rem 3rem 1rem;
    /* Extra bottom padding for X-axis labels */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: visible;
    /* Allow labels to be visible */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.chart-container-full canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.time-filter-buttons {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.time-filter-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 3rem;
    text-align: center;
}

.time-filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1f2937;
}

.time-filter-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    font-weight: 600;
}

.time-filter-btn.active:hover {
    background: #059669;
    border-color: #059669;
}

.insights-section-full {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

/* User Profile Dropdown Styles */
.user-profile-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 0;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #466842 0%, #5a7a52 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(70, 104, 66, 0.3);
    border: none;
    backdrop-filter: blur(10px);
    line-height: 1;
    box-sizing: border-box;
}

.user-profile-trigger:hover {
    background: linear-gradient(135deg, #3d5a38 0%, #4e6a47 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(70, 104, 66, 0.4);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1001;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, #f8fff8 0%, #f0f8f0 100%);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
}

.dropdown-user-info .material-icons {
    font-size: 18px;
    color: #466842;
    background: rgba(70, 104, 66, 0.1);
    padding: 6px;
    border-radius: 8px;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.dropdown-email {
    font-weight: 600;
    font-size: 13px;
    color: #2d3748;
    line-height: 1.2;
}

.dropdown-role {
    font-weight: 500;
    font-size: 11px;
    color: #718096;
    text-transform: capitalize;
    background: rgba(70, 104, 66, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.dropdown-section {
    padding: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(70, 104, 66, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(70, 104, 66, 0.05);
    color: #466842;
    transform: translateX(4px);
}

.dropdown-item:hover::before {
    width: 100%;
}

.dropdown-item .material-icons {
    font-size: 16px;
    color: #718096;
    transition: all 0.2s ease;
    z-index: 1;
}

.dropdown-item:hover .material-icons {
    color: #466842;
    transform: scale(1.1);
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 4px 0;
}

.insights-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.insights-header h4 {
    margin: 0;
    color: #111827;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.insights-header h4 .material-icons {
    font-size: 1.4rem;
    color: var(--primary-green);
    flex-shrink: 0;
}

.insights-metrics {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.insights-tiles-container {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
    align-items: stretch;
    justify-items: stretch;
}

.insight-tile {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
}

.insight-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), #8b5cf6);
}

.insight-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-green);
}

.insight-tile-content {
    color: #374151;
    line-height: 1.5;
    font-size: 0.95rem;
    width: 100%;
}

@media (max-width: 768px) {
    .insights-header h4 {
        font-size: 1.2rem;
        justify-content: center;
        line-height: 1.2;
    }

    .insights-header h4 .material-icons {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .insights-header h4 {
        font-size: 1.1rem;
        letter-spacing: -0.015em;
    }

    .insights-header h4 .material-icons {
        font-size: 1rem;
    }
}

.insight-tile-content strong {
    color: #1f2937;
    font-weight: 600;
}

/* Legacy styles for backward compatibility */
.index-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.index-details .chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    min-height: 300px;
}

.index-details .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

.insights-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.insights-panel h4 {
    margin: 0 0 .5rem 0;
    color: #1f2937;
}

.insights-panel .sub {
    font-size: .85rem;
    color: #6b7280;
    margin-bottom: .5rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
}

.chip {
    background: #e5f7e9;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: .25rem .5rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
}

.insights-metrics .chip-row {
    margin: 0;
    gap: 0.75rem;
}

.insights-metrics .chip {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Insights sections */
.insights-section {
    margin-bottom: 1.5rem;
}

.insights-section h5 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.insights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}

.insight-item:last-child {
    margin-bottom: 0;
}

.citation-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--primary-green-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin: 0 0.2rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
    border: 1px solid var(--primary-green);
    position: relative;
}

.citation-link:hover {
    background: var(--primary-green);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(64, 171, 38, 0.2);
    border-color: var(--primary-green);
}

.citation-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(64, 171, 38, 0.2);
}

/* Enhanced citation styling for report content - Subtle and professional */
.market-outlook-report .citation-link {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    margin: 0 0.1rem;
    background: rgba(64, 171, 38, 0.08);
    border: 1px solid rgba(64, 171, 38, 0.2);
    border-radius: 3px;
    font-weight: 500;
    color: var(--primary-green);
    line-height: 1.1;
    min-width: 14px;
    text-align: center;
    display: inline-block;
    vertical-align: baseline;
}

.market-outlook-report .citation-link:hover {
    background: rgba(64, 171, 38, 0.15);
    color: var(--primary-green);
    border-color: var(--primary-green);
    box-shadow: 0 1px 3px rgba(64, 171, 38, 0.15);
    transform: translateY(-0.5px);
}

.index-details-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .index-details-grid {
        grid-template-columns: 1fr;
    }

    .index-details .chart-container {
        height: 220px;
        min-height: 220px;
    }

    .chart-container-full {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .chart-container-full {
        height: 250px;
        padding: 0.5rem;
    }

    .insights-section-full {
        padding: 1rem;
    }

    .insights-metrics {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .insights-metrics .chip-row {
        gap: 0.5rem;
    }

    .insights-metrics .chip {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }

    .time-filter-buttons {
        gap: 0.25rem;
        padding: 0.125rem;
    }

    .time-filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
        min-width: 2.5rem;
    }

    .chart-header {
        justify-content: center;
    }
}

/* Index Widget */
.index-widget {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.index-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.index-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Grid keeps wrapped title in column 1 only; icon stays top-right (not vertically centered on multi-line titles). */
.widget-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.35rem 0.5rem;
    flex: 1;
    min-width: 0;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
    min-width: 0;
    line-height: 1.35;
    /* Prefer word boundaries; wider cards (grid minmax) reduce mid-word splits */
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
}

.widget-data-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    background: rgba(180, 83, 9, 0.1);
    margin-top: 0.1em;
    align-self: start;
}

.widget-data-pending-icon {
    font-size: 18px;
    line-height: 1;
    color: #b45309;
}

.widget-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.widget-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.widget-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.widget-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
    margin: 0.5rem 0;
    line-height: 1;
}

.widget-period {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Stack source then date so long source lines don't push "Updated" into odd vertical positions */
.widget-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #9ca3af;
    flex-shrink: 0;
}

.widget-footer--date-only {
    align-items: flex-start;
}

.widget-footer .widget-source {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

/* Second row under source; left-aligned with source text */
.widget-last-updated {
    display: inline-flex;
    align-items: baseline;
    align-self: flex-start;
    gap: 0.35rem;
    flex-shrink: 0;
    width: 100%;
    text-align: left;
    color: #9ca3af;
}

.widget-last-updated-date {
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.widget-source {
    margin-top: auto;
    padding-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Sample-data badge directly under chart (no footer): pin to bottom with siblings */
.index-widget > .widget-chart + .fallback-indicator {
    margin-top: auto;
    padding-top: 0.5rem;
}

.index-widget > .widget-chart + .widget-footer + .fallback-indicator {
    margin-top: 0;
    padding-top: 0.35rem;
}

.widget-source-prefix {
    color: #9ca3af;
    font-weight: 400;
}

.widget-source-link {
    color: #007a33;
    text-decoration: none;
    font-weight: 500;
}

.widget-source-link:hover {
    text-decoration: underline;
}

.widget-chart {
    height: 60px;
    position: relative;
}

.widget-chart canvas {
    width: 100% !important;
    height: 60px !important;
}

/* Chart customization */
.chart-container {
    position: relative;
    height: 60px;
    width: 100%;
    min-height: 60px;
}

.chart-container canvas {
    width: 100% !important;
    height: 60px !important;
    max-width: 100%;
    max-height: 60px;
}

/* News Section */
.news-section {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 2px solid #e5e7eb;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
}

.news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.news-section-title {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.news-section-title .material-icons {
    font-size: 1.5rem;
    color: var(--primary-green);
}


.news-refresh-btn {
    background: var(--primary-green);
    border: 1px solid var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.news-refresh-btn:hover {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    transform: translateY(-1px);
}

.news-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.news-refreshed-date {
    margin-left: 0.75rem;
    font-size: 0.85rem;
    color: #4b5563;
    white-space: nowrap;
    font-weight: 500;
    align-items: center;
}

.news-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* News Section Specific Styles - REMOVED CONFLICTING RULES */

/* Ensure news grid is not affected by other grid styles */
.news-section .news-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.news-section-title {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.news-refresh-btn {
    background: var(--primary-green);
    color: white;
    border: 1px solid var(--primary-green);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.news-refresh-btn:hover {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    transform: translateY(-1px);
}

.news-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Hide legacy pagination bar (replaced by overlay arrows) */
.news-pagination {
    display: none;
}

/* Prevent JavaScript from overriding news grid styles */
.news-grid[style] {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Force news grid layout on page load */
.news-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: start !important;
    justify-items: stretch !important;
}

/* Ensure news cards have consistent sizing */
.news-grid .news-card {
    width: 100% !important;
    max-width: none !important;
    min-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 1rem !important;
}

/* Responsive news card sizing */
@media (max-width: 1200px) {
    .news-grid .news-card {
        min-height: 180px !important;
        padding: 0.875rem !important;
    }
}

@media (max-width: 768px) {
    .news-grid .news-card {
        min-height: 160px !important;
        padding: 0.75rem !important;
    }

    .news-card .news-headline {
        font-size: 0.95rem !important;
        line-height: 1.35 !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        max-height: none !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .news-card .news-summary {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 480px) {
    .news-grid .news-card {
        min-height: 140px !important;
        padding: 0.625rem !important;
    }

    .news-card .news-headline {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        max-height: none !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .news-card .news-summary {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }

    .news-card .news-source {
        font-size: 0.7rem !important;
    }

    .news-card .news-date {
        font-size: 0.7rem !important;
    }
}

/* Override any conflicting grid styles */
.news-section * {
    box-sizing: border-box !important;
}

.news-section .news-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: start !important;
    justify-items: stretch !important;
}

/* Prevent any JavaScript from changing news grid */
.news-grid[class*="grid"] {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
}

/* Target the specific news container */
#newsContainer.news-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: start !important;
    justify-items: stretch !important;
}

/* Force news container to maintain grid layout */
#newsContainer {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: start !important;
    justify-items: stretch !important;
}

/* Ensure news cards in container maintain consistent sizing */
#newsContainer .news-card {
    width: 100% !important;
    max-width: none !important;
    min-height: 250px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 1rem !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Force equal height for all news cards */
#newsContainer {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

/* Ensure news cards fill their grid cells properly */
#newsContainer>* {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure news card content is properly structured */
#newsContainer .news-card .news-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.75rem !important;
    flex-shrink: 0 !important;
}

#newsContainer .news-card .news-headline {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    flex-shrink: 0 !important;
}

#newsContainer .news-card .news-summary {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    color: #6b7280 !important;
    flex-grow: 1 !important;
    margin-bottom: 1rem !important;
}

#newsContainer .news-card .news-link {
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* Override any inline styles that might be added by JavaScript */
#newsContainer[style] {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

/* Force news container to maintain grid layout even with dynamic content */
#newsContainer.news-grid,
#newsContainer[class*="news"],
#newsContainer[class*="grid"] {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

.news-pagination .news-refresh-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: 80px;
}

.news-pagination .news-refresh-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #9ca3af;
    border-color: #9ca3af;
}

.news-pagination .news-refresh-btn:disabled:hover {
    transform: none;
    background: #9ca3af;
    border-color: #9ca3af;
}

#newsPageIndicator {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

/* Overlay page navigation on first/last visible cards */
.news-card .page-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(17, 24, 39, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.news-card .page-nav-btn:hover {
    background: #ffffff;
    border-color: var(--primary-green);
}

.news-card .page-nav-prev {
    left: 8px;
}

.news-card .page-nav-next {
    right: 8px;
}

.news-card .page-nav-btn .material-icons {
    font-size: 20px;
    color: var(--primary-green);
}

.news-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
}

.news-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-green);
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), #8b5cf6);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.news-source {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    background: rgba(64, 171, 38, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.news-date {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
}

.news-headline {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    display: block;
    max-height: none;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    flex-grow: 1;
}

.news-summary {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: auto;
    transition: color 0.2s ease;
}

.news-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

.news-link .material-icons {
    font-size: 0.9rem;
}

.news-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-green);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: auto;
    padding: 0.5rem 0.75rem;
    background: rgba(64, 171, 38, 0.1);
    border-radius: 4px;
    border: 1px solid var(--primary-green-light);
}

.news-placeholder .material-icons {
    font-size: 0.9rem;
    color: var(--primary-green);
}

.news-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #6b7280;
    font-size: 0.9rem;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    min-height: 200px;
    width: 100%;
    position: relative;
    margin: 0 auto;
    grid-column: 1 / -1;
}

.news-spinner {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(45deg, #f0f9ff, #e0f2fe);
    border: 2px solid #e5e7eb;
}

.news-spinner-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--primary-green), transparent);
    animation: news-spin 1.2s linear infinite;
    position: relative;
}

.news-spinner-inner::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
}

@keyframes news-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.news-loading-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.news-loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.news-loading-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    font-style: italic;
}

.news-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #ef4444;
    font-size: 0.9rem;
    text-align: center;
}

.news-error .material-icons {
    margin-right: 0.5rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 2rem;
    margin-bottom: 0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-green);
    background: #f8fafc;
}

.tab-button.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
    background: #f8fafc;
}

/* Region Selector Styles */
.region-selector-container {
    width: 100%;
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.region-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.region-selector-subgroup {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eef2f7;
}

.gcc-country-selector {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eef2f7;
}

.region-selector-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.region-selector-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.region-selector-btn.active {
    background: #006400;
    color: #ffffff;
    border-color: #006400;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 100, 0, 0.2);
}

.region-selector-btn.active:hover {
    background: #004d00;
    border-color: #004d00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

.tab-button .material-icons {
    font-size: 1.2rem;
}

/* Small Beta badge for tabs */
.beta-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 14px;
    min-width: 14px;
    padding: 0 4px;
    border-radius: 9999px;
    background: #fde68a;
    /* amber-200 */
    color: #92400e;
    /* amber-800 */
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    transform: scale(0.85);
}

/* Market Watch notification indicator */
.market-watch-notification-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 0.5rem;
    border-radius: 50%;
    background: #10b981;
    /* green-500 */
}

/* Tab Content */
.tab-content {
    min-height: calc(100vh - 200px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.tab-panel {
    display: none;
    padding: 2rem;
}

/* Override padding for news section to eliminate side spacing */
.tab-panel .news-section {
    margin-left: -2rem !important;
    margin-right: -2rem !important;
    width: calc(100% + 4rem) !important;
    max-width: none !important;
}

.tab-panel .news-section .news-section-header {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.tab-panel .news-section .news-grid {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Force news container to have no side spacing */
#newsContainer.news-grid {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Ultra-specific override for news container */
#dashboardTab #newsContainer.news-grid {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Force news section to extend beyond tab panel */
#dashboardTab .news-section {
    margin-left: -2rem !important;
    margin-right: -2rem !important;
    width: calc(100% + 4rem) !important;
    max-width: none !important;
    position: relative !important;
}

.tab-panel.active {
    display: block;
}

/* Coming Soon State */
.coming-soon-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.coming-soon-state .coming-soon-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.coming-soon-state .coming-soon-icon {
    margin-bottom: 2rem;
}

.coming-soon-state .coming-soon-icon .material-icons {
    font-size: 4rem;
    color: var(--primary-green);
    opacity: 0.7;
}

.coming-soon-state h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.coming-soon-state p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.coming-soon-state .feature-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 400px;
    text-align: left;
    margin: 0 auto 2rem auto;
}

.coming-soon-state .feature-preview h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    text-align: center;
}

.coming-soon-state .feature-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.coming-soon-state .feature-preview li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
    line-height: 1.5;
}

.coming-soon-state .feature-preview li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.2rem;
}

.coming-soon-state .feature-preview li:last-child {
    margin-bottom: 0;
}

/* Coming Soon Content */
/* Market Outlook Styles - Consistent with Application Theme */
.market-outlook-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 400px !important;
    /* Add minimum height with !important */
    width: 100% !important;
    /* Ensure full width with !important */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.market-outlook-month-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.market-outlook-month-filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.market-outlook-month-filter-select {
    min-width: 220px;
    height: 36px;
    padding: 0.35rem 2rem 0.35rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.market-outlook-month-filter-select:hover {
    border-color: #9ca3af;
    background: #ffffff;
}

.market-outlook-month-filter-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(64, 171, 38, 0.16);
    background: #ffffff;
}

/* Research Insights: two filters side-by-side (avoid full-width stacking from .market-outlook-month-filter) */
.research-insights-filters-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.research-insights-filters-row .research-insights-filter.market-outlook-month-filter {
    flex: 1 1 280px;
    min-width: min(100%, 260px);
    width: auto;
    max-width: 100%;
    margin-bottom: 0;
}

.research-insights-upload-wrap {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    box-sizing: border-box;
}

.research-insights-upload-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.research-insights-upload-input {
    font-size: 0.875rem;
    max-width: 100%;
}

.research-insights-upload-banner {
    display: none;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #d1d5db;
    background: #ffffff;
    box-sizing: border-box;
}

.research-insights-upload-banner.is-visible {
    display: flex;
    position: relative;
    z-index: 5;
}

.research-insights-upload-banner.research-insights-upload-banner--processing {
    border-left-color: var(--primary-green, #40ab26);
    background: #f0fdf4;
}

.research-insights-upload-banner.research-insights-upload-banner--success {
    border-left-color: var(--primary-green, #40ab26);
    background: #f0fdf4;
}

.research-insights-upload-banner.research-insights-upload-banner--error {
    border-left-color: #b91c1c;
    background: #fef2f2;
}

.research-insights-upload-banner.research-insights-upload-banner--neutral {
    border-left-color: #6b7280;
    background: #f9fafb;
}

.research-insights-upload-banner.research-insights-upload-banner--neutral .research-insights-upload-status-text {
    color: #4b5563;
}

.research-insights-upload-spinner {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.1rem;
    border: 2px solid #d1d5db;
    border-top-color: var(--primary-green, #40ab26);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    opacity: 0;
    visibility: hidden;
}

.research-insights-upload-banner.research-insights-upload-banner--processing .research-insights-upload-spinner {
    opacity: 1;
    visibility: visible;
}

.research-insights-upload-status-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #374151;
}

.research-insights-upload-banner.research-insights-upload-banner--success .research-insights-upload-status-text {
    color: #166534;
}

.research-insights-upload-banner.research-insights-upload-banner--error .research-insights-upload-status-text {
    color: #b91c1c;
}

.research-insights-inline-refresh {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #374151;
    border-left: 3px solid var(--primary-green, #40ab26);
    background: #f0fdf4;
    border-radius: 6px;
}

#researchInsightsReport.research-insights-report--flash {
    animation: research-insights-report-flash 1.6s ease-out 1;
}

@keyframes research-insights-report-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(64, 171, 38, 0.45);
    }

    35% {
        box-shadow: 0 0 0 4px rgba(64, 171, 38, 0.28), 0 0 24px rgba(64, 171, 38, 0.12);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(64, 171, 38, 0);
    }
}

.market-outlook-next-update {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.01em;
    text-align: right;
    white-space: normal;
    max-width: min(100%, 22rem);
    line-height: 1.35;
}

.market-outlook-header {
    margin-bottom: 2rem;
}

.market-outlook-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.875rem;
    font-weight: 600;
}

.market-outlook-header p {
    color: #6b7280;
    margin: 0;
    font-size: 1rem;
}

/* Header removed - no longer needed */

.market-outlook-report {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.share-toggle-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
}

.share-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.35);
    width: auto;
    align-self: flex-start;
}

.share-toggle-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-toggle-btn:hover {
    color: #111827;
}

.share-toggle-btn.active {
    background: var(--primary-green);
    color: #fff;
    box-shadow: 0 6px 15px rgba(64, 171, 38, 0.35);
}

.share-pages {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.share-page {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex: 1 1 auto;
    flex-direction: column;
}

.share-page.active {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex: 1 1 auto;
}

.share-page-placeholder {
    border: 1px dashed #cbd5f5;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
}

.share-page-placeholder .placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: rgba(64, 171, 38, 0.15);
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.share-page-placeholder h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.share-page-placeholder p {
    margin: 0;
    color: #6b7280;
}

.loading-spinner.small {
    margin-bottom: 0;
    width: 32px;
    height: 32px;
}

.loading-spinner.small .spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Small copy button placed inside headings */
.heading-copy-btn {
    margin-left: 0.5rem;
    padding: 0.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.heading-copy-btn:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.heading-copy-btn .material-icons {
    font-size: 16px;
    line-height: 1;
}

.heading-copy-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    transform: scale(1.05);
}

/* Professional report styling - Word Document style */
.report-h1 {
    color: #111827;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-green);
}

.report-h2 {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--primary-green);
    background: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
}

.report-h3 {
    color: #4b5563;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-green);
}

/* Sub-headings that appear after main headings */
.report-h2+.report-h2 {
    color: #6b7280;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 1rem 0 0.75rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e5e7eb;
    background: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
}

/* Alternative sub-heading style */
.report-h4 {
    color: #6b7280;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 1rem 0 0.5rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.report-p {
    color: #374151;
    line-height: 1.7;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.report-summary {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.report-ul,
.report-ol {
    margin: 0.75rem 0 1rem 0;
    padding-left: 1.5rem;
}

.report-li,
.report-li-num {
    color: #374151;
    line-height: 1.6;
    margin: 0.5rem 0;
    font-size: 1rem;
}

.report-bold {
    color: #111827;
    font-weight: 700;
}

/* Executive summary styling - Professional and clean */
.market-outlook-report>.report-p:first-child {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--primary-green);
    padding: 1.5rem;
    margin: 0 0 2rem 0;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.market-outlook-sources {
    margin-top: 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.market-outlook-sources h4 {
    margin: 0 0 0.5rem 0;
    color: #111827;
}

.market-outlook-sources a {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

.market-outlook-sources a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Loading and Error States - Consistent with app theme */
.market-outlook-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.market-outlook-loading .spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

.market-outlook-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #dc2626;
    text-align: center;
}

.market-outlook-error .material-icons {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dc2626;
}

.market-outlook-error h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #dc2626;
}

.market-outlook-error p {
    font-size: 1rem;
    color: #991b1b;
}

.coming-soon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.coming-soon-icon {
    margin-bottom: 2rem;
}

.coming-soon-icon .material-icons {
    font-size: 4rem;
    color: var(--primary-green);
    opacity: 0.7;
}

.coming-soon-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.coming-soon-content p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
}

.feature-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 400px;
    text-align: left;
}

.feature-preview h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.feature-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-preview li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
    line-height: 1.5;
}

.feature-preview li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.2rem;
}

.feature-preview li:last-child {
    margin-bottom: 0;
}

/* Key Findings Section */
.key-findings-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.key-findings-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.key-findings-title {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.key-findings-title .material-icons {
    color: var(--primary-green);
    font-size: 1.75rem;
}

.key-findings-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.key-finding-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.key-finding-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-green);
}

.key-finding-source {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-green);
}

.key-finding-source .material-icons {
    font-size: 1rem;
}

.key-finding-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-finding-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #374151;
}

.key-finding-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.2rem;
}

.key-finding-list li:last-child {
    margin-bottom: 0;
}

.key-finding-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

.key-finding-error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.key-finding-error .material-icons {
    margin-right: 0.5rem;
}



/* Responsive Design */
@media (min-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 2rem !important;
        padding: 0 2rem;
    }

    .economic-indicators-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 2rem !important;
        padding: 0 2rem;
    }

    .news-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1.5rem !important;
        max-width: 1600px !important;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem !important;
        padding: 0 1.5rem;
    }

    .economic-indicators-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem !important;
        padding: 0 1.5rem;
    }

    .news-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1rem !important;
    }
}

@media (max-width: 768px) {
    .dashboard-controls {
        padding: 1rem;
    }

    .controls-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .controls-left {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    .controls-left .logo {
        height: 40px;
    }

    .controls-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .region-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .region-indicator .material-icons {
        font-size: 0.9rem;
    }

    .region-option {
        padding: 0.6rem 0.8rem;
        font-size: 12px;
    }

    .dropdown-section-header {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
        letter-spacing: -0.02em;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem !important;
    }

    .economic-indicators-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem !important;
    }

    .dashboard-grid .index-widget,
    .economic-indicators-grid .index-widget {
        width: 100%;
        margin: 0;
    }

    .index-widget {
        padding: 0.75rem;
    }

    .widget-value {
        font-size: 1.5rem;
    }

    .news-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .news-section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .news-section-title {
        font-size: 1.5rem;
        justify-content: center;
        letter-spacing: -0.02em;
    }


    .news-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }

    .news-card {
        padding: 1rem;
    }

    .news-headline {
        font-size: 0.9rem;
    }

    .news-summary {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .economic-indicators-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem !important;
    }

    .news-card {
        padding: 0.875rem;
    }

    .news-section-title {
        font-size: 1.375rem;
        letter-spacing: -0.015em;
    }

    .header-left h1 {
        font-size: 1.4rem;
    }

    .widget-value {
        font-size: 1.3rem;
    }

    .widget-title {
        font-size: 0.8rem;
    }
}

/* Animation for data updates */
@keyframes dataUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.index-widget.updating {
    animation: dataUpdate 0.5s ease-in-out;
}

/* Fallback data indicator */
.fallback-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(251, 191, 36, 0.9);
    color: #1f2937;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Analysis Page Styles */
.analysis-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Removed sticky override for analysis tabs. Positioning is now controlled by analysis.css */

.analysis-header {
    margin-bottom: 2rem;
}

.analysis-header h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.product-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-selector label {
    font-weight: 600;
    color: #374151;
}

.product-dropdown {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    min-width: 300px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.product-dropdown:focus {
    outline: none;
    border-color: var(--primary-green);
}

.product-overview {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.overview-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.analysis-left,
.analysis-right {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.competitor-panel,
.chart-panel {
    padding: 1.5rem;
}

.competitor-panel h3,
.chart-panel h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-weight: 600;
}

.competitor-list {
    max-height: 400px;
    overflow-y: auto;
}

.competitor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.competitor-item:hover {
    background-color: #f9fafb;
}

.competitor-item:last-child {
    border-bottom: none;
}

.competitor-name {
    font-weight: 500;
    color: #374151;
}

.competitor-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-percentage {
    font-weight: 600;
    color: #1f2937;
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-btn:hover {
    background-color: #fef2f2;
}

/* Analysis Page Chart Styles - Only affects analysis tab */
.analysis-content .chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    min-height: 400px;
}

.analysis-content .chart-container canvas {
    width: 100% !important;
    height: 400px !important;
}

/* Specific styles for Mekko chart to prevent distortion */
#mekkoChart {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

/* Ensure chart canvas maintains proper aspect ratio */
#mekkoChart canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Chart panel specific styles - only for analysis */
.chart-panel .chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    overflow: hidden;
}

/* Ensure Chart.js responsive behavior works correctly - analysis only */
.chart-panel {
    position: relative;
}

.chart-panel canvas {
    position: relative !important;
    z-index: 1;
}

.analysis-error {
    text-align: center;
    padding: 4rem 2rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 2rem;
}

.analysis-error .material-icons {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.analysis-error h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #dc2626;
}

.analysis-error p {
    font-size: 1rem;
    color: #991b1b;
}

/* Coming Soon Styles */
.coming-soon-content {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.coming-soon-icon {
    margin-bottom: 2rem;
}

.coming-soon-icon .material-icons {
    font-size: 4rem;
    color: var(--primary-green);
}

.coming-soon-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.coming-soon-content p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.feature-preview {
    text-align: left;
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.feature-preview h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #374151;
}

.feature-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-preview li {
    padding: 0.5rem 0;
    color: #6b7280;
    position: relative;
    padding-left: 1.5rem;
}

.feature-preview li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: bold;
}

/* Responsive Design for Analysis */
@media (max-width: 768px) {
    .analysis-content {
        padding: 1rem;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .product-dropdown {
        min-width: auto;
    }

    .overview-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Forecast Tab Styles */
.forecast-content {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 400px !important;
    /* Add minimum height with !important */
    width: 100% !important;
    /* Ensure full width with !important */
    padding: 1rem;
    /* Add some padding */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.forecast-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.forecast-header p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
}

.forecast-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.forecast-form .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.forecast-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.75rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.forecast-range-buttons {
    display: flex;
    gap: 0.5rem;
}

.range-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    transition: all .15s ease;
}

.range-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.range-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
}

.forecast-form input[type="file"] {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.primary-btn {
    background: var(--primary-green);
    border: 1px solid var(--primary-green);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
}

.form-error {
    margin-top: 0.75rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.forecast-results {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.table-wrapper {
    width: 100%;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

table.data-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #374151;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e5e7eb;
}

/* Center align the Year cells in the first header row (except the Month column) */
table.data-table thead tr:first-child th:not(:first-child) {
    text-align: center;
}

table.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    vertical-align: middle;
    /* keep amounts and pct vertically centered */
}

table.data-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

table.data-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

table.data-table tbody tr:hover {
    background: #f0fdf4;
}

/* Highlight forecasted cells differently */
td.forecast-cell {
    background: #fff7ed;
    /* warm hint */
    font-weight: 600;
}

/* Chart Data Table Styles */
.chart-data-table {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chart-data-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.chart-data-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.chart-data-table-wrapper thead th {
    background: #006400;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #004d00;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.9rem;
}

.chart-data-table-wrapper thead th:first-child {
    text-align: left;
}

.chart-data-table-wrapper thead th:not(:first-child) {
    text-align: center;
}

.chart-data-table-wrapper thead th.table-units-header {
    background: #fef3c7;
    color: #000;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.chart-data-table-wrapper thead tr:first-child th {
    background: #006400;
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
}

.chart-data-table-wrapper thead tr:first-child th:first-child {
    background: #006400;
}

.chart-data-table-wrapper thead tr:first-child th.table-units-header {
    background: #fef3c7;
    color: #000;
    text-align: center;
}

.chart-data-table-wrapper thead tr:nth-child(2) th {
    background: #006400;
    color: #fff;
    text-align: left;
    font-size: 0.9rem;
}

.chart-data-table-wrapper thead tr:nth-child(2) th:not(:first-child) {
    text-align: center;
}

.chart-data-table-wrapper tbody td:first-child {
    text-align: left;
}

.chart-data-table-wrapper tbody td:nth-child(2) {
    text-align: center;
}

.chart-data-table-wrapper tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    font-size: 0.85rem;
}

.chart-data-table-wrapper tbody td:not(:first-child):not(:nth-child(2)) {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.chart-data-table-wrapper tbody tr.table-section-heading {
    background: #e0f2fe;
    font-weight: 600;
    color: #0c4a6e;
}

.chart-data-table-wrapper tbody tr.table-section-heading td {
    padding: 0.625rem 0.75rem;
    border-bottom: 2px solid #bae6fd;
    font-size: 0.85rem;
}

.chart-data-table-wrapper tbody tr.table-total-row {
    background: #e0f2fe;
    font-weight: 600;
}

.chart-data-table-wrapper tbody tr.table-total-row td {
    border-top: 1px solid #bae6fd;
    border-bottom: 1px solid #bae6fd;
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
}

.chart-data-table-wrapper tbody tr.table-grand-total {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.9rem;
}

.chart-data-table-wrapper tbody tr.table-grand-total td {
    border-top: 2px solid #cbd5e1;
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
}

.chart-data-table-wrapper tbody tr:hover:not(.table-section-heading):not(.table-total-row):not(.table-grand-total) {
    background: #f9fafb;
}

/* Cell content with value + percentage change */
.cell-amount {
    font-weight: 600;
}

.cell-pct {
    font-size: 0.8rem;
    margin-top: 2px;
}

.pct-up {
    color: #10b981;
}

.pct-down {
    color: #ef4444;
}

.pct-flat {
    color: #6b7280;
}

.forecast-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 5;
    border-radius: 8px;
}

.forecast-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.forecast-extras .analysis,
.forecast-extras .methodology {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.forecast-extras h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.forecast-extras p {
    margin: 0;
    color: #374151;
}

/* Rich text styling for analysis/methodology */
.rich-text p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.rich-text ul {
    margin: 0 0 0.75rem 1.25rem;
    padding-left: 1rem;
    list-style: disc;
}

.rich-text li {
    margin: 0.25rem 0;
}

.rich-text strong {
    color: #111827;
}

/* Economic Indicators Styling - Compact Version */
.economic-indicators-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indicators-compact {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.indicator-compact {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #374151;
    transition: all 0.2s ease;
    min-width: fit-content;
}

.indicator-compact:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.indicator-compact-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-compact-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.8rem;
}

.indicator-compact-unit {
    font-weight: 500;
    color: #64748b;
    font-size: 0.75rem;
}

/* Legacy Economic Indicators Styling (kept for backward compatibility) */
.economic-indicators {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.economic-indicators h3 {
    margin: 0 0 1.5rem 0;
    color: #0c4a6e;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.economic-indicators h3::before {
    content: "📊";
    font-size: 1.5rem;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.indicator-card {
    background: #fff;
    border: 2px solid #0ea5e9;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.indicator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #0284c7;
}

.indicator-card h4 {
    margin: 0 0 0.75rem 0;
    color: #0c4a6e;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0c4a6e;
    margin: 0.5rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.indicator-source {
    font-size: 0.8rem;
    color: #0284c7;
    font-weight: 600;
    margin-top: 0.5rem;
    background: #e0f2fe;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.indicator-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .forecast-form .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .forecast-extras {
        grid-template-columns: 1fr;
    }

    .forecast-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .forecast-range-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .indicators-compact {
        justify-content: center;
        flex-wrap: wrap;
    }

    .indicator-compact {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2000;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Parameters and Example Styling */
.parameters-content,
.example-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.parameters-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.parameter-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
}

.parameter-name {
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.parameter-weight {
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.parameter-average {
    color: #7c3aed;
    font-weight: 600;
    background: #f3e8ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.parameter-stddev {
    color: #dc2626;
    font-weight: 600;
    background: #fef2f2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.parameter-lag {
    color: #ea580c;
    font-weight: 600;
    background: #fff7ed;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.parameter-value {
    color: #374151;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.parameter-separator {
    color: #6b7280;
    font-weight: 600;
}

.parameter-text {
    color: #374151;
    font-style: italic;
}

.example-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.step-number {
    background: #3b82f6;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}

.example-line {
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.step-content .number {
    color: #059669;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: #ecfdf5;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.step-content .variable {
    color: #7c3aed;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: #f3e8ff;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.step-content .operator {
    color: #dc2626;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: #fef2f2;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.step-content .result {
    color: #1d4ed8;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: #eff6ff;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    border: 1px solid #bfdbfe;
}

/* Structured Example Styling */
.structured-example {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 0.5rem;
}

.example-header {
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.example-header h4 {
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.example-info {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.example-parameters {
    margin-bottom: 1.5rem;
}

.example-parameters h5 {
    color: #374151;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.5rem;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.param-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.param-value {
    font-weight: 600;
    color: #1f2937;
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Enhanced Parameter Cards */
.parameter-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.parameter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.parameter-name {
    font-weight: 600;
    color: #1f2937;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.parameter-value {
    font-weight: 600;
    color: #059669;
    font-family: 'Courier New', monospace;
    background: #ecfdf5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.parameter-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    font-style: italic;
}

.parameters-fallback {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
}

.parameters-fallback pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.example-calculation {
    border-top: 1px solid #d1d5db;
    padding-top: 1.5rem;
}

.example-calculation h5 {
    color: #374151;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.formula-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    border-left: 4px solid #059669;
}

.formula-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1f2937;
    word-break: break-all;
    white-space: pre-wrap;
}

.formula-number {
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.formula-operator {
    color: #dc2626;
    font-weight: 600;
    background: #fef2f2;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.formula-variable {
    color: #7c3aed;
    font-weight: 600;
    background: #f3e8ff;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* UK index sources upload modal (CPA / Fensa) */
.uk-index-upload-modal-content {
    max-width: 420px;
}

.uk-index-upload-body {
    padding: 0 1.25rem 1rem;
}

.uk-index-upload-hint {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

.uk-index-upload-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.uk-index-upload-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.uk-index-upload-input {
    font-size: 0.8125rem;
    max-width: 100%;
}

.uk-index-upload-status {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    min-height: 1.25rem;
    color: #466842;
    word-break: break-all;
}

.uk-index-upload-status.uk-index-upload-status--error {
    color: #b91c1c;
}