/* Portfolio simulation: one workspace, three consecutive stages. */
#tab2.simulation-workspace {
    --simulation-green: #176b43;
    --simulation-ink: #1e352a;
    --simulation-muted: #617168;
    --simulation-border: #d8e3dc;
    min-width: 0;
    color: var(--simulation-ink);
}

#tab2.simulation-workspace.active {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: visible;
    padding-bottom: 20px;
}

#tab2 .simulation-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 2px 22px;
}

#tab2 .simulation-eyebrow,
#tab2 .simulation-section-kicker {
    margin-bottom: 8px;
    color: var(--simulation-green);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.5px;
    line-height: 1.5;
}

#tab2 .simulation-workspace-heading h2 {
    margin: 0 0 8px;
    color: #173c2a;
    font-size: clamp(23px, 2.1vw, 30px);
    font-weight: 750;
    letter-spacing: -1px;
    line-height: 1.3;
}

#tab2 .simulation-workspace-description {
    color: var(--simulation-muted);
    font-size: 13px;
    line-height: 1.7;
    word-break: keep-all;
}

#tab2 .simulation-workspace-tools {
    display: flex;
    flex: 0 1 370px;
    align-items: flex-end;
    flex-direction: column;
    gap: 11px;
}

#tab2 .simulation-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #bfd1c6;
    border-radius: 6px;
    background: #fff;
    color: #305342;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
}

#tab2 .simulation-view-toggle:hover,
#tab2 .simulation-view-toggle[aria-pressed="true"] {
    border-color: var(--simulation-green);
    background: #edf6f0;
}

#tab2 .simulation-workspace-context {
    color: var(--simulation-muted);
    font-size: 11.5px;
    line-height: 1.6;
    text-align: right;
    overflow-wrap: anywhere;
}

#tab2 .simulation-workflow {
    position: sticky;
    top: -12px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 24px;
    padding: 6px;
    border: 1px solid #d1e0d6;
    border-radius: 10px;
    background: #eef3ef;
    box-shadow: 0 4px 14px rgba(26, 58, 40, 0.035);
}

#tab2 .simulation-stage-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 70px;
    padding: 13px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #63756a;
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

#tab2 .simulation-stage-tab:hover {
    background: #f8fbf9;
    color: #244f37;
}

#tab2 .simulation-stage-tab[aria-selected="true"] {
    border-color: #b7d4c1;
    background: #fff;
    color: #185b37;
    box-shadow: 0 2px 5px rgba(24, 74, 45, 0.045);
}

#tab2 .simulation-stage-number {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #cddad1;
    border-radius: 8px;
    background: #e6eee8;
    color: #6a8173;
    font-size: 12px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

#tab2 .simulation-stage-tab[aria-selected="true"] .simulation-stage-number {
    border-color: var(--simulation-green);
    background: var(--simulation-green);
    color: #fff;
}

#tab2 .simulation-stage-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}

#tab2 .simulation-stage-copy strong {
    font-size: 15px;
    font-weight: 750;
    line-height: 1.3;
}

#tab2 .simulation-stage-copy small {
    color: #708076;
    font-size: 11px;
    line-height: 1.3;
}

#tab2 .simulation-stage-arrow {
    margin-left: auto;
    color: #96ab9e;
    font-size: 18px;
}

#tab2 .simulation-stage-copy .badge-complete {
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 9px;
    vertical-align: middle;
}

#tab2 .simulation-stage-panel {
    min-width: 0;
    scroll-margin-top: 100px;
}

#tab2 .simulation-stage-panel[hidden],
#tab2 [hidden] {
    display: none !important;
}

#tab2[data-simulation-view="all"] .simulation-stage-panel + .simulation-stage-panel {
    margin-top: 36px;
    padding-top: 30px;
    border-top: 1px solid #c9d9cf;
}

#tab2[data-simulation-view="all"] .sub-tab-pane {
    display: block;
    min-height: 0;
    overflow: visible;
}

#tab2[data-simulation-view="all"] .sub-tab-pane + .sub-tab-pane {
    border-top: 1px solid var(--simulation-border);
}

