/* =============================================
   CUSTOM STYLES
   Additional styles beyond TailwindCSS
   ============================================= */

/* ---- CSS Variables ---- */
:root {
    --gold-primary: #eab308;
    --gold-light: #facc15;
    --gold-dark: #ca8a04;
    --dark-bg: #020617;
    --dark-surface: #0f172a;
    --dark-border: #334155;
    
    /* iOS Safe Area Insets for PWA */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ---- iOS Safe Area Utility Classes ---- */
/* Basic safe-area top padding - for drawers/modals */
.safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Safe-area top with extra spacing - for headers */
.safe-area-top-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    /* Ensure minimum touch target clearance on iOS */
    min-height: calc(env(safe-area-inset-top, 0px) + 56px);
}

/* Safe-area bottom padding */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Drawer/Modal specific safe area - more aggressive padding for full-screen drawers */
.drawer-safe-area-top {
    padding-top: max(env(safe-area-inset-top, 0px), 20px);
}

/* iOS PWA standalone mode - additional safe area handling */
@supports (-webkit-touch-callout: none) {
    /* Safari/iOS specific - ensure close buttons are always reachable */
    .safe-area-top-header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    }
    
    /* Drawer panels that slide from right should respect safe area */
    #portfolioPanel .safe-area-top-header,
    #signalDrawer .safe-area-top-header,
    #monthlyDrawer .safe-area-top-header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    }
}

/* ---- Free Admin Gift Banner ---- */
.free-admin-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: inherit;
    direction: inherit;
}

.free-admin-badge .flex {
    gap: 12px;
}

/* Improve text sizing and alignment */
.free-admin-badge h3 {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.free-admin-badge p {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* RTL-specific adjustments for gift banner */
[dir="rtl"] .free-admin-badge {
    text-align: right;
}

/* Ensure the countdown box doesn't get too large */
.free-admin-badge .text-center {
    min-width: auto;
    flex-shrink: 0;
}

/* Mobile improvements */
@media (max-width: 480px) {
    .free-admin-badge {
        padding: 12px !important;
    }
    
    .free-admin-badge .flex {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .free-admin-badge .flex-1 {
        flex: 1 1 60%;
        min-width: 0;
    }
    
    .free-admin-badge h3 {
        font-size: 0.85rem;
    }
    
    .free-admin-badge p {
        font-size: 0.75rem;
    }
    
    .free-admin-badge .text-center {
        padding: 6px 10px !important;
    }
    
    .free-admin-badge .text-2xl {
        font-size: 1.25rem !important;
    }
}

/* ---- Base Styles ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

main {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

/* ---- Focus Styles ---- */
:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

/* ---- Selection Styles ---- */
::selection {
    background: rgba(234, 179, 8, 0.3);
    color: #fff;
}

/* ---- Sidebar Transitions ---- */
.sidebar {
    will-change: transform;
}

.sidebar-overlay {
    transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ---- Navigation Items ---- */
.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateX(4px);
}

.nav-item.active:hover {
    transform: none;
}

/* ---- Last Update Block (Stacked Layout) ---- */
.last-update-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    text-align: center;
}

.last-update-block .label {
    font-size: 0.65rem;
    opacity: 0.8;
}

.last-update-block .time {
    font-size: 0.875rem;
    font-weight: 600;
}

/* RTL Support for Last Update Block */
[dir="rtl"] .last-update-block {
    align-items: center;
}

/* ---- Widget Animations ---- */
.widget {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ---- Action Buttons ---- */
.action-btn {
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.02);
}

.action-btn:active {
    transform: scale(0.98);
}

/* ---- Gold Gradient Text ---- */
.gold-gradient {
    background: linear-gradient(135deg, #facc15, #ca8a04);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Gold Glow Effect ---- */
.gold-glow {
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3);
}

/* ---- Loading Skeleton ---- */
.skeleton {
    background: linear-gradient(
        90deg,
        #1e293b 0%,
        #334155 50%,
        #1e293b 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ---- Fade In Animation ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ---- Fade Out Animation ---- */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* ---- Pulse Animation ---- */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Notification Badge ---- */
.notification-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Global Risk Custom Scrollbar ---- */
.risk-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.risk-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.risk-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.risk-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ---- Global Risk: structural layout ---- */
.global-risk-view .risk-page-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center !important;
}

.global-risk-view .risk-page-intro h1,
.global-risk-view .risk-page-intro p {
    width: 100%;
    margin-inline: auto;
    text-align: center !important;
}

.global-risk-view .risk-page-status {
    align-items: center;
    text-align: center;
}

.global-risk-view .risk-section-heading {
    justify-content: center;
    text-align: center;
}

.global-risk-view .risk-section-heading > div:last-child {
    text-align: center;
}

.global-risk-view .risk-section-heading p {
    margin-inline: auto;
}

.global-risk-view .risk-panel-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.global-risk-view .risk-panel-heading {
    justify-content: center;
    text-align: center;
}

.global-risk-view #riskEventsList > div {
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}

.global-risk-view #riskEventsList > div > div {
    text-align: center;
}

.global-risk-view .risk-detail-title,
.global-risk-view .global-risk-empty {
    text-align: center;
}

@media (min-width: 768px) {
    .global-risk-view .risk-page-header > div {
        position: relative;
    }
    .global-risk-view .risk-page-intro {
        width: 100%;
    }
    .global-risk-view .risk-page-status {
        position: absolute;
        inset-inline-end: 0;
        top: 50%;
        transform: translateY(-50%);
    }
}

.global-risk-view .risk-map-legend-wrap {
    text-align: center;
}
.global-risk-view .risk-map-legend {
    justify-content: center;
}

.global-risk-view .market-glance-card {
    text-align: center;
}
.global-risk-view .market-glance-card-head {
    align-items: center;
}

.risk-transmission-grid {
    align-items: start;
}

.risk-transmission-card,
.risk-trend-card {
    align-self: start;
    min-width: 0;
}

.risk-transmission-card {
    height: auto;
}

.risk-trend-card {
    overflow: hidden;
}

.risk-trend-chart-wrap {
    min-height: 0;
    padding: 0.5rem 0.25rem 0;
    border: 1px solid rgba(51, 65, 85, 0.62);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.08), transparent 44%),
        rgba(2, 6, 23, 0.6);
    touch-action: pan-y;
}

.risk-trend-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: inherit;
}

.risk-trend-plot-bg {
    fill: rgba(2, 6, 23, 0.38);
    stroke: rgba(71, 85, 105, 0.62);
    stroke-width: 1;
}

.risk-trend-band {
    pointer-events: none;
}

.risk-trend-grid-line {
    stroke: rgba(148, 163, 184, 0.2);
    stroke-width: 1;
    stroke-dasharray: 4 6;
    vector-effect: non-scaling-stroke;
}

.risk-trend-axis {
    stroke: rgba(148, 163, 184, 0.42);
    stroke-width: 1.25;
    vector-effect: non-scaling-stroke;
}

