/* ===================================================================
   Market Overview Dashboard - GKCM Institutional Theme
   =================================================================== */

:root {
    --mo-bg: #F5F6F8;
    --mo-card-bg: #FFFFFF;
    --mo-card-border: rgba(0, 0, 0, 0.08);
    --mo-text-primary: #1A1D23;
    --mo-text-secondary: #6B7280;
    --mo-text-muted: #9CA3AF;
    --mo-positive: #10B981;
    --mo-positive-bg: rgba(16, 185, 129, 0.08);
    --mo-negative: #EF4444;
    --mo-negative-bg: rgba(239, 68, 68, 0.08);
    --mo-accent: #C8102E;
    --mo-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --mo-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --mo-radius: 10px;
    --mo-font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

/* Page background */
body:has(.mo-container) {
    background: var(--mo-bg);
}

/* Override base.html container width for this page */
body:has(.mo-container) main > .container {
    max-width: 1400px;
}

/* ===== Entry Animations ===== */
@keyframes mo-fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mo-anim {
    animation: mo-fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mo-anim-1 { animation-delay: 0.04s; }
.mo-anim-2 { animation-delay: 0.10s; }
.mo-anim-3 { animation-delay: 0.18s; }
.mo-anim-4 { animation-delay: 0.26s; }
.mo-anim-5 { animation-delay: 0.34s; }
.mo-anim-6 { animation-delay: 0.42s; }

/* ===== Container ===== */
.mo-container {
    padding: 24px 0 60px;
}

/* ===== Page Header ===== */
.mo-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--mo-accent);
}

.mo-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.mo-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mo-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.mo-subtitle {
    font-size: 0.85rem;
    color: var(--mo-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.mo-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mo-timestamp {
    font-family: var(--mo-font-mono);
    font-size: 0.8rem;
    color: var(--mo-text-secondary);
    background: var(--mo-card-bg);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--mo-card-border);
}

.mo-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mo-positive);
    box-shadow: 0 0 8px var(--mo-positive);
    animation: mo-pulse 2s ease-in-out infinite;
}

@keyframes mo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Index Cards Row ===== */
.mo-indices-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.mo-index-card {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    padding: 20px;
    box-shadow: var(--mo-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.mo-index-card:hover {
    box-shadow: var(--mo-shadow-md);
}

/* Colored top accent borders */
.mo-index-card.accent-main {
    border-top: 3px solid var(--mo-accent);
}
.mo-index-card.accent-junior {
    border-top: 3px solid #3B82F6;
}
.mo-index-card.accent-combined {
    border-top: 3px solid #8B5CF6;
}

.mo-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mo-index-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mo-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-index-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.mo-index-badge.main {
    background: rgba(200, 16, 46, 0.1);
    color: var(--mo-accent);
}

.mo-index-badge.junior {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.mo-index-badge.combined {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.mo-index-value-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.mo-index-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mo-text-primary);
    font-variant-numeric: tabular-nums;
    font-family: var(--mo-font-mono);
    letter-spacing: -0.02em;
}

.mo-index-change {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--mo-font-mono);
}

.mo-index-change.positive,
.mo-movers-table td.positive {
    background: var(--mo-positive-bg);
    color: var(--mo-positive);
}

.mo-index-change.negative,
.mo-movers-table td.negative {
    background: var(--mo-negative-bg);
    color: var(--mo-negative);
}

.mo-index-details {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--mo-text-muted);
    font-family: var(--mo-font-mono);
    margin-bottom: 12px;
}

.mo-sparkline {
    height: 50px;
    width: 100%;
}

/* ===== Macro Indicators Row ===== */
.mo-macro-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.mo-macro-card {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    overflow: hidden;
    box-shadow: var(--mo-shadow-sm);
}

.mo-macro-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(200, 16, 46, 0.04);
    border-bottom: 1px solid var(--mo-card-border);
}

.mo-macro-icon {
    color: var(--mo-accent);
}