#tab2 .simulation-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 2px 17px;
}

#tab2 .simulation-panel-heading h3 {
    color: #233c2e;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.5px;
    line-height: 1.5;
}

#tab2 .simulation-panel-heading > p {
    max-width: 420px;
    padding-bottom: 3px;
    color: var(--simulation-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
    word-break: keep-all;
}

#tab2 .simulation-section-kicker {
    margin-bottom: 5px;
    color: #789182;
    font-size: 9px;
    letter-spacing: 1.2px;
}

/* Assumption editors keep their controls, with page scrolling around bounded tables. */
#tab2 .simulation-workspace-heading,
#tab2 .simulation-panel-heading h3,
#tab2 .scenario-pane-title,
#tab2 .scenario-card-title,
#tab2 .scenario-section-heading h4 {
    text-align: left;
}

/* Keep daily inputs compact while preserving readable values and native controls. */
#tab2 .scenario-bulk-toolbar {
    gap: 10px;
    margin-bottom: 7px;
    padding: 6px 10px;
}

#tab2 .scenario-bulk-toolbar .bulk-field {
    gap: 3px;
}

#tab2 .scenario-bulk-toolbar .bulk-field > label {
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
}

#tab2 .scenario-date-field input,
#tab2 .scenario-bulk-amount input,
#tab2 .scenario-apply-button {
    height: 30px;
    min-height: 0;
    padding: 2px 8px;
    font-size: 13px;
}

#tab2 .scenario-date-separator {
    margin-top: 19px;
}

#tab2 .scenario-fund-picker {
    min-height: 30px;
    gap: 4px;
    padding: 2px 6px;
}

#tab2 .scenario-fund-picker .fund-chip {
    gap: 5px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
}

#tab2 .table-editor-container.compact-editor th,
#tab2 #liability-editor-table th,
#tab2 #rate-point-table th {
    padding: 4px 7px;
    font-size: 12.5px;
    line-height: 1.3;
    white-space: nowrap;
}

#tab2 .table-editor-container.compact-editor td,
#tab2 #liability-editor-table td,
#tab2 #rate-point-table td {
    padding: 1px 7px;
}

#tab2 .table-editor-container.compact-editor input,
#tab2 .table-editor-container.compact-editor select,
#tab2 #liability-editor-table input,
#tab2 #rate-point-table input {
    height: 24px;
    min-height: 0;
    padding: 1px 6px;
}

#tab2 .table-editor-container.compact-editor button,
#tab2 #rate-point-table button {
    white-space: nowrap;
}

#tab2 #rate-point-table button {
    height: 24px;
    min-height: 0;
    padding: 0 8px;
}

#tab2 #orders-editor-table {
    min-width: 1250px;
}

#tab2 .order-source-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

#tab2 .order-source-liquidity {
    background: #e6f4eb;
    color: #17613d;
    border: 1px solid #b9d8c4;
}

#tab2 .order-source-manual {
    background: #f1f3f5;
    color: #526170;
    border: 1px solid #dce2e7;
}

#tab2 .orders-pnl-note {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 11px;
}

#tab2 [data-sale-pnl-index] {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#tab2 #orders-editor-table th:last-child,
#tab2 #orders-editor-table td:last-child {
    padding-inline: 1px;
}

#tab2 #early-redemptions-table {
    min-width: 950px;
}

#tab2 .scenario-pagination {
    gap: 8px;
    margin-top: 5px;
    padding: 5px 8px;
}

#tab2 .scenario-date-jump input,
#tab2 .scenario-date-jump button,
#tab2 .scenario-pagination-controls select,
#tab2 .scenario-pagination-controls button {
    height: 28px;
}

#tab2.simulation-workspace .sub-tabs-container {
    flex: none;
    max-height: none;
    border-color: var(--simulation-border);
    box-shadow: none;
}

#tab2.simulation-workspace .sub-tabs-bar {
    background: #f4f7f5;
    border-bottom-color: var(--simulation-border);
}

#tab2.simulation-workspace .sub-tab-btn.active {
    border-color: #b9d5c4;
    color: #225c3c;
    box-shadow: none;
}