.risk-trend-axis-label {
    fill: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.risk-trend-time-label {
    fill: #cbd5e1;
    font-size: 12px;
}

.risk-trend-band-label {
    fill: rgba(226, 232, 240, 0.78);
    font-size: 11px;
    font-weight: 800;
    paint-order: stroke;
    stroke: rgba(2, 6, 23, 0.9);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.risk-trend-area {
    pointer-events: none;
}

.risk-trend-segment {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(15, 23, 42, 0.9));
}

.risk-trend-gap {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 7 8;
    opacity: 0.72;
    vector-effect: non-scaling-stroke;
}

.risk-trend-hit-point {
    fill: transparent;
    cursor: crosshair;
    pointer-events: all;
}

.risk-trend-tooltip {
    position: absolute;
    z-index: 4;
    display: flex;
    min-width: 7.5rem;
    transform: translate(-50%, calc(-100% - 0.65rem));
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.48rem 0.62rem;
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 0.7rem;
    color: #cbd5e1;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
    font-size: 0.68rem;
    pointer-events: none;
    white-space: nowrap;
}

.risk-trend-tooltip.hidden {
    display: none;
}

.risk-trend-tooltip strong {
    color: #f8fafc;
    font-size: 0.92rem;
}

.risk-trend-point {
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.risk-trend-latest-halo {
    fill: none;
    stroke-width: 2;
    opacity: 0.78;
    vector-effect: non-scaling-stroke;
    animation: risk-trend-pulse 2s ease-out infinite;
}

.risk-trend-point-label text {
    fill: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    paint-order: stroke;
    stroke: rgba(2, 6, 23, 0.88);
    stroke-width: 2px;
}

.risk-trend-point-label:not(.is-latest) {
    opacity: 0.9;
}

.risk-trend-point-label.is-hidden {
    display: none;
}

.risk-trend-reading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-height: 2.5rem;
    margin-top: 0.75rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
}

.risk-trend-reading strong {
    color: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.risk-trend-reading b {
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--trend-reading-color, #64748b);
    border-radius: 999px;
    color: var(--trend-reading-color, #cbd5e1);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 0 14px color-mix(in srgb, var(--trend-reading-color, #64748b) 24%, transparent);
}

.risk-trend-reading.is-up b { color: #fb7185; border-color: rgba(251,113,133,.45); }
.risk-trend-reading.is-down b { color: #34d399; border-color: rgba(52,211,153,.45); }
.risk-trend-reading.is-stable b { color: #cbd5e1; border-color: rgba(148,163,184,.4); }

.risk-trend-data-note {
    margin: 0.1rem auto 0.8rem;
    max-width: 42rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.65;
}

.risk-trend-legend {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.risk-trend-legend-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.35rem;
    padding: 0.48rem 0.38rem;
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 0.7rem;
    background: rgba(15, 23, 42, 0.66);
    color: #cbd5e1;
    font-size: 0.65rem;
}

.risk-trend-legend-item i {
    width: 0.48rem;
    height: 0.48rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #64748b;
    box-shadow: 0 0 8px currentColor;
}

.risk-trend-legend-item b {
    font-weight: 800;
}

.risk-trend-legend-item small {
    width: 100%;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6rem;
    font-variant-numeric: tabular-nums;
}

.risk-trend-legend-item.is-calm i { background: #34d399; color: #34d399; }
.risk-trend-legend-item.is-alert i { background: #60a5fa; color: #60a5fa; }
.risk-trend-legend-item.is-tension i { background: #fbbf24; color: #fbbf24; }
.risk-trend-legend-item.is-stress i { background: #fb923c; color: #fb923c; }
.risk-trend-legend-item.is-panic i { background: #fb7185; color: #fb7185; }

.risk-trend-legend-item.is-calm.is-active {
    --legend-tint: rgba(52, 211, 153, 0.1);
    --legend-border: rgba(52, 211, 153, 0.56);
    --legend-glow: rgba(52, 211, 153, 0.1);
}
.risk-trend-legend-item.is-alert.is-active {
    --legend-tint: rgba(96, 165, 250, 0.1);
    --legend-border: rgba(96, 165, 250, 0.58);
    --legend-glow: rgba(96, 165, 250, 0.1);
}
.risk-trend-legend-item.is-tension.is-active {
    --legend-tint: rgba(251, 191, 36, 0.09);
    --legend-border: rgba(251, 191, 36, 0.55);
    --legend-glow: rgba(251, 191, 36, 0.09);
}
.risk-trend-legend-item.is-stress.is-active {
    --legend-tint: rgba(251, 146, 60, 0.1);
    --legend-border: rgba(251, 146, 60, 0.55);
    --legend-glow: rgba(251, 146, 60, 0.1);
}
.risk-trend-legend-item.is-panic.is-active {
    --legend-tint: rgba(251, 113, 133, 0.1);
    --legend-border: rgba(251, 113, 133, 0.57);
    --legend-glow: rgba(251, 113, 133, 0.1);
}

.risk-trend-legend-item.is-active {
    background: var(--legend-tint);
    border-color: var(--legend-border);
    box-shadow: 0 0 0 1px var(--legend-glow), 0 0 14px var(--legend-glow);
}

.risk-trend-legend-item.is-active small {
    color: #cbd5e1;
}

@keyframes risk-trend-pulse {
    0% { opacity: 0.78; transform: scale(0.72); transform-origin: center; }
    70%, 100% { opacity: 0; transform: scale(1.45); transform-origin: center; }
}

.risk-panel-header {
    min-width: 0;
    gap: 0.75rem;
}

.risk-panel-heading {
    min-width: 0;
}

.risk-panel-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.risk-transmission-item {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid rgba(51, 65, 85, 0.78);
    border-radius: 1rem;
    background: rgba(2, 6, 23, 0.72);
}

.risk-transmission-flow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.55rem;
    min-width: 0;
    direction: rtl;
}

.risk-transmission-node {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.7rem 0.65rem;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 0.75rem;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.55;
    text-align: center;
    overflow-wrap: anywhere;
}

.risk-transmission-event {
    border-color: rgba(244, 63, 94, 0.32);
    background: rgba(244, 63, 94, 0.08);
    color: #fecdd3;
}

.risk-transmission-sector {
    gap: 0.4rem;
    flex-wrap: wrap;
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
}

.risk-transmission-sector-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.55rem;
    font-size: 0.7rem;
    line-height: 1.45;
}

.risk-transmission-sector-tag.is-positive {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.risk-transmission-sector-tag.is-negative {
    border-color: rgba(244, 63, 94, 0.42);
    background: rgba(244, 63, 94, 0.12);
    color: #fda4af;
}

.risk-transmission-sector-tag.is-neutral {
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
}

.risk-transmission-symbols {
    direction: ltr;
    border-color: rgba(34, 211, 238, 0.3);
    background: rgba(34, 211, 238, 0.07);
    color: #a5f3fc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.68rem;
    word-break: break-word;
}

.risk-transmission-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1rem;
    color: #64748b;
    font-size: 1rem;
    font-weight: 800;
}

.risk-transmission-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.risk-transmission-meta span {
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(71, 85, 105, 0.65);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #cbd5e1;
    font-size: 0.65rem;
    font-weight: 700;
}

.risk-transmission-summary {
    margin-top: 0.6rem;
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.7;
    text-align: center;
    overflow-wrap: anywhere;
}

.risk-transmission-meaning {
    margin-top: 0.7rem;
    color: #e2e8f0;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    overflow-wrap: anywhere;
}

.risk-contribution-impact {
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.risk-contribution-points {
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.risk-contribution-points span {
    color: #94a3b8;
    font-weight: 600;
}

.risk-contribution-status {
    margin-top: 0.45rem;
    color: #64748b;
    font-size: 0.64rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .risk-trend-card {
        padding-inline: 0.8rem !important;
    }

    .risk-trend-chart-wrap {
        margin-top: 0.25rem !important;
        padding-inline: 0;
    }

    .risk-trend-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .risk-trend-legend-item.is-panic {
        grid-column: 1 / -1;
        width: min(100%, 11rem);
        justify-self: center;
    }

    .risk-panel-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .risk-panel-heading {
        flex: 1 1 11rem;
    }

    .risk-panel-title {
        line-height: 1.55;
    }

    .risk-transmission-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .risk-transmission-arrow {
        flex-basis: auto;
        min-height: 1rem;
        font-size: 0;
    }

    .risk-transmission-arrow::before {
        content: "↓";
        font-size: 1rem;
    }

    .risk-transmission-node {
        flex-basis: auto;
        width: 100%;
    }

    .risk-contribution-impact,
    .risk-contribution-points {
        font-size: 0.64rem;
    }
}

/* ---- Global Risk: real map + lighthouse ---- */
.risk-summary-panel {
    --risk-summary-accent: #94a3b8;
    --risk-summary-soft: rgba(148, 163, 184, 0.2);
    --risk-summary-glow: rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at 50% -28%, var(--risk-summary-glow), transparent 48%),
        #0f172a !important;
    border-color: var(--risk-summary-soft) !important;
    box-shadow:
        0 0 0 1px var(--risk-summary-soft),
        0 0 30px var(--risk-summary-glow),
        0 18px 45px rgba(0, 0, 0, 0.2);
}

.risk-summary-panel .risk-summary-metric {
    min-width: 0;
    gap: 0.15rem;
}

.risk-summary-score-scale {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.risk-summary-panel .risk-summary-label {
    color: #a5b4fc !important;
    letter-spacing: 0.02em;
}

.risk-summary-panel .risk-summary-metric strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
}

.risk-summary-panel #summaryScore {
    color: var(--risk-summary-accent) !important;
    text-shadow: 0 0 24px var(--risk-summary-glow);
}

.risk-summary-panel #summaryLevel {
    color: var(--risk-summary-accent) !important;
    background: var(--risk-summary-glow) !important;
    border-color: var(--risk-summary-soft) !important;
}

.risk-summary-panel #summaryDirection,
.risk-summary-panel #summaryConfidence {
    color: #e2e8f0 !important;
}

.risk-summary-panel #summaryLeader {
    color: var(--risk-summary-accent) !important;
    text-shadow:
        0 0 8px var(--risk-summary-glow),
        0 0 20px var(--risk-summary-glow);
}

.risk-summary-text {
    max-width: 62rem;
    line-height: 1.9 !important;
    text-wrap: pretty;
}

.risk-summary-highlight {
    font-weight: 700;
    overflow-wrap: normal;
}

.risk-summary-highlight-positive {
    color: #34d399;
}

.risk-summary-highlight-watch {
    color: #60a5fa;
}

.risk-summary-highlight-warning {
    color: #fbbf24;
}

.risk-summary-highlight-topic {
    color: #7dd3fc;
}

.risk-summary-highlight-danger {
    color: #fb7185;
}

.risk-summary-highlight-highRisk {
    color: #f43f5e;
}

.risk-summary-panel #summaryUpdatedAt {
    color: #cbd5e1 !important;
}

.risk-score-explanation {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 0.9rem;
    background: rgba(30, 64, 175, 0.07);
    color: #94a3b8;
    font-size: 0.74rem;
    line-height: 1.65;
}

.risk-score-explanation strong { color: #bfdbfe; white-space: nowrap; }
.risk-score-explanation p { margin: 0; }
.risk-score-explanation b { color: #e2e8f0; }
.risk-score-explanation span { color: #64748b; white-space: nowrap; }

@media (max-width: 640px) {
    .risk-score-explanation {
        grid-template-columns: 1fr;
    }
    .risk-score-explanation span {
        white-space: normal;
    }
    .risk-trend-time-label {
        font-size: 10px;
    }
}

.risk-summary-tone-calm {
    --risk-summary-accent: #34d399;
    --risk-summary-soft: rgba(52, 211, 153, 0.28);
    --risk-summary-glow: rgba(52, 211, 153, 0.2);
}

.risk-summary-tone-alert {
    --risk-summary-accent: #60a5fa;
    --risk-summary-soft: rgba(96, 165, 250, 0.28);
    --risk-summary-glow: rgba(96, 165, 250, 0.2);
}

.risk-summary-tone-tension {
    --risk-summary-accent: #fbbf24;
    --risk-summary-soft: rgba(251, 191, 36, 0.3);
    --risk-summary-glow: rgba(251, 191, 36, 0.2);
}

.risk-summary-tone-stress {
    --risk-summary-accent: #fb923c;
    --risk-summary-soft: rgba(251, 146, 60, 0.3);
    --risk-summary-glow: rgba(251, 146, 60, 0.2);
}

.risk-summary-tone-panic {
    --risk-summary-accent: #fb7185;
    --risk-summary-soft: rgba(251, 113, 133, 0.32);
    --risk-summary-glow: rgba(251, 113, 133, 0.22);
}

.risk-summary-text {
    color: #f8fafc !important;
    text-align: center !important;
}

.risk-map-shell {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 1rem;
    background: #06101f;
    container-type: inline-size;
}

.risk-world-map {
    display: block;
    width: 100%;
    height: auto;
    min-height: 300px;
}

.risk-world-land {
    fill: #17283d;
    stroke: #526a8c;
    stroke-width: 1.15;
    stroke-linejoin: round;
    opacity: 0.92;
}

.risk-map-marker {
    cursor: pointer;
    outline: none;
}

.risk-map-marker-pulse {
    opacity: 0.13;
    transform-origin: center;
    animation: risk-map-pulse 2.6s ease-out infinite;
}

.risk-map-marker-core {
    stroke: #f8fafc;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 7px currentColor);
}

.risk-map-marker.is-unavailable .risk-map-marker-pulse {
    animation: none;
    opacity: 0.06;
}

.risk-map-marker.is-unavailable .risk-map-marker-core {
    stroke-dasharray: 2 2;
}

.risk-map-marker:hover .risk-map-marker-core,
.risk-map-marker:focus .risk-map-marker-core,
.risk-map-marker-active .risk-map-marker-core {
    stroke-width: 4;
}

.risk-map-marker-label {
    display: block;
    fill: #dbeafe;
    font-size: 15px;
    font-weight: 700;
    paint-order: stroke;
    stroke: #06101f;
    stroke-width: 5px;
    stroke-linejoin: round;
    pointer-events: none;
}

.risk-map-marker-label.is-hidden,
.risk-map-marker-connector.is-hidden {
    display: none;
}

.risk-map-marker-state {
    fill: #e2e8f0;
    font-size: 16px;
    font-weight: 900;
    paint-order: stroke;
    stroke: #06101f;
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

.risk-map-marker-state.is-up {
    fill: #6ee7b7;
}

.risk-map-marker-state.is-down {
    fill: #fda4af;
}

.risk-map-marker-state.is-flat {
    fill: #cbd5e1;
}

.risk-map-marker-change {
    font-size: 12px;
    font-weight: 800;
}

.risk-map-marker-change.is-up,
.risk-map-mini-change.is-up {
    fill: #6ee7b7;
    color: #6ee7b7;
}

.risk-map-marker-change.is-down,
.risk-map-mini-change.is-down {
    fill: #fda4af;
    color: #fda4af;
}

.risk-map-marker-change.is-flat,
.risk-map-mini-change.is-flat {
    fill: #cbd5e1;
    color: #cbd5e1;
}

.risk-map-marker-active .risk-map-marker-label {
    fill: #ffffff;
}

.risk-map-empty {
    fill: #94a3b8;
    font-size: 20px;
    font-weight: 600;
}

.risk-map-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    min-width: 176px;
    max-width: min(240px, calc(100% - 1rem));
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(129, 140, 248, 0.62);
    border-radius: 0.8rem;
    background: rgba(5, 12, 27, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(15, 23, 42, 0.6);
    color: #cbd5e1;
    direction: rtl;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 1rem)) scale(0.96);
    transform-origin: bottom center;
    transition: opacity .16s ease, transform .16s ease;
}

.risk-map-tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 1rem)) scale(1);
}

.risk-map-tooltip-market,
.risk-map-tooltip-indicator {
    display: block;
}

.risk-map-tooltip-market {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
}

.risk-map-tooltip-indicator {
    margin-top: 0.12rem;
    color: #f8fafc;
    font-size: 0.8rem;
}

.risk-map-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 0.38rem;
    color: #cbd5e1;
    font-size: 0.68rem;
}

.risk-map-tooltip-row b {
    color: #64748b;
    font-weight: 700;
}

.risk-map-tooltip-row .is-up {
    color: #6ee7b7;
}

.risk-map-tooltip-row .is-down {
    color: #fda4af;
}

.risk-map-tooltip-row .is-flat {
    color: #cbd5e1;
}

.risk-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
}

.risk-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.risk-map-legend i {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    box-shadow: 0 0 8px currentColor;
}

.risk-map-legend-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-top: 0.9rem;
}

.risk-map-help {
    flex: none;
    margin: 0;
    color: #64748b;
    font-size: 0.68rem;
}

.risk-legend-dot {
    background: #fbbf24;
}

.risk-legend-dot.risk-legend-up {
    background: #34d399;
}

.risk-legend-dot.risk-legend-down {
    background: #fb7185;
}

.risk-map-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.risk-map-mini-card {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid rgba(71, 85, 105, 0.48);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.54);
    color: #cbd5e1;
    text-align: right;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.risk-map-mini-card:hover,
.risk-map-mini-card:focus-visible,
.risk-map-mini-card.is-selected {
    border-color: rgba(96, 165, 250, 0.8);
    background: rgba(30, 58, 138, 0.18);
    transform: translateY(-1px);
}

.risk-map-mini-name,
.risk-map-mini-indicator,
.risk-map-mini-symbol,
.risk-map-mini-change,
.risk-map-mini-pressure {
    display: block;
}

.risk-map-mini-name {
    color: #e2e8f0;
    font-size: 0.73rem;
    font-weight: 750;
    line-height: 1.4;
}

.risk-map-mini-indicator {
    margin-top: 0.15rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.risk-map-mini-symbol {
    margin-top: 0.1rem;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.62rem;
    font-weight: 700;
}

.risk-map-mini-change {
    margin-top: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.risk-map-mini-pressure {
    margin-top: 0.2rem;
    color: #94a3b8;
    font-size: 0.62rem;
}

.risk-map-mini-pressure::before {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-inline-end: 0.28rem;
    border-radius: 999px;
    background: var(--map-pressure);
    content: "";
}

/* Global Risk — consistent market glance cards */
.market-glance-group {
    min-width: 0;
}

.market-glance-group-title {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.market-glance-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.market-glance-card {
    display: flex;
    min-width: 0;
    min-height: 7.7rem;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.85rem;
    border: 1px solid rgba(30, 41, 59, 0.85);
    border-radius: 0.75rem;
    background: #020617;
}

.market-glance-card-head {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.market-glance-name {
    min-width: 0;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.market-glance-symbol {
    flex: none;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.625rem;
    font-variant-numeric: tabular-nums;
}

.market-glance-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
    direction: rtl;
}

.market-glance-metric {
    min-width: 0;
    text-align: center;
}

.market-glance-label {
    display: block;
    min-height: 1.9em;
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.25;
}

.market-glance-number {
    display: block;
    overflow: hidden;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.73rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-glance-bond-direction {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(51, 65, 85, 0.55);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.market-glance-bond-update {
    margin-top: 0.28rem;
    color: #94a3b8;
    font-size: 0.62rem;
    line-height: 1.45;
    text-align: center;
}

.market-glance-bond-update-late {
    color: #fbbf24;
}

.market-glance-status {
    justify-content: center;
    text-align: center;
}

.market-glance-status-value {
    margin-top: 0.75rem;
    color: #e2e8f0;
    font-size: 0.85rem;
}

@media (max-width: 700px) {
    #riskMarketsGrid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.25rem;
    }

    .market-glance-group-title {
        margin-bottom: 0.7rem;
        font-size: 0.8rem;
    }

    .market-glance-card {
        min-height: 7.4rem;
        padding: 0.85rem;
    }

    .market-glance-metrics {
        gap: 0.55rem;
    }

    .market-glance-number {
        font-size: 0.72rem;
    }
}

@media (max-width: 700px) {
    .risk-map-shell,
    .risk-world-map {
        min-height: 250px;
    }

    .risk-map-legend-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .risk-map-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 420px) {
    .risk-map-marker-label,
    .risk-map-marker-connector {
        display: none;
    }
}

.scout-art-mount {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-width: 0;
    aspect-ratio: 11 / 15;
    align-self: center;
    background:
        radial-gradient(circle at 42% 18%, rgba(245, 158, 11, 0.08), transparent 34%),
        linear-gradient(145deg, rgba(15, 31, 56, 0.9), rgba(2, 6, 23, 0.98));
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.scout-art-svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.scout-panel {
    display: grid;
    grid-template-columns: minmax(150px, 0.95fr) minmax(0, 1.15fr);
    gap: 1.25rem;
    min-width: 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(34, 211, 238, 0.09), transparent 35%),
        radial-gradient(circle at 88% 92%, rgba(167, 139, 250, 0.1), transparent 42%),
        rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(167, 139, 250, 0.28) !important;
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.08), 0 18px 42px rgba(2, 6, 23, 0.28);
}

.scout-copy {
    min-width: 0;
    width: 100%;
    align-items: center;
    justify-self: stretch;
    text-align: center !important;
}

.scout-copy h2,
.scout-copy h3,
.scout-copy p {
    text-align: center !important;
}

.scout-copy h2 {
    margin-inline: auto !important;
}

.scout-copy h3 {
    width: 100%;
    margin-inline: auto;
    color: #f8fafc !important;
    text-shadow: 0 0 18px rgba(167, 139, 250, 0.18);
}

.scout-copy p {
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
    color: #f8fafc !important;
}

.risk-scout-highlight {
    font-weight: 700;
}

.risk-scout-highlight-warning { color: #fbbf24; }
.risk-scout-highlight-topic { color: #7dd3fc; }
.risk-scout-highlight-positive { color: #34d399; }

.scout-art-mount {
    border-color: rgba(167, 139, 250, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(148, 163, 184, 0.1),
        0 0 0 1px rgba(34, 211, 238, 0.06),
        0 18px 40px rgba(0, 0, 0, 0.24);
}

#scoutMeta {
    justify-content: center !important;
    width: 100%;
}

#scoutMeta > div {
    justify-content: center;
    text-align: center;
    gap: 0.5rem !important;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.48);
}

#scoutMeta > div:first-child {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(120, 53, 15, 0.2);
}

#scoutMeta > div:last-child {
    color: #a78bfa !important;
    border-color: rgba(167, 139, 250, 0.28);
    background: rgba(76, 29, 149, 0.2);
}

#scoutMeta > div > span:last-child {
    color: inherit !important;
}

.scout-copy h3,
.scout-copy p {
    overflow-wrap: anywhere;
}

.scout-art-svg .sc-lamp {
    animation: scout-lamp-pulse 2.4s ease-in-out infinite;
    transform-origin: center;
}

.scout-art-svg .sc-sweep {
    animation: scout-sweep 5.2s linear infinite;
}

@keyframes risk-map-pulse {
    0%, 100% { opacity: 0.08; transform: scale(0.72); }
    50% { opacity: 0.27; transform: scale(1.15); }
}

@keyframes scout-lamp-pulse {
    0%, 100% { opacity: 0.64; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.22); }
}

@keyframes scout-sweep {
    from { transform: rotate(-40deg); }
    to { transform: rotate(320deg); }
}

@media (max-width: 640px) {
    .scout-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .scout-art-mount {
        width: min(100%, 220px);
        justify-self: center;
    }

    .scout-copy {
        text-align: center;
    }

    .scout-copy h2 {
        margin-left: auto;
        margin-right: auto;
    }

    #scoutMeta {
        justify-content: center;
    }

    .risk-map-shell,
    .risk-world-map {
        min-height: 230px;
    }

    .risk-map-marker-label {
        font-size: 20px;
    }
}

/* ---- Table Styles ---- */
table {
    border-collapse: collapse;
}

/* ---- Sahaba Signals Direction Colors ---- */
.signal-buy {
    color: #22c55e; /* green-500 */
}

.signal-sell {
    color: #ef4444; /* red-500 */
}

/* ---- Closed Signal Row Styling ---- */
/* Win/Loss signals get slightly reduced opacity but remain clickable */
.closed-row {
    opacity: 0.75;
}

.closed-row:hover {
    opacity: 0.9;
}

/* ---- Locked Signal Row Styling ---- */
/* Active signals that require subscription - NO blur/opacity on row */
/* Only specific columns (Symbol, Signal Price, Last Price) show lock icons or dashes */
/* Row looks completely normal; locked fields handled in JS renderer */
.locked-row {
    /* No blur, no opacity - row looks normal */
    /* Locked behavior is handled per-cell in the JS renderer */
}

/* Locked rows still allow favorites star interaction (first column) */
.locked-row td:first-child {
    pointer-events: auto;
}

/* ---- Responsive Utilities ---- */
@media (max-width: 640px) {
    .widget {
        padding: 1rem;
    }
    
    .widget:hover {
        transform: none;
    }
}

/* ---- Light Mode Support (optional) ---- */
html:not(.dark) body {
    background: #f1f5f9;
    color: #0f172a;
}

html:not(.dark) .bg-dark-900 {
    background: #ffffff;
}

html:not(.dark) .bg-dark-950 {
    background: #f1f5f9;
}

html:not(.dark) .border-dark-700 {
    border-color: #e2e8f0;
}

html:not(.dark) .text-white {
    color: #0f172a;
}

html:not(.dark) .text-dark-300,
html:not(.dark) .text-dark-400 {
    color: #64748b;
}

/* ---- Live Feed Scroll ---- */
#liveFeedContainer {
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

#liveFeedContainer::-webkit-scrollbar {
    width: 4px;
}