.mo-macro-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mo-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-macro-body {
    padding: 20px;
}

.mo-macro-primary {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mo-macro-big-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--mo-text-primary);
    font-family: var(--mo-font-mono);
}

.mo-macro-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--mo-font-mono);
}

.mo-macro-change.positive {
    background: var(--mo-positive-bg);
    color: var(--mo-positive);
}

.mo-macro-change.negative {
    background: var(--mo-negative-bg);
    color: var(--mo-negative);
}

.mo-macro-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mo-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mo-macro-details {
    display: flex;
    flex-direction: column;
}

.mo-macro-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.85rem;
}

.mo-macro-detail-row:last-child {
    border-bottom: none;
}

.mo-macro-detail-row span:first-child {
    color: var(--mo-text-secondary);
}

.mo-macro-detail-row span:last-child {
    color: var(--mo-text-primary);
    font-weight: 500;
    font-family: var(--mo-font-mono);
}

.mo-decision-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mo-decision-badge.cut {
    background: var(--mo-positive-bg);
    color: var(--mo-positive);
}

.mo-decision-badge.hold {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.mo-decision-badge.hike {
    background: var(--mo-negative-bg);
    color: var(--mo-negative);
}

.mo-macro-notes {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border-left: 3px solid var(--mo-accent);
}

.mo-macro-notes p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--mo-text-secondary);
    line-height: 1.6;
}

/* ===== Top Movers Section ===== */
.mo-movers-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.mo-movers-card {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    overflow: hidden;
    box-shadow: var(--mo-shadow-sm);
}

.mo-movers-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mo-card-border);
}

.mo-movers-card.advancers .mo-movers-header {
    background: var(--mo-positive-bg);
}

.mo-movers-card.decliners .mo-movers-header {
    background: var(--mo-negative-bg);
}

.mo-movers-icon-up {
    color: var(--mo-positive);
    font-size: 0.9rem;
}

.mo-movers-icon-down {
    color: var(--mo-negative);
    font-size: 0.9rem;
}

.mo-movers-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mo-text-primary);
}

.mo-movers-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--mo-text-secondary);
}

.mo-movers-body {
    max-height: 350px;
    overflow-y: auto;
}

.mo-movers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.mo-movers-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--mo-card-border);
    background: rgba(0, 0, 0, 0.01);
    position: sticky;
    top: 0;
    z-index: 1;
}

.mo-movers-table tbody tr {
    transition: background 0.15s ease;
}

.mo-movers-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Clickable mover rows */
.mo-mover-row {
    cursor: pointer;
}
.mo-mover-row:hover {
    background: rgba(200, 16, 46, 0.03) !important;
}
.mo-mover-row:hover .mo-symbol {
    color: var(--mo-accent);
    text-decoration: underline;
}

.mo-movers-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--mo-text-primary);
}

.mo-symbol {
    font-weight: 700;
    font-family: var(--mo-font-mono);
    color: var(--mo-text-primary);
    font-size: 0.82rem;
}

.mo-security {
    color: var(--mo-text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mo-movers-table td.positive,
.mo-movers-table td.negative {
    font-weight: 600;
    font-family: var(--mo-font-mono);
}

/* ===== BOJ Timeline Button ===== */
.mo-macro-timeline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(200, 16, 46, 0.06), rgba(200, 16, 46, 0.02));
    border: 1px solid rgba(200, 16, 46, 0.15);
    border-radius: 8px;
    color: var(--mo-accent);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.mo-macro-timeline-btn:hover {
    background: var(--mo-accent);
    color: #FFFFFF;
    border-color: var(--mo-accent);
    box-shadow: 0 2px 10px rgba(200, 16, 46, 0.25);
    text-decoration: none;
}

/* ===== Charts Section ===== */
.mo-charts-section {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    padding: 20px;
    box-shadow: var(--mo-shadow-sm);
}

.mo-charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mo-card-border);
    flex-wrap: wrap;
    gap: 12px;
}