#tab2.simulation-workspace .sub-tab-pane.active {
    flex: none;
    min-height: 0;
    max-height: none;
    overflow: visible;
}

#tab2.simulation-workspace #subtab-basic.active,
#tab2.simulation-workspace #subtab-liability.active,
#tab2.simulation-workspace #subtab-orders.active,
#tab2.simulation-workspace #subtab-rates.active,
#tab2.simulation-workspace #subtab-early-redemptions.active {
    height: auto;
    min-height: 0;
    overflow: visible;
}

#tab2.simulation-workspace .table-editor-container.compact-editor,
#tab2.simulation-workspace #subtab-early-redemptions .compact-editor,
#tab2.simulation-workspace .liability-table-scroll {
    flex: none;
    min-height: 120px;
    max-height: min(50vh, 520px);
    overflow: auto;
}

#tab2.simulation-workspace #subtab-rates .rate-eq-board {
    min-height: 400px;
    max-height: none;
    overflow: visible;
}

#tab2.simulation-workspace #subtab-rates .rate-graph-layout {
    min-height: 360px;
}

#tab2.simulation-workspace .scenario-run-button {
    width: auto;
    min-width: 200px;
    min-height: 44px;
    border-radius: 6px;
    background: var(--simulation-green);
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
}

#tab2 .simulation-text-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--simulation-green);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
}

#tab2 .simulation-text-button:hover { color: #123e27; text-decoration: underline; }

#tab2 .simulation-execution-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr);
    align-items: stretch;
    gap: 18px;
}

#tab2 .simulation-review-card,
#tab2 .simulation-engine-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--simulation-border);
    border-radius: 9px;
    background: #fff;
}

#tab2 .simulation-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

#tab2 .simulation-card-heading h4,
#tab2 .simulation-readiness-section h4 {
    color: #294a36;
    font-size: 14px;
    font-weight: 750;
}

#tab2 .simulation-review-card .simulation-config-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    min-height: 40px;
}

#tab2 .simulation-review-card .simulation-summary-chip {
    gap: 8px;
    min-height: 35px;
    padding: 7px 10px;
    border-color: #dce5df;
    border-radius: 5px;
    background: #f8faf8;
}

#tab2 .simulation-review-card .simulation-summary-chip.primary {
    border-color: #c9decf;
    background: #f0f7f2;
}

#tab2 .simulation-review-card .simulation-summary-chip.warning {
    border-color: #ebd6a1;
    background: #fff9eb;
}

#tab2 .simulation-readiness-section {
    margin-top: 24px;
    padding-top: 23px;
    border-top: 1px solid #e5ece7;
}

#tab2 .simulation-readiness {
    display: grid;
    gap: 0;
    margin: 13px 0 0;
    padding: 0;
    list-style: none;
}

#tab2 .simulation-readiness-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2ef;
    font-size: 12px;
    line-height: 1.6;
}

#tab2 .simulation-readiness-item:last-child { border-bottom: 0; }

#tab2 .simulation-readiness-marker {
    display: grid;
    flex: 0 0 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #eef2ef;
    color: #738179;
    font-size: 12px;
    font-weight: 700;
}

#tab2 .simulation-readiness-item[data-status="ready"] .simulation-readiness-marker {
    background: #e9f5ed;
    color: #267644;
}

#tab2 .simulation-readiness-item[data-status="warning"] .simulation-readiness-marker {
    background: #fff4d8;
    color: #8c650e;
}

#tab2 .simulation-readiness-item[data-status="blocked"] .simulation-readiness-marker {
    background: #fff0ed;
    color: #a83d2d;
}

#tab2 .simulation-readiness-copy { display: grid; gap: 2px; min-width: 0; }
#tab2 .simulation-readiness-copy strong { color: #36513f; font-size: 12px; font-weight: 650; }
#tab2 .simulation-readiness-detail { color: #78867e; font-size: 11.5px; overflow-wrap: anywhere; }

#tab2 .simulation-engine-card {
    background: #f0f5f1;
    border-color: #d5e2d9;
}