#liveFeedContainer::-webkit-scrollbar-track {
    background: transparent;
}

#liveFeedContainer::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

/* ---- Monthly Stats Card Hover ---- */
#monthlyStatsGrid > div {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#monthlyStatsGrid > div:hover {
    transform: translateY(-2px);
    border-color: rgba(234, 179, 8, 0.3);
}

/* ---- Top/Worst Trades Hover ---- */
#topTradesContainer > div,
#worstTradesContainer > div {
    transition: background-color 0.2s ease;
}

#topTradesContainer > div:hover,
#worstTradesContainer > div:hover {
    background-color: rgba(30, 41, 59, 0.8);
}

/* ---- Toggle Switch ---- */
.peer:checked + div {
    background-color: #eab308;
}

/* ---- Print Styles ---- */
@media print {
    .sidebar,
    header {
        display: none;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
}

/* ---- Winning Signals Card Background ---- */
.winning-signals-card {
    position: relative;
}


/* ---- Losing Signals Card Background ---- */
.losing-signals-card {
    position: relative;
}


/* ---- Best Trade Card Background ---- */


/* ---- Sahaba Card 3-Zone Layout (shared by Market Events & Market Catalysts) ---- */
.sahaba-card-header {
    position: absolute;
    top: 12px;
    right: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    z-index: 3;
}

.sahaba-card-body {
    position: absolute;
    top: 42px;
    bottom: 36px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

.sahaba-card-footer {
    position: absolute;
    bottom: 10px;
    left: 14px;
    font-size: 12px;
    z-index: 3;
}

.event-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    width: 100%;
}

.event-row + .event-row {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(245,199,106,0.08);
}

/* Compact card section labels */
.catalyst-section-label {
    display: flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #6B9AB8;
    margin-bottom: 6px;
    padding-inline-start: 6px;
    border-inline-start: 2px solid rgba(107,154,184,0.35);
    line-height: 1;
}

.catalyst-section-label--upcoming {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(245,199,106,0.07);
}

/* ── Today-released informational badge on the card ── */
.catalyst-today-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: #F5C76A;
    background: rgba(245,199,106,0.08);
    border: 1px solid rgba(245,199,106,0.18);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.catalyst-today-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F5C76A;
    flex-shrink: 0;
    animation: pulse-gold 2s infinite;
}
@keyframes pulse-gold {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ── Card section headers (compact, inside the dashboard card) ── */
.catalyst-card-section-header {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B9AB8;
    padding: 2px 0 4px;
    margin-top: 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(107,154,184,0.15);
}
.catalyst-card-section-header:first-child {
    margin-top: 0;
}
.catalyst-card-section-header.released {
    color: #e9b96a;
    border-bottom-color: rgba(245,199,106,0.20);
}
.catalyst-card-section-header.released-dot::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #F5C76A;
    margin-inline-end: 5px;
    vertical-align: middle;
    animation: pulse-gold 2s infinite;
}