.mo-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mo-text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-chart-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Overlay toggles */
.mo-overlay-toggles {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 16px;
    border-right: 1px solid var(--mo-card-border);
}

.mo-overlay-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.mo-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--mo-card-border);
    color: var(--mo-text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mo-overlay-btn:hover {
    border-color: var(--mo-text-secondary);
}

.mo-overlay-btn.active {
    border-color: transparent;
    color: #FFFFFF;
}

.mo-overlay-btn.active[data-overlay="bojRate"] {
    background: #06B6D4;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.mo-overlay-btn.active[data-overlay="tbill"] {
    background: #F59E0B;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.mo-overlay-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mo-overlay-dot.boj {
    background: #06B6D4;
}

.mo-overlay-dot.tbill {
    background: #F59E0B;
}

.mo-legend-marker.tbill {
    background: #F59E0B;
    box-shadow: 0 0 0 1px #F59E0B;
}

.mo-overlay-btn.active .mo-overlay-dot {
    background: rgba(255, 255, 255, 0.8);
}

.mo-chart-timeframe {
    display: flex;
    gap: 4px;
}

/* Overlay legend in chart cards */
.mo-chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mo-chart-legend {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mo-legend-item {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--mo-text-muted);
    font-weight: 500;
}

.mo-legend-item.visible {
    display: flex;
}

.mo-legend-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #06B6D4;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 0 0 1px #06B6D4;
}

.mo-tf-btn {
    background: transparent;
    border: 1px solid var(--mo-card-border);
    color: var(--mo-text-secondary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mo-tf-btn:hover {
    color: var(--mo-accent);
    border-color: var(--mo-accent);
}

.mo-tf-btn.active {
    background: var(--mo-accent);
    border-color: var(--mo-accent);
    color: #FFFFFF;
}

.mo-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mo-chart-card {
    border: 1px solid var(--mo-card-border);
    border-radius: 8px;
    overflow: hidden;
}

.mo-chart-card-header {
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mo-text-secondary);
    border-bottom: 1px solid var(--mo-card-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-chart-container {
    height: 250px;
}

/* ===== AI Analysis Section ===== */
.mo-ai-card {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    overflow: hidden;
    box-shadow: var(--mo-shadow-sm);
    margin-bottom: 16px;
}

.mo-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(200, 16, 46, 0.06), rgba(139, 92, 246, 0.04));
    border-bottom: 1px solid var(--mo-card-border);
}

.mo-ai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mo-ai-icon {
    width: 20px;
    height: 20px;
    color: var(--mo-accent);
}

.mo-ai-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mo-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mo-accent);
    color: #FFFFFF;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.mo-ai-btn:hover {
    background: #A00D24;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.mo-ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mo-ai-btn svg {
    width: 14px;
    height: 14px;
}

.mo-ai-body {
    padding: 20px;
}

/* Loading */
.mo-ai-loading {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    color: var(--mo-text-secondary);
    font-size: 0.85rem;
}

.mo-ai-loading.visible {
    display: flex;
}

.mo-ai-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(200, 16, 46, 0.15);
    border-top-color: var(--mo-accent);
    border-radius: 50%;
    animation: mo-spin 0.8s linear infinite;
}

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

/* Error */
.mo-ai-error {
    display: none;
    padding: 12px 16px;
    background: var(--mo-negative-bg);
    border-radius: 6px;
    color: var(--mo-negative);
    font-size: 0.82rem;
    font-weight: 500;
}

.mo-ai-error.visible {
    display: block;
}

/* Result */
.mo-ai-result {
    display: none;
}

.mo-ai-result.visible {
    display: block;
}

/* Sentiment badge */
.mo-ai-sentiment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.mo-ai-sentiment-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-ai-sentiment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.mo-ai-sentiment.bullish {
    background: var(--mo-positive-bg);
    color: var(--mo-positive);
}

