/* Modal styles moved out of the inline <style> blocks in templates/components/modal_*.html
   (2026-10-22). Linked in index.html right after theme.css, where those body-level blocks used
   to apply, and kept in the same order as the includes, so the cascade is unchanged.
   modal_reasoning.html, and the components shared with login.html (modal_contact, modal_terms,
   modal_success, cookie_banner), still carry their own inline styles. */

/* ===== components/modal_terms_gate.html ===== */
#termsGateModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    z-index: 9990;
    justify-content: center;
    align-items: center;
    padding: 16px;
    direction: rtl;
}
#termsGateModal.active { display: flex; }
/* The cookie banner is pinned bottom at z-index 20000 (it is a legal notice of its
   own, so it stays on top) and is much taller on a phone, where its text wraps.
   Its real height is measured at runtime into --pd-cookie-h, so the gate's footer
   links are never covered at any width. The class goes away once it is dismissed. */
#termsGateModal.cookie-banner-visible {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: calc(var(--pd-cookie-h, 150px) + 16px);
}
#termsGateModal.cookie-banner-visible .terms-gate-box {
    max-height: calc(100vh / var(--pd-zoom, 1) - var(--pd-cookie-h, 150px) - 40px);
}
/* Header and footer keep their size; only the scrollable text area gives way. */
.terms-gate-header, .terms-gate-footer { flex: 0 0 auto; }
.terms-gate-box {
    background: #fff;
    width: 100%;
    max-width: 720px;
    max-height: calc(92vh / var(--pd-zoom, 1));
    border-radius: var(--pd-r-xl);
    box-shadow: var(--pd-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.terms-gate-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    min-height: 72px;
    box-sizing: border-box;
    text-align: right;
    background: var(--pd-surface-sunk); /* light window header, theme.css .modal-header (2026-10-21) */
    border-bottom: 2px solid var(--pd-navy);
    color: var(--pd-ink);
}
.terms-gate-titles { flex: 1; min-width: 0; }
.terms-gate-header h2 { margin: 0 0 2px; font-size: var(--pd-fs-xl); font-weight: 800; color: var(--pd-ink); letter-spacing: 0; }
.terms-gate-sub { margin: 0; color: var(--pd-muted); font-size: var(--pd-fs-sm); line-height: 1.6; }
.terms-gate-body { max-height: calc(46vh / var(--pd-zoom, 1)); min-height: 120px; border: none; flex: 1 1 auto; min-height: 0; }
.terms-gate-footer {
    padding: 14px 24px 16px;
    background: var(--pd-surface);
    border-top: 1px solid var(--pd-line);
    text-align: center;
}
.terms-gate-hint { margin: 0 0 12px; font-weight: 700; color: var(--pd-navy); font-size: var(--pd-fs-sm); }
.terms-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.terms-gate-accept { font-size: var(--pd-fs-md); padding: 10px 28px; }

.terms-gate-links { margin-top: 12px; font-size: var(--pd-fs-xs); color: var(--pd-muted); display: flex; gap: 8px; justify-content: center; }
.terms-gate-link { background: none; border: none; color: var(--pd-muted); text-decoration: underline; cursor: pointer; font-size: var(--pd-fs-xs); padding: 0; }
.terms-gate-link:hover { color: var(--pd-blue-hover); }
.terms-gate-error { margin: 10px 0 0; color: var(--pd-loss); font-weight: 700; font-size: var(--pd-fs-sm); }
@media (max-width: 640px) {
    .terms-gate-header { padding: 14px 16px; }
    .terms-gate-footer { padding: 14px 16px 16px; }
    .terms-gate-body { max-height: calc(40vh / var(--pd-zoom, 1)); }
    .terms-gate-accept { width: 100%; }
}

/* ===== components/modal_calculator.html ===== */
/* Date-range picker (תקופת השקעה) — disabled state must look visibly inert,
   not just clickable-and-empty, since it's disabled until a fund is picked. */
#interestCalculatorModal .calc-range-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--pd-surface-2) !important;
}

/* Period control (תקופת השקעה) — years and the exact date range are
   always shown together, kept in sync by JS (onCalcYearsInput /
   onCalcRangeChange), never a mode toggle the user has to switch. */
#interestCalculatorModal .calc-period-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

#interestCalculatorModal .calc-period-label {
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

#interestCalculatorModal .calc-period-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--pd-surface-sunk);
    border: 1px solid var(--pd-line);
    border-radius: 0.9rem;
    padding: 7px 12px;
}

#interestCalculatorModal .calc-years-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

#interestCalculatorModal .calc-years-inline input {
    width: 52px;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid var(--pd-line);
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--pd-ink);
    background: #fff;
    outline: none;
}

#interestCalculatorModal .calc-years-inline input:focus {
    border-color: var(--pd-blue);
    box-shadow: var(--pd-focus-ring);
}

#interestCalculatorModal .calc-years-suffix {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pd-muted);
    white-space: nowrap;
}

#interestCalculatorModal .calc-period-link-icon {
    width: 15px;
    height: 15px;
    color: #c7d2e0;
    flex-shrink: 0;
}

#interestCalculatorModal .calc-range-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#interestCalculatorModal .calc-range-inline select.calc-range-select {
    width: auto;
    min-width: 88px;
    padding: 6px 8px;
    border: 1px solid var(--pd-line);
    border-radius: 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    background: #fff;
    color: var(--pd-ink);
}

#interestCalculatorModal .calc-range-arrow {
    width: 13px;
    height: 13px;
    color: var(--pd-faint);
    flex-shrink: 0;
}

#interestCalculatorModal .calc-range-hint-inline {
    display: block;
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--pd-muted);
    font-weight: 600;
}