/* ── Modal section headers ── */
.catalyst-modal-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B9AB8;
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(107,154,184,0.15);
}
.catalyst-modal-section-header.released {
    margin-top: 20px;
    color: #9CA3AF;
    border-bottom-color: rgba(156,163,175,0.15);
}

/* ── Primary Event Compact Card (dashboard card view) ── */
.primary-event-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(245, 199, 106, 0.40);
    background: linear-gradient(135deg, rgba(245,199,106,0.07) 0%, rgba(4,11,28,0.0) 100%);
    box-shadow: 0 0 14px rgba(245,199,106,0.08), inset 0 0 0 1px rgba(245,199,106,0.04);
    margin-bottom: 6px;
}

.primary-event-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #F5C76A;
    opacity: 0.85;
    margin-bottom: 1px;
}

.primary-event-name {
    font-size: 15px;
    font-weight: 700;
    color: #FFF8E7;
    line-height: 1.3;
    text-shadow: 0 0 10px rgba(245,199,106,0.18);
}

.primary-event-data {
    font-size: 11px;
    color: #B8A87A;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
}

/* ── Primary Event Modal Header & Card ── */
.primary-event-modal-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #F5C76A;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(245,199,106,0.25);
}

.primary-event-modal-card {
    border-radius: 10px;
    border: 1px solid rgba(245,199,106,0.35) !important;
    box-shadow: 0 0 18px rgba(245,199,106,0.10);
    overflow: hidden;
}

.primary-event-modal-card > div {
    border: none !important;
    margin-bottom: 0 !important;
}

/* ── Fed Day Grouping ── */
.fed-day-group-card {
    position: relative;
    margin-bottom: 2px;
}

.fed-day-note {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    color: #8B7B5A;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    padding-inline-start: 6px;
    border-inline-start: 2px solid rgba(245,199,106,0.20);
}

.event-name {
    font-size: 14px;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.35;
    color: #F5E6C8;
    text-shadow: 0 0 8px rgba(0,0,0,0.5);
    width: 100%;
}

.event-meta {
    font-size: 11px;
    color: #8DA3B8;
    opacity: 0.80;
    line-height: 1.4;
}

/* Timing line: slightly brighter so it reads first */
.event-meta--time {
    color: #9BB8D0;
    opacity: 0.90;
    font-size: 11px;
}

/* Data line: dimmer, smaller — clearly secondary */
.event-meta--data {
    color: #7A9AB5;
    opacity: 0.78;
    font-size: 10.5px;
}

.event-type {
    color: #F5C76A;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.3;
}

.macro-tooltip-trigger {
    display: inline-block;
    cursor: pointer;
    color: #9FB3C8;
    font-size: 13px;
    position: relative;
    vertical-align: middle;
    margin-inline-start: 4px;
    transition: color 0.2s;
}

.macro-tooltip-trigger:hover {
    color: #F5C76A;
}

.macro-tooltip-popup {
    position: fixed;
    background: #1a2332;
    color: #d1d5db;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(245, 199, 106, 0.2);
    white-space: normal;
    width: 240px;
    max-width: 80vw;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 9999;
    text-align: start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.macro-tooltip-popup.tooltip-visible {
    opacity: 1;
    visibility: visible;
}

.event-time {
    color: #9FB3C8;
    font-size: 13px;
    line-height: 1.3;
}

.value-positive {
    color: #00e676;
    font-weight: 600;
}

.value-negative {
    color: #ff5252;
    font-weight: 600;
}

.value-neutral {
    color: #cfd8dc;
}

/* Numeric metric highlights — Market Catalysts compact card */
.metric-highlight {
    color: #f5c76a;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.metric-time {
    color: #6ee7b7;
    font-weight: 500;
}

/* ---- Market Events Card Background ---- */
.market-events-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
}



/* ---- Macro Catalysts Card Background ---- */
.macro-catalysts-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

/* Macro-catalysts card body: exit absolute positioning, flow naturally */
#cardMacroCatalysts .sahaba-card-body {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: start;
    gap: 0;
    padding-top: 18px;      /* clears the absolute-positioned card header (~30px tall at top:12px) */
    padding-bottom: 26px;   /* clears the absolute-positioned footer */
    overflow: visible;
    flex: 1;
    width: 100%;
}

/* ---- Active Signals Card Background ---- */
.active-signals-card {
    position: relative;
}

/* ---- Total Signals Card Background (Sahaba Eagle) ---- */
.total-signals-card {
    position: relative;
    overflow: hidden;
}

/* =============================================
   RTL (Right-to-Left) SUPPORT FOR ARABIC
   ============================================= */

/* Base RTL styles */
body.lang-ar {
    direction: rtl;
}

body.lang-en {
    direction: ltr;
}

/* RTL text alignment */
body.lang-ar .sidebar,
body.lang-ar .main-content,
body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar p {
    text-align: right;
}

/* RTL table headers and cells - centered for Arabic */
html[lang="ar"] table td,
html[lang="ar"] table th {
    text-align: center !important;
}

/* RTL navigation hover effect */
body.lang-ar .nav-item:hover {
    transform: translateX(-4px);
}

/* RTL flex row reversals for specific elements */
body.lang-ar .flex-row-reverse-ar {
    flex-direction: row-reverse;
}

/* RTL margin/padding adjustments */
body.lang-ar .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

body.lang-ar .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Keep numbers LTR in RTL mode */
body.lang-ar .ltr-numbers {
    direction: ltr;
    unicode-bidi: embed;
}

/* RTL input text alignment */
body.lang-ar input,
body.lang-ar textarea {
    text-align: right;
}

/* RTL select elements */
body.lang-ar select {
    text-align: right;
    padding-right: 2.5rem;
    padding-left: 0.75rem;
}

/* Language toggle styling */
.lang-toggle button {
    transition: all 0.2s ease;
}

.lang-toggle button:hover {
    opacity: 0.9;
}

.lang-toggle button.active {
    font-weight: 600;
}

/* Sidebar navigation RTL - icon on right, text on left */
body.lang-ar .sidebar .nav-item {
    flex-direction: row-reverse;
    text-align: right;
}

body.lang-ar .sidebar .nav-item svg {
    margin-left: 0;
    margin-right: 0;
}

/* Keep LTR layout for English sidebar */
body.lang-en .sidebar .nav-item {
    flex-direction: row;
    text-align: left;
}

/* Keep layout stable - don't reverse the main grid */
body.lang-ar .flex.h-screen {
    flex-direction: row;
}

/* Ensure stats cards text aligns properly */
body.lang-ar [data-testid^="card-"] p,
body.lang-ar [data-testid^="card-"] h3 {
    text-align: right;
}

/* Arabic font family for better rendering */
body.lang-ar {
    font-family: 'Segoe UI', Tahoma, 'Arial Unicode MS', Arial, sans-serif;
}

/* ---- Sticky Table Columns ---- */
/* Sticky columns for signals table - works with both RTL and LTR */

/* Favorite/Star column - first sticky column */
.sticky-favorite-col {
    position: sticky;
    z-index: 10;
    background-color: #0f172a;
}

/* LTR (English): sticky to the left */
[dir="ltr"] .sticky-favorite-col {
    left: 0;
    border-right: 1px solid #334155;
}

/* RTL (Arabic): sticky to the right */
[dir="rtl"] .sticky-favorite-col {
    right: 0;
    border-left: 1px solid #334155;
}

/* Symbol column - second sticky column */
.sticky-symbol-col {
    position: sticky;
    z-index: 9;
    background-color: #0f172a;
}

/* LTR (English): sticky to the left, offset by favorite column width (40px) */
[dir="ltr"] .sticky-symbol-col {
    left: 40px;
    border-right: 1px solid #334155;
}

/* RTL (Arabic): sticky to the right, offset by favorite column width (40px) */
[dir="rtl"] .sticky-symbol-col {
    right: 40px;
    border-left: 1px solid #334155;
}

/* Header cells need higher z-index to stay above body cells when scrolling */
thead .sticky-favorite-col {
    z-index: 25;
}

thead .sticky-symbol-col {
    z-index: 24;
}

/* Ensure proper background on hover for sticky cells */
.sticky-favorite-col:hover,
.sticky-symbol-col:hover {
    background-color: #0f172a;
}

/* =============================================
   iOS PWA SAFE AREA SUPPORT
   Ensures content is not obscured by notch/status bar
   ============================================= */

/* Apply safe area padding to main app headers - FINAL FIX */
.app-header {
    padding-top: calc(var(--safe-top) + 24px) !important;
    padding-bottom: 12px;
}

/* For centered pages without traditional headers */
.safe-top {
    padding-top: calc(var(--safe-top) + 24px) !important;
}

/* Apply safe area padding to main content containers */
.app-content,
.safe-bottom {
    padding-bottom: var(--safe-bottom);
}