#tab2 .simulation-engine-label {
    display: inline-flex;
    margin-bottom: 15px;
    padding: 4px 8px;
    border: 1px solid #c5d9cc;
    border-radius: 4px;
    color: #52755d;
    font-size: 10px;
    font-weight: 700;
}

#tab2 .simulation-engine-card h4 {
    margin-bottom: 12px;
    color: #2b5038;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.7px;
    line-height: 1.5;
}

#tab2 .simulation-engine-card > p {
    color: #66806e;
    font-size: 12px;
    line-height: 1.85;
    word-break: keep-all;
}

#tab2 .simulation-engine-summary:empty { display: none; }
#tab2 .simulation-engine-summary { margin-top: 14px; color: #40674c; font-size: 11px; line-height: 1.75; }
#tab2 .simulation-engine-card .simulation-engine-limit { margin-top: 13px; padding-top: 12px; border-top: 1px solid #d7e4db; color: #728479; font-size: 11px; }

#tab2 .simulation-engine-flow {
    display: grid;
    gap: 18px;
    margin: 24px 0 20px;
    padding: 0;
    list-style: none;
}

#tab2 .simulation-engine-flow li { display: flex; align-items: center; gap: 12px; }
#tab2 .simulation-engine-flow li > span {
    display: grid;
    flex: 0 0 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #caddcf;
    border-radius: 50%;
    background: #f9fcfa;
    color: #6a8b74;
    font-size: 10px;
    font-weight: 700;
}
#tab2 .simulation-engine-flow li > div { display: grid; gap: 4px; }
#tab2 .simulation-engine-flow strong { color: #3b5f47; font-size: 12px; font-weight: 650; }
#tab2 .simulation-engine-flow small { color: #7a8f80; font-size: 11px; }

#tab2 .simulation-launch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid #c7d9ce;
    border-radius: 8px;
    background: #fff;
}

#tab2 .simulation-launch-bar strong { color: #36533f; font-size: 13px; font-weight: 700; }
#tab2 .simulation-launch-bar p { margin-top: 7px; color: #718477; font-size: 11.5px; line-height: 1.65; }
#tab2 .simulation-launch-bar .scenario-run-button { flex: 0 0 auto; }
#tab2 button:disabled { cursor: not-allowed; }

#tab2 .simulation-run-progress {
    margin-top: 16px;
    padding: 20px 24px;
    border: 1px solid #bbd7c5;
    border-radius: 8px;
    background: #f0f8f3;
}

#tab2 .simulation-run-progress-heading { display: flex; justify-content: space-between; gap: 16px; color: #28613c; font-size: 12px; line-height: 1.6; }
#tab2 #simulation-run-percent { flex: 0 0 auto; font-weight: 750; font-variant-numeric: tabular-nums; }
#tab2 #simulation-run-bar { display: block; width: 100%; height: 8px; margin-top: 13px; overflow: hidden; border: 0; border-radius: 8px; background: #dceadf; accent-color: var(--simulation-green); }
#tab2 #simulation-run-bar::-webkit-progress-bar { background: #dceadf; border-radius: 8px; }
#tab2 #simulation-run-bar::-webkit-progress-value { background: var(--simulation-green); border-radius: 8px; transition: width 250ms ease; }
#tab2 #simulation-run-bar::-moz-progress-bar { background: var(--simulation-green); border-radius: 8px; }
#tab2 .simulation-run-progress > p { margin-top: 10px; color: #6c8b75; font-size: 11px; line-height: 1.6; }
#tab2 .simulation-run-error { margin-top: 16px; padding: 12px 14px; border: 1px solid #ebc9c1; border-radius: 6px; background: #fff5f2; color: #9c3e2d; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }

#tab2 .simulation-result-context { margin: -7px 2px 18px; color: #708276; font-size: 12px; line-height: 1.7; }
#tab2 .simulation-result-stale { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 15px 18px; border: 1px solid #e6d6af; border-radius: 7px; background: #fffbf0; color: #81612b; }
#tab2 .simulation-result-stale strong { font-size: 12px; font-weight: 700; }
#tab2 .simulation-result-stale p { margin-top: 5px; font-size: 11.5px; line-height: 1.6; }
#tab2 .simulation-result-stale .simulation-text-button { color: #81612b; }