/* "הוסף קופה להשוואה": pd dashed add button. styles.css styles it through the
   #addCompareBtnContainer id, so the pd look is restated here at higher specificity. */
#interestCalculatorModal #addCompareBtnContainer .pd-btn--dashed {
    background: transparent;
    border: 1px dashed var(--pd-line-strong);
    color: var(--pd-ink-4);
    font-weight: 700;
    font-size: var(--pd-fs-xs);
    padding: 0 12px;
    border-radius: var(--pd-r-sm);
    gap: 8px;
    transform: none;
}

#interestCalculatorModal #addCompareBtnContainer .pd-btn--dashed:hover {
    color: var(--pd-blue-hover);
    border-color: var(--pd-blue);
    background: var(--pd-blue-tint);
    transform: none;
}

/* Mobile Overrides for Calculator */
@media (max-width: 768px) {
    #interestCalculatorModal .modal-content {
        width: 98% !important;
        margin: 1% !important;
    }
    /* Simple Mode Square Refinements */
    #interestCalculatorModal .yield-box, 
    #interestCalculatorModal .fee-box {
        width: 95px !important;   /* Consistent width */
        height: 50px !important;  /* Slightly taller for bigger text */
        min-height: 50px !important;
        border-radius: 12px !important;
        border-width: 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03) !important;
        margin: 0 auto !important;
    }
    #interestCalculatorModal .yield-box {
        background: #f5f8ff !important;
        border-color: #dbe4ff !important;
    }
    #interestCalculatorModal .fee-box {
        background: #fffdf5 !important;
        border-color: #fef3c7 !important;
    }
    #interestCalculatorModal .simple-input-v5 {
        font-size: 1.4rem !important; /* Slightly adjusted to fit */
        font-weight: 800 !important;
        height: 100% !important;
        width: 100% !important;
        color: var(--pd-ink) !important;
    }
    #interestCalculatorModal .simple-label {
        font-size: 8px !important; /* Smaller to fit full text */
        font-weight: 800 !important;
        color: #475569 !important; /* Slightly darker slate */
        margin-bottom: 4px !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        white-space: normal !important; /* Allow wrapping for full labels */
        line-height: 1.1 !important;
        height: 20px !important; /* Fixed height for label area to keep boxes aligned */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    #interestCalculatorModal .simple-pct {
        font-size: 11px !important;
        left: 8px !important;
        top: 15px !important;
    }
    #interestCalculatorModal .simple-inputs-grid {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 16px !important; /* Increased spacing */
        width: 100% !important;
        padding: 0 5px !important;
        margin-bottom: 24px !important;
    }
    #interestCalculatorModal .simple-input-group {
        gap: 2px !important;
        flex: 1 !important;
        max-width: 95px !important;
    }

    /* Advanced Mode - Fund Selection Clipping Fix */
    #interestCalculatorModal .calc-v5-fixed-box, 
    #interestCalculatorModal .select2-container,
    #interestCalculatorModal .select2-selection,
    #interestCalculatorModal .select2-selection--single {
        height: auto !important;
        min-height: 52px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    #interestCalculatorModal .select2-selection__rendered {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.2 !important;
        padding: 8px 5px !important;
        font-size: 11px !important;
        display: block !important;
    }
    /* Ensure the row height in the table can expand */
    #v5Table td {
        height: auto !important;
    }
}

/* ===== components/modal_portfolio.html ===== */
/* Portfolio KPI Sections (Returns vs Exposures Grouping) */
.portfolio-kpi-section {
    background: #ffffff;
    border-radius: var(--pd-r-xl);
    border: 1px solid var(--pd-line);
    padding: 18px 20px 20px 20px;
    margin-bottom: 22px;
    box-shadow: var(--pd-shadow-sm);
    position: relative;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.portfolio-kpi-section:hover {
    box-shadow: var(--pd-shadow-md);
}

.portfolio-returns-section {
    border-top: 4px solid var(--pd-blue);
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 48px);
}

.portfolio-exposures-section {
    border-top: 4px solid var(--pd-institution);
    background: linear-gradient(180deg, #f4fbf9 0%, #ffffff 48px);
}

.portfolio-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pd-line);
    flex-wrap: wrap;
    gap: 12px;
}

.portfolio-section-title-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.portfolio-section-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portfolio-section-title-icon i,
.portfolio-section-title-icon svg {
    width: 20px;
    height: 20px;
}

.returns-icon {
    background: linear-gradient(135deg, var(--pd-tool-portfolio-from), var(--pd-tool-portfolio));
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.exposures-icon {
    background: linear-gradient(135deg, var(--pd-institution), #14b8a6);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.portfolio-section-heading {
    font-size: var(--pd-fs-lg);
    font-weight: 800;
    color: var(--pd-ink-2);
    letter-spacing: 0;
    line-height: 1.25;
}

.portfolio-section-subheading {
    font-size: var(--pd-fs-xs);
    color: var(--pd-muted);
    margin-top: 2px;
    font-weight: 500;
}

.portfolio-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--pd-fs-xs);
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--pd-r-pill);
}

.returns-badge {
    background: var(--pd-blue-tint);
    color: var(--pd-blue-hover);
    border: 1px solid var(--pd-blue-subtle);
}

