        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .loader {
            border: 4px solid #f3f3f3;
            border-radius: 50%;
            border-top: 4px solid var(--primary);
            width: 30px;
            height: 30px;
            -webkit-animation: spin 1s linear infinite;
            /* Safari */
            animation: spin 1s linear infinite;
        }

        /* --- משתני עיצוב מעודכנים (כחול כהה ולבן) --- */
        :root {
            --primary: #002366;
            /* כחול כהה מלכותי (Navy Blue) */
            --primary-light: #f0f4f8;
            --secondary: #0056b3;
            /* כחול בהיר יותר לכפתורים משניים */
            --risk-btn-color: #004080;
            --compare-color: #e67e22;
            /* כתום להשוואה - נשאר לניגודיות */
            --bg: #f4f7f6;
            --card: #ffffff;
            --text: #333;
            --text-muted: #7f8c8d;
            --gold: #ffc107;
            --tooltip-bg: #1a1a1a;
            --sticky-bg: #f1f1f1;
            --avg-row-bg: #e8f5e9;
            --avg-row-text: #1b5e20;
            --success-color: #27ae60;
            --border-radius: 12px;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }

        body {
            font-family: 'Rubik', sans-serif;
            background-color: var(--bg);
            margin: 0;
            padding: 20px;
            color: var(--text);
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: var(--card);
            padding: 30px;
            border-radius: 16px;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            min-height: 90vh;
            position: relative;
            border-top: 5px solid var(--primary);
        }

        /* Simple Mode V5 Refactored Styles */
        .simple-input-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            align-items: center;
        }

        .simple-label {
            font-size: 13px;
            font-weight: 900;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            text-align: center;
        }

        .simple-input-v5 {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            text-align: center !important;
            font-weight: 900 !important;
            color: #1e1b4b !important;
            font-size: 1.125rem !important;
            /* text-lg */
            width: 100% !important;
            height: 100% !important;
            padding: 0 !important;
        }

        .simple-pct {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            font-weight: 800;
            font-size: 12px;
            pointer-events: none;
        }

        .yield-box {
            background: #eef2ff !important;
            /* bg-indigo-50 */
            border: 1px solid #c7d2fe !important;
            /* border-indigo-200 */
            position: relative;
            width: 150px;
            height: 48px;
            border-radius: 12px;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            transition: all 0.2s;
        }

        .fee-box {
            background: #fffbeb !important;
            /* bg-amber-50 */
            border: 1px solid #fecaca !important;
            /* border-amber-200 (wait amber-200 is #fde68a, amber-50 is #fffbeb) */
            border-color: #fde68a !important;
            position: relative;
            width: 140px;
            height: 48px;
            border-radius: 12px;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            transition: all 0.2s;
        }

        .yield-box:focus-within {
            background: #ffffff !important;
            border-color: #6366f1 !important;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
        }

        .fee-box:focus-within {
            background: #ffffff !important;
            border-color: #f59e0b !important;
            box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
        }

        .yield-box .simple-pct {
            color: #818cf8;
        }

        .fee-box .simple-pct {
            color: #fbbf24;
        }

        /* --- Interest Calculator Premium Styles --- */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in {
            animation: fadeIn 0.4s ease-out forwards;
        }

        /* --- Premium Mode Selector --- */
        .calc-mode-selector {
            display: flex;
            background: #f1f5f9;
            padding: 5px;
            border-radius: 20px;
            gap: 5px;
            width: fit-content;
            margin: 0 auto 30px;
            border: 1px solid #e2e8f0;
        }

        .calc-mode-btn {
            border: none !important;
            background: transparent !important;
            padding: 10px 24px !important;
            border-radius: 16px !important;
            font-family: 'Rubik', sans-serif !important;
            font-size: 14px !important;
            font-weight: 800 !important;
            color: #64748b !important;
            cursor: pointer !important;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        }

        /* Iron-Clad Box Stability */
        .calc-v5-fixed-box {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            min-height: 52px !important;
            height: auto !important;
            overflow: visible !important;
        }

        .calc-v5-fixed-box .select2-selection {
            min-height: 52px !important;
            height: auto !important;
            max-height: none !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            padding: 0 4px !important;
            border-radius: 12px !important;
        }

        .calc-v5-fixed-box .select2-selection__rendered {
            white-space: normal !important;
            line-height: 1 !important;
            text-align: center !important;
            font-size: 11px !important;
            padding: 0 !important;
            width: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            height: 100% !important;
            word-break: break-all !important;
            hyphens: auto !important;
        }

        .calc-v5-fixed-box .select2-selection__arrow {
            display: none !important;
        }

        /* Fixed Grid for Filters */
        .calc-grid-filters {
            display: grid !important;
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 4px !important;
            width: 100% !important;
            align-items: center !important;
        }

        .text-gradient-indigo {
            background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        /* Dashboard-style Select2 overrides */
        .calc-select2-container .select2-selection--single {
            background-color: #f8fafc !important;
            border: none !important;
            border-radius: 1rem !important;
            height: 48px !important;
            display: flex !important;
            align-items: center !important;
        }

        .calc-select2-container .select2-selection__rendered {
            font-weight: 800 !important;
            color: #1E1B4B !important;
            padding-right: 1.5rem !important;
        }

        .calc-select2-container .select2-selection__arrow {
            height: 46px !important;
        }

        /* --- Common UI Elements --- */
        .modal-overlay {
            z-index: 2000 !important;
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            justify-content: center;
            align-items: center;
        }

        .select2-dropdown {
            z-index: 3000 !important;
        }

        /* Path Filter 2-Column Layout */
        .path-dropdown-columns .select2-results>.select2-results__options {
            display: flex;
            flex-direction: row;
            /* RTL sets right-to-left, so right is first flex child */
            overflow-y: auto;
            max-height: 400px;
        }

        .path-dropdown-columns .select2-results__option[role="group"] {
            flex: 1;
            width: 50%;
            min-width: 0;
            border-left: 1px solid #e2e8f0;
            padding: 0;
            margin: 0;
        }

        .path-dropdown-columns .select2-results__option[role="group"]:last-child {
            border-left: none;
        }

        .modal-validity-banner {
            display: none;
            /* Hidden by default, shown by JS */
            text-align: center;
            margin-bottom: 25px;
            font-size: 1.1rem;
            color: #475569;
            font-weight: 800;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .path-dropdown-columns .select2-results__group {
            font-weight: 800;
            text-align: center;
            background: #f8fafc;
            color: var(--primary);
            position: sticky;
            top: 0;
            z-index: 10;
            font-size: 1rem;
            padding: 10px;
            border-bottom: 2px solid #e2e8f0;
            margin-bottom: 5px;
        }

        /* Logos */
        /* שינוי גודל לוגו עליון ל-120px (תוספת 50%) */
        .company-logo-top {
            position: absolute;
            top: 20px;
            left: 25px;
            height: 120px;
            width: auto;
            z-index: 10;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .company-logo-top:hover {
            transform: scale(1.05);
        }

        .company-logo-footer {
            display: block;
            margin: 5px auto 0 auto;
            height: 60px;
            width: auto;
            opacity: 0.9;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .company-logo-footer:hover {
            opacity: 1;
        }

        /* Agent Branding Wrapper */
        .agent-branding-wrapper {
            position: absolute;
            top: 20px;
            right: 25px;
            z-index: 20;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            max-width: 250px;
        }

        /* Personal Logo Styles */
        .personal-logo-container {
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 12px;
            overflow: hidden;
            background: white;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            border: 1px solid #e2e8f0;
            position: relative;
            width: fit-content;
        }

        .personal-logo-container:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 8px 20px rgba(0,0,0,0.1);
            border-color: #6366f1;
        }

        .personal-logo-container:hover .logo-overlay {
            opacity: 1;
        }

        .personal-logo-top {
            height: 100px;
            width: auto;
            max-width: 100%;
            min-width: 120px;
            object-fit: contain;
            padding: 4px; /* Reduced padding to make logo inside appear larger */
            background: white;
        }

        .logo-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 35, 102, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s;
            backdrop-filter: blur(2px);
        }

        .logo-overlay i {
            color: white;
            width: 32px;
            height: 32px;
        }

        .upload-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            color: #64748b;
            gap: 8px;
            font-weight: 600;
            font-size: 0.85rem;
            width: 120px;
            height: 100px;
        }

        .agent-welcome-wrapper {
            width: 100%;
            text-align: center;
            display: flex;
            flex-direction: column;
            gap: 2px;
            user-select: none;
            pointer-events: none;
        }

        .welcome-text {
            font-size: 0.85rem;
            color: #64748b;
            font-weight: 500;
        }

        .agent-name {
            font-size: 1.1rem;
            color: var(--primary);
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Header - Clickable & Interactive */
        .header {
            text-align: center;
            margin-bottom: 20px;
        }

        .header-content {
            display: inline-block;
            cursor: pointer;
            padding: 10px 20px;
            border-radius: 16px;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        .header-content:hover {
            background-color: rgba(0, 35, 102, 0.04);
            transform: translateY(-3px);
        }

        .header-content:active {
            transform: scale(0.98);
        }

        .header img.main-logo {
            height: 150px;
            width: auto;
            margin-bottom: 10px;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        /* כותרת בכחול כהה */
        h1 {
            color: var(--primary);
            margin: 0;
            font-size: 2.2rem;
            font-weight: 700;
            user-select: none;
        }

        .blue-star {
            color: var(--secondary);
            font-size: 1.2em;
            vertical-align: bottom;
        }

        /* עיצוב לכוכב הכחול */
        h2 {
            color: #666;
            font-weight: 300;
            font-size: 1.4rem;
            margin-top: 5px;
            user-select: none;
        }

        /* Buttons */
        button {
            font-family: 'Rubik', sans-serif;
        }

        button.action-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            font-size: 1.25rem;
            transition: 0.3s;
            white-space: nowrap;
            height: 47px;
        }

        button.action-btn:hover {
            background: #001a4d;
            transform: translateY(-2px);
        }

        /* כפתור מסלול משולב - עיצוב מותאם לשורה העליונה */
        button.synth-btn-top {
            background: var(--secondary);
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            font-size: 1.15rem;
            transition: 0.3s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            white-space: nowrap;
            height: auto;
        }

        button.synth-btn-top:hover {
            background: #004494;
            transform: translateY(-2px);
        }

        .rating-toggle-btn {
            background-color: transparent;
            color: #64748b;
            border: 1px solid #e2e8f0;
            padding: 8px 12px;
            font-size: 1.1rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: none;
            min-width: 140px;
            height: 48px;
            white-space: nowrap;
        }

        .btn-icon-wrapper i,
        .btn-icon-wrapper svg,
        .btn-icon-wrapper i svg path,
        .btn-icon-wrapper i svg line,
        .btn-icon-wrapper i svg polyline {
            width: 22px !important;
            height: 22px !important;
            color: white !important;
            stroke: white !important;
        }

        .rating-toggle-btn i,
        .rating-toggle-btn svg {
            width: 24px !important;
            height: 24px !important;
            min-width: 24px;
            min-height: 24px;
        }

        .rating-toggle-btn:hover {
            background-color: #f8fafc;
            color: var(--primary);
            border-color: var(--primary);
        }

        .rating-toggle-btn i {
            width: 20px;
            height: 20px;
        }

        button.secondary-btn {
            background: #6c757d;
            padding: 0 20px;
            font-size: 0.95rem;
            margin-left: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }

        button.risk-btn {
            background: var(--risk-btn-color);
            padding: 10px 25px;
            font-size: 1.15rem;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            height: auto;
            border: none;
            border-radius: 8px;
            color: white;
            cursor: pointer;
        }

        button.calc-btn {
            background: var(--primary);
            padding: 10px 25px;
            font-size: 1.15rem;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            height: auto;
            margin-right: 10px;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: 0.3s;
        }

        /* Tiny Reset Button - Modified location style handled in container */
        .reset-tiny-btn {
            background: #ffffff;
            border: 1px solid #ddd;
            color: var(--text-muted);
            padding: 6px 12px;
            border-radius: 50px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-weight: 500;
            white-space: nowrap;
        }

        .reset-tiny-btn:hover {
            border-color: #bbb;
            color: var(--text);
            background: #f9f9f9;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        /* --- V5 CSS Grid Filters & Column Stability --- */
        .calc-v5-stack-filters {
            display: flex !important;
            flex-direction: column !important;
            gap: 6px !important;
            width: 100% !important;
            box-sizing: border-box !important;
            padding: 4px 0 !important;
            /* background and border removed per user request to avoid "square within square" */
        }

        .calc-v5-row-filters {
            display: flex !important;
            flex-direction: row !important;
            gap: 12px !important;
            width: 100% !important;
            box-sizing: border-box !important;
            padding: 4px 0 !important;
            align-items: center !important;
        }

        .calc-v5-row-filters .select2-container,
        .calc-v5-row-filters select {
            flex: 1 !important;
            min-width: 0 !important;
        }

        .calc-v5-stack-filters .select2-container {
            width: 100% !important;
            display: block !important;
            position: relative !important;
            height: auto !important;
            /* Let content define height */
            margin-bottom: 0 !important;
        }

        .comparison-table-v5 {
            table-layout: fixed !important;
            width: 100% !important;
        }

        /* Wide dropdown overlay for better readability on narrow triggers */
        .path-dropdown-columns.select2-dropdown {
            min-width: 350px !important;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
            border: 1px solid #e2e8f0 !important;
            z-index: 3000 !important;
        }

        /* Selection box truncation */
        .select2-selection__rendered {
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            padding-right: 25px !important;
        }

        .select2-selection--multiple .select2-selection__rendered {
            white-space: nowrap !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
            text-overflow: clip !important;
        }

        .filter-col-header {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            margin-bottom: 8px !important;
            padding: 0 4px !important;
        }

        /* Scale down selection boxes globally */
        .calc-v5-stack-filters .select2-container--default .select2-selection--single,
        .filter-square-select,
        .v5-fund-select {
            font-size: 11px !important;
            height: 28px !important;
            min-height: 28px !important;
            line-height: 28px !important;
            max-width: 100% !important;
            border-radius: 6px !important;
        }

        .calc-v5-stack-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 26px !important;
            font-size: 11px !important;
            padding-right: 12px !important;
        }

        .calc-v5-stack-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 26px !important;
            width: 18px !important;
        }

        .comparison-table-v5 td[data-row="filters"] {
            padding: 8px 4px !important;
        }

        .comparison-table-v5 {
            table-layout: fixed !important;
            width: 100% !important;
        }

        .filter-square-select {
            appearance: none;
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            padding: 0 10px;
            color: #475569;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-overflow: ellipsis;
            height: 28px !important;
        }

        /* Legacy classes maintained for print/mobile compatibility */
        .filters-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2rem;
            margin-bottom: 0;
            margin-top: 0;
            align-items: stretch;
        }

        .filter-box {
            display: flex;
            flex-direction: column;
            width: 100%;
            justify-content: flex-end;
        }

        .filter-header-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            height: auto;
            min-height: 32px;
        }

        .filter-box label {
            font-weight: 900;
            color: #0f172a;
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            font-size: 0.95rem;
        }

        /* Select2 Premium Customization */
        .select2-container {
            width: 100% !important;
        }

        .select2-container .select2-selection--single {
            height: 48px; /* Default height */
            min-height: 32px;
            border: 1px solid #cbd5e1;
            border-radius: 0.75rem;
            display: flex;
            align-items: center;
            background-color: #ffffff;
            box-sizing: border-box;
            transition: all 0.2s;
        }

        /* Dashboard Premium Styles */
        .select2-premium .select2-selection--single,
        .select2-premium .select2-selection--multiple {
            height: 64px !important;
            min-height: 64px !important;
            max-height: 64px !important;
            border-radius: 1.25rem !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
        }

        .select2-container .select2-selection--multiple {
            min-height: 48px;
            border: 1px solid #cbd5e1;
            border-radius: 0.75rem;
            display: flex;
            align-items: center;
            background-color: #ffffff;
            box-sizing: border-box;
            position: relative;
        }

        /* Scope summary-specific overrides */
        .select2-summary-mode .select2-selection--multiple {
            overflow: hidden !important;
        }

        /* Add Chevron to Multi-select for consistency */
        .select2-summary-mode .select2-selection--multiple::after {
            content: "";
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            border-color: #94a3b8 transparent transparent transparent;
            border-style: solid;
            border-width: 5px 4px 0 4px;
            height: 0;
            width: 0;
            pointer-events: none;
        }

        .select2-container .select2-selection--single:focus-within,
        .select2-container .select2-selection--multiple:focus-within {
            border-color: rgba(99, 102, 241, 0.4) !important;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.05) !important;
        }

        .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 48px;
            padding-right: 16px;
            padding-left: 32px;
            color: #1e293b;
            font-weight: 500;
            width: 100%;
            text-align: right;
        }

        .select2-premium .select2-selection__rendered {
            line-height: 64px !important;
            padding-right: 24px !important;
            padding-left: 40px !important;
            font-weight: 700 !important;
            font-size: 1.05rem !important;
        }

        .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 46px;
            left: 10px;
            top: 1px;
        }

        .select2-premium .select2-selection__arrow {
            height: 62px !important;
            left: 12px !important;
        }

        .select2-container--default .select2-selection--multiple {
            padding: 4px 8px;
        }

        .select2-premium.select2-container--default .select2-selection--multiple {
            padding: 8px 24px 8px 40px !important;
            height: 64px !important;
        }

        .select2-premium.select2-container--default .select2-selection--multiple .select2-selection__rendered {
            display: flex !important;
            flex-wrap: nowrap !important;
            overflow: hidden !important;
            gap: 8px !important;
            padding-right: 24px !important;
            padding-left: 40px !important;
            margin: 0 !important;
            width: 100% !important;
            text-align: right !important;
            height: 100% !important;
            align-items: center !important;
        }
        
        /* Hide default Select2 tags and search ONLY in Summary Mode */
        .select2-summary-mode .select2-selection__choice,
        .select2-summary-mode .select2-search--inline {
            display: none !important;
        }

        /* Summary Wrapper Styles */
        .select2-summary-wrapper {
            display: flex !important;
            align-items: center !important;
            flex-wrap: nowrap !important; /* Ensure they stay in one row */
            gap: 6px !important;
            width: 100% !important;
            height: 100% !important;
            overflow: hidden !important;
            position: absolute !important;
            top: 0 !important;
            right: 0 !important;
            padding-right: 24px !important;
            padding-left: 40px !important;
            pointer-events: none !important; /* Let clicks pass through to Select2 */
            z-index: 1 !important;
        }

        .select2-summary-badge {
            background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
            color: white !important;
            font-size: 0.75rem !important;
            min-width: 24px !important;
            height: 24px !important;
            border-radius: 999px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            font-weight: 800 !important;
            flex-shrink: 0 !important;
            box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2) !important;
        }

        .select2-summary-text {
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
            font-weight: 700 !important;
            color: #1e293b !important;
            font-size: 1.05rem !important;
            flex-grow: 1 !important;
        }

        .select2-summary-placeholder {
            color: #94a3b8 !important;
            font-weight: 500 !important;
        }

        /* Mini-Pill Styles for Free Search */
        .select2-summary-pill {
            background: #eef2ff !important;
            color: #4338ca !important;
            border: 1px solid #c7d2fe !important;
            padding: 4px 10px !important;
            border-radius: 8px !important;
            font-size: 0.875rem !important;
            font-weight: 700 !important;
            white-space: nowrap !important;
            flex-shrink: 0 !important;
            max-width: 280px !important;
            line-height: 1.4 !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 8px !important;
            pointer-events: auto !important; /* Allow clicking the 'X' */
            box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
            transition: all 0.2s !important;
        }

        .select2-summary-pill > span:first-child {
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
            min-width: 0 !important;
            flex: 1 !important;
        }

        .pill-remove {
            cursor: pointer !important;
            color: #6366f1 !important;
            font-size: 1.2rem !important;
            font-weight: bold !important;
            line-height: 1 !important;
            transition: all 0.2s !important;
            padding: 0 !important;
            border-radius: 50% !important;
            width: 20px !important;
            height: 20px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            margin-right: 2px !important;
            flex-shrink: 0 !important;
        }

        .pill-remove:hover {
            color: #ef4444 !important;
            background: rgba(239, 68, 68, 0.1) !important;
        }

        /* Ensure Select2 Dropdowns are ALWAYS on top of modals */
        .select2-container--open {
            z-index: 999999999 !important;
        }

        /* Fix for compact selects in modals */
        .compact-select + .select2 .select2-selection--single .select2-selection__rendered {
            line-height: 22px !important;
        }

        /* KILL ALL GRAY - Selected items must always be BLUE and CHECKED */
        /* We use quotes for attributes to ensure cross-browser/Select2 compatibility */
        .select2-container--default .select2-results__option[aria-selected="true"],
        .select2-container--default .select2-results__option--highlighted[aria-selected="true"],
        .select2-container--default .select2-results__option[aria-selected="true"]:hover,
        .select2-container--default .select2-results__option[aria-selected="true"]:focus,
        .select2-container--default .select2-results__option.select2-results__option--selected,
        .select2-container--default .select2-results__option--highlighted.select2-results__option--selected {
            background-color: #eef2ff !important;
            color: #4338ca !important;
            font-weight: 900 !important;
            position: relative !important;
            padding-left: 40px !important;
            opacity: 1 !important;
            display: block !important;
        }

        /* Ensure the checkmark (✓) is ALWAYS visible on selected items */
        .select2-container--default .select2-results__option[aria-selected="true"]::before,
        .select2-container--default .select2-results__option.select2-results__option--selected::before {
            content: "✓" !important;
            position: absolute !important;
            left: 14px !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            font-size: 1.3rem !important;
            color: #4338ca !important;
            font-weight: 900 !important;
            display: block !important;
            z-index: 2 !important;
        }








        /* Toggles & Search */
        .toggle-wrapper {
            display: flex;
            align-items: center;
            font-size: 0.9rem;
            color: #64748b;
            font-weight: 700;
            gap: 0.625rem;
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 32px;
            height: 16px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 9999px;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 12px;
            width: 12px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 50%;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
        }

        input:checked+.slider {
            background: linear-gradient(to right, #4f46e5, #2563eb);
        }

        /* Hover: reset icon turns rose */
        .reset-tiny-btn:hover .reset-icon {
            color: #e11d48 !important;
        }

        input:checked+.slider:before {
            transform: translateX(16px);
        }

        /* --- Filter Mode Selector (Segmented Control) --- */
        .filter-mode-selector {
            display: flex;
            align-items: center;
            background: #f1f5f9;
            padding: 4px 8px;
            border-radius: 14px;
            gap: 4px;
            border: 1px solid #e2e8f0;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
        }

        .mode-label {
            font-size: 0.7rem;
            font-weight: 900;
            color: #6366f1;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-left: 8px;
            margin-right: 4px;
        }

        .filter-mode-btn {
            border: none !important;
            background: transparent !important;
            padding: 8px 16px !important;
            border-radius: 10px !important;
            font-size: 0.8rem !important;
            font-weight: 800 !important;
            color: #475569 !important;
            cursor: pointer !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            white-space: nowrap !important;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .filter-mode-btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: #6366f1;
            opacity: 0;
            transition: opacity 0.2s;
            z-index: 0;
        }

        .filter-mode-btn:hover:not(.active) {
            color: white !important;
            background: #6366f1 !important;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
        }

        .filter-mode-btn.active {
            background: white !important;
            color: #4f46e5 !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
            transform: translateY(-1px);
        }

        .filter-mode-btn span {
            position: relative;
            z-index: 1;
        }

        /* --- Risk Level Selector --- */
        .risk-filter-container {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: #f8fafc;
            border: 1px solid #cbd5e1;
            border-radius: 1.25rem;
            padding: 12px;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
        }

        .risk-levels-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 14px;
            width: 100%;
        }

        .risk-level-btn {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            border: 2px solid #e2e8f0;
            background: white;
            color: #475569;
            font-weight: 900;
            font-size: 1.1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 2px 4px rgba(0,0,0,0.04);
        }

        .risk-level-btn:hover {
            border-color: #6366f1;
            color: white;
            background: #6366f1;
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25);
        }

        .risk-level-btn.active {
            color: white !important;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
            transform: translateY(-4px) scale(1.1);
            border: none !important;
        }

        .risk-level-btn.active[data-level="1"] { background: linear-gradient(135deg, #22c55e, #16a34a); }
        .risk-level-btn.active[data-level="2"] { background: linear-gradient(135deg, #84cc16, #65a30d); }
        .risk-level-btn.active[data-level="3"] { background: linear-gradient(135deg, #eab308, #ca8a04); }
        .risk-level-btn.active[data-level="4"] { background: linear-gradient(135deg, #f97316, #ea580c); }
        .risk-level-btn.active[data-level="5"] { background: linear-gradient(135deg, #ef4444, #dc2626); }

        .search-row-container {
            display: flex;
            gap: 1.5rem;
            align-items: stretch;
            padding-top: 1.5rem;
            border-top: 1px solid #e2e8f0;
        }

        .search-input-wrapper {
            flex-grow: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }

        .select-container {
            width: 100%;
        }

        /* Search select2 override for the free search */
        #fundSelect+.select2-container .select2-selection--multiple {
            min-height: 64px !important;
            max-height: 64px !important;
            border-radius: 1.5rem !important;
            background: white !important;
            border: 1px solid #cbd5e1 !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
            padding: 8px 56px 8px 24px !important;
        }

        /* Ensure the summary text doesn't overlap the magnifying glass icon */
        #fundSelect+.select2-container .select2-summary-wrapper {
            padding-right: 48px !important;
        }

        /* Action button submit premium */
        #btnRun {
            border-radius: 1.5rem !important;
            background: #0f172a;
            position: relative;
            overflow: hidden;
            font-size: 1rem !important;
            font-weight: 900 !important;
            letter-spacing: 0.05em;
            transition: all 0.3s;
        }

        #btnRun:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35) !important;
        }

        #btnRun::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, #6366f1, #4338ca);
            opacity: 0;
            transition: opacity 0.3s;
            border-radius: inherit;
        }

        #btnRun:hover::after {
            opacity: 1;
        }

        #btnRun>* {
            position: relative;
            z-index: 1;
        }

        /* Reset button premium */
        .reset-tiny-btn {
            background: rgba(255, 255, 255, 0.6) !important;
            border: none !important;
            border-radius: 0.75rem !important;
            padding: 8px 16px !important;
            font-size: 0.625rem !important;
            font-weight: 900 !important;
            text-transform: uppercase !important;
            letter-spacing: 0.2em !important;
            color: #64748b !important;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        }

        .reset-tiny-btn:hover {
            background: white !important;
        }

        .reset-tiny-btn:active {
            transform: scale(0.95);
        }

        /* Risk Wizard */
        .risk-top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding: 0 10px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .active-filter-badge {
            background: var(--risk-btn-color);
            color: white;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 1rem;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            font-weight: bold;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .wizard-container {
            text-align: center;
        }

        .wizard-question {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 20px;
            color: var(--primary);
        }

        .wizard-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .wizard-option {
            background: #f8f9fa;
            border: 1px solid #ddd;
            padding: 15px;
            border-radius: 8px;
            cursor: pointer;
            transition: 0.2s;
            text-align: right;
            font-size: 1rem;
        }

        .wizard-option:hover {
            background: #e9ecef;
            border-color: var(--secondary);
        }

        .wizard-result-box {
            background: #e8f5e9;
            padding: 20px;
            border-radius: 12px;
            margin-top: 10px;
            border: 1px solid #c8e6c9;
        }

        .wizard-score {
            font-size: 3rem;
            font-weight: bold;
            color: var(--primary);
            margin: 10px 0;
        }

        .wizard-desc {
            font-size: 1.2rem;
            color: #333;
            margin-bottom: 20px;
        }

        /* Progress Bar */
        .wizard-progress {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 20px;
            margin-top: 10px;
        }

        .progress-step {
            width: 30px;
            height: 8px;
            background: #eee;
            border: 1px solid #ddd;
            border-radius: 2px;
            transition: 0.3s;
        }

        .progress-step.active {
            background: var(--secondary);
            border-color: var(--secondary);
        }

        /* Table Styles (Premium Glassmorphism) */
        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin-bottom: 24px;
        }

        th,
        td {
            padding: 16px 14px;
            text-align: center;
            border-bottom: 1px solid #cbd5e1;
            vertical-align: middle;
            transition: background 0.2s;
        }

        th {
            background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
            color: #0f172a;
            font-weight: 800;
            font-size: 0.95rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            position: sticky;
            top: 0;
            z-index: 100;
            border-bottom: 2px solid #94a3b8;
        }

        .fund-link {
            transition: color 0.2s;
            cursor: pointer;
        }

        .detailed-fund-header .fund-link,
        .detailed-fund-header small {
            color: white !important;
        }

        table.comparison-table th.detailed-fund-header:hover .fund-link,
        table.comparison-table th.detailed-fund-header:hover small,
        .fund-link:hover {
            color: #3b82f6 !important;
        }


        table.comparison-table tbody tr {
            background: white;
            transition: all 0.2s;
        }

        table.comparison-table tbody tr:hover {
            background: #f8fafc;
            transform: scale(1.001);
            box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.05);
            position: relative;
            z-index: 10;
        }

        table.comparison-table th:first-child,
        table.comparison-table td:first-child {
            position: sticky;
            right: 0;
            background: rgba(241, 245, 249, 0.95);
            backdrop-filter: blur(8px);
            font-weight: 800;
            text-align: right;
            width: 260px;
            min-width: 260px;
            z-index: 110;
            border-left: 1px solid #cbd5e1;
            box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
            color: #0f172a;
            font-size: 0.95rem;
        }

        table.comparison-table th:first-child {
            z-index: 120;
            box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
            border-left: 2px solid #cbd5e1;
            border-bottom: 2px solid #cbd5e1;
        }

        .metric-cell-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .best-val {
            background-color: #ecfdf5 !important;
            color: #047857 !important;
            font-weight: 800;
            border-radius: 6px;
            padding: 4px 8px;
            border: 1px solid #a7f3d0 !important;
        }

        .stars-container {
            font-size: 1.3rem;
            letter-spacing: 2px;
            white-space: nowrap;
            display: inline-block;
        }

        /* Company Focus Modal */
        /* Company Focus Modal */
        .company-focus-modal {
            max-width: 600px;
            width: 95%;
            background: white;
            border-radius: 24px;
            padding: 0;
            display: flex;
            flex-direction: column;
            max-height: 85vh;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.1);
            overflow: hidden;
            animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes modalFadeIn {
            from { opacity: 0; transform: scale(0.95) translateY(10px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .focus-search-bar {
            padding: 24px;
            border-bottom: 1px solid #f1f5f9;
            background: linear-gradient(to bottom, #f8fafc, #ffffff);
        }

        .focus-search-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 1rem;
        }

        .focus-list-container {
            flex: 1;
            overflow-y: auto;
            padding: 10px 20px;
        }

        .focus-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            border-radius: 12px;
            margin-bottom: 8px;
            border: 1px solid #f1f5f9;
            transition: all 0.2s ease;
            background: #ffffff;
        }

        .focus-item:hover {
            background: #f8fafc;
            border-color: #e2e8f0;
            transform: translateX(-4px);
        }

        .focus-item label {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 0;
            cursor: pointer;
            flex: 1;
        }

        .focus-item input[type="radio"], 
        .focus-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #4f46e5;
        }

        .focus-actions {
            padding: 15px;
            border-top: 1px solid #eee;
            background: #f9f9f9;
            border-radius: 0 0 12px 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .star-filled {
            color: var(--gold);
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
        }

        .star-empty {
            color: #e0e0e0;
        }

        .cell-medal {
            font-size: 1.2em;
            cursor: help;
            margin-left: 5px;
        }

        /* Mass View & Tooltips (Premium Table) */
        table.mass-table {
            border-collapse: separate;
            border-spacing: 0;
            width: 100%;
        }

        table.mass-table th {
            text-align: center;
            cursor: pointer;
            padding: 16px 12px;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #ffffff;
            background: linear-gradient(135deg, #3b82f6, #2563eb);
            border-bottom: 2px solid #1e3a8a;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
            transition: background 0.2s, opacity 0.2s;
        }

        table.mass-table th:nth-child(1),
        table.mass-table th:nth-child(2) {
            background: #f8fafc;
            color: #475569;
            text-shadow: none;
            border-bottom: 2px solid #e2e8f0;
        }

        table.mass-table th:hover {
            opacity: 0.9;
        }

        table.mass-table th[style*="background-color"] {
            color: #ffffff !important;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
            background-image: none !important;
            /* Force inline flat colors to override the gradient */
        }

        table.mass-table td {
            text-align: center;
            padding: 14px 12px;
            font-size: 0.95rem;
            color: #334155;
            border-bottom: 1px solid #f1f5f9;
            transition: all 0.2s;
        }

        /* Override for Fund Name (Second Column) */
        table.mass-table th:nth-child(2),
        table.mass-table td:nth-child(2) {
            text-align: right;
            padding-right: 20px;
            font-weight: 600;
        }

        /* Override for Star Rating */
        table.mass-table th[data-col-type="stars"],
        table.mass-table td[data-col-type="stars"] {
            text-align: center;
        }

        table.mass-table tbody tr {
            background-color: white;
            transition: all 0.2s ease;
        }

        table.mass-table tbody tr:hover {
            background-color: #f8fafc;
            transform: scale(1.002);
            box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.05);
            position: relative;
            z-index: 10;
        }

        tr.avg-row td {
            background-color: rgba(241, 245, 249, 0.8) !important;
            backdrop-filter: blur(8px);
            color: #0f172a !important;
            font-weight: 800;
            border-top: 2px solid #94a3b8;
            border-bottom: 2px solid #94a3b8;
            font-size: 1rem;
        }

        /* --- Hide Ratings Feature --- */
        .hide-ratings #winnerSection,
        .hide-ratings .runner-ups-container {
            display: none !important;
        }

        .hide-ratings tr[data-key="דירוג כוכבים"],
        .hide-ratings tr[data-key="risk_level"] {
            display: none !important;
        }

        .hide-ratings .mass-table th[data-col-type="stars"],
        .hide-ratings .mass-table td[data-col-type="stars"],
        .hide-ratings .mass-table th[data-col-key="risk_level"],
        .hide-ratings .mass-table td[data-col-key="risk_level"] {
            display: none !important;
        }

        .mass-view-header {
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.8);
            border-radius: 1rem;
            padding: 20px 24px;
            margin-bottom: 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        .view-toggle-btn {
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: #475569;
            border: 1px solid rgba(203, 213, 225, 0.5);
            padding: 10px 18px;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            min-width: 120px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 1rem;
            white-space: nowrap;
        }

        .view-toggle-btn i,
        .view-toggle-btn svg {
            width: 24px !important;
            height: 24px !important;
            min-width: 24px;
            min-height: 24px;
        }

        .view-toggle-btn:hover {
            background: rgba(255, 255, 255, 0.9);
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .view-toggle-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            box-shadow: 0 10px 15px -3px rgba(26, 37, 47, 0.3);
            font-weight: 700;
        }

        .view-toggle-btn.active i, 
        .view-toggle-btn.active svg {
            color: white !important;
        }

        .view-toggle-btn i, 
        .view-toggle-btn svg {
            width: 20px !important;
            height: 20px !important;
            transition: transform 0.3s ease;
        }

        .view-toggle-btn:hover i, 
        .view-toggle-btn:hover svg {
            transform: scale(1.1);
        }

        .rating-toggle-btn.header-aligned {
            margin: 0 !important;
            padding: 6px 14px !important;
            font-size: 0.85rem !important;
            height: 36px !important;
            min-width: 0 !important;
            background: rgba(255, 255, 255, 0.8) !important;
            border: 1px solid #cbd5e1 !important;
            color: #475569 !important;
        }

        .rating-toggle-btn.header-aligned:hover {
            background: white !important;
            border-color: var(--primary) !important;
            color: var(--primary) !important;
        }

        .rating-toggle-btn.header-aligned i,
        .rating-toggle-btn.header-aligned svg {
            width: 16px !important;
            height: 16px !important;
        }

        /* --- Date Badges --- */
        .date-badge-container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .date-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 16px;
            border-radius: 50px;
            font-size: 0.85rem;
            font-weight: 800;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            white-space: nowrap;
        }

        .date-badge.blue {
            background: #eef2ff;
            color: #4338ca;
            border: 1px solid #c7d2fe;
        }

        .date-badge.green {
            background: #f0fdf4;
            color: #166534;
            border: 1px solid #bbf7d0;
        }
        
        .date-badge.purple {
            background: #f5f3ff;
            color: #7c3aed;
            border: 1px solid #ddd6fe;
        }


        .date-badge i {
            width: 16px;
            height: 16px;
        }

        .view-toggle-group-full {
            display: flex;
            gap: 6px;
            width: 100%;
        }

        .view-toggle-group-full .view-toggle-btn,
        .view-toggle-group-full .rating-toggle-btn {
            flex: 1;
            min-width: 0;
            /* Allow shrinking */
        }

        .select-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        #globalTooltip {
            position: fixed;
            visibility: hidden;
            background-color: var(--tooltip-bg);
            color: white;
            padding: 10px 15px;
            border-radius: 8px;
            font-size: 0.85rem;
            z-index: 4000 !important;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
            pointer-events: none;
            white-space: normal;
            max-width: 280px;
            text-align: center;
            transform: translate(-50%, -120%);
        }

        #globalTooltip::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            border-width: 6px;
            border-style: solid;
            border-color: var(--tooltip-bg) transparent transparent transparent;
            transform: translateX(-50%);
        }

        /* Mix Generator Period Selector */
        .period-selector-group {
            display: flex;
            background: #e0f2f1;
            border-radius: 8px;
            padding: 4px;
            gap: 4px;
            margin-top: 5px;
        }

        .period-selector-group input[type="radio"] {
            display: none;
        }

        .period-selector-group label {
            flex: 1;
            text-align: center;
            padding: 8px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9em;
            font-weight: 500;
            color: #00695c;
            transition: all 0.2s;
            user-select: none;
        }

        .period-selector-group input[type="radio"]:checked+label {
            background: #00897b;
            color: white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* Modal Overlay Base Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            justify-content: center;
            align-items: center;
        }

        /* Modal Z-Index Fix - Force Fund Card Above Mix Generator */
        #fundModal {
            z-index: 2200 !important;
        }

        #mixGeneratorModal {
            z-index: 2100 !important;
        }

        #mixGeneratorModal .select2-container--default .select2-selection--multiple,
        #mixGeneratorModal .select2-container--default .select2-selection--single {
            height: 48px !important;
            min-height: 48px !important;
            max-height: 48px !important;
            display: flex !important;
            align-items: flex-start !important;
            /* Start from top for better scrolling visibility */
            overflow-y: auto !important;
            border-radius: 10px !important;
            border: 1px solid #cbd5e1 !important;
            padding-top: 4px !important;
            padding-bottom: 4px !important;
        }

        #mixGeneratorModal .select2-container--default .select2-selection--multiple .select2-selection__rendered,
        #mixGeneratorModal .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 1.4 !important;
            /* Reduced from 38px to allow multi-line fit */
            display: flex !important;
            flex-wrap: wrap !important;
            gap: 4px !important;
            padding: 0 10px !important;
            font-size: 0.95rem !important;
        }



        #mixGeneratorModal .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 46px !important;
        }

        .mandatory-highlight {
            border: 2px solid #00897b !important;
            background: #e0f2f1 !important;
            box-shadow: 0 0 10px rgba(0, 137, 123, 0.2) !important;
        }

        .metric-tooltip {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 18px;
            height: 18px;
            background: #999;
            color: white;
            border-radius: 50%;
            font-size: 11px;
            font-weight: bold;
            cursor: help;
            margin-right: 10px;
            position: relative;
            flex-shrink: 0;
        }

        .metric-tooltip:hover {
            background: var(--secondary);
        }

        /* Updated Info Icon Container to hold Reset Button */
        .info-icon-container {
            position: absolute;
            top: 15px;
            left: 15px;
            z-index: 10;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .user-guide-btn {
            background: white !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.2s;
            font-family: 'Rubik', sans-serif;
            text-decoration: none;
            outline: none;
        }

        .user-guide-btn:hover {
            border-color: var(--primary) !important;
            background: #f8fafc !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        }

        .user-guide-btn span {
            color: #334155;
            font-size: 0.625rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.15em;
        }

        .user-guide-btn .info-icon {
            margin: 0;
            width: 20px;
            height: 20px;
            line-height: 20px;
            font-size: 14px;
        }

        .info-icon {
            background-color: var(--primary);
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            text-align: center;
            line-height: 24px;
            font-weight: bold;
            cursor: help;
        }

        .fund-link {
            cursor: pointer;
            text-decoration: none;
            color: #0f172a !important;
            font-weight: 600;
            transition: 0.2s;
        }

        .fund-link:hover {
            color: #3b82f6 !important;
            text-decoration: underline !important;
        }

        th .fund-link {
            color: #0f172a !important;
        }

        /* Winner & Runner Ups */
        .winner-card {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 1);
            border-radius: 1.5rem;
            padding: 24px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 24px;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }

        .winner-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.05));
            z-index: 0;
            pointer-events: none;
        }

        .winner-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.2);
            border-color: rgba(99, 102, 241, 0.3);
        }

        .medal {
            font-size: 4rem;
            position: relative;
            z-index: 1;
            filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
        }

        .winner-info {
            flex-grow: 1;
            position: relative;
            z-index: 1;
        }

        .winner-info h3 {
            margin: 0 0 8px 0;
            color: #0f172a;
            font-size: 1.5rem;
            font-weight: 800;
            letter-spacing: -0.02em;
        }

        .winner-desc {
            font-size: 1rem;
            line-height: 1.6;
            color: #475569;
        }

        .winner-disclaimer {
            font-size: 0.85rem;
            color: #94a3b8;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            font-weight: 500;
        }

        /* --- New Calculator Toggle --- */
        .calc-mode-selector {
            display: flex;
            background: #e2e8f0;
            padding: 4px;
            border-radius: 12px;
            margin-bottom: 20px;
            gap: 4px;
        }

        .calc-mode-btn {
            flex: 1;
            padding: 10px;
            border: none;
            background: transparent;
            color: #64748b;
            font-weight: 700;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.95rem;
        }

        .calc-mode-btn.active {
            background: #6366f1 !important;
            color: white !important;
            box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3) !important;
        }

        /* --- Statistics Grid in Calculator --- */
        .calc-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-top: 20px;
        }

        .calc-stat-card {
            background: #f8fafc;
            padding: 12px;
            border-radius: 10px;
            text-align: center;
            border: 1px solid #e2e8f0;
        }

        .calc-stat-label {
            display: block;
            font-size: 0.75rem;
            color: #64748b;
            margin-bottom: 4px;
            font-weight: 600;
        }

        .calc-stat-value {
            display: block;
            font-size: 1rem;
            font-weight: 800;
            color: #0f172a;
        }

        .calc-stat-value.positive {
            color: #10b981;
        }

        .calc-stat-value.negative {
            color: #ef4444;
        }

        .runner-ups-container {
            margin-bottom: 30px;
        }

        .runner-ups-title {
            font-size: 1.1rem;
            color: #64748b;
            margin-bottom: 12px;
            padding-bottom: 8px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .runner-ups-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .runner-up-card {
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.8);
            border-radius: 1rem;
            padding: 12px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            cursor: pointer;
            transition: all 0.3s;
        }

        .runner-up-card:hover {
            transform: translateX(-4px) scale(1.01);
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(99, 102, 241, 0.2);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .runner-up-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .rank-badge {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #f1f5f9;
            color: #475569;
            display: flex;
            justify-content: center;
            align-items: center;
            font-weight: 800;
            font-size: 1rem;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .rank-2 {
            background: #f8fafc;
            color: #334155;
            border: 2px solid #cbd5e1;
        }

        .rank-3 {
            background: #fff7ed;
            color: #9a3412;
            border: 2px solid #fed7aa;
        }

        .runner-up-name {
            font-weight: 700;
            color: #0f172a;
            font-size: 1.05rem;
        }

        .runner-up-right {
            display: flex;
            align-items: center;
        }

        /* Accordion & Chat */
        /* Accordion Sections */
        .report-section-wrapper {
            page-break-inside: avoid;
            break-inside: avoid;
            margin-bottom: 32px;
            width: 100%;
            box-sizing: border-box;
            background: rgba(255, 255, 255, 0.4);
            border-radius: 1.5rem;
            padding: 0 24px 24px;
            border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
            backdrop-filter: blur(8px);
        }

        .section-header {
            display: flex;
            align-items: center;
            cursor: pointer;
            margin-top: 32px;
            margin-bottom: 16px;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 12px;
            transition: opacity 0.2s;
        }

        .section-header:hover {
            opacity: 0.8;
        }

        .section-vis-btn {
            background: rgba(255, 255, 255, 0.7);
            color: #3b82f6;
            border: 1px solid rgba(59, 130, 246, 0.3);
            padding: 8px 16px;
            border-radius: 2rem;
            cursor: pointer;
            font-weight: 700;
            font-size: 0.9rem;
            transition: all 0.2s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(8px);
        }

        .section-vis-btn:hover {
            background: #3b82f6;
            color: white;
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
            transform: translateY(-1px);
        }

        .section-title {
            color: #0f172a;
            font-size: 1.6rem;
            font-weight: 900;
            letter-spacing: -0.02em;
            margin: 0;
            display: inline-block;
        }

        .toggle-icon {
            font-size: 1em;
            margin-right: 12px;
            color: #94a3b8;
            transition: transform 0.3s;
        }

        .toggle-icon.open {
            transform: rotate(180deg);
        }

        .section-desc {
            display: none;
            background: rgba(248, 250, 252, 0.8);
            backdrop-filter: blur(8px);
            padding: 16px;
            border-left: 4px solid #6366f1;
            margin-bottom: 20px;
            border-radius: 0 12px 12px 0;
            font-size: 0.95rem;
            line-height: 1.6;
            color: #475569;
        }

        /* AI Section Glassmorphism */
        .ai-section {
            background: rgba(240, 249, 255, 0.6);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.8);
            border-radius: 1.5rem;
            padding: 24px;
            margin-top: 40px;
            box-shadow: 0 10px 30px -10px rgba(14, 165, 233, 0.15);
        }

        .select2-dropdown {
            border: 1px solid #e2e8f0 !important;
            border-radius: 1rem !important;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
            overflow: hidden !important;
            margin-top: 8px !important;
            z-index: 1000 !important;
        }



        .chat-box {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            height: 650px !important;
            min-height: 650px !important;
            overflow-y: auto;
            padding: 15px;
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            position: relative; /* For centered absolute elements if needed */
        }

        /* AI Magic Start Screen */
        .ai-magic-container {
            text-align: center;
            padding: 60px 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
        }



        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }

        .ai-magic-title {
            background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 3.8rem;
            font-weight: 900;
            margin: 0 0 20px 0;
            letter-spacing: -0.03em;
        }

        .ai-magic-description {
            color: #64748b;
            font-size: 1.6rem;
            max-width: 700px;
            line-height: 1.5;
            margin-bottom: 50px;
            font-weight: 400;
        }

        .ai-magic-btn {
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
            color: white !important;
            padding: 22px 65px !important;
            font-size: 1.8rem !important;
            font-weight: 800 !important;
            border-radius: 100px !important;
            border: none !important;
            cursor: pointer !important;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
            box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.4) !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 15px !important;
            text-decoration: none !important;
        }

        .ai-magic-btn:hover {
            transform: translateY(-5px) scale(1.05) !important;
            box-shadow: 0 20px 40px -5px rgba(99, 102, 241, 0.5) !important;
            background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%) !important;
        }

        .ai-magic-btn:active {
            transform: scale(0.98) !important;
        }

        .ai-magic-btn i {
            transition: transform 0.4s ease;
        }

        .ai-magic-btn:hover i {
            transform: rotate(20deg) scale(1.2);
        }

        .message {
            padding: 12px 18px;
            border-radius: 12px;
            max-width: 90%;
            line-height: 1.6;
            font-size: 1.15rem;
        }

        .msg-ai {
            background: #f1f8ff;
            align-self: flex-start;
            transition: all 0.2s ease;
        }

        .msg-ai[contenteditable="true"]:hover {
            background: #fff;
            box-shadow: 0 0 0 1px #cbd5e1;
            cursor: text;
        }

        .msg-ai[contenteditable="true"]:focus {
            background: #fff;
            box-shadow: 0 0 0 2px #4f46e5;
            outline: none;
            cursor: text;
        }

        .msg-user {
            background: var(--primary);
            color: white;
            align-self: flex-end;
            gap: 10px;
        }

        .chat-input-area {
            display: flex;
            gap: 10px;
        }

        .chat-input-area input {
            flex-grow: 1;
            padding: 12px;
            border: 1px solid #ccc;
            border-radius: 8px;
        }

        /* --- AI Premium Header & Buttons --- */
        .ai-header-premium {
            background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-weight: 900 !important;
            font-size: 1.5rem !important;
            letter-spacing: -0.02em;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .ai-action-btn-premium {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 18px;
            border-radius: 50px;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid rgba(99, 102, 241, 0.2);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            white-space: nowrap;
        }

        .ai-btn-refresh {
            background: rgba(232, 245, 233, 0.8);
            color: #2e7d32;
            border-color: rgba(46, 125, 50, 0.2);
        }

        .ai-btn-refresh:hover {
            background: #e8f5e9;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(46, 125, 50, 0.15);
        }

        .ai-btn-focus {
            background: rgba(227, 242, 253, 0.8);
            color: #1565c0;
            border-color: rgba(21, 101, 192, 0.2);
        }

        .ai-btn-focus:hover {
            background: #e3f2fd;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(21, 101, 192, 0.15);
        }

        .ai-action-btn-premium i, .ai-action-btn-premium svg {
            width: 16px;
            height: 16px;
            transition: transform 0.3s ease;
        }

        .ai-action-btn-premium:hover i, .ai-action-btn-premium:hover svg {
            transform: rotate(15deg) scale(1.1);
        }

        /* --- Report Action Buttons (Card Style like Dashboard) --- */
        .report-actions-container {
            display: flex;
            justify-content: center;
            align-items: stretch;
            gap: 20px;
            margin: 40px auto 20px;
            width: 100%;
            max-width: 800px;
            flex-wrap: nowrap;
            /* Force side-by-side */
            padding: 0 20px;
        }

        .print-btn,
        .reasoning-report-btn {
            flex: 1;
            min-width: 0;
            position: relative;
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
            padding: 20px !important;
            background: white !important;
            border: 1px solid #e2e8f0 !important;
            border-radius: 1.5rem !important;
            cursor: pointer !important;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
            overflow: hidden;
            text-decoration: none !important;
            height: 110px !important;
        }

        .btn-icon-wrapper {
            position: relative;
            z-index: 2;
            padding: 10px;
            border-radius: 12px;
            margin-bottom: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .print-btn .btn-icon-wrapper {
            background: linear-gradient(135deg, #1e3a8a, #3b82f6);
        }

        .reasoning-report-btn .btn-icon-wrapper {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
        }

        .print-btn i,
        .reasoning-report-btn i {
            width: 22px !important;
            height: 22px !important;
            color: white !important;
        }

        .btn-text {
            position: relative;
            z-index: 2;
            font-weight: 800;
            color: #334155;
            font-size: 0.95rem;
            letter-spacing: -0.0125em;
            transition: color 0.3s;
        }

        .print-btn:hover,
        .reasoning-report-btn:hover {
            transform: translateY(-5px);
            border-color: #cbd5e1;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
            background: #f8fafc !important;
        }

        .reasoning-report-btn:hover {
            border-color: #fbbf24 !important;
        }

        .print-btn:hover {
            border-color: #3b82f6 !important;
        }

        .print-btn:hover .btn-icon-wrapper,
        .reasoning-report-btn:hover .btn-icon-wrapper {
            transform: scale(1.1);
        }

        .print-btn:active,
        .reasoning-report-btn:active {
            transform: scale(0.96);
        }

        .footer-disclaimer {
            margin-top: auto;
            padding-top: 40px;
            border-top: 1px solid #ddd;
            font-size: 0.85rem;
            color: #666;
            text-align: center;
            line-height: 1.6;
        }

        .loader {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #00897b;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 20px auto;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* Modals General */

        .modal-content {
            background: white;
            width: 90%;
            max-width: 900px;
            max-height: 90vh;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: slideUp 0.3s ease-out;
        }

        .modal-header {
            background: var(--primary);
            color: white;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            flex-shrink: 0;
            min-height: 60px;
        }

        .modal-header h2 {
            color: white !important;
            margin: 0;
            font-size: 1.5rem;
            font-weight: 700;
        }

        .modal-header .fund-id-badge {
            margin-bottom: 0 !important;
            display: inline-flex !important;
            align-items: center !important;
            background: rgba(255, 255, 255, 0.2) !important;
            color: white !important;
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            height: auto !important;
            min-height: 28px !important;
            font-size: 1.15rem !important;
            padding: 2px 14px !important;
            border-radius: 20px !important;
            font-weight: 700 !important;
            pointer-events: auto !important;
            margin-right: 12px !important;
            flex-shrink: 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        }

        .modal-body {
            padding: 15px;
            overflow-y: auto;
        }

        .modal-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
        }

        .modal-card {
            background: white;
            padding: 15px;
            border-radius: 8px;
            border: 1px solid #eee;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .modal-card h3 {
            color: var(--secondary);
            margin-top: 0;
            border-bottom: 1px solid #eee;
            padding-bottom: 8px;
            font-size: 1.1rem;
        }

        .data-row {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            border-bottom: 1px solid #f9f9f9;
            font-size: 0.9rem;
        }

        .data-label {
            color: #000;
            font-weight: 700;
        }

        /* FIX: Bold Black Label */
        .data-value {
            color: #333;
            font-weight: 400;
            unicode-bidi: isolate;
            direction: rtl;
            text-align: right;
        }

        /* FIX: Normal Value */
        .close-modal {
            background: transparent;
            border: none;
            color: white;
            font-size: 2rem;
            cursor: pointer;
        }

        @keyframes slideUp {
            from {
                transform: translateY(50px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* Synthetic Builder (Original) */
        .synth-controls {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
        }

        .synth-controls select {
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            border: 1px solid #ccc;
        }

        .synth-list {
            max-height: 300px;
            overflow-y: auto;
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 10px;
        }

        .synth-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            border-bottom: 1px solid #f1f1f1;
        }

        .synth-item:last-child {
            border-bottom: none;
        }

        .synth-item-name {
            flex-grow: 1;
            font-weight: bold;
        }

        .synth-item-inputs {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .synth-weight-input {
            width: 60px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
            text-align: center;
        }

        .synth-add-btn {
            background: var(--secondary);
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            cursor: pointer;
        }

        .selected-synth-list {
            margin-top: 20px;
            background: #e8f5e9;
            padding: 15px;
            border-radius: 8px;
        }

        .total-weight {
            font-weight: bold;
            margin-top: 10px;
            text-align: left;
            color: var(--primary);
        }

        .total-weight.error {
            color: red;
        }

        /* --- Legacy/Common Calculator Layout (Used by Portfolio Check) --- */
        .calc-layout {
            display: flex;
            gap: 30px;
            align-items: flex-start;
        }

        .calc-sidebar {
            flex: 0 0 320px;
            min-width: 320px;
        }

        .calc-main {
            flex: 1;
            min-width: 0;
        }

        .calc-card {
            background: white;
            padding: 24px;
            border-radius: 16px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            margin-bottom: 20px;
        }

        .calc-card-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* --- Empty State --- */
        .empty-state-modern {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border-radius: 24px;
            border: 2px dashed #e2e8f0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin-top: 20px;
        }

        .empty-icon-circle {
            width: 80px;
            height: 80px;
            background: #f1f5f9;
            border-radius: 50%;
            margin-bottom: 20px;
            position: relative;
        }

        .empty-icon-circle::after {
            content: '📊';
            font-size: 40px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        @media (max-width: 1024px) {
            .calc-layout {
                flex-direction: column;
            }

            .calc-sidebar {
                flex: none;
                width: 100%;
                min-width: 0;
            }
        }

        /* ====================================================================================
           🔥 NEW CALCULATOR CSS (UPGRADED LAYOUT V4 PREMIUM) 
           ==================================================================================== */
        .text-gradient-indigo {
            background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .calc-layout-v2 {
            display: flex;
            flex-direction: column;
            gap: 25px;
            height: auto;
        }

        .calc-inputs-v2 {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }

        .calc-header-v2 {
            background: transparent;
            padding: 10px 0;
            border-radius: 0;
            margin-bottom: 5px;
            border: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-align: center;
            box-shadow: none;
            position: relative;
        }

        .calc-header-v2 h3 {
            margin: 0;
            font-weight: 900;
            font-size: 1.5rem;
            color: #1e293b;
            letter-spacing: -0.02em;
        }

        .calc-badge-activity {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 16px;
            background: #f0f7ff;
            color: #1d4ed8;
            border: 1px solid #dbeafe;
            border-radius: 9999px;
            font-size: 0.85rem;
            font-weight: 800;
            box-shadow: 0 2px 4px rgba(29, 78, 216, 0.05);
        }

        .calc-section-v2 {
            background: #fff;
            padding: 20px;
            border-radius: 1.5rem;
            border: 1px solid #f1f5f9;
            box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.04);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .calc-section-v2::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            background: transparent;
            z-index: 10;
        }

        .fund-section-a::before {
            background: #6366f1;
        }

        .fund-section-b::before {
            background: #f59e0b;
        }

        .calc-section-v2:hover {
            transform: translateY(-6px);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
            border-color: #cbd5e1;
        }

        .calc-input-group-v2 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 25px;
        }

        .input-row label {
            font-size: 0.85rem;
            font-weight: 800;
            color: #475569;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }

        .input-wrapper input,
        .calc-inputs-v2 select {
            width: 100%;
            padding: 16px 16px 16px 48px;
            border: 1px solid #e2e8f0;
            border-radius: 1.25rem;
            font-size: 1.1rem;
            font-weight: 700;
            color: #0f172a;
            outline: none;
            transition: all 0.2s;
            box-sizing: border-box;
            background: #f8fafc;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
        }

        .input-wrapper input:focus,
        .calc-inputs-v2 select:focus {
            background: #fff;
            border-color: #6366f1;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
        }

        .input-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            font-size: 0.9rem;
            font-weight: 800;
            pointer-events: none;
            background: white;
            padding: 4px 8px;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        /* Fund Comparison Grid */
        .calc-fund-comparison-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 25px;
            width: 100%;
        }

        /* Result Box Restoration */
        .box-result-summary {
            margin-top: 25px;
            padding-top: 25px;
            border-top: 2px dashed #f1f5f9;
        }

        .box-result-main-val {
            font-size: 3rem;
            font-weight: 950;
            color: #1e1b4b;
            margin-bottom: 15px;
            letter-spacing: -0.04em;
        }

        .fund-section-b .box-result-main-val {
            color: #92400e;
        }

        .box-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-top: 20px;
        }

        .box-stat-item {
            background: white;
            padding: 15px;
            border-radius: 1.25rem;
            border: 1px solid #f1f5f9;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
            text-align: right;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .box-stat-label {
            font-size: 0.75rem;
            color: #64748b;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .box-stat-val {
            font-size: 1.25rem;
            font-weight: 900;
            color: #0f172a;
        }

        /* Chart Bottom Row Cleanup */
        .calc-bottom-row {
            margin-top: 15px;
            background: white;
            padding: 40px;
            border-radius: 2.5rem;
            border: 1px solid #f1f5f9;
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.05);
        }

        /* Mode Selector High End */
        .calc-mode-selector {
            display: flex;
            background: #f1f5f9;
            padding: 4px;
            border-radius: 0.75rem;
            gap: 4px;
            border: 1px solid #e2e8f0;
            width: fit-content;
        }

        .calc-mode-btn {
            border: none;
            padding: 8px 20px;
            border-radius: 0.6rem;
            font-size: 0.85rem;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.2s ease;
            color: #64748b;
            background: transparent;
            white-space: nowrap;
        }

        .calc-mode-btn.active {
            background: #6366f1;
            color: white;
            box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.3);
        }

        /* Comparison Button V4 */
        /* Comparison Table V5 */
        .comparison-table-v5-wrapper {
            width: 100%;
            overflow-x: auto;
            overflow-y: visible;
            background: white;
            border-radius: 1.5rem;
            border: 1px solid #f1f5f9;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
            margin-top: 20px;
            padding: 15px 0;
        }

        .calc-comparison-table {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            /* Strict column widths */
            min-width: 950px;
            /* Ensure space for 3 columns */
        }

        .calc-comparison-table th,
        .calc-comparison-table td {
            padding: 15px;
            border-bottom: 2px solid #e2e8f0;
            border-left: 2px solid #e2e8f0;
            text-align: center;
            vertical-align: middle;
        }

        .calc-comparison-table tr:hover td {
            background-color: #f8fafc;
        }

        .premium-hero-row td {
            background-color: #f0f7ff !important;
            font-weight: 900 !important;
            color: #1e293b !important;
            border-bottom: 2px solid #6366f1 !important;
        }

        .premium-hero-row td:first-child {
            color: #6366f1 !important;
        }

        .main-val-cell {
            font-size: 1.2rem;
            color: #6366f1;
            font-weight: 950;
        }

        /* V2 Single Row Input Layout */
        .calc-input-group-v2 {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 20px;
            justify-content: space-between;
            align-items: flex-end;
            background: #fff;
            padding: 24px;
            border-radius: 1.5rem;
            border: 1px solid #e2e8f0;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        }

        .calc-input-group-v2 .input-row {
            flex: 1;
            min-width: 0;
            margin-bottom: 0 !important;
        }

        .calc-input-group-v2 .input-row label {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
            margin-bottom: 8px;
            font-size: 0.8rem;
            font-weight: 800;
            color: #64748b;
        }

        @media (max-width: 900px) {
            .calc-input-group-v2 {
                flex-wrap: wrap;
            }

            .calc-input-group-v2 .input-row {
                flex: 1 1 calc(50% - 10px);
            }
        }

        /* Simple Mode Cards - Refined Premium Design */
        .simple-results-v5 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
            gap: 24px;
            margin-bottom: 30px;
            padding: 10px;
        }

        .simple-card-v5 {
            background: #ffffff;
            border-radius: 24px;
            padding: 24px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.02);
            border: 1px solid #f1f5f9;
            position: relative;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .simple-card-v5:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
            border-color: #e2e8f0;
        }

        .simple-card-v5::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 6px;
            height: 100%;
            background: var(--primary);
            border-radius: 0 4px 4px 0;
        }

        .simple-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid #f8fafc;
        }

        .simple-card-title {
            font-weight: 900;
            font-size: 1.25rem;
            color: #1e293b;
            letter-spacing: -0.02em;
        }

        .simple-card-metrics {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .simple-metric-item {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
        }

        .simple-metric-label {
            color: #64748b;
            font-size: 0.95rem;
            font-weight: 500;
        }

        .simple-metric-val {
            font-weight: 800;
            font-size: 1.1rem;
            color: #334155;
        }

        .simple-metric-val.hero {
            font-size: 1.75rem;
            color: #6366f1;
            font-weight: 950;
            background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .simple-metric-val.profit {
            color: #10b981;
            font-size: 1.25rem;
        }

        .simple-card-footer-note {
            margin-top: 15px;
            font-size: 0.75rem;
            color: #94a3b8;
            font-style: italic;
        }

        /* Fee Inputs inside Simple Cards */
        .simple-card-fees {
            display: flex;
            gap: 12px;
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px dashed #e2e8f0;
        }

        .simple-fee-item {
            flex: 1;
        }

        .simple-fee-label {
            display: block;
            font-size: 0.7rem;
            font-weight: 800;
            color: #94a3b8;
            margin-bottom: 4px;
        }

        .simple-fee-input-wrapper {
            position: relative;
        }

        .simple-fee-input-wrapper input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 700;
            color: #1e293b;
            background: #f8fafc;
            text-align: center;
        }

        .simple-fee-input-wrapper .input-icon {
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.65rem;
            color: #94a3b8;
            pointer-events: none;
        }

        .calc-comparison-table th:first-child,
        .calc-comparison-table td:first-child {
            width: 200px;
            text-align: right;
            background: #f1f5f9;
            border-left: 2px solid #e2e8f0;
            font-weight: 800;
            color: #475569;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.025em;
            position: sticky;
            right: 0;
            z-index: 5;
        }

        .calc-comparison-table tr:last-child td {
            border-bottom: 2px solid #e2e8f0;
        }

        .calc-comparison-table th {
            border-top: 2px solid #e2e8f0;
        }

        .calc-comparison-table .fund-col-header {
            position: relative;
            background: #fff;
            padding: 20px 15px;
        }

        .calc-comparison-table .fund-id-badge {
            font-size: 0.7rem;
            background: #f1f5f9;
            padding: 2px 8px;
            border-radius: 4px;
            color: #64748b;
            margin-bottom: 5px;
            display: inline-block;
        }

        .calc-comparison-table .remove-fund-btn {
            position: absolute;
            top: 5px;
            left: 5px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #fee2e2;
            color: #ef4444;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
        }

        .calc-comparison-table .remove-fund-btn:hover {
            background: #ef4444;
            color: white;
            transform: scale(1.1);
        }

        .calc-comparison-table .main-val-cell {
            font-size: 1.25rem;
            font-weight: 900;
            color: #1e1b4b;
        }

        .calc-comparison-table .stat-val-cell {
            font-size: 1rem;
            font-weight: 800;
            color: #334155;
        }

        #addCompareBtnContainer button {
            background: #f1f5f9;
            border: 2px dashed #cbd5e1;
            color: #64748b;
            font-weight: 800;
            font-size: 0.95rem;
            padding: 14px 28px;
            border-radius: 1rem;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        #addCompareBtnContainer button:hover {
            border-color: #6366f1;
            background: #f8fafc;
            color: #6366f1;
            transform: translateY(-2px);
        }

        @media (max-width: 1024px) {
            .calc-fund-comparison-row {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .calc-top-row {
                grid-template-columns: 1fr;
            }
        }

        @media print {
            body {
                margin: 0;
                padding: 0;
                background: white;
                color: black;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            .controls-wrapper,
            .risk-top-bar,
            .search-row-container,
            .chat-input-area,
            .report-actions-container,
            .print-btn,
            .reasoning-report-btn,
            .view-toggle-btn,
            .info-icon-container,
            .select2-container,
            .select-checkbox,
            .metric-tooltip,
            .toggle-icon,
            button,
            .fees-toggle-btn,
            .close-comp-btn {
                display: none !important;
            }

            .company-logo-top {
                display: block !important;
                position: absolute;
                top: 0;
                left: 0;
                height: 70px;
                width: auto;
            }

            header,
            footer,
            .url-header,
            .date-footer {
                display: none !important;
            }

            .container {
                box-shadow: none;
                border: none;
                padding: 0;
                width: 100%;
                max-width: 100%;
                margin: 0;
                min-height: auto;
                display: block;
                position: relative;
                border-top: none;
            }

            .header {
                display: block !important;
                margin-bottom: 20px;
                margin-top: 20px;
            }

            .header img.main-logo {
                display: block !important;
                height: 120px;
                width: auto;
                margin: 0 auto 10px auto;
            }

            .header h1 {
                display: block !important;
                font-size: 2rem;
                color: var(--primary) !important;
                margin: 0;
            }

            .header h2 {
                display: block !important;
                font-size: 1rem;
                color: #666 !important;
                margin-top: 5px;
            }

            #reportContent {
                display: block !important;
            }

            table {
                page-break-inside: auto;
                width: 100%;
                border: 1px solid #e2e8f0;
                font-size: 0.85rem;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            tr {
                page-break-inside: avoid;
            }

            thead {
                display: table-header-group;
            }

            tfoot {
                display: table-footer-group;
            }

            th {
                background-color: #f1f5f9 !important;
                color: #0f172a !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            td {
                color: #334155 !important;
                border-bottom: 1px solid #e2e8f0 !important;
            }

            tr.avg-row td {
                background-color: #f8fafc !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            table.comparison-table th:first-child,
            table.comparison-table td:first-child {
                background-color: #f8fafc !important;
                color: #0f172a !important;
                position: static !important;
                display: table-cell;
                width: auto !important;
                min-width: auto !important;
                border: 1px solid #cbd5e1;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            table.mass-table th:first-child,
            table.mass-table td:first-child {
                display: none;
            }

            .winner-card,
            .ai-section,
            .report-section-wrapper {
                page-break-inside: avoid;
                border: 1px solid #eee;
                box-shadow: none;
                margin-bottom: 20px;
            }

            .section-desc {
                display: block !important;
                border: none;
                padding: 5px 0;
                margin-bottom: 10px;
            }

            [id^="table-container-"] {
                display: block !important;
                visibility: visible !important;
            }

            table.comparison-table,
            .tab-content,
            #reportTabs {
                display: block !important;
                visibility: visible !important;
                opacity: 1 !important;
            }

            .chat-box {
                height: auto !important;
                max-height: none !important;
                overflow: visible !important;
                border: none;
                padding: 0;
            }

            .star-filled {
                color: #ffc107 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .star-empty {
                color: #ccc !important;
            }

            .footer-disclaimer {
                display: block !important;
                margin-top: 30px;
                page-break-inside: avoid;
                text-align: center;
                font-size: 0.75rem;
                color: #555;
                border-top: 1px solid #ddd;
                padding-top: 15px;
            }

            .footer-disclaimer img {
                height: 45px;
                margin-top: 10px;
                opacity: 1;
            }

            a {
                text-decoration: none;
                color: black;
            }

            .calc-card,
            .chart-wrapper {
                border: 1px solid #ccc;
                box-shadow: none;
            }

            canvas {
                max-width: 100% !important;
            }
        }

        /* Non-tradable Modal Styles */
        .nontradable-modal {
            width: 90%;
            max-width: 1000px;
            background: white;
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
            animation: modalSlide 0.3s ease-out;
        }

        .nontradable-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        .nontradable-table thead th {
            background: #000 !important;
            color: #fff !important;
            font-weight: 700;
            padding: 15px;
            text-align: right;
            border-bottom: 2px solid #eee;
        }

        .nontradable-table td {
            padding: 12px 15px;
            border-bottom: 1px solid #eee;
            color: #444;
        }

        .nontradable-table tr:hover {
            background: #f1f7ff;
        }

        /* Trigger Row Effects - Specific to comparison-table tbody tr */
        table.comparison-table tbody tr.clickable-row {
            cursor: pointer !important;
            transition: all 0.2s;
            position: relative;
        }

        table.comparison-table tbody tr.clickable-row td {
            cursor: pointer !important;
        }

        table.comparison-table tbody tr.clickable-row:hover td {
            color: #007bff !important;
            background: #f0f7ff !important;
            box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.1);
        }

        table.comparison-table tbody tr.clickable-row:active {
            transform: scale(0.99);
            background: #e1efff !important;
        }

        .clickable-row td:first-child {
            color: var(--primary);
            font-weight: 600;
            text-decoration: underline;
        }

        .modal-subtitle {
            font-size: 0.9rem;
            color: #666;
            margin-top: 5px;
        }

        /* --- KPI Card & Container System --- */
        .kpi-container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .kpi-card {
            background: white;
            padding: 20px;
            border-radius: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
            text-align: right;
            border: 1px solid #f1f5f9;
            position: relative;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-height: 100px;
        }

        .kpi-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
            border-color: #6366f1;
        }

        /* Portfolio Specific Overrides */
        .portfolio-kpis .kpi-card {
            flex-direction: row;
            height: 120px;
            gap: 15px;
        }

        .portfolio-kpis .kpi-card::before {
            display: none;
        }

        .kpi-icon-wrapper {
            width: 60px;
            height: 60px;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: transform 0.3s ease;
        }

        .kpi-icon-wrapper i {
            width: 32px;
            height: 32px;
        }

        /* Color Variants for Icons */
        .kpi-icon-indigo { background: #eef2ff; color: #4f46e5; }
        .kpi-icon-purple { background: #f5f3ff; color: #8b5cf6; }
        .kpi-icon-amber { background: #fffbeb; color: #d97706; }
        .kpi-icon-emerald { background: #ecfdf5; color: #059669; }
        .kpi-icon-rose { background: #fff1f2; color: #e11d48; }
        .kpi-icon-blue { background: #eff6ff; color: #2563eb; }
        .kpi-icon-slate { background: #f8fafc; color: #475569; }

        .kpi-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
            overflow: hidden;
        }

        .kpi-label {
            font-size: 0.95rem;
            color: #64748b;
            font-weight: 700;
            margin-bottom: 2px;
            text-transform: none;
            letter-spacing: 0;
            min-height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1.4;
            width: 100%;
        }

        .portfolio-kpis .kpi-label {
            justify-content: flex-start;
        }

        .kpi-value {
            font-size: 1.85rem;
            font-weight: 800;
            color: #1e293b;
            font-family: 'Rubik', sans-serif;
            letter-spacing: -0.5px;
            line-height: 1.1;
            text-align: center;
        }

        .portfolio-kpis .kpi-value {
            text-align: right;
        }

        .portfolio-kpis .kpi-card.nt-split-card {
            cursor: pointer;
            position: relative;
            padding: 0; /* Let front/back handle padding */
        }

        .nt-front, .nt-back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            padding: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            gap: 15px;
        }

        .nt-back {
            opacity: 0;
            transform: translateY(10px);
            pointer-events: none;
            flex-direction: column;
            background: #f8fafc;
            gap: 8px;
        }

        .nt-split-card.nt-show-detail .nt-front {
            opacity: 0;
            transform: translateY(-10px);
            pointer-events: none;
        }

        .nt-split-card.nt-show-detail .nt-back {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .nt-hint {
            position: absolute;
            left: 15px;
            bottom: 15px;
            font-size: 0.72rem;
            color: #4f46e5;
            font-weight: 800;
            background: #f0f4ff;
            padding: 8px 16px;
            border-radius: 50px;
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 20; /* Ensure it's above both front and back */
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.08);
            border: 1px solid rgba(79, 70, 229, 0.1);
        }

        .nt-split-card.nt-show-detail .nt-hint {
            bottom: auto;
            top: 8px;
            left: 8px;
            width: 28px;
            height: 28px;
            padding: 0;
            border-radius: 50%;
            background: #ffffff;
            border: 1.5px solid #e2e8f0;
            color: #64748b;
            justify-content: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .nt-split-card.nt-show-detail .nt-hint span {
            display: none; /* Hide text in detail mode */
        }

        .nt-split-card.nt-show-detail .nt-hint:hover {
            background: #f8fafc;
            color: #4f46e5;
            border-color: #4f46e5;
        }

        .nt-hint span {
            writing-mode: horizontal-tb;
        }

        .nt-micro-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px 15px; /* Reduced vertical gap to lift the bottom row */
            width: 100%;
            margin-top: 0px; /* Removed margin to pull it up */
        }

        .nt-grid-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .nt-grid-label {
            font-size: 0.68rem;
            color: #64748b;
            font-weight: 700;
            margin-top: -3px; /* Pull label closer to value */
        }

        .nt-grid-value {
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            font-size: 0.95rem;
            font-weight: 800;
            color: #1e293b;
            margin-bottom: 0px;
        }

        .kpi-sub {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-top: 1px;
        }

        .charts-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .chart-box {
            background: white;
            border-radius: 12px;
            padding: 10px 15px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
            border: 1px solid #f0f0f0;
            display: flex;
            flex-direction: column;
            height: auto;
            min-height: 320px;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            border-bottom: 1px solid #f5f5f5;
            padding-bottom: 10px;
        }

        .chart-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: #34495e;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chart-icon {
            background: #eef2f6;
            padding: 6px;
            border-radius: 8px;
        }

        .modern-table-container {
            background: white;
            border-radius: 16px;
            padding: 0;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
            overflow: hidden;
            border: 1px solid #f0f0f0;
        }

        .modern-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px;
        }

        .modern-table thead {
            border-bottom: 2px solid #eef2f6;
        }

        .modern-table th {
            background: #000000;
            padding: 15px 20px;
            text-align: right;
            font-size: 0.85rem;
            font-weight: 700;
            color: white;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .modern-table td {
            padding: 15px 20px;
            border-bottom: 1px solid #f5f5f5;
            color: #2c3e50;
            font-size: 0.95rem;
            font-weight: 500;
        }

        .modern-table tr:last-child td {
            border-bottom: none;
        }

        .modern-table tr:hover td {
            background: #fbfbfb;
        }

        .modal-content.portfolio-modal {
            max-width: 1400px !important;
            background: #f4f6f9 !important;
        }

        .empty-state-modern {
            text-align: center;
            padding: 60px 20px;
            color: #bdc3c7;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            border: 2px dashed #e0e0e0;
            border-radius: 16px;
            margin: 20px;
            background: rgba(255, 255, 255, 0.5);
        }

        .empty-icon-circle {
            width: 100px;
            height: 100px;
            background: #ecedf0;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            margin-bottom: 20px;
            color: #95a5a6;
        }

        @media (max-width: 1100px) {
            .kpi-container {
                grid-template-columns: 1fr;
            }

            .charts-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Fix for Fund Modal overlap */
        #fundModal {
            z-index: 2200 !important;
        }

        /* --- New Buttons Grid Layout --- */
        .buttons-grid-row {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 15px;
            width: 100%;
            align-items: center;
            margin-top: 5px;
        }

        #mixGeneratorModal {
            z-index: 2100 !important;
        }

        /* Mix Generator Select2 Font Fix */
        #mixGeneratorModal .select2-search__field {
            font-size: 0.85rem !important;
        }

        .buttons-grid-row button {
            width: 100%;
            height: 52px;
            /* Fixed height for uniformity */
            margin: 0 !important;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0;
            /* Let flex center the content */
            font-size: 1rem;
            white-space: nowrap;
        }


        /* Default Desktop Style for Currency Text */
        .geo-exposure-text {
            font-size: 1.1rem;
            font-weight: bold;
            color: #2c3e50;
            margin-top: 10px;
            text-align: center;
        }

        /* =========================================
   📱 Mobile Responsive Styles (Refined)
   ========================================= */
        @media (max-width: 900px) {

            /* --- Global Reductions for Overview --- */
            body {
                padding: 5px;
            }

            /* Minimized padding */
            h1 {
                font-size: 1.3rem;
                margin-bottom: 5px;
            }

            /* Smaller Title */
            h2 {
                font-size: 0.9rem;
                margin-top: 2px;
            }

            .header img.main-logo {
                height: 80px;
            }

            /* Smaller Logo */

            .company-logo-top {
                height: 40px;
                top: 5px;
                left: 5px;
            }

            /* Compact Buttons */
            .buttons-grid-row button,
            button.action-btn,
            button.synth-btn-top,
            button.risk-btn,
            button.calc-btn {
                height: 42px;
                /* Reduced height */
                font-size: 0.95rem;
            }

            /* Basic Layout Adjustments */
            .container {
                padding: 10px;
                width: 100%;
                border-radius: 0;
                box-shadow: none;
                border-top: none;
                min-height: auto;
            }

            /* Top Action Bar (Buttons) */
            .risk-top-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
                padding: 0;
            }

            .buttons-grid-row {
                grid-template-columns: 1fr;
                gap: 8px;
                width: 100%;
                margin-top: 0;
            }

            /* Filters Section - Compact */
            .controls-wrapper {
                padding: 10px;
                margin-bottom: 15px;
            }

            .filters-row {
                grid-template-columns: 1fr;
                gap: 10px;
                margin-bottom: 15px;
            }

            .search-row-container {
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
            }

            /* Select2 Size Fix */
            .select2-container .select2-selection--single,
            .select2-container .select2-selection--multiple {
                height: 42px !important;
                min-height: 42px !important;
                max-height: 42px !important;
            }

            .select2-container--default .select2-selection--single .select2-selection__rendered {
                line-height: 42px !important;
            }

            .select2-container--default .select2-selection--single .select2-selection__arrow {
                height: 40px !important;
            }

            /* Info Icon & Reset */
            .info-icon-container {
                position: relative;
                top: auto;
                left: auto;
                margin-bottom: 10px;
                justify-content: flex-end;
            }

            /* --- Sticky Fund Names (Mass View - Only for main table) --- */
            .mass-table th:nth-child(2),
            .mass-table td:nth-child(2) {
                position: sticky;
                right: 0;
                z-index: 5;
                background-color: #fff;
                border-right: 2px solid #ddd;
            }

            .mass-table th:nth-child(2) {
                background-color: var(--primary);
                color: white;
                z-index: 6;
            }

            .mass-table th:nth-child(1),
            .mass-table td:nth-child(1) {
                position: sticky;
                right: -1px;
                background-color: #f9f9f9;
                z-index: 5;
            }

            .mass-table th:nth-child(1) {
                z-index: 6;
                background-color: var(--primary);
            }


            /* --- Compact Modals (Mix & Portfolio) --- */
            .modal-content {
                width: 98% !important;
                max-width: 98% !important;
                margin: 5px auto;
                max-height: 90vh;
                /* More height */
            }

            .modal-body {
                padding: 10px;
                overflow-y: auto;
            }

            /* FORCE Column Layout for Mix Generator & Portfolio Analysis */
            /* Removed forced column layout to allow side-by-side on desktop/large tablets */
            #mixGeneratorModal .modal-body>div,
            #portfolioModal .modal-body .calc-layout {
                flex-direction: column !important;
                gap: 15px !important;
            }

            #mixGeneratorModal .modal-body>div>div:first-child,
            #portfolioModal .calc-sidebar {
                width: 100% !important;
                flex: none !important;
                max-width: none !important;
                min-width: 0 !important;
            }

            /* --- TABLE CARD VIEW (For Modals Only) --- */
            /* This transforms tables in modals to cards to avoid horizontal scroll */
            .modal-content .modern-table-container table,
            .modal-content .modern-table-container thead,
            .modal-content .modern-table-container tbody,
            .modal-content .modern-table-container th,
            .modal-content .modern-table-container td,
            .modal-content .modern-table-container tr {
                display: block;
            }

            .modal-content .modern-table-container thead {
                display: none;
            }

            .modal-content .modern-table-container tr {
                margin-bottom: 12px;
                border: 1px solid #e0e0e0;
                border-radius: 8px;
                padding: 10px;
                background: #fff;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
                display: flex;
                flex-wrap: wrap;
                gap: 8px;
            }

            .modal-content .modern-table-container td {
                border: none !important;
                padding: 4px !important;
                position: relative;
                flex: 1 1 45%;
                /* 2 columns of data */
                display: flex;
                flex-direction: column;
                align-items: center;
                /* Center align for card look */
                text-align: center !important;
                font-size: 0.9rem;
            }

            /* Name Row - Full Width */
            .modal-content .modern-table-container td:first-child {
                flex: 1 1 100%;
                border-bottom: 1px solid #f0f0f0 !important;
                padding-bottom: 8px !important;
                margin-bottom: 5px;
                font-weight: bold;
                color: var(--primary);
                text-align: right !important;
                /* Keep name right aligned */
                align-items: flex-start;
            }

            .modal-content .modern-table-container td:first-child:before {
                content: none;
            }

            /* Add labels via CSS - Fix Direction */
            .modal-content .modern-table-container td:before {
                direction: rtl;
                unicode-bidi: embed;
                text-align: right;
            }

            .modal-content .modern-table-container td:nth-child(2):before {
                content: "משקל";
                font-size: 0.7em;
                color: #888;
                display: block;
                margin-bottom: 2px;
            }

            .modal-content .modern-table-container td:nth-child(3):before {
                content: "חודש";
                font-size: 0.7em;
                color: #888;
                display: block;
                margin-bottom: 2px;
            }

            .modal-content .modern-table-container td:nth-child(4):before {
                content: "שנה";
                font-size: 0.7em;
                color: #888;
                display: block;
                margin-bottom: 2px;
            }

            .modal-content .modern-table-container td:nth-child(5):before {
                content: "3 שנים";
                font-size: 0.7em;
                color: #888;
                display: block;
                margin-bottom: 2px;
            }

            .modal-content .modern-table-container td:nth-child(6):before {
                content: "5 שנים";
                font-size: 0.7em;
                color: #888;
                display: block;
                margin-bottom: 2px;
            }

            /* Reset specific table styles that conflict */
            .modal-content table {
                min-width: 0 !important;
                width: 100% !important;
            }

            .modal-content .modern-table-container {
                overflow-x: visible !important;
            }

            /* Allow flow */

            /* --- End of Card View --- */

            /* Compact Inputs within Modals */
            .calc-card {
                padding: 10px;
                margin-bottom: 10px;
            }

            .input-row {
                margin-bottom: 8px;
            }

            .input-row label {
                font-size: 0.85rem;
            }

            .input-wrapper input {
                padding: 8px;
                font-size: 1rem;
            }

            /* Touch friendly inputs */

            /* Allow Side-by-Side Inputs on Mobile for Density - IF it fits */
            #interestCalculatorModal .input-row,
            #portfolioModal .input-row {
                display: flex;
                flex-wrap: wrap;
                /* Wrap if too small */
                align-items: center;
                justify-content: space-between;
                gap: 5px;
            }

            #interestCalculatorModal .input-row label {
                flex: 1 0 auto;
                margin-bottom: 0;
            }

            #interestCalculatorModal .input-wrapper {
                flex: 1 1 120px;
            }

            /* Min width for input */


            /* Polish: Reduced Chart Size for Mobile */
            .chart-wrapper {
                height: 200px;
                padding: 5px;
            }

            .chart-title {
                font-size: 0.95rem;
            }

            /* Polish: Stack Mix Generator Inputs */
            .synth-controls {
                flex-direction: column !important;
                gap: 10px !important;
            }

            .synth-controls>div {
                width: 100% !important;
            }

            /* KPI Compact */
            .kpi-container {
                grid-template-columns: 1fr 1fr;
                gap: 8px;
            }

            .kpi-card {
                padding: 8px;
            }

            .kpi-value {
                font-size: 1.2rem;
            }

            .kpi-label {
                font-size: 0.7rem;
                min-height: auto;
            }

            /* Resize Portfolio Charts to Small Squares (Center Aligned) */
            /* User wants reduced WIDTH and HEIGHT equally */
            .charts-grid {
                grid-template-columns: 1fr;
                /* Stacked */
                gap: 15px;
            }

            .chart-box {
                width: 240px !important;
                /* Fixed width small square */
                height: 240px !important;
                /* Fixed height square */
                margin: 0 auto;
                /* Center it */
                display: flex;
                flex-direction: column;
            }

            /* Ensure internal canvas container fits */
            .chart-box>div:last-child {
                flex: 1;
                position: relative;
                height: 100%;
            }

            /* Currency Exposure Text on Mobile */
            .geo-exposure-text {
                font-size: 0.9rem !important;
                margin-top: 5px;
            }

            /* Report */
            #reportContent>div:not(.ai-section):not(.winner-card):not(.risk-warning-banner) {
                overflow-x: auto;
            }

            table {
                min-width: 600px;
            }

            /* Comparison Table keep scroll, but sticky */
            table.comparison-table th:first-child,
            table.comparison-table td:first-child {
                position: sticky;
                right: 0;
                background: #f1f1f1;
                z-index: 10;
                max-width: 110px;
                min-width: 110px;
                font-size: 0.85rem;
            }

            table.comparison-table th:first-child {
                background: var(--primary);
                color: white;
            }
        }

        @media (max-width: 480px) {
            .buttons-grid-row button {
                font-size: 0.85rem;
            }

            h1 {
                font-size: 1.1rem;
            }

            /* On very small screens, maybe single KPi? */
            .kpi-container {
                grid-template-columns: 1fr 1fr;
            }

            /* stick to 2cols, usually fine */

            /* Ensure card data items don't squash */
            .modal-content .modern-table-container td {
                flex: 1 1 40%;
            }
        }

        /* === Animated ProData Logo === */
        .animated-prodata-wrapper {
            width: 100%;
            max-width: 56rem;
            margin: 0.25rem auto 0 auto;
            position: relative;
            display: block;
        }

        .animated-prodata-wrapper svg {
            display: block;
            width: 100%;
            height: auto;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
            transition: transform 0.2s ease;
        }

        .animated-prodata-header-wrapper:hover .animated-prodata-wrapper svg {
            transform: scale(1.02);
        }

        .animated-prodata-header-wrapper {
            cursor: pointer;
            border-radius: 16px;
            display: block;
            max-width: 56rem;
            margin: 0 auto;
            padding: 6px 8px;
            transition: background 0.2s;
        }

        .animated-prodata-header-wrapper:hover {
            background: rgba(0, 35, 102, 0.04);
        }

        .animated-bar {
            transition: all 1200ms cubic-bezier(0.4, 0, 0.2, 1);
        }

        .animated-subtitle {
            text-align: center;
            color: #111;
            font-weight: 600;
            font-size: 1rem;
            letter-spacing: 0.05em;
            margin: 2px 0 8px 0;
            font-family: system-ui, -apple-system, sans-serif;
        }

        /* === End Animated ProData Logo === */

        /* === Default Dashboard Styles === */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 30px;
            animation: fadeIn 0.8s ease-out;
        }

        @media (max-width: 1024px) {
            .dashboard-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .dashboard-grid {
                grid-template-columns: 1fr;
            }
        }

        .mini-table-card {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 1.5rem;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .mini-table-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15);
        }

        .mini-table-header {
            padding: 15px;
            background: rgba(248, 250, 252, 0.8);
            border-bottom: 1px solid #e2e8f0;
        }

        .mini-table-header select {
            width: 100%;
            padding: 8px;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            font-size: 0.85rem;
            margin-bottom: 8px;
            background: white;
            color: #1e293b;
            font-weight: 600;
        }

        .screenshot-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: white;
            border: 1px solid #cbd5e1;
            color: #475569;
            padding: 3px 8px;
            border-radius: 8px;
            font-size: 0.7rem;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        }

        .screenshot-btn:hover {
            background: #f1f5f9;
            border-color: #6366f1;
            color: #6366f1;
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .screenshot-btn:active {
            transform: translateY(0);
        }

        /* Select2 Fix for Mini-Table Header (Definitive Override) */
        .select2-container.mini-table-select2-container .select2-selection--single {
            height: 35px !important;
            min-height: 35px !important;
            max-height: 35px !important;
            border-radius: 8px !important;
            border: 1px solid #cbd5e1 !important;
            margin-bottom: 8px !important;
            background: white !important;
            display: flex !important;
            align-items: center !important;
            box-shadow: none !important;
        }

        .select2-container.mini-table-select2-container .select2-selection--single .select2-selection__rendered {
            line-height: 33px !important;
            padding: 0 10px !important;
            font-size: 0.85rem !important;
            font-weight: 600 !important;
            color: #1e293b !important;
            text-align: right !important;
        }

        .select2-container.mini-table-select2-container .select2-selection--single .select2-selection__arrow {
            height: 33px !important;
            top: 1px !important;
            left: 5px !important;
            right: auto !important;
        }

        /* Remove Scrollbar from Mini-Table Dropdowns */
        .mini-table-results-no-scroll .select2-results>.select2-results__options {
            max-height: none !important;
        }

        .mini-table-container {
            flex: 1;
            overflow-x: auto;
            overflow-y: auto;
            max-height: 500px;
            padding: 0;
        }

        .mini-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        .mini-table th {
            background: #f1f5f9;
            color: #475569;
            font-weight: 700;
            text-align: right;
            padding: 8px 4px;
            white-space: nowrap;
            position: sticky;
            top: 0;
            font-size: 0.75rem;
        }

        .mini-table td {
            padding: 8px 4px;
            border-bottom: 1px solid #e2e8f0;
            color: #334155;
            font-size: 0.85rem;
        }

        .mini-table tr:hover {
            background: rgba(99, 102, 241, 0.05);
        }

        .mini-table .fund-name {
            font-weight: 700;
            color: #1e293b;
            cursor: pointer;
            transition: color 0.2s;
        }

        .mini-table .fund-name:hover {
            color: #6366f1;
            text-decoration: underline;
        }

        .mini-table .yield-val {
            font-family: 'Rubik', sans-serif;
            font-weight: 800;
            font-size: 0.95rem;
            text-align: center;
        }

        .mini-table .yield-positive {
            color: #10b981;
        }

        .mini-table .yield-negative {
            color: #f43f5e;
        }

        .mini-table-footer {
            padding: 10px;
            text-align: center;
            background: #f8fafc;
            border-top: 1px solid #f1f5f9;
        }

        .add-to-search-btn {
            background: #6366f1;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }

        .add-to-search-btn:hover {
            background: #4f46e5;
        }

        /* === Mix Generator Modal Styles (Extracted from inline) === */
        .section-vis-btn {
            background: white;
            border: 1px solid var(--primary);
            color: var(--primary);
            font-size: 0.8rem;
            padding: 4px 10px;
            border-radius: 4px;
            cursor: pointer;
            transition: 0.2s;
            font-weight: 500;
        }

        .section-vis-btn:hover {
            background: var(--primary);
            color: white;
        }

        .section-vis-btn.active-vis {
            background: var(--secondary);
            color: white;
            border-color: var(--secondary);
        }

        .section-chart-container {
            background: #fff;
            padding: 15px;
            border-radius: 8px;
            border: 1px solid #eee;
            margin-top: 10px;
            height: 350px;
            position: relative;
        }

        #mixGeneratorModal .modal-body {
            padding: 12px !important;
        }

        #mixGeneratorModal .calc-card {
            padding: 12px !important;
            margin-bottom: 8px !important;
        }

        .mix-sidebar {
            flex: 0 0 320px;
            display: flex;
            flex-direction: column;
            gap: 8px !important;
        }

        .mix-manager-row {
            display: flex !important;
            gap: 10px !important;
            align-items: center !important;
        }

        #mixGeneratorModal .select2-container--default .select2-selection--single,
        #mixGeneratorModal .select2-container--default .select2-selection--multiple {
            border-radius: 12px !important;
            border-color: #e0f2f1 !important;
            min-height: 36px !important;
            display: flex !important;
            align-items: center !important;
        }

        #mixGeneratorModal .select2-selection__rendered {
            line-height: normal !important;
            display: flex !important;
            align-items: center !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }

        .mix-period-row {
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            gap: 10px !important;
            padding: 6px 10px !important;
            background: #00796b !important;
            border-radius: 10px !important;
            margin-bottom: 10px !important;
        }

        .mix-period-row label {
            color: white !important;
            margin-bottom: 0 !important;
            font-size: 0.75rem !important;
            white-space: nowrap !important;
        }

        .period-selector-group {
            background: rgba(255, 255, 255, 0.2) !important;
            padding: 2px !important;
        }

        .period-selector-group label {
            padding: 3px 6px !important;
            font-size: 0.7rem !important;
            color: white !important;
        }

        .period-selector-group input[type="radio"]:checked+label {
            background: white !important;
            color: #00796b !important;
        }

        .mix-exposure-list {
            display: flex;
            flex-direction: column;
            gap: 6px !important;
            margin-bottom: 8px !important;
        }

        .compact-row {
            padding: 6px 10px !important;
            background: white;
            border-radius: 10px;
            border: 1px solid #e0f2f1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .compact-row .row-header {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .compact-row label {
            font-size: 0.8rem !important;
            color: #00695c !important;
            margin: 0 !important;
            font-weight: 700 !important;
        }

        .small-wrapper {
            width: 80px;
            position: relative;
        }

        .small-wrapper input {
            height: 28px !important;
            font-size: 0.85rem !important;
            padding: 4px 8px !important;
            text-align: center;
        }

        .small-wrapper .input-icon {
            left: 6px !important;
            font-size: 0.7rem !important;
            color: #00695c !important;
        }

        #mixGeneratorModal .input-row:not(.compact-row):not(.mix-period-row) {
            background: white;
            padding: 8px 12px;
            border-radius: 12px;
            border: 1px solid #e0f2f1;
            margin-bottom: 8px;
            position: relative;
        }

        #mixGeneratorModal .input-row label {
            display: block;
            margin-bottom: 4px;
            color: #00695c;
            font-weight: 700;
            font-size: 0.8rem;
        }

        .mix-num-funds-wrapper .select2-selection__rendered {
            font-size: 0.78rem !important;
            padding-right: 4px !important;
            padding-left: 15px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 100% !important;
        }

        #mixGeneratorModal .select2-selection--multiple {
            max-height: 80px !important;
            overflow-y: auto !important;
            padding: 2px 4px !important;
        }

        #mixGeneratorModal .select2-selection--single {
            height: 36px !important;
        }

        #mixGeneratorModal .input-row {
            position: relative !important;
        }

        #mixGeneratorModal .small-wrapper {
            position: relative !important;
        }

        #mixGeneratorModal .input-icon {
            position: absolute !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            z-index: 5;
        }

        /* --- System Info Modal Styles --- */
        #systemInfoModal .modal-content {
            animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @keyframes modalSlideUp {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .info-accordion-item.active {
            border-color: #6366f1 !important;
            box-shadow: 0 4px 15px -1px rgba(99, 102, 241, 0.1);
        }

        .info-accordion-item.active button i[data-lucide="chevron-down"] {
            transform: rotate(180deg);
        }

        .info-accordion-content {
            transition: all 0.3s ease;
        }

        .animate-fade-in {
            animation: fadeIn 0.3s ease-out forwards;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(5px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .info-section h3 {
            letter-spacing: -0.01em;
        }

        .info-icon {
            transition: all 0.2s;
        }

        .info-icon:hover {
            transform: scale(1.1);
            background-color: var(--secondary);
            cursor: pointer;
        }

        /* --- Driver.js Tutorial Overrides --- */
        .driver-popover {
            max-width: 450px !important;
            /* Slightly wider for better readability */
        }

        .driver-popover-title {
            font-size: 1.5rem !important;
            /* Larger title */
            font-weight: 800 !important;
            margin-bottom: 15px !important;
            color: var(--primary) !important;
        }

        .driver-popover-description {
            font-size: 1.25rem !important;
            /* Larger description text */
            line-height: 1.6 !important;
            color: #334155 !important;
        }

        .driver-popover-footer button {
            font-size: 1.1rem !important;
            /* Larger button text */
            padding: 8px 16px !important;
            font-family: 'Rubik', sans-serif !important;
        }

        .driver-popover-progress-text {
            font-size: 1rem !important;
            /* Larger progress text */
            font-weight: 600 !important;
        }

        /* Why ProData? Button */
        .why-prodata-container {
            margin: 25px auto 10px;
            text-align: center;
        }

        .why-prodata-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            background: linear-gradient(135deg, #002366 0%, #0056b3 100%);
            color: white !important;
            font-weight: 700;
            font-size: 1.1rem;
            padding: 14px 35px;
            border-radius: 50px;
            text-decoration: none !important;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 8px 20px rgba(0, 35, 102, 0.2);
            border: none;
            cursor: pointer;
        }

        .why-prodata-btn:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 12px 25px rgba(0, 35, 102, 0.3);
            background: linear-gradient(135deg, #001a4d 0%, #004494 100%);
        }

/* Accessibility - Focus rings for keyboard users */
:focus:not(:focus-visible) {
    outline: none !important;
}

:focus-visible {
    outline: 3px solid #3b82f6 !important; /* Blue outline */
    outline-offset: 2px !important;
    border-radius: 4px;
    z-index: 100;
}

button:focus-visible, 
a:focus-visible, 
select:focus-visible, 
input:focus-visible, 
.card:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #6366f1 !important; /* Indigo outline to match standard buttons */
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4) !important;
}

/* Modals should be easily scrollable and focused when opened */
.modal:focus-visible {
    outline: none !important; /* Avoid huge outline on entire modal, outline inner elements instead */
}
/* Info Popover (Global) */
.info-popover-wrapper { position: relative; display: inline-flex; align-items: center; }
.info-trigger { color: #3b82f6; opacity: 0.7; cursor: help; width: 16px; height: 16px; transition: opacity 0.2s; }
.info-trigger:hover { opacity: 1; }
.info-popover {
    position: absolute; bottom: 125%; right: 0; width: 260px;
    background: white; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    padding: 16px; z-index: 2000; display: none; opacity: 0;
    transform: translateY(10px); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; direction: rtl;
}
.info-popover-wrapper:hover .info-popover { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
.info-popover::after {
    content: ''; position: absolute; top: 100%; right: 5px;
    border: 8px solid transparent; border-top-color: white;
}
.info-popover-content p { margin: 0 0 14px 0; color: #1e293b; font-size: 0.9rem; line-height: 1.5; font-weight: 500; text-align: right; white-space: normal; }
.info-popover-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #002366; color: white !important; text-decoration: none;
    padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 700;
    transition: all 0.2s; border: 1px solid transparent;
}
.info-popover-btn:hover { background: #004494; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.info-popover-btn i { width: 14px; height: 14px; }

/* Expanded Screenshot Buttons */
.screenshot-btn-mass, .screenshot-btn-section {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
    transition: all .25s;
    white-space: nowrap;
}

.screenshot-btn-mass:hover, .screenshot-btn-section:hover {
    background: #dcfce7 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
    border-color: #86efac !important;
}

.screenshot-btn-section i, .screenshot-btn-mass i {
    width: 14px;
    height: 14px;
}

.small-mass-screenshot:hover {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    transform: scale(1.02);
}

/* Detailed Report Screenshot Button (Matches Toggle Button) */
.screenshot-toggle-btn {
    background-color: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
    min-width: 140px;
    height: 48px;
    white-space: nowrap;
    margin: 0;
}

.screenshot-toggle-btn:hover {
    background-color: #f8fafc;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.screenshot-toggle-btn i, .screenshot-toggle-btn svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
}