#tab2 .simulation-result-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
#tab2 .simulation-result-overview:empty { display: none; }
#tab2 .simulation-result-metric { display: grid; min-width: 0; gap: 10px; padding: 20px; border: 1px solid var(--simulation-border); border-radius: 7px; background: #fff; }
#tab2 .simulation-result-metric > span { color: #6c8072; font-size: 11px; font-weight: 650; }
#tab2 .simulation-result-metric > strong { color: #254b32; font-size: clamp(19px, 1.8vw, 26px); font-weight: 750; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#tab2 .simulation-result-metric > small { color: #88948c; font-size: 10.5px; line-height: 1.5; }
#tab2 .simulation-result-metric.negative > strong { color: #ab4e3d; }
#tab2 .simulation-result-chart-panel { margin-bottom: 18px; padding: 20px; border: 1px solid var(--simulation-border); border-radius: 8px; background: #fff; }
#tab2 .simulation-result-chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
#tab2 .simulation-result-chart-heading h4 { color: #36533f; font-size: 14px; font-weight: 750; }
#tab2 .simulation-result-chart-heading p { color: #7a897f; font-size: 11px; line-height: 1.6; }
#tab2 .simulation-result-chart-canvas { position: relative; height: 250px; min-width: 0; }
#tab2 .simulation-results-content { min-width: 0; }
#tab2 #result-scenario-badge { margin-left: 8px; font-size: 10px; font-weight: 600; vertical-align: middle; }
#tab2 .result-ledger-filter { border-color: var(--simulation-border); }
#tab2 .result-ledger-section { border-color: var(--simulation-border); }

#tab2 .simulation-empty-state { padding: 50px 24px; border: 1px dashed #c5d8cb; border-radius: 9px; background: #f8fbf9; text-align: center; }
#tab2 .simulation-empty-icon { display: inline-grid; width: 44px; height: 44px; margin-bottom: 17px; place-items: center; border: 1px solid #d4e3d8; border-radius: 12px; background: #ecf5ef; color: #4d785a; font-size: 23px; }
#tab2 .simulation-empty-state h4 { margin-bottom: 9px; color: #34553e; font-size: 16px; font-weight: 700; }
#tab2 .simulation-empty-state p { max-width: 530px; margin: 0 auto 24px; color: #7b8d80; font-size: 12px; line-height: 1.8; word-break: keep-all; }
#tab2 .simulation-empty-state .scenario-run-button { display: inline-flex; }

#tab2 .simulation-stage-tab:focus-visible,
#tab2 .simulation-view-toggle:focus-visible,
#tab2 .simulation-text-button:focus-visible,
#tab2 .scenario-run-button:focus-visible {
    outline: 2px solid var(--simulation-green);
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    #tab2 .simulation-stage-tab { gap: 9px; padding: 12px; }
    #tab2 .simulation-stage-copy strong { font-size: 13px; }
    #tab2 .simulation-stage-arrow { display: none; }
    #tab2 .simulation-review-card, #tab2 .simulation-engine-card { padding: 20px; }
    #tab2 .simulation-execution-grid { grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr); }
    #tab2 .simulation-stage-copy .badge-complete { display: none; }
}