.exposures-badge {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.portfolio-kpi-section .kpi-container {
    margin-bottom: 0 !important;
    gap: 14px;
}

.portfolio-kpi-section .kpi-card {
    background: #ffffff;
    border: 1px solid var(--pd-line);
    box-shadow: var(--pd-shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-returns-section .kpi-card:hover {
    border-color: var(--pd-blue-subtle);
    box-shadow: var(--pd-shadow-md);
}

.portfolio-exposures-section .kpi-card:hover {
    border-color: #5eead4;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
}

@media (max-width: 768px) {
    .portfolio-kpi-section {
        padding: 14px 14px 16px 14px;
        margin-bottom: 16px;
        border-radius: 16px;
    }

    .portfolio-section-title-bar {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .portfolio-section-heading {
        font-size: 1rem;
    }

    .portfolio-section-subheading {
        font-size: 0.75rem;
    }

    .portfolio-section-title-icon {
        width: 34px;
        height: 34px;
    }

    .portfolio-section-title-icon i,
    .portfolio-section-title-icon svg {
        width: 18px;
        height: 18px;
    }
}

.maslaka-dragover {
    border-color: var(--pd-blue) !important;
    background: var(--pd-blue-subtle) !important;
    transform: scale(1.01);
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.ai-pulse-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-pulse-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--pd-ai-glow);
    border-radius: 50%;
    animation: ai-pulse 2s infinite;
    opacity: 0;
}

.ai-pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.ai-pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes ai-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.ai-loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--pd-ai-to), var(--pd-ai-from));
    width: 0%;
    animation: ai-progress 10s infinite ease-in-out;
}

@keyframes ai-progress {
    0% {
        width: 0%;
    }

    20% {
        width: 40%;
    }

    50% {
        width: 60%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

.ai-analysis-content hr {
    border: 0;
    border-top: 1px solid var(--pd-line);
    margin: 20px 0;
}

.ai-analysis-content b {
    color: var(--pd-navy);
    font-weight: 800;
}

.ai-analysis-content th,
.ai-analysis-content td {
    position: static !important;
}

.ai-analysis-content th {
    background: var(--pd-surface-2) !important;
    color: var(--pd-ink) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--pd-line-strong) !important;
}

.ai-report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 25px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--pd-line-strong);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ai-report-table th,
.ai-report-table td {
    padding: 14px 16px;
    font-size: 1.05rem;
    line-height: 1.5;
    vertical-align: middle;
}

.ai-report-table th {
    background: var(--pd-surface-2) !important;
    color: var(--pd-ink) !important;
    font-weight: 800 !important;
    text-align: center;
    border-bottom: 2px solid var(--pd-line-strong) !important;
}

.ai-report-table th:first-child {
    text-align: right;
}

.ai-report-table td {
    color: var(--pd-ink-3);
    border-bottom: 1px solid var(--pd-line);
    text-align: center;
}

.ai-report-table td:first-child {
    text-align: right;
    font-weight: 700;
    color: var(--pd-ink-2);
}

.ai-report-table tr:last-child td {
    border-bottom: none;
}

.ai-report-table tr:hover {
    background: var(--pd-surface-sunk);
}

.ai-analysis-content h3 {
    color: #1e3a8a;
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 25px;
    margin-bottom: 12px;
    border-right: 4px solid #3b82f6;
    padding-right: 12px;
    line-height: 1.4;
}

.ai-analysis-content h4 {
    color: var(--pd-blue);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
    border-right: 3px solid #60a5fa;
    padding-right: 8px;
    line-height: 1.4;
}

.ai-analysis-content p {
    margin-bottom: 12px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--pd-ink-2);
}

.ai-analysis-content ul {
    list-style-type: disc !important;
    padding-right: 25px !important;
    margin-top: 5px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-analysis-content ol {
    list-style-type: decimal !important;
    padding-right: 25px !important;
    margin-top: 5px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-analysis-content li {
    margin-bottom: 4px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--pd-ink-3);
}

.ai-company-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--pd-blue);
}

.ai-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    color: var(--pd-ink-2);
    font-weight: 500;
}

.ai-dropdown-item:hover {
    background: var(--pd-surface-2);
}

.ai-dropdown-item input:checked+span {
    color: var(--pd-blue-hover);
    font-weight: 700;
}

/* ===== components/modal_proposal.html ===== */
/* Select2 Track Filter — same height & look as the native product/manager selects */
.proposal-path-select + .select2-container--default .select2-selection--single,
.select2-container--default.proposal-path-select-container .select2-selection--single {
    height: 40px !important;
    min-height: 40px !important;
    border-radius: var(--pd-r-md) !important;
    border: 1px solid var(--pd-line-strong) !important;
    background-color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

/* Match exact font & padding of native selects */
.select2-container--default.proposal-path-select-container .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-right: 10px !important;
    padding-left: 22px !important;
    font-size: var(--pd-fs-sm) !important;
    font-weight: 600 !important;
    color: var(--pd-ink) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.select2-container--default.proposal-path-select-container .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    top: 1px !important;
    left: 6px !important;
    right: auto !important;
}

.select2-container--default.proposal-path-select-container.select2-container--focus .select2-selection--single,
.select2-container--default.proposal-path-select-container.select2-container--open .select2-selection--single {
    border-color: var(--pd-blue) !important;
    box-shadow: var(--pd-focus-ring) !important;
}

/* Force Select2 container width to match its parent div */
.proposal-path-select-container {
    width: 100% !important;
}


/* 2-Column Optgroup Styling for Investment Track Dropdown (Active / Passive) */
.select2-container--default .select2-dropdown.path-dropdown-columns {
    /* This selector's specificity (0-3-0) beats mobile.css's
       .path-dropdown-columns.select2-dropdown{min-width:unset} (0-2-0), so the
       mobile override never applied and this dropdown overflowed every phone.
       min() keeps 480px on desktop and clamps to the viewport below that. */
    min-width: min(480px, calc(100vw - 24px)) !important;
    border-radius: var(--pd-r-lg) !important;
    border: 1px solid var(--pd-line-strong) !important;
    box-shadow: var(--pd-shadow-lg) !important;
    overflow: hidden !important;
}