.mo-ai-sentiment.bearish {
    background: var(--mo-negative-bg);
    color: var(--mo-negative);
}

.mo-ai-sentiment.neutral {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.mo-ai-sentiment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Summary */
.mo-ai-summary {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mo-ai-summary p {
    margin: 0 0 10px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--mo-text-primary);
}

.mo-ai-summary p:last-child {
    margin-bottom: 0;
}

/* Bullet categories */
.mo-ai-bullets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mo-ai-bullet-group {
    padding: 14px;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.mo-ai-bullet-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mo-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.mo-ai-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mo-ai-bullet-list li {
    position: relative;
    padding: 4px 0 4px 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--mo-text-primary);
}

.mo-ai-bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mo-accent);
    opacity: 0.5;
}

/* Disclaimer */
.mo-ai-disclaimer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.7rem;
    color: var(--mo-text-muted);
    font-style: italic;
}

/* ===== JSE News Section ===== */
.mo-news-section {
    background: var(--mo-card-bg);
    border: 1px solid var(--mo-card-border);
    border-radius: var(--mo-radius);
    overflow: hidden;
    box-shadow: var(--mo-shadow-sm);
    margin-bottom: 16px;
}

.mo-news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(200, 16, 46, 0.04);
    border-bottom: 1px solid var(--mo-card-border);
}

.mo-news-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mo-news-icon {
    width: 20px;
    height: 20px;
    color: var(--mo-accent);
    flex-shrink: 0;
}

.mo-news-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mo-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mo-news-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(200, 16, 46, 0.1);
    color: var(--mo-accent);
}

.mo-news-source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mo-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.mo-news-source-link:hover {
    color: var(--mo-accent);
}

.mo-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    padding: 16px;
}

.mo-news-hidden {
    display: none !important;
}

.mo-news-grid.mo-news-expanded .mo-news-hidden {
    display: flex !important;
}

.mo-news-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--mo-card-border);
    color: var(--mo-accent);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mo-news-toggle:hover {
    background: rgba(200, 16, 46, 0.04);
}

.mo-news-toggle-icon {
    transition: transform 0.2s ease;
}

.mo-news-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--mo-card-bg, #FFFFFF);
    border: 1px solid var(--mo-card-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    min-height: 130px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mo-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--mo-accent);
}

.mo-news-card:hover .mo-news-card-title {
    color: var(--mo-accent);
}

.mo-news-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.mo-news-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mo-text-muted);
}

.mo-news-source > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mo-news-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.mo-news-recency {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(200, 16, 46, 0.1);
    color: var(--mo-accent);
    text-transform: uppercase;
}

.mo-news-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--mo-text-primary);
    margin: 0 0 10px;
    line-height: 1.4;
    transition: color 0.2s;
    /* Clamp to 3 lines so all cards stay roughly equal height in the grid */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.mo-news-card-desc {
    font-size: 0.78rem;
    color: var(--mo-text-secondary);
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mo-news-card-footer {
    margin-top: auto;
}

.mo-news-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mo-text-muted);
    font-family: var(--mo-font-mono);
}

.mo-news-empty {
    padding: 40px 20px;
    text-align: center;
    grid-column: 1 / -1;
}

.mo-news-empty p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mo-text-muted);
}

/* ===== Trade on JSE Button ===== */
.mo-trade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #FFFFFF;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-decoration: none;
}

.mo-trade-btn:hover {
    background: #15803d;
    color: #fff;
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
    text-decoration: none;
}

/* ===== Daily Report Button ===== */
.mo-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mo-accent);
    color: #FFFFFF;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.mo-report-btn:hover {
    background: #A00D24;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.mo-report-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rpt-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #E8E8E8;
    flex-direction: column;
}
.rpt-overlay.visible { display: flex; }

.rpt-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 24px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--mo-card-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.rpt-toolbar-right { display: flex; align-items: center; gap: 8px; }
.rpt-toolbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--mo-card-border);
    color: var(--mo-text-secondary); padding: 6px 14px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.rpt-toolbar-btn:hover { border-color: var(--mo-text-secondary); color: var(--mo-text-primary); }