/* Apply safe area to sidebar (for iOS landscape) */
.sidebar {
    padding-left: var(--safe-left);
}

[dir="rtl"] .sidebar {
    padding-left: 0;
    padding-right: var(--safe-right);
}

/* Standalone PWA specific adjustments */
@media all and (display-mode: standalone) {
    .app-header {
        padding-top: calc(var(--safe-top) + 24px) !important;
        padding-bottom: 12px;
    }
    
    .safe-top {
        padding-top: calc(var(--safe-top) + 24px) !important;
    }
    
    /* Ensure body doesn't scroll behind status bar */
    body {
        padding-top: var(--safe-top);
    }
    
    /* Remove body padding if using app-header class */
    body:has(.app-header) {
        padding-top: 0;
    }
}

/* =============================================
   PRICE FLASH ANIMATIONS
   Subtle background flashes when prices update
   ============================================= */

/* Green flash for price going UP */
.price-flash-up {
    animation: priceFlashUp 0.8s ease-out;
}

/* Red flash for price going DOWN */
.price-flash-down {
    animation: priceFlashDown 0.8s ease-out;
}

@keyframes priceFlashUp {
    0% {
        background-color: rgba(34, 197, 94, 0.35);  /* green-500 with opacity */
    }
    100% {
        background-color: transparent;
    }
}

@keyframes priceFlashDown {
    0% {
        background-color: rgba(239, 68, 68, 0.35);  /* red-500 with opacity */
    }
    100% {
        background-color: transparent;
    }
}

/* =============================================
   ROW FLASH ANIMATIONS
   Full row flashes when prices update
   ============================================= */

/* Green flash for entire row when price went UP */
.row-flash-up {
    animation: rowFlashUp 0.9s ease-out;
}

/* Red flash for entire row when price went DOWN */
.row-flash-down {
    animation: rowFlashDown 0.9s ease-out;
}

@keyframes rowFlashUp {
    0% {
        background-color: rgba(0, 200, 0, 0.25);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes rowFlashDown {
    0% {
        background-color: rgba(220, 0, 0, 0.25);
    }
    100% {
        background-color: transparent;
    }
}

/* =============================================
   STRONG MOVE ANIMATION
   Golden pulse for big price jumps (>= 2%)
   ============================================= */

.row-strong-move {
    animation: strongPulse 1.4s ease-out;
}

@keyframes strongPulse {
    0% {
        background-color: rgba(255, 215, 0, 0.28);
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.45);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* =============================================
   SHARE APP MESSAGE ANIMATION
   Fade in/out for clipboard copy confirmation
   ============================================= */

.share-app-msg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-app-msg.show {
    opacity: 1;
}

/* =============================================
   CARD HELP BUTTON
   Interactive help icons on dashboard cards
   ============================================= */

.card-help-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.6;
    z-index: 5;
}

.card-help-btn:hover {
    background: rgba(234, 179, 8, 0.25);
    border-color: rgba(234, 179, 8, 0.5);
    opacity: 1;
    transform: scale(1.1);
}

.card-help-btn svg {
    width: 14px;
    height: 14px;
}

/* RTL Support - flip to left corner */
[dir="rtl"] .card-help-btn {
    right: auto;
    left: 8px;
}

/* Overlay variant for cards with background images */
.card-help-btn-overlay {
    background: rgba(234, 179, 8, 0.15);
    backdrop-filter: blur(4px);
    opacity: 0.7;
}

.card-help-btn-overlay:hover {
    opacity: 1;
}

/* Ensure all widget cards have position relative for absolute positioning */
.widget {
    position: relative;
}

/* ---- Chart Modal Range Tabs ---- */
.chart-range-tab {
    background: transparent;
    color: #94a3b8;
    border: 1px solid transparent;
}

.chart-range-tab:hover {
    background: rgba(234, 179, 8, 0.1);
    color: #facc15;
}

.chart-range-tab.active {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border-color: rgba(234, 179, 8, 0.4);
}

/* Clickable card indicator - subtle chart icon on hover */
.market-status-card::after,
.fear-index-card::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23facc15' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7 12l3-3 3 3 4-4'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
}

.market-status-card:hover::after,
.fear-index-card:hover::after,
.market-status-card:focus::after,
.fear-index-card:focus::after {
    opacity: 0.6;
}

/* RTL support for chart indicator */
[dir="rtl"] .market-status-card::after,
[dir="rtl"] .fear-index-card::after {
    right: auto;
    left: 8px;
}

/* ---- Card Background Layer System ---- */
/* All cards with background images now use the img-based pattern:
   <div class="absolute inset-0 z-0 overflow-hidden rounded-xl">
       <img src="..." class="w-full h-full object-cover" style="opacity: X;">
       <div class="absolute inset-0 bg-black/50"></div>
   </div>
   <div class="relative z-10">content</div>
   This pattern works reliably on Chrome Desktop and Mobile. */

/* ---- Portfolio Value Animation ---- */
/* Subtle fade transition for numeric value updates */
.portfolio-value-animate {
    transition: opacity 200ms ease-in-out;
}

.portfolio-value-fade-out {
    opacity: 0;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .portfolio-value-animate {
        transition: none;
    }
    .portfolio-value-fade-out {
        opacity: 1;
    }
}

/* ---- Sahaba Flash Animation System ---- */
/* Unified flash animations for live-updating dashboard cards
   - Subtle visual pulse to signal fresh data updates
   - Triggers ONLY when displayed values actually change
   - No layout shift, no resize, uses opacity + soft glow only */

/* Flash Up (green) - Positive / improvement */
.sahaba-flash-up,
.midan-flash-up {
    animation: sahabaFlashUp 700ms ease-out;
}

/* Flash Down (red) - Negative / deterioration */
.sahaba-flash-down,
.midan-flash-down {
    animation: sahabaFlashDown 700ms ease-out;
}

/* Flash Neutral (gold) - Informational refresh / unchanged direction */
.sahaba-flash-neutral {
    animation: sahabaFlashNeutral 700ms ease-out;
}

@keyframes sahabaFlashUp {
    0% {
        box-shadow: inset 0 0 0 1px rgba(60, 220, 140, 0.4), 0 0 8px rgba(60, 220, 140, 0.25);
        background-color: rgba(60, 220, 140, 0.08);
    }
    100% {
        box-shadow: none;
        background-color: transparent;
    }
}

@keyframes sahabaFlashDown {
    0% {
        box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.4), 0 0 8px rgba(255, 90, 90, 0.25);
        background-color: rgba(255, 90, 90, 0.08);
    }
    100% {
        box-shadow: none;
        background-color: transparent;
    }
}

@keyframes sahabaFlashNeutral {
    0% {
        box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.4), 0 0 8px rgba(212, 175, 55, 0.25);
        background-color: rgba(212, 175, 55, 0.08);
    }
    100% {
        box-shadow: none;
        background-color: transparent;
    }
}

/* Pulse Refresh Animation - Subtle neutral pulse on every successful refresh */
/* Triggers on auto-refresh even when values don't change */
.pulse-refresh {
    animation: sahabaPulseRefresh 400ms ease-in-out;
}

@keyframes sahabaPulseRefresh {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
        box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.2);
    }
    100% {
        opacity: 1;
        box-shadow: none;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .sahaba-flash-up,
    .sahaba-flash-down,
    .sahaba-flash-neutral,
    .midan-flash-up,
    .midan-flash-down,
    .pulse-refresh {
        animation: none;
    }
}

/* =============================================
   AHA OVERLAY - One-Time Onboarding Experience
   Scoped styles - does NOT affect other pages
   ============================================= */

/* CRITICAL: Block body scroll and background interactions during tour */
body.aha-tour-active {
    overflow: hidden !important;
}

/* Block all pointer events on main content during tour */
body.aha-tour-active main,
body.aha-tour-active header,
body.aha-tour-active aside,
body.aha-tour-active nav {
    pointer-events: none !important;
}

/* Overlay backdrop - dims entire dashboard */
.aha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    transition: background 0.5s ease;
    pointer-events: all;
}

.aha-overlay.aha-active {
    background: rgba(0, 0, 0, 0.85);
}

/* Step 2: ZERO DIMMING - overlay must be completely transparent 
   Higher specificity to override .aha-active */
.aha-overlay.aha-active.aha-step2-clear {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
}

/* Double-ensure body class variant works too */
body .aha-overlay.aha-step2-clear {
    background: transparent !important;
    background-color: transparent !important;
}

/* Spotlight effect for Best Signal card */
.aha-spotlight-target {
    position: relative;
    z-index: 10001 !important;
    box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.6), 0 0 40px rgba(234, 179, 8, 0.4) !important;
    transform: scale(1.02);
    transition: all 0.4s ease;
}

/* Center content container */
.aha-center-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    text-align: center;
    max-width: 90vw;
    width: 400px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.aha-center-content.aha-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Aha text styling */
.aha-text {
    color: #fff;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Dark background container for NON-DIM steps (2, 3, 6, 7)
   Ensures text readability without screen dimming */
.aha-text-bg {
    background-color: rgba(2, 6, 23, 0.75);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
    line-height: 1.5;
}

.aha-text-bg .aha-text {
    text-shadow: none;
    margin-bottom: 1rem;
}

.aha-text-bg .aha-text:last-child {
    margin-bottom: 0;
}

.aha-text-bg .aha-button {
    margin-top: 1rem;
}

.aha-text-large {
    font-size: 1.5rem;
    font-weight: 500;
}

.aha-text-small {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Aha example card */
.aha-example-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.aha-example-symbol {
    font-size: 1.75rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 0.5rem;
}

.aha-example-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.aha-example-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: #fff;
    font-size: 0.9rem;
}

.aha-example-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.aha-stat-positive {
    color: #4ade80;
}

/* Aha button */
.aha-button {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #000;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
    /* CRITICAL: Ensure button is always clickable */
    pointer-events: auto !important;
    position: relative;
    z-index: 10003;
}

.aha-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(234, 179, 8, 0.4);
}

.aha-button:active {
    transform: translateY(0);
}

/* Aha question text */
.aha-question {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1.25rem;
}

/* Cards fade effect for step 5 - very low opacity, visible but unreadable */
.aha-cards-hidden {
    opacity: 0.12 !important;
    filter: blur(3px);
    transition: opacity 0.5s ease, filter 0.5s ease !important;
}

/* ISSUE 2 FIX: Dim everything except spotlight targets */
.aha-dimmed {
    opacity: 0.25 !important;
    filter: blur(2px);
    transition: opacity 0.4s ease, filter 0.4s ease !important;
}

/* Spotlight targets should override parent dimming */
.aha-dimmed .aha-spotlight-target,
.aha-spotlight-target {
    opacity: 1 !important;
    filter: none !important;
    position: relative;
    z-index: 10002;
}

/* Ensure overlay content remains interactive above faded content */
.aha-overlay,
.aha-center-content {
    pointer-events: auto !important;
}

/* ISSUE 4 FIX: Star spotlight - maximum visibility */
.aha-star-spotlight {
    opacity: 1 !important;
    filter: none !important;
    position: relative;
    z-index: 10004;
    background: rgba(218, 165, 32, 0.3) !important;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.8), 0 0 40px rgba(218, 165, 32, 0.4);
}