.path-dropdown-columns .select2-results > .select2-results__options {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important; /* body is RTL: 'row' puts first-child (Active/אקטיבי) on RIGHT, Passive on LEFT */
    max-height: min(320px, calc(90vh / var(--pd-zoom, 1) - 300px)) !important;
    overflow-y: auto !important;
    padding: 0 !important;
}

/* Top full-width row for "כל המסלולים בחברה" */
.path-dropdown-columns .select2-results > .select2-results__options > .select2-results__option:not(.select2-results__option--group) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    font-weight: 800 !important;
    color: #1e3a8a !important;
    background: var(--pd-surface-2) !important;
    border-bottom: 1px solid var(--pd-line-strong) !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
}

.path-dropdown-columns .select2-results > .select2-results__options > .select2-results__option:not(.select2-results__option--group):hover,
.path-dropdown-columns .select2-results > .select2-results__options > .select2-results__option:not(.select2-results__option--group)[aria-selected="true"] {
    background-color: var(--pd-blue-tint) !important;
    color: var(--pd-blue-hover) !important;
}

/* 2 Columns for Active (right) & Passive (left) optgroups */
.path-dropdown-columns .select2-results__option--group {
    flex: 1 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

/* body is RTL + row: first-child = Active (RIGHT), last-child = Passive (LEFT) */
/* Separator: border on LEFT side of Active (first-child) */
.path-dropdown-columns .select2-results__option--group:first-child {
    border-left: 1px solid var(--pd-line) !important;
}

.path-dropdown-columns .select2-results__group {
    text-align: center !important;
    font-weight: 800 !important;
    color: #1e3a8a !important;
    font-size: var(--pd-fs-sm) !important;
    padding: 10px 8px !important;
    border-bottom: 1px solid var(--pd-line) !important;
    background: var(--pd-surface-sunk) !important;
    letter-spacing: 0 !important;
}

.path-dropdown-columns .select2-results__options--nested {
    padding: 4px 0 !important;
}

.path-dropdown-columns .select2-results__option {
    padding: 8px 14px !important;
    font-size: var(--pd-fs-sm) !important;
    font-weight: 600 !important;
    color: var(--pd-ink-3) !important;
    transition: background 0.15s ease !important;
}

.path-dropdown-columns .select2-results__option--highlighted[aria-selected] {
    background-color: var(--pd-blue-tint) !important;
    color: var(--pd-blue-hover) !important;
}

.path-dropdown-columns .select2-results__option[aria-selected="true"] {
    background-color: var(--pd-blue-tint) !important;
    color: var(--pd-blue-hover) !important;
    font-weight: 800 !important;
}

/* ===== components/modal_synthetic.html ===== */
#syntheticModal .modal-content {
    width: 92vw;
    max-width: 1020px;
    box-sizing: border-box;
}

#syntheticModal .modal-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) !important;
    overflow-x: hidden !important;
}

#syntheticModal .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#syntheticModal .select2-container .select2-selection--single {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
}

#syntheticModal .select2-container .select2-selection__rendered {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
    box-sizing: border-box !important;
    padding-left: 20px !important;
    padding-right: 4px !important;
}

#syntheticModal .premium-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#syntheticModal .premium-select, #syntheticModal .premium-input {
    padding: 10px 14px;
    border: 1px solid var(--pd-line-strong);
    border-radius: var(--pd-r-md);
    font-family: inherit;
    font-size: var(--pd-fs-md);
    background: white;
    transition: all 0.2s;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#syntheticModal .premium-select:focus, #syntheticModal .premium-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#syntheticModal .generate-btn-premium {
    background: var(--pd-navy);
    color: white;
    border: 1px solid transparent;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--pd-r-md);
    font-family: var(--pd-font);
    font-weight: 700;
    font-size: var(--pd-fs-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color var(--pd-dur) var(--pd-ease), border-color var(--pd-dur) var(--pd-ease);
    box-shadow: var(--pd-shadow-sm);
    width: 100%;
    white-space: nowrap;
}

#syntheticModal .generate-btn-premium:hover {
    background: var(--pd-navy-deep);
}

/* "שמור מסלול": secondary action next to the run button */
#syntheticModal .save-synth-btn {
    background: var(--pd-surface);
    color: var(--pd-ink-3);
    border-color: var(--pd-line-strong);
    box-shadow: none;
}

#syntheticModal .save-synth-btn:hover {
    background: var(--pd-surface-2);
    color: var(--pd-ink);
}

/* Switch Component */
#syntheticModal .premium-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

#syntheticModal .premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

#syntheticModal .premium-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--pd-line);
    transition: .4s;
    border-radius: 34px;
}

#syntheticModal .premium-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#syntheticModal input:checked + .premium-slider {
    background-color: #3b82f6;
}

#syntheticModal input:checked + .premium-slider:before {
    transform: translateX(14px);
}


.synth-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.2s;
    border: 1px solid transparent;
    min-width: 0;
}

.synth-item-row:hover {
    background: var(--pd-surface-sunk);
    border-color: var(--pd-line);
}

.synth-add-btn-premium {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--pd-line);
    background: white;
    color: var(--pd-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.synth-add-btn-premium:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.selected-synth-item {
    background: white;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
    min-width: 0;
}

.selected-synth-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border-color: #3b82f6;
}

.weight-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pd-surface-sunk);
    padding: 4px 8px;
    border-radius: 8px;
}

.weight-input-premium {
    width: 60px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1rem;
    color: var(--pd-ink-2);
    text-align: center;
}

.weight-input-premium:focus {
    outline: none;
}