@media (max-width: 900px) {
    #tab2 .scenario-bulk-funds,
    #tab2 .scenario-bulk-amount { flex-basis: auto; }
    #tab2 .simulation-workspace-header { align-items: flex-start; flex-direction: column; gap: 16px; }
    #tab2 .simulation-workspace-tools { flex: auto; width: 100%; align-items: center; justify-content: space-between; flex-direction: row-reverse; gap: 16px; }
    #tab2 .simulation-workspace-context { text-align: left; }
    #tab2 .simulation-workflow { top: 0; }
    #tab2 .simulation-panel-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    #tab2 .simulation-panel-heading > p { max-width: none; text-align: left; }
    #tab2 .simulation-execution-grid { grid-template-columns: 1fr; }
    #tab2 .simulation-engine-card h4 br { display: none; }
    #tab2 .simulation-engine-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    #tab2 .simulation-result-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    #tab2 .simulation-workspace-header { padding-top: 7px; }
    #tab2 .simulation-workspace-description { font-size: 12px; }
    #tab2 .simulation-workspace-tools { align-items: flex-start; flex-direction: column; gap: 10px; }
    #tab2 .simulation-workflow { gap: 3px; margin-bottom: 20px; padding: 4px; }
    #tab2 .simulation-stage-tab { align-items: flex-start; flex-direction: column; gap: 8px; min-height: 82px; padding: 10px 8px; }
    #tab2 .simulation-stage-number { flex-basis: 24px; width: 25px; height: 24px; border-radius: 5px; font-size: 10px; }
    #tab2 .simulation-stage-copy strong { font-size: 11px; line-height: 1.5; white-space: nowrap; }
    #tab2 .simulation-stage-copy small { display: none; }
    #tab2 .simulation-panel-heading h3 { font-size: 17px; }
    #tab2 .simulation-review-card, #tab2 .simulation-engine-card { padding: 17px; }
    #tab2 .simulation-review-card .simulation-summary-chip { white-space: normal; }
    #tab2 .simulation-card-heading { gap: 10px; }
    #tab2 .simulation-card-heading h4 { font-size: 13px; }
    #tab2 .simulation-engine-flow { grid-template-columns: 1fr; gap: 16px; }
    #tab2 .simulation-launch-bar, #tab2 .simulation-result-stale { align-items: stretch; flex-direction: column; gap: 15px; padding: 17px; }
    #tab2 .simulation-launch-bar .scenario-run-button { width: 100%; }
    #tab2.simulation-workspace .scenario-action-buttons .scenario-run-button { width: 100%; }
    #tab2 .simulation-result-overview { gap: 9px; }
    #tab2 .simulation-result-metric { gap: 7px; padding: 14px; }
    #tab2 .simulation-result-metric > strong { font-size: 19px; }
    #tab2 .simulation-result-chart-panel { padding: 15px; }
    #tab2 .simulation-result-chart-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    #tab2 .simulation-result-chart-canvas { height: 230px; }
    #tab2 .simulation-run-progress { padding: 17px; }
    #tab2 #result-scenario-badge { display: table; margin: 7px 0 0; }
    #tab2 .simulation-stage-panel { scroll-margin-top: 112px; }
}

@media (prefers-reduced-motion: reduce) {
    #tab2 .simulation-stage-tab,
    #tab2 #simulation-run-bar::-webkit-progress-value { transition: none; }
}