.rpt-toolbar-btn--primary {
    background: var(--mo-accent); border-color: var(--mo-accent); color: #FFFFFF;
}
.rpt-toolbar-btn--primary:hover {
    background: #A00D24; border-color: #A00D24; color: #FFFFFF;
}
.rpt-toolbar-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.rpt-close-btn { padding: 6px 8px; border: none; }
.rpt-close-btn:hover { color: var(--mo-negative); border: none; }

.rpt-scroll {
    flex: 1; overflow-y: auto; padding: 24px;
    display: flex; justify-content: center; align-items: flex-start;
}

/* ===== Report Document — Redesign v2 ===== */
.rpt-document {
    width: 100%; max-width: 820px;
    background: #FFFFFF;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.10);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12.5px; line-height: 1.5;
    color: #1a1d23;
    overflow: hidden;
}

/* ── Masthead ── */
.rpt-hd {
    display: grid; grid-template-columns: 1fr auto;
    align-items: flex-end; gap: 20px;
    padding: 28px 36px 14px;
}
.rpt-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.rpt-logo {
    height: 34px; width: auto; display: block;
}
.rpt-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700; font-size: 38px;
    color: #1a1d23; letter-spacing: -0.5px;
    margin: 0; line-height: 1.05;
}
.rpt-hd-meta {
    text-align: right;
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 6px;
    padding-bottom: 6px;
}
.rpt-tag {
    font-size: 8.5px; font-weight: 700;
    color: #8B919A; letter-spacing: 2px;
    text-transform: uppercase;
}
.rpt-date {
    font-size: 10.5px; font-weight: 700;
    color: #1a1d23; letter-spacing: 1.8px;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

/* ── Flag accent ── */
.rpt-flag {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    height: 3px; margin: 0 36px 16px;
}
.rpt-flag span:nth-child(1) { background: #009b48; }
.rpt-flag span:nth-child(2) { background: #fed100; }
.rpt-flag span:nth-child(3) { background: #C00000; }

/* ── Section headers ── */
.rpt-sec { padding: 6px 36px 14px; }
.rpt-sec-hdr {
    display: flex; align-items: center; gap: 8px;
    font-size: 9.5px; font-weight: 800;
    color: #1a1d23; letter-spacing: 2px;
    text-transform: uppercase;
    padding-bottom: 8px; margin-bottom: 10px;
    border-bottom: 1px solid #e6e9ee;
}
.rpt-sec-hdr .rpt-sq {
    width: 9px; height: 9px;
    background: #C00000; flex-shrink: 0;
}

/* ── Market summary paragraph ── */
.rpt-summary {
    font-size: 11.5px; line-height: 1.65;
    color: #374151; margin: 0;
    text-align: justify;
}
.rpt-summary strong { color: #1a1d23; font-weight: 700; }
.rpt-summary .v-pos { color: #0d9f4f; font-weight: 700; }
.rpt-summary .v-neg { color: #C00000; font-weight: 700; }

/* ── Two-column grid ── */
.rpt-2col {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 24px; padding: 0 36px 14px;
    align-items: stretch;
}
.rpt-col { display: flex; flex-direction: column; }

/* ── Index cards ── */
.rpt-idx-list {
    display: flex; flex-direction: column;
    gap: 6px; flex: 1;
}
.rpt-idx-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr auto;
    align-items: center; gap: 10px;
    padding: 9px 12px;
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-left: 3px solid #C00000;
    border-radius: 3px;
    flex: 1;
}
.rpt-idx-name {
    font-size: 10.5px; font-weight: 700;
    color: #1a1d23; line-height: 1.2;
}
.rpt-idx-sub {
    font-size: 7px; font-weight: 700;
    color: #9ca3af; letter-spacing: 1.2px;
    text-transform: uppercase; margin-top: 2px;
}
.rpt-idx-val {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px; font-weight: 700;
    color: #1a1d23; line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
}
.rpt-idx-chg {
    text-align: right;
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 2px;
}
.rpt-idx-pct {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 9.5px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.rpt-idx-pct.v-pos { background: #ecfdf5; color: #0d9f4f; }
.rpt-idx-pct.v-neg { background: #fef2f2; color: #C00000; }
.rpt-idx-pts {
    font-size: 8.5px; font-weight: 600;
    color: #9ca3af; font-variant-numeric: tabular-nums;
}

/* ── KPI rows (Economic Indicators) ── */
.rpt-kpi-list {
    display: flex; flex-direction: column;
    gap: 6px; flex: 1;
}
.rpt-kpi-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center; gap: 14px;
    padding: 11px 14px;
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-radius: 3px;
    flex: 1;
}
.rpt-kpi-label {
    font-size: 8.5px; font-weight: 700;
    color: #9ca3af; letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.rpt-kpi-detail {
    font-size: 9px; color: #6b7280;
    line-height: 1.45;
}
.rpt-kpi-detail strong { color: #1a1d23; font-weight: 700; }
.rpt-pill {
    display: inline-block;
    padding: 0 6px;
    background: #f1f3f6;
    border-radius: 2px;
    font-size: 8px; font-weight: 700;
    color: #1a1d23; letter-spacing: 1px;
    text-transform: uppercase;
    vertical-align: middle;
    line-height: 1.6;
}
.rpt-kpi-big {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px; font-weight: 700;
    color: #1a1d23; line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.4px;
}
.rpt-kpi-pct {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px; font-weight: 600;
    color: #1a1d23; margin-left: 1px;
}

/* ── Data table ── */
.rpt-tbl {
    width: 100%;
    border-collapse: separate; border-spacing: 0;
    border: 1px solid #e6e9ee;
    border-radius: 4px;
    overflow: hidden;
}
.rpt-tbl thead th {
    padding: 10px 12px; text-align: left;
    font-size: 8.5px; font-weight: 700;
    color: #ffffff; text-transform: uppercase;
    letter-spacing: 1.6px;
    background: #1a1d23;
    border-bottom: none;
}
.rpt-tbl thead th.r { text-align: right; }
.rpt-tbl td {
    padding: 11px 12px; font-size: 11px;
    border-bottom: 1px solid #f1f3f6;
    vertical-align: middle;
}
.rpt-tbl td.r {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.rpt-tbl td.sym {
    font-weight: 800; font-size: 10.5px;
    color: #1a1d23; letter-spacing: 0.3px;
}
.rpt-tbl tr:last-child td { border-bottom: none; }
.rpt-tbl .v-pos { color: #0d9f4f; font-weight: 700; }
.rpt-tbl .v-neg { color: #C00000; font-weight: 700; }
.rpt-pct-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.rpt-pct-pill.v-pos { background: #ecfdf5; color: #0d9f4f; }
.rpt-pct-pill.v-neg { background: #fef2f2; color: #C00000; }

/* Lighter table variant — used for dividends */
.rpt-tbl--light {
    border: none; border-radius: 0; overflow: visible;
}
.rpt-tbl--light thead th {
    background: transparent;
    color: #9ca3af;
    font-weight: 700;
    border-bottom: 1px solid #e6e9ee;
    padding: 7px 8px;
    letter-spacing: 1.4px;
}
.rpt-tbl--light td { padding: 10px 8px; }

/* ── Upcoming dividends — compact amount cell ── */
.rpt-div-amt {
    display: flex; flex-direction: column;
    align-items: flex-end; line-height: 1.15;
}
.rpt-div-amt .ccy {
    font-size: 8px; font-weight: 700;
    color: #8B919A; letter-spacing: 0.8px;
    margin-top: 1px;
}

/* ── News (JSE Announcements) ── */
.rpt-news { display: flex; flex-direction: column; }
.rpt-news-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f3f6;
    align-items: flex-start;
}
.rpt-news-item:last-child { border-bottom: none; }
.rpt-news-date {
    font-size: 8px; font-weight: 800;
    color: #C00000; letter-spacing: 1.2px;
    text-transform: uppercase;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}
.rpt-news-body {
    font-size: 10.5px; line-height: 1.45;
    color: #1a1d23;
}
.rpt-news-body strong { font-weight: 700; }
.rpt-news-body a {
    color: #1a1d23; text-decoration: none;
    border-bottom: 1px solid transparent;
}
.rpt-news-body a:hover {
    color: #C00000; border-bottom-color: #C00000;
}

/* ── Disclaimer ── */
.rpt-disc {
    padding: 14px 36px;
    border-top: 1px solid #e6e9ee;
    margin-top: 8px;
    font-size: 8.5px; line-height: 1.55;
    color: #9CA3AF;
}

/* ── Footer (black bar) ── */
.rpt-foot {
    background: #1a1d23; color: #fff;
    padding: 12px 36px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px;
}
.rpt-foot-l {
    font-size: 8.5px; font-weight: 800;
    color: #fff; letter-spacing: 2px;
    text-transform: uppercase;
}
.rpt-foot-c {
    font-size: 8.5px; font-weight: 500;
    color: rgba(255,255,255,0.65);
    flex: 1; text-align: center;
}
.rpt-foot-r {
    font-size: 8.5px; font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 1.4px;
    font-variant-numeric: tabular-nums;
}

/* Empty-state helpers */
.rpt-empty {
    padding: 20px 8px;
    text-align: center;
    color: #9CA3AF;
    font-size: 11px;
    font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .mo-charts-grid { grid-template-columns: 1fr; }
    .mo-chart-container { height: 220px; }
}

@media (max-width: 992px) {
    .mo-indices-row { grid-template-columns: 1fr; }
    .mo-macro-row { grid-template-columns: 1fr; }
    .mo-movers-row { grid-template-columns: 1fr; }
    .mo-ai-bullets { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .mo-page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mo-header-left { flex-direction: column; gap: 4px; }
    .mo-index-value { font-size: 1.3rem; }
    .mo-macro-big-value { font-size: 1.5rem; }
    .mo-chart-controls { flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; }
    .mo-overlay-toggles { border-right: none; padding-right: 0; padding-bottom: 8px; border-bottom: 1px solid var(--mo-card-border); width: 100%; }
    .rpt-2col { grid-template-columns: 1fr; gap: 16px; }
}

/* ===== Print ===== */
@media print {
    @page { size: letter; margin: 0.4in; }
    body:has(.rpt-overlay.visible), html:has(.rpt-overlay.visible) { background: #FFF !important; }
    body:has(.rpt-overlay.visible) > *:not(.rpt-overlay) { display: none !important; }
    .rpt-overlay { position: static !important; display: block !important; background: #FFF !important; }
    .rpt-toolbar { display: none !important; }
    .rpt-scroll { overflow: visible !important; padding: 0 !important; }
    .rpt-document { box-shadow: none !important; max-width: none !important; }
    .rpt-2col, .rpt-idx-card, .rpt-kpi-row, .rpt-news-item, .rpt-tbl tr { break-inside: avoid; }
    .rpt-foot, .rpt-flag span, .rpt-logo, .rpt-sec-hdr .rpt-sq,
    .rpt-news-date, .rpt-tbl thead th, .rpt-tbl .v-pos, .rpt-tbl .v-neg,
    .rpt-summary .v-pos, .rpt-summary .v-neg,
    .rpt-idx-pct, .rpt-pct-pill, .rpt-pill, .rpt-idx-card {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}

/* CSP refactor utilities */
.mo-empty-cell {
    color: var(--mo-text-muted);
    padding: 20px;
}
.mo-news-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mo-news-refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--mo-text-secondary, #666);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
}