.remove-synth-btn {
    background: var(--pd-loss-tint);
    color: var(--pd-loss);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-synth-btn:hover {
    background: var(--pd-loss);
    color: white;
}

#totalWeightDisplay.error {
    color: var(--pd-loss);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ===== components/modal_mix_generator.html (block 1) ===== */
/* Settings (force include/exclude) trigger button in the header */
.mix-force-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    border-radius: var(--pd-r-md);
    border: 1px solid #b2dfdb;
    background: white;
    color: #00695c;
    cursor: pointer;
    transition: all var(--pd-dur) var(--pd-ease);
}

.mix-force-trigger:hover {
    background: #e0f2f1;
    border-color: #00897b;
}

.mix-force-trigger .mix-force-badge-dot {
    display: none;
    position: absolute;
    top: -3px;
    left: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pd-loss);
    border: 2px solid white;
}

.mix-force-trigger.has-active .mix-force-badge-dot {
    display: block;
}

/* Per-row "keep"/"ban" icons in the mix results table */
.mix-row-force-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--pd-line);
    background: white;
    color: var(--pd-faint);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 4px;
    transition: all 0.2s;
}

.mix-row-force-btn:hover {
    border-color: #00897b;
    color: #00897b;
}

.mix-row-force-btn.active-include {
    background: var(--pd-institution-tint);
    border-color: #00897b;
    color: #00695c;
}

.mix-row-force-btn.active-exclude {
    background: var(--pd-loss-tint);
    border-color: var(--pd-loss);
    color: var(--pd-loss);
}

/* ===== components/modal_mix_generator.html (block 2) ===== */
/* ====== Custom Manager Dropdown ====== */
.mix-manager-custom {
    position: relative;
    width: 100%;
}

.mix-manager-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: white;
    border: 1px solid #b2dfdb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--pd-ink-2);
    min-height: 28px;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

.mix-manager-trigger:hover {
    border-color: #00897b;
    box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.12);
}

.mix-manager-trigger.open {
    border-color: #00897b;
    box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.15);
}

.mix-manager-trigger .trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Placeholder look while no manager has been picked */
.mix-manager-custom.is-empty .trigger-text {
    color: var(--pd-muted);
}

.mix-manager-trigger .trigger-arrow {
    flex-shrink: 0;
    margin-right: 6px;
    font-size: 0.65rem;
    color: #00897b;
    transition: transform 0.2s;
}

.mix-manager-trigger.open .trigger-arrow {
    transform: rotate(180deg);
}

.mix-manager-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    background: white;
    border: 1.5px solid #b2dfdb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 4px 0;
}

.mix-manager-dropdown.open {
    display: block;
}

.mix-mgr-mode-header {
    padding: 8px 10px;
    background: #f0fdfc;
    border-bottom: 1px solid #b2dfdb;
    margin-bottom: 4px;
}

.mix-mgr-mode-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #00695c;
    margin-bottom: 5px;
}

.mix-mgr-mode-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mix-mgr-mode-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.79rem;
    color: var(--pd-ink-2);
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.mix-mgr-mode-radio-label input[type="radio"] {
    accent-color: #00897b;
    width: 13px;
    height: 13px;
    margin: 0;
    cursor: pointer;
}

.mix-mgr-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid #e0f2f1;
    margin-bottom: 2px;
}

.mix-mgr-clear-btn {
    background: none;
    border: none;
    color: #00897b;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.15s;
}

.mix-mgr-clear-btn:hover {
    background: #e0f2f1;
}

.mix-mgr-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.81rem;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--pd-ink-2);
    white-space: nowrap;
}

.mix-mgr-option:hover {
    background: #e0f2f1;
}

.mix-mgr-option.all-option {
    font-weight: 700;
    color: #00695c;
}

.mix-mgr-option input[type="checkbox"] {
    accent-color: #00897b;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    margin-left: 6px;
    margin-right: 0px;
}

/* Adjust for multi-select tags - compact height */
#mixManagerSelect+.select2 .select2-selection--multiple {
    min-height: 26px !important;
    max-height: 50px !important;
    overflow-y: auto !important;
    border-color: #b2dfdb;
    padding: 0 4px !important;
}

#mixManagerSelect+.select2 .select2-selection__choice {
    background-color: #00897b !important;
    color: white !important;
    border: none !important;
    font-size: 0.7rem !important;
    margin-top: 1px !important;
    margin-bottom: 1px !important;
    padding: 1px 4px !important;
    line-height: 1.4 !important;
}

#mixManagerSelect+.select2 .select2-selection__choice__remove {
    color: white !important;
    margin-left: 4px !important;
}

/* Compact single selects */
#mixNumFunds+.select2 .select2-selection--single,
#mixProductSelect+.select2 .select2-selection--single {
    height: 28px !important;
    line-height: 26px !important;
}

#mixNumFunds+.select2 .select2-selection__rendered {
    line-height: 26px !important;
    font-size: 0.82rem !important;
    padding-right: 6px !important;
}

#mixNumFunds+.select2 .select2-selection__arrow {
    height: 26px !important;
}

/* Compact input rows with % box */
.compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: white;
    border-radius: var(--pd-r-sm);
    border: 1px solid #e0f2f1;
    margin-bottom: 0;
    transition: all 0.2s;
    gap: 6px;
}

.compact-row:hover {
    border-color: #4db6ac;
    box-shadow: 0 2px 8px rgba(0, 137, 121, 0.06);
}

.compact-row .row-header {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.compact-row .row-header label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pd-ink-2);
    white-space: nowrap;
    cursor: pointer;
    margin: 0;
}

.percent-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid #b2dfdb;
    border-radius: 5px;
    background: white;
    overflow: hidden;
    height: 26px;
    flex-shrink: 0;
}

.percent-input-group input {
    border: none !important;
    width: 34px !important;
    height: 100% !important;
    text-align: center;
    padding: 0 !important;
    font-weight: 700;
    color: #00695c;
    outline: none;
    font-size: 0.82rem;
    -moz-appearance: textfield;
}