#tab2 #subtab-capital-calls { height: auto; min-height: 0; overflow: visible; }
#tab2.simulation-workspace #subtab-capital-calls .capital-call-editor { height: auto; min-height: 0; max-height: var(--capital-table-height, 50dvh); overflow: auto; overscroll-behavior: contain; }
#tab2 #capital-calls-table thead th { position: sticky; top: 0; z-index: 2; background: #f6f8fa; }
#tab2 #capital-calls-table { min-width: 1300px; }
#tab2 .capital-call-input { width: 100%; height: 26px; min-height: 0; padding: 2px 6px; border: 1px solid var(--border-base); border-radius: 4px; font: inherit; background: #fff; color: var(--text-main); }
#tab2 .capital-call-input[type="number"] { text-align: right; }
#tab2 .capital-call-input[inputmode="decimal"] { text-align: right; }
#tab2 .capital-call-input:disabled { background: #f4f6f5; color: var(--text-muted); }
#tab2 .capital-call-input[readonly] { background: #edf5ef; color: #225c3c; }
#tab2 .capital-call-date-editor { position: relative; }
#tab2 .capital-call-date-editor > .capital-call-input { padding-right: 27px; }
#tab2 .capital-call-date-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#tab2 .capital-call-calendar-button { position: absolute; right: 2px; top: 2px; display: flex; align-items: center; justify-content: center; width: 23px; height: 22px; padding: 0; border: 0; background: transparent; color: var(--text-main); cursor: pointer; }
#tab2 .capital-call-currency { display: block; text-align: center; font-weight: 600; }
#tab2 .capital-call-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.capital-call-asset-popup { position: fixed; inset: auto; z-index: 10000; box-sizing: border-box; margin: 0; padding: 0; border: 1px solid var(--border-base); border-radius: 6px; background: #fff; color: var(--text-main); box-shadow: 0 6px 20px #17342626; font: 11.5px/1.4 var(--font-base, sans-serif); text-align: left; }
.capital-call-asset-popup .capital-call-asset-results { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.capital-call-asset-popup .capital-call-asset-option { padding: 6px 8px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; border-bottom: 1px solid var(--border-base); }
.capital-call-asset-popup .capital-call-asset-option:last-child { border-bottom: 0; }
.capital-call-asset-popup .capital-call-asset-option:hover,
.capital-call-asset-popup .capital-call-asset-option[aria-selected="true"] { background: #e8f3ec; color: #155d3a; }
.capital-call-asset-popup .capital-call-asset-option strong,
.capital-call-asset-popup .capital-call-asset-option small { display: block; }
.capital-call-asset-popup .capital-call-asset-option small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.capital-call-asset-popup .capital-call-asset-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.capital-call-asset-popup .capital-call-asset-balance { margin-left: auto; color: var(--accent-red, #b42318); font-size: 11px; font-weight: 600; }
.capital-call-asset-popup .capital-call-search-status { padding: 5px 8px; border-top: 1px solid var(--border-base); color: var(--text-muted); font-size: 10px; white-space: normal; text-align: left; }

.assumption-leave-dialog {
    width: min(520px, calc(100vw - 32px)); margin: auto; padding: 24px;
    border: 1px solid #c9d9d0; border-radius: 10px; color: #263e32;
    box-shadow: 0 16px 60px #17342633;
}
.assumption-leave-dialog::backdrop { background: #15281e66; }
.assumption-leave-dialog h3 { margin: 0 0 12px; font-size: 18px; text-align: left; }
.assumption-leave-description { margin: 0 0 18px; font-size: 13px; line-height: 1.7; }
.assumption-leave-dialog label { display: block; margin-bottom: 6px; font-size: 12px; }
.assumption-leave-dialog input { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #c9d9d0; border-radius: 5px; }
.assumption-leave-error { margin-top: 12px; color: #b42318; font-size: 13px; }
.assumption-leave-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.assumption-leave-actions button { min-height: 34px; padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer; border-radius: 5px; }
.assumption-leave-actions .btn-primary { border: 1px solid #167348; background: #167348; color: #fff; }
.assumption-leave-actions button:disabled { opacity: .6; cursor: wait; }
.purchase-income-terms { white-space: normal; min-width: 180px; font-size: 11px; }
.purchase-income-terms summary { cursor: pointer; color: var(--text-main); }
.purchase-income-terms p { margin: 6px 0; color: var(--text-muted); line-height: 1.5; }
.purchase-income-terms label { display: grid; gap: 3px; margin: 6px 0; }
.purchase-income-terms input, .purchase-income-terms select {
    width: 100%; box-sizing: border-box; min-height: 26px; font: inherit;
    color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border-base); border-radius: 4px;
}

/* Live simulation dashboard */
#tab2 .simulation-run-progress { padding: 26px; background: linear-gradient(125deg, #f0f8f3, #fff 72%); border-radius: 14px; }
#tab2 .simulation-live-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; color:#667e6e; font-size:11px; }
#tab2 .simulation-live-badge { display:inline-flex; align-items:center; gap:8px; color:#246c43; font-weight:750; letter-spacing:.06em; }
#tab2 .simulation-live-badge::before { content:""; width:7px; height:7px; background:#36845a; border-radius:50%; box-shadow:0 0 0 4px #dfeee4; }
#tab2 .simulation-live-overview { display:flex; gap:32px; align-items:center; margin:28px 0; }
#tab2 .simulation-progress-dial { --progress:0%; display:grid; place-items:center; flex:0 0 154px; height:154px; border-radius:50%; background:conic-gradient(#327951 var(--progress), #dfebe3 0); }
#tab2 .simulation-progress-dial>div { display:grid; align-content:center; justify-items:center; gap:6px; width:132px; height:132px; border-radius:50%; background:#f6faf7; }
#tab2 .simulation-progress-dial strong { font-size:30px; color:#245a3b; letter-spacing:-1px; }
#tab2 .simulation-progress-dial span { font-size:11px; color:#637c6b; }
#tab2 .simulation-live-copy { flex:1; min-width:0; }
#tab2 .simulation-live-eyebrow { color:#64816e; font-size:10px; letter-spacing:.16em; margin:0 0 8px; }
#tab2 .simulation-live-copy h3 { font-size:20px; color:#274e35; line-height:1.5; word-break:keep-all; margin:0 0 8px; overflow-wrap:anywhere; }
#tab2 .simulation-live-copy>p:not(.simulation-live-eyebrow) { color:#617568; font-size:12px; line-height:1.8; margin:0; }
#tab2 .simulation-live-copy>small { display:block; margin-top:9px; color:#6d7f72; font-size:10px; }
#tab2 .simulation-live-stages { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:0; margin:0 0 22px; list-style:none; gap:10px; }
#tab2 .simulation-live-stages li { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:16px 12px; border:1px solid #dde6df; border-radius:9px; background:#f7f9f7; color:#718276; }
#tab2 .simulation-live-stages li>span { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#e8eee9; font-size:10px; font-weight:700; }
#tab2 .simulation-live-stages li>div { display:grid; gap:5px; }
#tab2 .simulation-live-stages strong { font-size:12px; }
#tab2 .simulation-live-stages small { font-size:10px; }
#tab2 .simulation-live-stages em { font-size:10px; font-style:normal; margin-left:auto; }
#tab2 .simulation-live-stages [data-state="active"] { border-color:#6caa83; background:#eaf5ee; color:#215e39; box-shadow:0 3px 12px #2c65400b; }
#tab2 .simulation-live-stages [data-state="active"]>span { background:#327951; color:white; }
#tab2 .simulation-live-stages [data-state="done"] { background:#fff; color:#476d52; }
#tab2 .simulation-live-bottom { display:grid; grid-template-columns:2fr 1fr; gap:22px; border-top:1px solid #dce7df; padding-top:22px; }
#tab2 .simulation-live-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
#tab2 .simulation-live-metrics>div { display:flex; flex-direction:column; gap:10px; }
#tab2 .simulation-live-metrics span, #tab2 .simulation-live-log h4 { color:#5c7564; font-size:11px; font-weight:600; margin:0; }
#tab2 .simulation-live-metrics strong { color:#2a5037; font-size:22px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#tab2 .simulation-live-metrics small { color:#6b7e71; font-size:10px; line-height:1.6; }
#tab2 .simulation-live-log { border-left:1px solid #dce7df; padding-left:22px; }
#tab2 .simulation-live-log ol { display:grid; gap:9px; padding:0; margin:12px 0 0; list-style:none; max-height:110px; overflow:auto; }
#tab2 .simulation-live-log li { display:flex; gap:12px; color:#4f6a59; font-size:11px; }
#tab2 .simulation-live-log time { color:#708676; min-width:46px; font-variant-numeric:tabular-nums; }
@media(max-width:1000px) { #tab2 .simulation-live-stages { grid-template-columns:repeat(2,minmax(0,1fr)); } #tab2 .simulation-live-bottom { grid-template-columns:1fr; } #tab2 .simulation-live-log { border-left:0; padding-left:0; } }
@media(max-width:540px) { #tab2 .simulation-live-overview { flex-direction:column; gap:20px; align-items:stretch; } #tab2 .simulation-progress-dial { flex-basis:auto; width:154px; align-self:center; } #tab2 .simulation-live-copy h3 { font-size:17px; } #tab2 .simulation-live-metrics { grid-template-columns:1fr; } #tab2 .simulation-live-metrics>div { padding-bottom:12px; border-bottom:1px solid #e0e9e2; } }