/* Table row highlight during step 2 */
.aha-row-highlight {
    position: relative;
    z-index: 10002;
    background: linear-gradient(90deg, rgba(218, 165, 32, 0.25), rgba(218, 165, 32, 0.15)) !important;
    box-shadow: 0 0 0 2px var(--gold-primary), 0 0 20px rgba(218, 165, 32, 0.3);
    animation: aha-row-glow 2s ease-in-out infinite;
}

@keyframes aha-row-glow {
    0%, 100% { box-shadow: 0 0 0 2px var(--gold-primary), 0 0 15px rgba(218, 165, 32, 0.3); }
    50% { box-shadow: 0 0 0 2px var(--gold-primary), 0 0 25px rgba(218, 165, 32, 0.5); }
}

/* Star icon pulse during step 3 */
.aha-star-pulse {
    position: relative;
    z-index: 10003;
    animation: aha-star-pulse-anim 1.2s ease-in-out infinite;
}

@keyframes aha-star-pulse-anim {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(218, 165, 32, 0.5)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 8px rgba(218, 165, 32, 0.8)); }
}

/* Hold info text in step 4 */
.aha-hold-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

/* =============================================
   VISUAL GRADATION CLASSES (Steps 2-6)
   Each step has DISTINCT dimming - NEVER share classes
   ============================================= */

/* Step 2: ORIENTATION dim - VERY LIGHT (~10% reduction) 
   Text: "من هنا تبدأ الإشارة" 
   Purpose: Show starting point, NOT emphasis */
.aha-orient-dim {
    filter: brightness(0.93) !important;
    opacity: 0.95 !important;
    transition: filter 0.3s ease, opacity 0.3s ease !important;
}

/* Step 3: Soft dim (80-85% brightness) - training signal */
.aha-soft-dim {
    filter: brightness(0.82) !important;
    opacity: 0.9 !important;
    transition: filter 0.4s ease, opacity 0.4s ease !important;
}

/* Step 4: Strong dim for star dominance (60-65% brightness) */
.aha-action-dim {
    filter: brightness(0.62) !important;
    opacity: 0.75 !important;
    transition: filter 0.4s ease, opacity 0.4s ease !important;
}

/* Step 3: Soft row highlight - context, not action */
.aha-row-soft-highlight {
    position: relative;
    z-index: 10002;
    background: rgba(218, 165, 32, 0.14) !important;
    border: 1px solid rgba(218, 165, 32, 0.3);
    transition: background 0.3s ease, border 0.3s ease;
}

/* Step 3: TRAINING ROW - Soft glow to indicate "this is the training unit"
   - Light border + subtle background tint
   - NO animation (calm, not interactive)
   - Purpose: Visual anchor, NOT call to action */
.aha-row-training {
    position: relative;
    z-index: 10002;
    background: rgba(218, 165, 32, 0.12) !important;
    border: 1px solid rgba(218, 165, 32, 0.4) !important;
    border-radius: 6px;
    transition: background 0.3s ease, border 0.3s ease;
}

/* Step 4: STAR PULSE - One-time attention grab animation
   - Single strong flash to catch the eye
   - Duration: 600ms, plays ONCE
   - Purpose: Initial attention, then calms down */
.aha-star-pulse {
    position: relative;
    z-index: 10010 !important;
    animation: aha-star-attention-pulse 600ms ease-out forwards;
}

@keyframes aha-star-attention-pulse {
    0% { 
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
    }
    40% { 
        transform: scale(1.6);
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1)) drop-shadow(0 0 50px rgba(255, 215, 0, 0.9));
    }
    100% { 
        transform: scale(1.25);
        filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 24px rgba(255, 215, 0, 0.7));
    }
}

/* Step 4: STAR STEADY - Persistent glow after pulse completes
   - No animation, just a calm golden glow
   - Slight scale (1.25) for emphasis
   - Purpose: Maintained focus without distraction */
.aha-star-steady {
    position: relative;
    z-index: 10010 !important;
    transform: scale(1.25);
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 24px rgba(255, 215, 0, 0.7)) !important;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Legacy class - redirects to new steady state */
.aha-star-action {
    position: relative;
    z-index: 10010 !important;
    transform: scale(1.25);
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 24px rgba(255, 215, 0, 0.7)) !important;
}

/* Step 4/5: Full brightness row - action emphasis */
.aha-row-focus {
    position: relative;
    z-index: 10002;
    filter: brightness(1) !important;
    opacity: 1 !important;
    background: rgba(218, 165, 32, 0.28) !important;
    box-shadow: 0 0 0 2px var(--gold-primary), 0 0 25px rgba(218, 165, 32, 0.4);
    transition: all 0.3s ease;
}

/* Step 4/5: Intense star spotlight - strong gold glow */
.aha-star-intense {
    position: relative;
    z-index: 10004;
    filter: drop-shadow(0 0 12px rgba(218, 165, 32, 0.9)) drop-shadow(0 0 24px rgba(218, 165, 32, 0.6)) !important;
    transform: scale(1.15);
    transition: transform 0.3s ease, filter 0.3s ease;
    animation: aha-star-intense-pulse 1.5s ease-in-out infinite;
}

@keyframes aha-star-intense-pulse {
    0%, 100% { 
        transform: scale(1.15); 
        filter: drop-shadow(0 0 12px rgba(218, 165, 32, 0.9)) drop-shadow(0 0 24px rgba(218, 165, 32, 0.6)) !important;
    }
    50% { 
        transform: scale(1.25); 
        filter: drop-shadow(0 0 16px rgba(218, 165, 32, 1)) drop-shadow(0 0 32px rgba(218, 165, 32, 0.8)) !important;
    }
}

/* Step 4/5: Mute sibling rows while one is focused */
.aha-table-muted tr:not(.aha-row-focus) {
    filter: brightness(0.6) !important;
    opacity: 0.5 !important;
}

/* RTL support for Aha overlay */
[dir="rtl"] .aha-example-stats {
    flex-direction: row-reverse;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .aha-overlay,
    .aha-center-content,
    .aha-spotlight-target,
    .aha-button,
    .aha-cards-hidden {
        transition: none;
    }
    .aha-row-highlight {
        animation: none;
    }
    .aha-star-pulse {
        animation: none;
    }
}

/* =============================================
   MOBILE-FIRST AHA OVERLAY ADJUSTMENTS
   ============================================= */
@media (max-width: 640px) {
    .aha-center-content {
        width: 90%;
        max-width: 340px;
        padding: 1.5rem 1.25rem;
    }
    
    /* ISSUE 1 FIX: Step 1 text appears BELOW card on mobile */
    .aha-center-content.aha-step1-position {
        top: auto;
        bottom: 15%;
        transform: translateX(-50%);
    }
    
    .aha-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .aha-text-large {
        font-size: 1.25rem;
        line-height: 1.5;
    }
    
    .aha-button {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
        min-height: 48px; /* Touch-friendly */
        min-width: 140px;
    }
    
    .aha-example-card {
        padding: 1.25rem 1rem;
    }
    
    .aha-example-symbol {
        font-size: 1.5rem;
    }
    
    .aha-example-stats {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .aha-hold-info {
        font-size: 0.8rem;
    }
    
    .aha-question {
        font-size: 0.85rem;
    }
    
    /* Ensure row highlight is visible on mobile table */
    .aha-row-highlight {
        box-shadow: 0 0 0 1px var(--gold-primary), 0 0 12px rgba(218, 165, 32, 0.4);
    }
    
    /* Star pulse slightly smaller on mobile */
    .aha-star-pulse {
        animation: aha-star-pulse-mobile 1.2s ease-in-out infinite;
    }
}

@keyframes aha-star-pulse-mobile {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(218, 165, 32, 0.5)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(218, 165, 32, 0.7)); }
}