.percent-input-group input::-webkit-outer-spin-button,
.percent-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.percent-box {
    background: #00897b;
    color: white;
    width: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.72rem;
}

/* 2-column exposure grid */
.mix-exposure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Compact input-row labels inside sidebar */
.mix-sidebar .input-row label {
    font-size: 0.78rem;
    margin-bottom: 3px;
}

.mix-sidebar .input-row {
    margin-bottom: 8px !important;
}

.mix-sidebar .calc-card {
    padding: 12px 14px !important;
}

.mix-sidebar .calc-card-title {
    font-size: 0.9rem;
    margin-bottom: 10px !important;
}

/* Sidebar and results end at the same line: the goals card fills the
   sidebar and its generate button sits at the bottom */
#mixGeneratorModal .mix-sidebar > .calc-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}

.mix-sidebar .mix-generate-row {
    margin-top: auto !important;
    padding-top: 15px;
}

/* Period pills and the "דירוג" toggle: two groups joined by "+", one row */
.mix-period-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mix-period-controls .period-selector-group {
    margin-top: 0;
}

.mix-period-plus {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
}

/* Side by side, the results column sets its own height (user request
   2026-10-22: no inner scroll - the best-3 cards pushed the "צור מסלול סינטטי"
   button out of view). The modal grows with the content up to 96vh; only past
   that does the whole modal body scroll, never a box inside it. */
@media (min-width: 1025px) {
    #mixResults .modern-table-container {
        min-height: 150px;
        flex: none !important;
        overflow-y: visible !important;
    }
}

/* Tighter results spacing so more fund rows fit before the table scrolls */
#mixGeneratorModal #mixResults .calc-card {
    margin-bottom: 0 !important;
    padding: 10px 15px !important;
}

#mixGeneratorModal #mixResults #mixDataDateDisplay {
    margin-bottom: 0 !important;
}

#mixGeneratorModal #mixResults .modern-table td {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* With few funds the rows stretch evenly to fill the table card (no blank
   strip); with many, the table is taller than the card and scrolls. Browsers
   share extra table height by content height, so each row gets an explicit
   1/count share (quantity selectors, 1-6 funds) to keep the rows equal. */
#mixGeneratorModal #mixResults .modern-table {
    height: 100%;
    margin: 0;
}

#mixTableBody > tr:first-child:nth-last-child(1) { height: 100%; }
#mixTableBody > tr:first-child:nth-last-child(2),
#mixTableBody > tr:first-child:nth-last-child(2) ~ tr { height: 50%; }
#mixTableBody > tr:first-child:nth-last-child(3),
#mixTableBody > tr:first-child:nth-last-child(3) ~ tr { height: 33.333%; }
#mixTableBody > tr:first-child:nth-last-child(4),
#mixTableBody > tr:first-child:nth-last-child(4) ~ tr { height: 25%; }
#mixTableBody > tr:first-child:nth-last-child(5),
#mixTableBody > tr:first-child:nth-last-child(5) ~ tr { height: 20%; }
#mixTableBody > tr:first-child:nth-last-child(6),
#mixTableBody > tr:first-child:nth-last-child(6) ~ tr { height: 16.666%; }

/* Best-3 mixes strip above the results (renderMixAlternatives) */
#mixAlternatives .mix-alt-heading {
    color: #00695c;
    font-weight: 700;
    font-size: var(--pd-fs-sm);
    margin-bottom: 6px;
}

#mixAlternatives .mix-alt-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

#mixAlternatives .mix-alt-card {
    text-align: start;
    font: inherit;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--pd-r-md);
    background: #f0faf9;
    border: 2px solid #b2dfdb;
    color: var(--pd-ink-2);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#mixAlternatives .mix-alt-card.selected {
    border-color: #00695c;
    background: #e0f2f1;
}

#mixAlternatives .mix-alt-title {
    font-weight: 700;
    color: #00695c;
}

#mixAlternatives .mix-alt-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

#mixAlternatives .mix-alt-mgr,
#mixAlternatives .mix-alt-rets,
#mixAlternatives .mix-alt-stars {
    font-size: var(--pd-fs-xs);
    color: var(--pd-muted);
}

#mixAlternatives .mix-alt-rets {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
}

#mixAlternatives .mix-alt-fund {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: var(--pd-fs-xs);
}

#mixAlternatives .mix-alt-fund span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    #mixAlternatives .mix-alt-row {
        grid-template-columns: 1fr;
    }
}

/* ===== components/modal_mix_generator.html (block 3) ===== */
#mixNoticeModal.modal-overlay {
    z-index: 2800 !important;
    background: rgba(15, 23, 42, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    direction: rtl;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
}

#mixNoticeModal .modal-content {
    background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 100%);
    border: 1.5px solid #a7f3d0;
    border-radius: var(--pd-r-xl);
    max-width: 480px;
    width: 100%;
    padding: 28px 24px 22px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(16, 185, 129, 0.15);
    position: relative;
    text-align: center;
    animation: mixNoticeModalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mixNoticeModalPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.mix-notice-icon-box {
    width: 62px;
    height: 62px;
    border-radius: var(--pd-r-lg);
    background: linear-gradient(135deg, var(--pd-tool-mix-from) 0%, var(--pd-tool-mix) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.mix-notice-title {
    font-size: var(--pd-fs-xl);
    font-weight: 800;
    color: #064e3b;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.mix-notice-body {
    font-size: var(--pd-fs-md);
    color: var(--pd-ink-3);
    line-height: 1.55;
    margin-bottom: 14px;
    font-weight: 500;
}

.mix-notice-highlight-card {
    background: #f0fdfa;
    border: 1px solid var(--pd-institution-tint);
    border-radius: var(--pd-r-md);
    padding: 12px 14px;
    color: #047857;
    font-size: var(--pd-fs-sm);
    font-weight: 600;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 137, 123, 0.05);
}

.mix-notice-btn {
    width: 100%;
    min-height: 40px;
    background: var(--pd-blue);
    color: white;
    font-family: var(--pd-font);
    font-weight: 700;
    font-size: var(--pd-fs-md);
    padding: 0 18px;
    border-radius: var(--pd-r-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--pd-shadow-sm);
    transition: background-color var(--pd-dur) var(--pd-ease);
}

.mix-notice-btn:hover {
    background: var(--pd-blue-hover);
}

/* Same close button as every modal (light-surface variant: this dialog has no navy header) */
.mix-notice-close-x {
    position: absolute;
    top: 14px;
    left: 16px;
    background: var(--pd-surface-2);
    border: none;
    color: var(--pd-ink-4);
    width: 36px;
    height: 36px;
    border-radius: var(--pd-r-pill);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--pd-dur) var(--pd-ease);
}

.mix-notice-close-x svg {
    width: 18px;
    height: 18px;
}

.mix-notice-close-x:hover {
    background: var(--pd-line);
    color: var(--pd-ink);
}

/* ===== components/modal_mix_force.html ===== */
/* Opens on top of the (already open) mix generator modal, which also sits at z-index 2000. */
#mixForceModal.modal-overlay {
    z-index: 2600 !important;
}

#mixForceModal .mix-force-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: white;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-r-lg);
    padding: 16px;
}

#mixForceModal .mix-force-search {
    position: relative;
}

#mixForceModal .mix-force-search input {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    padding: 0 32px 0 10px;
    border: 1px solid var(--pd-line-strong);
    border-radius: var(--pd-r-md);
    font-size: var(--pd-fs-sm);
    outline: none;
    background: var(--pd-surface-sunk);
    color: var(--pd-ink);
}

#mixForceModal .mix-force-search input:focus {
    border-color: var(--pd-blue);
    background: var(--pd-surface);
    box-shadow: var(--pd-focus-ring);
}

#mixForceModal .mix-force-search i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--pd-faint);
    pointer-events: none;
}

#mixForceModal .mix-force-results {
    height: 220px;
    overflow-y: auto;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    padding: 4px;
    background: var(--pd-surface-sunk);
}

#mixForceModal .mix-force-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

/* ===== components/modal_custom_period.html ===== */
/* ===== CUSTOM PERIOD MODAL STYLES ===== */
#customPeriodModal {
    position: fixed;
    inset: 0;
    z-index: 25000;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#customPeriodModal.active {
    opacity: 1;
}

.period-modal-box {
    background: #ffffff;
    border-radius: var(--pd-r-xl);
    box-shadow: var(--pd-shadow-lg);
    max-width: 480px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

#customPeriodModal.active .period-modal-box {
    transform: scale(1) translateY(0);
}

.period-header {
    /* light window header - same as theme.css .modal-header (2026-10-21) */
    background: var(--pd-surface-sunk);
    border-bottom: 2px solid var(--pd-navy);
    padding: 16px 24px;
    min-height: 72px;
    box-sizing: border-box;
    color: var(--pd-ink);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.period-header-titles {
    flex: 1;
    min-width: 0;
}

.period-header-title {
    margin: 0;
    font-size: var(--pd-fs-xl);
    font-weight: 800;
    letter-spacing: 0;
    font-family: var(--pd-font);
    color: var(--pd-ink);
}

.period-header-subtitle {
    font-size: var(--pd-fs-xs);
    color: var(--pd-muted);
    margin-top: 2px;
    font-weight: 500;
}

.period-body {
    padding: 24px;
    direction: rtl;
    font-family: var(--pd-font);
}

.period-date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.period-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.period-label {
    font-size: var(--pd-fs-sm);
    font-weight: 700;
    color: var(--pd-ink-3);
}

.period-select-pair {
    display: flex;
    gap: 8px;
}

.period-select {
    flex: 1;
    height: 40px;
    border-radius: var(--pd-r-md);
    border: 1px solid var(--pd-line-strong);
    background-color: var(--pd-surface-sunk);
    color: var(--pd-ink);
    font-size: var(--pd-fs-sm);
    font-weight: 600;
    padding: 0 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.period-select:focus {
    border-color: var(--pd-blue);
    background-color: var(--pd-surface);
    box-shadow: var(--pd-focus-ring);
}

.period-info-card {
    margin-bottom: 24px;
}

.period-error-msg {
    margin-bottom: 20px;
    display: none;
}

.period-actions {
    display: flex;
    gap: 12px;
}

/* ===== components/modal_advanced_exposure.html ===== */
/* ===== ADVANCED EXPOSURE FILTER MODAL ===== */
#advancedExposureModal {
    position: fixed;
    inset: 0;
    z-index: 25000;
    background: rgba(15, 23, 42, 0.15);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#advancedExposureModal.active {
    opacity: 1;
}

.adv-exp-modal-box {
    background: #ffffff;
    border-radius: var(--pd-r-xl);
    box-shadow: var(--pd-shadow-lg);
    max-width: 560px;
    width: 92%;
    max-height: calc(88vh / var(--pd-zoom, 1));
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

#advancedExposureModal.active .adv-exp-modal-box {
    transform: scale(1) translateY(0);
}

.adv-exp-header {
    /* light window header - same as theme.css .modal-header (2026-10-21) */
    background: var(--pd-surface-sunk);
    border-bottom: 2px solid var(--pd-navy);
    padding: 16px 24px;
    min-height: 72px;
    box-sizing: border-box;
    color: var(--pd-ink);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.adv-exp-header-titles {
    flex: 1;
    min-width: 0;
}

.adv-exp-header-title {
    margin: 0;
    font-size: var(--pd-fs-xl);
    font-weight: 800;
    letter-spacing: 0;
    font-family: var(--pd-font);
    color: var(--pd-ink);
}

.adv-exp-header-subtitle {
    font-size: var(--pd-fs-xs);
    color: var(--pd-muted);
    margin-top: 2px;
    font-weight: 500;
}

.adv-exp-body {
    padding: 20px 24px;
    direction: rtl;
    font-family: var(--pd-font);
    overflow-y: auto;
    flex: 1;
}

.adv-exp-section-title {
    font-size: var(--pd-fs-xs);
    font-weight: 700;
    color: var(--pd-muted);
    margin: 18px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.adv-exp-section-title:first-child {
    margin-top: 0;
}

.adv-exp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--pd-r-md);
    border: 1px solid var(--pd-line);
    background: var(--pd-surface-sunk);
    margin-bottom: 6px;
    transition: all 0.2s;
}

.adv-exp-row.adv-exp-row-total {
    background: var(--pd-blue-tint);
    border-color: var(--pd-blue-subtle);
}

.adv-exp-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--pd-fs-sm);
    font-weight: 700;
    color: var(--pd-ink-3);
    cursor: pointer;
    user-select: none;
    flex: 1;
    min-width: 0;
}