/* iOS safe area support for overlay */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .aha-center-content {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Signal News Indicator */
.news-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.news-dot-breaking {
    animation: news-pulse 1.5s ease-in-out infinite;
}
@keyframes news-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}
.news-article-row {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
}
.news-article-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.news-sentiment-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
}
.news-sentiment-positive { background: rgba(34,197,94,0.15); color: #4ade80; }
.news-sentiment-negative { background: rgba(239,68,68,0.15); color: #f87171; }
.news-sentiment-neutral { background: rgba(148,163,184,0.15); color: #94a3b8; }
.news-sentiment-mixed { background: rgba(251,191,36,0.15); color: #fbbf24; }

.news-insight-card {
    background: rgba(180,145,60,0.08);
    border: 1px solid rgba(180,145,60,0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}
.news-insight-impact-positive { background: rgba(34,197,94,0.15); color: #4ade80; }
.news-insight-impact-negative { background: rgba(239,68,68,0.15); color: #f87171; }
.news-insight-impact-neutral { background: rgba(148,163,184,0.15); color: #94a3b8; }
.news-insight-impact-mixed { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* ---- Global Risk Panorama (scoped) ---- */
.global-risk-dashboard-card {
    min-height: 142px;
    --risk-calm: #34d399;
    --risk-alert: #60a5fa;
    --risk-tension: #fbbf24;
    --risk-stress: #fb923c;
    --risk-panic: #fb7185;
}
.global-risk-dashboard-gauge {
    width: min(100%, 240px);
    height: 132px;
    margin: .15rem auto 0;
    position: relative;
}
.global-risk-dashboard-gauge-arc { width: 100%; height: 100%; display: block; overflow: visible; }
.global-risk-gauge-track, .global-risk-gauge-segment {
    fill: none;
    stroke-width: 7;
}
.global-risk-gauge-track { stroke: rgba(148, 163, 184, .13); }
.global-risk-gauge-segment { stroke-dasharray: 18.8 100; }
.global-risk-gauge-calm { stroke: var(--risk-calm); stroke-dashoffset: -.6; }
.global-risk-gauge-alert { stroke: var(--risk-alert); stroke-dashoffset: -20.6; }
.global-risk-gauge-tension { stroke: var(--risk-tension); stroke-dashoffset: -40.6; }
.global-risk-gauge-stress { stroke: var(--risk-stress); stroke-dasharray: 13.8 100; stroke-dashoffset: -60.6; }
.global-risk-gauge-panic { stroke: var(--risk-panic); stroke-dasharray: 23.8 100; stroke-dashoffset: -75.6; }
.global-risk-gauge-needle { fill: #fff; pointer-events: none; }
.global-risk-dashboard-gauge-readout {
    position: absolute;
    top: 55px;
    left: 50%;
    width: 170px;
    transform: translateX(-50%);
    text-align: center;
}
.global-risk-dashboard-score {
    color: #f8fafc;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.global-risk-dashboard-card .global-risk-dashboard-gauge .global-risk-dashboard-state {
    margin: .2rem 0 0;
    color: #cbd5e1;
    font-size: .85rem;
    font-weight: 650;
    text-align: center;
}
.global-risk-dashboard-card .global-risk-dashboard-state[data-risk-zone="calm"] { color: var(--risk-calm); }
.global-risk-dashboard-card .global-risk-dashboard-state[data-risk-zone="alert"] { color: var(--risk-alert); }
.global-risk-dashboard-card .global-risk-dashboard-state[data-risk-zone="tension"] { color: var(--risk-tension); }
.global-risk-dashboard-card .global-risk-dashboard-state[data-risk-zone="stress"] { color: var(--risk-stress); }
.global-risk-dashboard-card .global-risk-dashboard-state[data-risk-zone="panic"] { color: var(--risk-panic); }
.global-risk-dashboard-insights {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid rgba(167, 139, 250, .13);
    display: grid;
    gap: .45rem;
    min-width: 0;
}
.global-risk-dashboard-insights[hidden],
.global-risk-dashboard-insight[hidden] { display: none; }
.global-risk-dashboard-insight {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    min-width: 0;
}
.global-risk-dashboard-insight::before {
    content: '';
    flex: 0 0 .36rem;
    width: .36rem;
    height: .36rem;
    margin-top: .32rem;
    border-radius: 50%;
    background: #c4b5fd;
}
#globalRiskScoutRow::before { background: #fbbf24; }
#globalRiskScoutRow.is-weakening::before { background: #cbd5e1; }
.global-risk-dashboard-insight-value {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.4;
}
.global-risk-dashboard-insight-scout { color: #fbbf24; }
.global-risk-dashboard-insight.is-weakening .global-risk-dashboard-insight-scout { color: #cbd5e1; }
.global-risk-dashboard-insight-watch { color: #c4b5fd; }
.global-risk-dashboard-bottom-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    min-width: 0;
}
.global-risk-dashboard-bottom-row .global-risk-dashboard-insight { flex: 1 1 auto; }
.global-risk-dashboard-details-hint {
    flex: 0 0 auto;
    margin-inline-start: auto;
    white-space: nowrap;
    text-align: left;
}

.home-cloud-card {
    min-width: 0;
    height: 100%;
}
.global-risk-page { --gr-surface: rgba(15,23,42,.86); --gr-border: rgba(148,163,184,.15); --gr-cyan: #22d3ee; }
.global-risk-header { display:grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items:center; margin-bottom:1.6rem; }
.global-risk-back { color:#94a3b8; font-size:.8rem; transition:color .2s; }
.global-risk-back:hover { color:#e9d5ff; }
.global-risk-title-row { display:flex; gap: .9rem; align-items:center; grid-column:1; }
.global-risk-title-row h1 { margin:0; font-size:clamp(1.3rem,3vw,2rem); font-weight:750; color:#f8fafc; }
.global-risk-title-row p:not(.global-risk-eyebrow) { margin:.25rem 0 0; color:#94a3b8; font-size:.8rem; }
.global-risk-eyebrow { color:#a78bfa; font-size:.62rem; letter-spacing:.15em; font-weight:700; margin:0 0 .2rem; }
.global-risk-title-icon { width:48px; height:48px; border:1px solid rgba(167,139,250,.35); border-radius:14px; display:grid; place-items:center; color:#c4b5fd; background:rgba(139,92,246,.11); }
.global-risk-title-icon svg { width:26px; height:26px; }
.global-risk-update { grid-column:2; grid-row:1 / span 2; color:#94a3b8; font-size:.75rem; white-space:nowrap; }
.global-risk-live-dot { width:7px; height:7px; margin-inline-end:.35rem; display:inline-block; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.1); }
.global-risk-live-dot.is-stale { background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.1); }
.global-risk-hero, .global-risk-grid { display:grid; gap:1rem; margin-bottom:1rem; }
.global-risk-hero { grid-template-columns: 2fr repeat(3, 1fr); }
.global-risk-score-panel, .global-risk-hero-stat, .global-risk-panel { background:var(--gr-surface); border:1px solid var(--gr-border); border-radius:18px; }
.global-risk-score-panel { display:flex; gap:1rem; align-items:center; padding:1.15rem; background:linear-gradient(120deg, rgba(76,29,149,.28), rgba(15,23,42,.86) 58%); }
.global-risk-score-ring { --risk-progress: 0%; width:86px; height:86px; flex:0 0 auto; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; background:conic-gradient(#22d3ee var(--risk-progress), rgba(148,163,184,.16) 0); box-shadow:inset 0 0 0 7px #111827; }
.global-risk-score-ring strong { font-size:1.55rem; line-height:1.1; }
.global-risk-score-ring span { color:#94a3b8; font-size:.62rem; }
.global-risk-score-ring.is-panic { background:conic-gradient(#f43f5e var(--risk-progress),rgba(148,163,184,.16) 0); }
.global-risk-score-ring.is-stress { background:conic-gradient(#fb7185 var(--risk-progress),rgba(148,163,184,.16) 0); }
.global-risk-score-ring.is-tension { background:conic-gradient(#f59e0b var(--risk-progress),rgba(148,163,184,.16) 0); }
.global-risk-score-ring.is-alert { background:conic-gradient(#eab308 var(--risk-progress),rgba(148,163,184,.16) 0); }
.global-risk-score-panel h2 { margin:0; font-size:1.25rem; color:#f5f3ff; }
.global-risk-score-panel p { margin:.25rem 0 0; color:#cbd5e1; font-size:.76rem; line-height:1.55; }
.global-risk-label { color:#a78bfa !important; font-weight:700; font-size:.62rem !important; letter-spacing:.08em; }
.global-risk-hero-stat { padding:1rem; display:flex; flex-direction:column; justify-content:center; gap:.25rem; }
.global-risk-hero-stat > span, .global-risk-hero-stat small { color:#94a3b8; font-size:.67rem; }
.global-risk-hero-stat strong { color:#e2e8f0; font-size:.94rem; line-height:1.3; }
.global-risk-grid-3 { grid-template-columns:repeat(3, minmax(0,1fr)); }
.global-risk-grid-wide { grid-template-columns:repeat(2, minmax(0,1fr)); }
.global-risk-panel { padding:1rem; min-width:0; }
.global-risk-panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; margin-bottom:1rem; }
.global-risk-panel-heading p { margin:0 0 .14rem; color:#a78bfa; font-size:.62rem; letter-spacing:.1em; font-weight:700; }
.global-risk-panel-heading h2 { margin:0; font-size:.93rem; color:#f1f5f9; }
.global-risk-hint, .global-risk-svg-badge, .global-risk-health-status { font-size:.65rem; color:#94a3b8; padding:.2rem .45rem; border:1px solid rgba(148,163,184,.15); border-radius:999px; }
.global-risk-svg-badge { color:#67e8f9; border-color:rgba(34,211,238,.25); }
.global-risk-regions, .global-risk-contributions { display:flex; flex-direction:column; gap:.72rem; }
.global-risk-region > div:first-child, .global-risk-contribution > div:first-child { display:flex; justify-content:space-between; align-items:center; font-size:.75rem; }
.global-risk-region strong, .global-risk-contribution span { color:#e2e8f0; }
.global-risk-region span { color:#64748b; font-size:.64rem; margin-inline-start:.4rem; }
.global-risk-region b, .global-risk-contribution b { color:#c4b5fd; }
.global-risk-meter { height:5px; background:rgba(148,163,184,.12); border-radius:999px; overflow:hidden; margin-top:.35rem; }
.global-risk-meter i { height:100%; display:block; border-radius:inherit; background:linear-gradient(90deg, #22d3ee, #8b5cf6); }
.global-risk-scout-body { display:flex; gap:.75rem; align-items:center; }
.global-risk-scout-art { width:76px; height:76px; flex:0 0 auto; stroke:#a78bfa; fill:none; stroke-width:1.2; }
.global-risk-scout-needle { fill:#22d3ee; stroke:#22d3ee; transform-origin:50px 50px; animation:global-risk-pulse 3s ease-in-out infinite; }
.global-risk-scout-meta { color:#a78bfa !important; font-size:.62rem !important; }
.global-risk-ships { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.7rem; }
.global-risk-ship { padding:.22rem .45rem; border:1px solid rgba(148,163,184,.18); border-radius:999px; color:#cbd5e1; background:rgba(30,41,59,.45); font-size:.61rem; }
.global-risk-ship.is-building, .global-risk-ship.is-clear { color:#fbbf24; border-color:rgba(251,191,36,.3); }
.global-risk-ship.is-high, .global-risk-ship.is-critical { color:#fda4af; border-color:rgba(251,113,133,.35); }
@keyframes global-risk-pulse { 50% { transform:rotate(12deg); opacity:.65; } }
.global-risk-scout h3 { margin:0 0 .28rem; color:#e2e8f0; font-size:.82rem; }
.global-risk-scout p { margin:0; color:#94a3b8; font-size:.72rem; line-height:1.55; }
.global-risk-transmission { display:flex; flex-direction:column; gap:.45rem; }
.global-risk-transmission-row { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:.45rem; padding:.55rem; border-radius:9px; background:rgba(30,41,59,.5); font-size:.7rem; }
.global-risk-transmission-row span { color:#cbd5e1; }
.global-risk-transmission-row i { color:#a78bfa; font-style:normal; }
.global-risk-transmission-row small { grid-column:1 / -1; color:#64748b; font-size:.62rem; }
.global-risk-chart-wrap { height:185px; border-radius:10px; overflow:hidden; background:linear-gradient(180deg, rgba(30,41,59,.4), transparent); }
.global-risk-chart { width:100%; height:100%; }
.global-risk-list { display:flex; flex-direction:column; gap:.25rem; max-height:205px; overflow:auto; padding-inline-end:.25rem; }
.global-risk-list-row { display:grid; grid-template-columns:auto 1fr auto; gap:.5rem; align-items:start; padding:.55rem 0; border-bottom:1px solid rgba(148,163,184,.09); }
.global-risk-list-row:last-child { border-bottom:0; }
.global-risk-event-dot { width:7px; height:7px; margin-top:.33rem; border-radius:50%; background:#f59e0b; box-shadow:0 0 9px rgba(245,158,11,.5); }
.global-risk-list-row strong { display:block; color:#e2e8f0; font-size:.73rem; }
.global-risk-list-row p { margin:.18rem 0 0; color:#64748b; font-size:.65rem; line-height:1.45; }
.global-risk-list-row b { color:#fbbf24; font-size:.62rem; font-weight:600; }
.global-risk-health { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.global-risk-health > div { padding:.65rem; background:rgba(30,41,59,.45); border-radius:9px; display:flex; flex-direction:column; gap:.16rem; }
.global-risk-health span, .global-risk-health small { color:#64748b; font-size:.62rem; }
.global-risk-health strong { color:#e2e8f0; font-size:.76rem; }
.global-risk-health-status.is-good { color:#86efac; border-color:rgba(74,222,128,.28); }
.global-risk-health-status.is-warning { color:#fbbf24; border-color:rgba(251,191,36,.28); }
.global-risk-admin-diagnostics { margin-top:1rem; }
.global-risk-admin-note { margin:.75rem 0 0; color:#fbbf24; font-size:.72rem; line-height:1.6; }
.global-risk-map { display:flex; align-items:center; gap:.35rem; overflow:auto; padding:.35rem 0 .6rem; }
.global-risk-map-node { min-width:110px; position:relative; display:flex; flex-direction:column; gap:.15rem; padding:.75rem; border:1px solid rgba(148,163,184,.14); border-radius:12px; background:rgba(30,41,59,.45); }
.global-risk-map-node span { color:#cbd5e1; font-size:.72rem; }
.global-risk-map-node b { color:#fbbf24; font-size:1rem; }
.global-risk-map-node small { color:#64748b; font-size:.62rem; }
.global-risk-map-node i { display:block; height:4px; width:var(--risk-map-level); max-width:100%; border-radius:99px; background:linear-gradient(90deg,#22d3ee,#f59e0b,#fb7185); }
.global-risk-map-arrow { color:#a78bfa; font-size:1.1rem; }
.global-risk-storm-path { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; }
.global-risk-storm-row { display:flex; gap:.5rem; align-items:flex-start; padding:.55rem; border-radius:10px; background:rgba(30,41,59,.4); }
.global-risk-storm-row strong { display:block; color:#e2e8f0; font-size:.72rem; }
.global-risk-storm-row p { margin:.16rem 0 0; color:#64748b; font-size:.62rem; line-height:1.45; }
.global-risk-storm-dot { width:8px; height:8px; flex:0 0 auto; margin-top:.3rem; border-radius:50%; background:#64748b; }
.global-risk-storm-dot.is-confirmed { background:#fb7185; box-shadow:0 0 8px rgba(251,113,133,.6); }
.global-risk-storm-dot.is-partial { background:#fbbf24; }
.global-risk-storm-dot.is-reversed { background:#22d3ee; }
.global-risk-markets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.global-risk-market-group { padding:.55rem; border-radius:10px; background:rgba(30,41,59,.4); }
.global-risk-market-group h3 { margin:0 0 .35rem; color:#a78bfa; font-size:.68rem; }
.global-risk-market-group div { display:flex; justify-content:space-between; gap:.5rem; padding:.22rem 0; border-bottom:1px solid rgba(148,163,184,.08); }
.global-risk-market-group div:last-child { border-bottom:0; }
.global-risk-market-group span { color:#cbd5e1; font-size:.62rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.global-risk-market-group b { color:#67e8f9; font-size:.62rem; direction:ltr; }
.global-risk-market-group small { color:#64748b; font-size:.62rem; }
.global-risk-empty { margin:1rem 0; color:#64748b; text-align:center; font-size:.72rem; }
.global-risk-error { margin-bottom:1rem; padding:.75rem 1rem; border:1px solid rgba(251,113,133,.35); border-radius:11px; background:rgba(159,18,57,.14); color:#fda4af; font-size:.78rem; }
.global-risk-disclaimer { margin:1.25rem 0 .5rem; padding:.75rem; color:#64748b; text-align:center; font-size:.66rem; line-height:1.6; }
@media (max-width: 960px) { .global-risk-hero { grid-template-columns:1.6fr 1fr 1fr; } .global-risk-hero-stat:last-child { grid-column:2 / 4; } .global-risk-grid-3 { grid-template-columns:repeat(2,minmax(0,1fr)); } .global-risk-scout { grid-column:1 / -1; } }
@media (max-width: 640px) { .global-risk-page { padding:1rem; } .global-risk-header { grid-template-columns:1fr; gap:.8rem; } .global-risk-update { grid-column:1; grid-row:auto; } .global-risk-hero, .global-risk-grid-3, .global-risk-grid-wide { grid-template-columns:1fr; } .global-risk-hero-stat:last-child, .global-risk-scout { grid-column:auto; } .global-risk-score-panel { padding:1rem; } .global-risk-score-ring { width:72px; height:72px; } .global-risk-title-row p:not(.global-risk-eyebrow) { max-width:290px; } }
@media (max-width: 640px) { .global-risk-storm-path, .global-risk-markets { grid-template-columns:1fr; } .global-risk-map-node { min-width:96px; } }

/* ---- Big Portfolios Enhancements ---- */
.bp-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.bp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease, height 0.3s ease;
}
.bp-card:hover::before {
    opacity: 1;
    height: 3px;
}

/* Gradient borders using pseudo-element */
.bp-card-gold::before { background: linear-gradient(90deg, transparent, #facc15, transparent); }
.bp-card-blue::before { background: linear-gradient(90deg, transparent, #60a5fa, transparent); }
.bp-card-green::before { background: linear-gradient(90deg, transparent, #34d399, transparent); }
.bp-card-amber::before { background: linear-gradient(90deg, transparent, #fbbf24, transparent); }
.bp-card-red::before { background: linear-gradient(90deg, transparent, #f87171, transparent); }
.bp-card-purple::before { background: linear-gradient(90deg, transparent, #c084fc, transparent); }
.bp-card-neutral::before { background: linear-gradient(90deg, transparent, #64748b, transparent); }

/* Very subtle background tints for sections to enhance scanning without overpowering */
.bp-card-gold { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(202, 138, 4, 0.06), transparent 50%); }
.bp-card-blue { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.06), transparent 50%); }
.bp-card-green { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(16, 185, 129, 0.06), transparent 50%); }
.bp-card-amber { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(245, 158, 11, 0.06), transparent 50%); }
.bp-card-red { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(239, 68, 68, 0.06), transparent 50%); }
.bp-card-purple { background-color: #0f172a; background-image: radial-gradient(circle at top right, rgba(168, 85, 247, 0.06), transparent 50%); }

/* Metric Cards Hover */
.bp-metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.bp-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(234, 179, 8, 0.4);
}

/* List Items */
.bp-list-item {
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.bp-list-item:hover {
    background-color: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(100, 116, 139, 0.6);
    transform: scale(1.015);
}

/* Table Rows Hover */
.bp-responsive-table tbody tr {
    transition: background-color 0.2s ease;
}
@media (min-width: 640px) {
    .bp-responsive-table tbody tr:hover {
        background-color: rgba(30, 41, 59, 0.75) !important;
    }
}

/* Market Mood V1 (isolated) */
.market-mood-card { --mm-xf:#ef4444; --mm-f:#f97316; --mm-n:#facc15; --mm-g:#a3e635; --mm-xg:#22c55e; }
.market-mood-gauge { width:min(100%,240px); height:132px; margin:.15rem auto 0; position:relative; }
.market-mood-gauge-arc { width:100%; height:100%; display:block; overflow:visible; }
.market-mood-track, .market-mood-seg { fill:none; stroke-width:7; }
.market-mood-track { stroke:rgba(148,163,184,.13); }
.market-mood-seg { stroke-dasharray:24.2 100; }
.mm-extreme-fear { stroke:var(--mm-xf); stroke-dashoffset:-.4; }
.mm-fear { stroke:var(--mm-f); stroke-dasharray:24.2 100; stroke-dashoffset:-24.8; }
.mm-neutral { stroke:var(--mm-n); stroke-dasharray:.8 100; stroke-dashoffset:-49.6; }
.mm-greed { stroke:var(--mm-g); stroke-dasharray:24.2 100; stroke-dashoffset:-50.4; }
.market-mood-scale { fill:#94a3b8; font-size:10px; text-anchor:middle; font-variant-numeric:tabular-nums; }
.mm-extreme-greed { stroke:var(--mm-xg); stroke-dasharray:24.2 100; stroke-dashoffset:-75.6; }
.market-mood-needle { fill:#fff; pointer-events:none; }
.market-mood-readout { position:absolute; top:55px; left:50%; width:170px; transform:translateX(-50%); text-align:center; }
.market-mood-score { color:#f8fafc; font-weight:800; font-size:2rem; line-height:1.15; font-variant-numeric:tabular-nums; }
.market-mood-card .market-mood-state { margin:.2rem 0 0; color:#cbd5e1; font-size:.85rem; font-weight:650; text-align:center; }
.market-mood-state[data-band="extreme_fear"], .market-mood-interpretation-tone[data-band="extreme_fear"] { color:var(--mm-xf)!important; }
.market-mood-state[data-band="fear"], .market-mood-interpretation-tone[data-band="fear"] { color:var(--mm-f)!important; }
.market-mood-state[data-band="neutral"], .market-mood-interpretation-tone[data-band="neutral"] { color:var(--mm-n)!important; }
.market-mood-state[data-band="greed"], .market-mood-interpretation-tone[data-band="greed"] { color:var(--mm-g)!important; }
.market-mood-state[data-band="extreme_greed"], .market-mood-interpretation-tone[data-band="extreme_greed"] { color:var(--mm-xg)!important; }
.market-mood-card .market-mood-interpretation { margin:.35rem 0 .5rem; color:#cbd5e1; font-size:.75rem; line-height:1.6; text-align:center; overflow-wrap:anywhere; }
.market-mood-card .market-mood-interpretation[hidden] { display:none; }
#cardMarketSentiment { cursor:default; }
#cardMarketSentiment.market-mood-interactive { cursor:pointer; }
#cardMarketSentiment.market-mood-interactive:hover { border-color:rgba(167,139,250,.6); }
#cardMarketSentiment #sentimentTitle,
#cardMarketSentiment #marketMoodSubtitle { text-align:right !important; }
#cardMarketSentiment #marketMoodScore,
#cardMarketSentiment #marketMoodState,
#cardMarketSentiment #marketMoodInterpretation,
#cardMarketSentiment #marketMoodMeta { text-align:center !important; }
.market-mood-insights { margin-top:auto; padding-top:.75rem; border-top:1px solid rgba(167,139,250,.13); display:grid; gap:.45rem; min-width:0; }
.market-mood-insight[hidden] { display:none; }
.market-mood-insight { margin:0; display:flex; align-items:flex-start; gap:.4rem; min-width:0; }
.market-mood-insight::before { content:''; flex:0 0 .36rem; width:.36rem; height:.36rem; margin-top:.32rem; border-radius:50%; background:#c4b5fd; }
.market-mood-insight-value { display:block; min-width:0; overflow-wrap:anywhere; font-size:.82rem; font-weight:600; line-height:1.4; color:#c4b5fd; }
.market-mood-bottom-row { display:flex; align-items:baseline; gap:.5rem; min-width:0; }
.market-mood-bottom-row .market-mood-insight { flex:1 1 auto; }
.market-mood-hint { flex:0 0 auto; margin-inline-start:auto; white-space:nowrap; }
.market-mood-hint-solo { margin-inline-start:0; }
/* Market Mood details page */
.mm-page .mm-panel { background:rgba(15,23,42,.86); border:1px solid rgba(148,163,184,.15); border-radius:.9rem; padding:1.25rem; }
.mm-page table { width:100%; border-collapse:collapse; font-size:.85rem; }
.mm-page th, .mm-page td { padding:.55rem .5rem; text-align:start; border-bottom:1px solid rgba(148,163,184,.12); }
.mm-page th { color:#94a3b8; font-weight:600; font-size:.75rem; }
.mm-num { font-variant-numeric:tabular-nums; }

/* Reserve the same column in the next row; do not stretch the risk card or its peers. */
@media (min-width: 768px) {
    .home-cloud-card.market-mood-cell { grid-column: 2; grid-row: 2; }
}