.adv-exp-row-label input[type="checkbox"] {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: var(--pd-blue);
    flex-shrink: 0;
}

.adv-exp-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--pd-line);
    background: var(--pd-surface);
    flex-shrink: 0;
    direction: rtl;
    font-family: var(--pd-font);
}

.adv-exp-match-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: var(--pd-fs-md);
    font-weight: 700;
    color: var(--pd-ink-3);
    background: var(--pd-blue-tint);
    border: 1px solid var(--pd-blue-subtle);
    border-radius: var(--pd-r-md);
    padding: 12px 18px;
    margin-bottom: 16px;
}

.adv-exp-match-banner strong {
    color: var(--pd-blue-hover);
    font-size: var(--pd-fs-2xl);
    line-height: 1;
}

.adv-exp-actions {
    display: flex;
    gap: 10px;
}

.adv-exp-btn {
    height: 40px;
    border-radius: var(--pd-r-md);
    font-weight: 700;
    font-size: var(--pd-fs-md);
    cursor: pointer;
    transition: background-color var(--pd-dur) var(--pd-ease), color var(--pd-dur) var(--pd-ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    font-family: var(--pd-font);
}

.adv-exp-btn-primary {
    flex: 2;
    background: var(--pd-blue);
    color: white;
    box-shadow: var(--pd-shadow-sm);
}

.adv-exp-btn-primary:hover {
    background: var(--pd-blue-hover);
}

.adv-exp-btn-reset {
    flex: 1;
    background: var(--pd-surface);
    color: var(--pd-ink-3);
    border-color: var(--pd-line-strong);
}

.adv-exp-btn-reset:hover {
    background: var(--pd-surface-2);
    color: var(--pd-ink);
}

/* Benchmark-index checklist (מדדי ייחוס מהצהרת מדיניות ההשקעה) */
.adv-bm-search {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--pd-line-strong);
    border-radius: var(--pd-r-md);
    background: #fff;
    font-family: var(--pd-font);
    font-size: var(--pd-fs-sm);
    direction: rtl;
}

.adv-bm-search:focus {
    outline: none;
    border-color: var(--pd-blue);
    box-shadow: 0 0 0 3px var(--pd-blue-tint);
}

.adv-bm-scroll {
    max-height: 240px;
    overflow-y: auto;
    margin-top: 8px;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-r-md);
    background: #fff;
}

.adv-bm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--pd-fs-sm);
}

.adv-bm-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--pd-surface-2);
    color: var(--pd-muted);
    font-weight: 700;
    font-size: var(--pd-fs-xs);
    text-align: right;
    padding: 7px 10px;
    border-bottom: 1px solid var(--pd-line);
}

.adv-bm-table td {
    padding: 6px 10px;
    border-top: 1px solid var(--pd-line);
    color: var(--pd-ink-3);
}

.adv-bm-table tr:first-child td {
    border-top: none;
}

.adv-bm-table tr.is-selected td {
    background: var(--pd-blue-tint);
}

.adv-bm-table .adv-bm-name label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.adv-bm-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: var(--pd-blue);
    cursor: pointer;
}

.adv-bm-table .adv-bm-count {
    width: 70px;
    text-align: center;
    color: var(--pd-muted);
    font-variant-numeric: tabular-nums;
}

.adv-bm-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: var(--pd-fs-xs);
    color: var(--pd-muted);
}

.adv-bm-clear {
    border: none;
    background: none;
    padding: 0;
    color: var(--pd-blue-hover);
    font-family: var(--pd-font);
    font-size: var(--pd-fs-xs);
    font-weight: 700;
    cursor: pointer;
}

.adv-bm-empty {
    padding: 14px;
    text-align: center;
    color: var(--pd-muted);
    font-size: var(--pd-fs-sm);
}

/* Small trigger button inside the exposures row (visibility follows the container) */
.adv-exposure-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--pd-r-md);
    border: 1px solid var(--pd-blue-subtle);
    background: var(--pd-blue-tint);
    color: var(--pd-blue-hover);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.adv-exposure-trigger:hover {
    background: var(--pd-blue-subtle);
    border-color: var(--pd-blue);
}

.adv-exposure-trigger .adv-badge-dot {
    display: none;
    position: absolute;
    top: -4px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pd-loss);
    border: 2px solid white;
}

.adv-exposure-trigger.has-active .adv-badge-dot {
    display: block;
}
