/* Funding Plan: Funding Map + Horizon */

/* Funding records share Folio's paper, type and fine rules; controls retain the
   canvas interaction contract. This route owns its spatial composition. */
.funding-plan-v2 .funding-view-switch { display:flex; gap:2px; border-bottom:1px solid var(--funding-line); }
.funding-plan-v2 { display:grid; grid-template-rows:auto minmax(0,1fr); }
.funding-plan-v2:not(.is-fullscreen):has(> [data-funding-re-suggest]:not([hidden])) { height:auto; grid-template-rows:auto auto minmax(520px,1fr); }
/* Full screen reserves the remaining row for the canvas. Property suggestions
   remain available in Add to map rather than consuming its viewport. */
.funding-plan-v2.is-fullscreen > [data-funding-re-suggest] { display:none; }
.funding-plan-v2 .funding-product-shell { height:100%; min-height:0; }
.funding-plan-v2[data-funding-product="map"][data-funding-view="breakdown"] .funding-product-shell { grid-template-columns:minmax(0,1fr); }
.funding-plan-v2[data-funding-product="map"][data-funding-view="breakdown"] .funding-product-shell > aside { display:none; }
.funding-plan-v2 .funding-map-product { grid-template-rows:auto auto minmax(0,1fr); }
.funding-plan-v2 .funding-funding-strip { display:grid; grid-template-columns:1fr 1.15fr 1.15fr auto; gap:18px; padding:12px 18px; border-bottom:1px solid var(--funding-line); }
.funding-plan-v2 .funding-funding-strip .funding-ledger-lane { padding:0 14px; border:0; border-left:1px solid var(--funding-line); }
.funding-plan-v2 .funding-funding-strip header > strong { font-size:13px; color:var(--funding-ink); }
.funding-plan-v2 .funding-funding-strip footer { display:grid; gap:8px; align-content:center; }
.funding-plan-v2 .funding-funding-strip button, .funding-plan-v2 .funding-plan-context > button { border:0; background:transparent; font:inherit; font-size:12px; color:var(--funding-ink); text-align:left; }
.funding-plan-v2 .funding-product-tabs span { font-family:var(--f-font-ui, "Segoe UI", sans-serif); font-weight:600; }
.funding-plan-v2 .funding-view-switch button { border:0; padding:8px 10px; background:transparent; font:inherit; }
.funding-plan-v2 .funding-view-switch [aria-pressed="true"] { box-shadow:inset 0 -2px var(--f-green, #2e6f40); font-weight:650; }
.funding-plan-v2 .funding-workspace-summary { background:var(--funding-paper); border-radius:3px; box-shadow:none; }
.funding-plan-v2 .funding-workspace-summary header { display:grid; gap:5px; }
.funding-plan-v2 .funding-workspace-summary header > span { font-size:10px; letter-spacing:.08em; color:var(--funding-muted); }
.funding-plan-v2 .funding-workspace-summary header > strong { font-size:16px; font-weight:600; }
.funding-plan-v2 .funding-workspace-summary p { font-size:12px; line-height:1.5; }
.funding-plan-v2 .funding-workspace-summary footer button { border:0; border-bottom:1px solid var(--funding-line); background:transparent; padding:5px 0; margin-right:16px; font:inherit; font-size:12px; color:var(--funding-ink); }
.funding-plan-v2 .funding-ledger-lane { display:grid; grid-template-columns:1fr auto; gap:4px 12px; padding:12px 0; border-bottom:1px solid var(--funding-line); }
.funding-plan-v2 .funding-ledger-lane span { font-size:12px; }
.funding-plan-v2 .funding-ledger-lane strong { font-size:15px; font-variant-numeric:tabular-nums; }
.funding-plan-v2 .funding-ledger-lane small { grid-column:1/-1; color:var(--funding-muted); font-size:11px; }
.funding-plan-v2 .funding-breakdown-workspace { overflow:auto; position:relative; height:100%; min-height:0; padding:24px; background:var(--funding-paper); }
.funding-plan-v2 .funding-breakdown-summary { max-width:680px; margin-bottom:28px; }
.funding-plan-v2 .funding-breakdown-workspace h2 { font-size:20px; font-weight:600; margin:28px 0 12px; }
.funding-plan-v2 .funding-breakdown-workspace p { color:var(--funding-muted); font-size:13px; }
.funding-plan-v2 .funding-source-register { display:grid; gap:0; }
.funding-plan-v2 .funding-source-register > button { display:grid; grid-template-columns:minmax(160px,1fr) 2fr; gap:6px 20px; padding:14px 0; border:0; border-bottom:1px solid var(--funding-line); background:transparent; text-align:left; color:inherit; font:inherit; }
.funding-plan-v2 .funding-source-register small { grid-column:2; color:var(--funding-muted); }
.funding-plan-v2 .funding-breakdown-scroll { overflow:auto; }
.funding-plan-v2 .funding-breakdown-scroll table { border-collapse:collapse; width:100%; min-width:820px; font-size:13px; font-variant-numeric:tabular-nums; }
.funding-plan-v2 .funding-breakdown-scroll th, .funding-plan-v2 .funding-breakdown-scroll td { padding:14px 12px; border-bottom:1px solid var(--funding-line); text-align:left; vertical-align:top; }
.funding-plan-v2 .funding-breakdown-scroll thead { font-size:11px; color:var(--funding-muted); }
.funding-plan-v2 .funding-breakdown-scroll button { font:inherit; color:inherit; background:transparent; border:0; padding:2px 4px; text-align:left; text-decoration:underline; text-underline-offset:3px; }
.funding-plan-v2 .funding-breakdown-scroll small { display:block; font-weight:400; font-size:11px; color:var(--funding-muted); margin-top:6px; }
.funding-plan-v2 .funding-breakdown-group { background:var(--f-quiet, #fcf9f1); }
.funding-plan-v2 .funding-breakdown-workspace > .fundingmap-inspector:not([hidden]) { position:sticky; bottom:0; width:min(420px,100%); max-height:min(70vh, 100%); margin-left:auto; z-index:30; box-shadow:0 0 0 1px var(--funding-line); }
.funding-plan-v2 .funding-source-fields, .funding-plan-v2 .funding-current-fields { border:0; border-top:1px solid var(--funding-line); padding:14px 0; margin:10px 0; }
.funding-plan-v2 .funding-source-fields label, .funding-plan-v2 .funding-current-fields label { display:grid; gap:6px; margin-top:12px; }
.funding-plan-v2 .funding-source-fields p, .funding-plan-v2 .funding-current-fields p { font-size:12px; line-height:1.5; color:var(--funding-muted); }
.funding-plan-v2 .funding-current-fields .funding-check { display:flex; align-items:flex-start; }
.funding-plan-v2 .funding-review-list { margin-top:24px; }
.funding-plan-v2 .funding-map-canvas text { font-family:var(--f-font-ui, "Segoe UI", sans-serif); }
.funding-plan-v2 .funding-svg-state-pill { display:none; }
.funding-plan-v2 .funding-warning-count[hidden] { display:none; }
.funding-plan-v2 .funding-svg-state-text { letter-spacing:.04em; font-weight:500; }
.funding-plan-v2 .funding-horizon-card { border-radius:3px; box-shadow:none; }
.funding-plan-v2 button:focus-visible, .funding-plan-v2 input:focus-visible, .funding-plan-v2 summary:focus-visible { outline:2px solid var(--f-green, #2e6f40); outline-offset:3px; }
@media (max-width:760px) {
    .funding-plan-v2 .funding-shared-header { display:flex; flex-direction:column; align-items:stretch; gap:0; }
    .funding-plan-v2 .funding-product-tabs { min-width:0; width:100%; }
    .funding-plan-v2 .funding-product-tabs button { flex:1; }
    .funding-plan-v2 .funding-plan-context { width:100%; padding:8px 12px; justify-content:flex-start; gap:8px; }
    .funding-plan-v2 .funding-funding-strip { grid-template-columns:1fr; gap:10px; padding:12px; }
    .funding-plan-v2 .funding-funding-strip .funding-ledger-lane { border:0; padding:0; }
    .funding-plan-v2 .funding-funding-strip footer { display:flex; }
    .funding-plan-v2 .funding-plan-context { flex-wrap:wrap; }
    .funding-plan-v2 .funding-breakdown-workspace { padding:14px; }
    .funding-plan-v2 .funding-source-register > button { grid-template-columns:1fr; }
    .funding-plan-v2 .funding-source-register small { grid-column:1; }
    .funding-plan-v2 .funding-workspace-summary { max-width:100%; }
}

.advisor-tab-shell--funding {
    gap: 0;
}

.funding-plan-v2 {
    --funding-ink: var(--f-ink, #26231c);
    --funding-muted: #756e60;
    --funding-line: #d8cfbd;
    --funding-line-strong: #bfb39c;
    --funding-paper: var(--f-paper, #fffdf8);
    --funding-canvas: var(--f-canvas, #f9f4e7);
    --funding-source: #347863;
    --funding-account: #396f94;
    --funding-insurance: #825f8b;
    --funding-obligation: #aa6b32;
    --funding-goal: #b68a2d;
    --funding-structure: #777064;
    position: relative;
    min-width: 0;
    height: max(360px, calc(100dvh - 196px));
    overflow: hidden;
    border: 1px solid var(--funding-line);
    border-radius: 4px;
    background: var(--funding-paper);
    color: var(--funding-ink);
    box-shadow: none;
    font-family: var(--f-font-ui, "Segoe UI", sans-serif);
}

.funding-plan-v2 *,
.funding-plan-empty * {
    box-sizing: border-box;
}

.funding-plan-v2 button,
.funding-plan-v2 input,
.funding-plan-v2 select,
.funding-plan-v2 textarea {
    font: inherit;
}

.funding-plan-v2 button {
    color: inherit;
}

.funding-shared-header {
    position: relative;
    z-index: 12;
    display: flex;
    min-height: 66px;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 0 14px;
    border-bottom: 1px solid var(--funding-line);
    background: rgba(255, 253, 248, 0.98);
}

.funding-product-tabs {
    display: flex;
    min-width: 330px;
    gap: 4px;
    align-items: stretch;
}

.funding-product-tabs button {
    position: relative;
    display: grid;
    min-width: 150px;
    align-content: center;
    gap: 2px;
    padding: 8px 18px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.funding-product-tabs button::after {
    position: absolute;
    right: 16px;
    bottom: -1px;
    left: 16px;
    height: 3px;
    background: transparent;
    content: "";
}

.funding-product-tabs button[aria-selected="true"]::after {
    background: var(--funding-source);
}

.funding-product-tabs span {
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1.08rem;
    font-weight: 600;
}

.funding-product-tabs small,
.funding-plan-context label > span {
    color: var(--funding-muted);
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.funding-plan-context {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.funding-shared-history {
    display: flex;
    gap: 4px;
}

.funding-shared-history button {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: transparent;
    font-size: 0.66rem;
    cursor: pointer;
}

.funding-shared-history button:hover:not(:disabled) {
    border-color: var(--funding-line-strong);
    background: var(--funding-canvas);
}

.funding-shared-history button:disabled {
    opacity: 0.42;
    cursor: default;
}

.funding-plan-picker {
    display: grid;
    gap: 3px;
}

.funding-plan-context select {
    max-width: 250px;
    height: 32px;
    padding: 0 28px 0 9px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
    color: var(--funding-ink);
    font-size: 0.74rem;
}

.funding-plan-settings-button {
    display: grid;
    width: 30px;
    height: 30px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: transparent;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    place-items: center;
}

.funding-plan-settings-button:hover {
    border-color: var(--funding-line-strong);
    background: var(--funding-canvas);
}

.funding-plan-status-pill {
    padding: 3px 9px;
    border: 1px solid var(--funding-line);
    border-radius: 99px;
    background: var(--funding-canvas);
    color: var(--funding-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.funding-plan-status-pill.status-active {
    border-color: #b8cfc5;
    background: #eaf3ee;
    color: var(--funding-source);
}

/* College Planning evidence, collapsed out of the old full-width banner. */
.funding-college-chip {
    position: relative;
}

.funding-college-chip > summary {
    display: flex;
    height: 30px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--funding-line);
    border-radius: 99px;
    background: var(--funding-paper);
    font-size: 0.68rem;
    cursor: pointer;
    list-style: none;
}

.funding-college-chip > summary::-webkit-details-marker {
    display: none;
}

.funding-college-chip > summary:hover {
    border-color: var(--funding-line-strong);
    background: var(--funding-canvas);
}

.funding-college-chip > summary i {
    width: 7px;
    height: 7px;
    border-radius: 99px;
}

.funding-college-chip > summary b {
    color: var(--funding-goal);
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.78rem;
}

.funding-college-chip-body {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    width: 288px;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--funding-line);
    border-radius: 9px;
    background: var(--funding-paper);
    box-shadow: 0 14px 34px rgba(59, 50, 35, 0.16);
}

.funding-college-chip-body p {
    margin: 0;
    color: var(--funding-muted);
    font-size: 0.68rem;
    line-height: 1.45;
}

.funding-college-chip-body > div {
    display: grid;
    gap: 6px;
}

.funding-college-chip-body > div span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.funding-college-chip-body small {
    color: var(--funding-muted);
    font-size: 0.66rem;
}

.funding-college-chip-body b {
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.8rem;
}

.funding-capacity-track {
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: #e5ded0;
}

.funding-capacity-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--funding-source);
    transition: width 180ms ease;
}

.is-over .funding-capacity-track i {
    background: #a54438;
}

.funding-save-state {
    min-width: 84px;
    color: var(--funding-muted);
    font-size: 0.68rem;
    text-align: right;
}

.funding-product-shell {
    display: grid;
    height: calc(100% - 66px);
    min-height: 0;
    grid-template-columns: 232px minmax(0, 1fr);
    transition: grid-template-columns 160ms ease;
}

.funding-plan-v2.toolbox-collapsed .funding-product-shell {
    grid-template-columns: 64px minmax(0, 1fr);
}

.funding-toolbox {
    position: relative;
    z-index: 8;
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid var(--funding-line);
    background: #fbf8f1;
}

.funding-toolbox-toggle {
    display: flex;
    width: 100%;
    height: 42px;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-bottom: 1px solid var(--funding-line);
    background: transparent;
    color: var(--funding-muted);
    cursor: pointer;
}

.funding-toolbox-toggle:hover {
    background: #f3eee3;
}

.funding-toolbox-toggle span {
    font-size: 1.25rem;
    line-height: 1;
}

.funding-toolbox-toggle b {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.funding-plan-v2.toolbox-collapsed .funding-toolbox-toggle {
    height: 100%;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14px;
}

.funding-plan-v2.toolbox-collapsed .funding-toolbox-toggle b {
    position: absolute;
    top: 50px;
    writing-mode: vertical-rl;
}

.funding-plan-v2.toolbox-collapsed .funding-toolbox-content {
    display: none;
}

.funding-toolbox-content {
    height: calc(100% - 42px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.funding-tool-section {
    border-bottom: 1px solid var(--funding-line);
}

.funding-tool-section > summary,
.funding-palette-v2 > header {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    color: var(--funding-ink);
    cursor: pointer;
    list-style: none;
}

.funding-tool-section > summary::-webkit-details-marker,
.funding-palette-v2 details > summary::-webkit-details-marker {
    display: none;
}

.funding-tool-section > summary span,
.funding-palette-v2 > header span {
    font-size: 0.74rem;
    font-weight: 750;
}

.funding-tool-section > summary small,
.funding-palette-v2 > header small {
    color: var(--funding-muted);
    font-size: 0.58rem;
}

.funding-tool-fields label,
.funding-horizon-settings label {
    display: grid;
    gap: 4px;
}

.funding-tool-fields label > span,
.funding-horizon-settings label > span {
    color: var(--funding-muted);
    font-size: 0.62rem;
    font-weight: 650;
}

.funding-tool-fields input,
.funding-tool-fields select,
.funding-horizon-settings input,
.funding-horizon-settings select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
    color: var(--funding-ink);
    font-size: 0.72rem;
}

.funding-editor-row {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.funding-check {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    cursor: pointer;
}

.funding-check input {
    width: 15px !important;
    height: 15px !important;
    accent-color: var(--funding-source);
}

.funding-palette-v2 {
    padding-bottom: 10px;
}

.funding-palette-v2 details {
    border-top: 1px solid rgba(216, 207, 189, 0.65);
}

.funding-palette-v2 details > summary {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    color: var(--funding-muted);
    font-size: 0.64rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.funding-family-dot,
.funding-palette-items button > i {
    display: block;
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.tone-source { background: var(--funding-source); }
.tone-account { background: var(--funding-account); }
.tone-insurance { background: var(--funding-insurance); }
.tone-obligation { background: var(--funding-obligation); }
.tone-goal { background: var(--funding-goal); }
.tone-structure { background: var(--funding-structure); }

.funding-palette-items {
    display: grid;
    gap: 5px;
    padding: 0 9px 9px;
}

.funding-palette-items button {
    display: grid;
    min-width: 0;
    min-height: 34px;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #4f4a41;
    text-align: left;
    cursor: grab;
}

.funding-palette-items button:hover,
.funding-palette-items button:focus-visible {
    border-color: var(--funding-line);
    background: var(--funding-paper);
}

.funding-palette-items button:active {
    cursor: grabbing;
}

.funding-palette-items button span {
    overflow: hidden;
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-palette-items button b {
    color: var(--funding-muted);
    font-size: 0.86rem;
}

.funding-product-main {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.funding-map-product {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: 46px minmax(0, 1fr) 28px;
}

.funding-map-toolbar {
    position: relative;
    z-index: 7;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--funding-line);
    background: rgba(255, 253, 248, 0.97);
}

.funding-toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.funding-map-toolbar > .funding-toolbar-group:nth-of-type(2) {
    margin-left: auto;
}

.funding-map-toolbar button.is-active {
    border-color: var(--funding-line-strong);
    background: #efe8da;
}

.funding-warning-count {
    display: inline-grid;
    min-width: 16px;
    height: 16px;
    margin-left: 5px;
    padding: 0 4px;
    border-radius: 99px;
    background: #a54438;
    color: #fff;
    font-size: 0.56rem;
    line-height: 16px;
    place-items: center;
}

/* Canvas view switches, moved off the palette rail. */
.funding-view-menu {
    position: relative;
}

.funding-view-menu > summary {
    display: grid;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
    color: #4f4a41;
    font-size: 0.65rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    place-items: center;
}

.funding-view-menu > summary::-webkit-details-marker {
    display: none;
}

.funding-view-menu[open] > summary {
    border-color: var(--funding-line-strong);
    background: #efe8da;
}

.funding-view-menu-body {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    width: 210px;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--funding-line);
    border-radius: 8px;
    background: var(--funding-paper);
    box-shadow: 0 14px 34px rgba(59, 50, 35, 0.16);
}

.funding-view-menu-body label {
    display: grid;
    gap: 4px;
    font-size: 0.7rem;
}

.funding-view-menu-body select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
    font-size: 0.7rem;
}

.funding-map-search.is-empty {
    border-color: #c8796e;
}

.funding-map-search.is-empty input {
    color: #a54438;
}

.funding-map-toolbar button {
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
    color: #4f4a41;
    font-size: 0.65rem;
    font-weight: 650;
    cursor: pointer;
}

.funding-map-toolbar button:hover:not(:disabled) {
    border-color: var(--funding-line-strong);
    background: #f4efe5;
}

.funding-map-toolbar button:disabled {
    opacity: 0.4;
    cursor: default;
}

.funding-map-search {
    display: flex;
    min-width: 150px;
    max-width: 260px;
    height: 30px;
    flex: 1;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
}

.funding-map-search span {
    color: var(--funding-muted);
}

.funding-map-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--funding-ink);
    font-size: 0.68rem;
}

.funding-zoom-controls output {
    min-width: 40px;
    color: var(--funding-muted);
    font-size: 0.64rem;
    text-align: center;
}

.funding-map-frame {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) auto;
    background: var(--funding-canvas);
}

.funding-map-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    outline: none;
    contain: layout size;
}

.funding-map-canvas.is-drop-target {
    box-shadow: inset 0 0 0 3px rgba(52, 120, 99, 0.28);
}

.funding-map-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(52, 120, 99, 0.35);
}

.funding-map-canvas .x6-graph-svg {
    overflow: hidden;
}

.funding-map-canvas .x6-node {
    cursor: grab;
}

.funding-map-canvas .x6-node:active {
    cursor: grabbing;
}

.funding-map-canvas .x6-node.funding-target-legal {
    filter: drop-shadow(0 0 5px rgba(52, 120, 99, 0.6));
}

.funding-map-canvas .x6-node.funding-target-illegal {
    opacity: 0.24;
}

.funding-map-canvas .funding-x6-port,
.funding-map-canvas .funding-x6-port + text {
    opacity: 0.14;
    transition: opacity 120ms ease, filter 120ms ease;
}

.funding-map-canvas .x6-node:hover .funding-x6-port,
.funding-map-canvas .x6-node:hover .funding-x6-port + text,
.funding-map-canvas .x6-node.funding-node-selected .funding-x6-port,
.funding-map-canvas .x6-node.funding-node-selected .funding-x6-port + text,
.funding-map-canvas .x6-port-available .funding-x6-port,
.funding-map-canvas .x6-port-available .funding-x6-port + text {
    opacity: 1;
}

.funding-map-canvas .x6-port-available .funding-x6-port {
    filter: drop-shadow(0 0 5px rgba(52, 120, 99, 0.7));
}

.funding-map-canvas .x6-port-unavailable {
    opacity: 0.18;
}

.funding-hide-edge-labels .x6-edge-labels {
    display: none;
}

.funding-simplify-nodes .funding-svg-type,
.funding-simplify-nodes .funding-svg-divider,
.funding-simplify-nodes .funding-svg-metric-label,
.funding-simplify-nodes .funding-svg-metric-value,
.funding-simplify-nodes .funding-svg-state-pill,
.funding-simplify-nodes .funding-svg-state-text {
    display: none;
}

.funding-plan-v2:has([data-funding-display-field="label_density"] option[value="compact"]:checked) .funding-svg-type,
.funding-plan-v2:has([data-funding-display-field="label_density"] option[value="compact"]:checked) .funding-svg-metric-label {
    display: none;
}

.funding-capacity-hud {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 6;
    display: grid;
    width: 286px;
    gap: 8px;
    padding: 10px 0 8px;
    border-top: 2px solid var(--funding-source);
    border-bottom: 1px solid rgba(184, 207, 197, 0.8);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(255, 253, 248, 0.68));
    backdrop-filter: blur(6px);
}

.funding-capacity-hud.is-over {
    border-color: #a54438;
    background: linear-gradient(180deg, rgba(255, 247, 244, 0.9), rgba(255, 247, 244, 0.7));
}

.funding-capacity-hud header,
.funding-capacity-hud footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.funding-capacity-hud header,
.funding-capacity-hud footer,
.funding-capacity-hud > .funding-capacity-track {
    margin-inline: 10px;
}

.funding-capacity-hud header span {
    color: var(--funding-muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.funding-capacity-hud header strong {
    color: var(--funding-source);
    font-size: 0.68rem;
    font-weight: 750;
}

.funding-capacity-hud.is-over header strong {
    color: #a54438;
}

.funding-capacity-hud header > div {
    display: grid;
    gap: 2px;
}

.funding-capacity-percent {
    color: var(--funding-source);
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1rem;
}

.funding-capacity-hud.is-over .funding-capacity-percent {
    color: #a54438;
}

.funding-capacity-hud-amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-block: 1px solid rgba(216, 207, 189, 0.72);
}

.funding-capacity-hud-amounts > span:nth-child(n + 3) {
    border-top: 1px solid rgba(216, 207, 189, 0.72);
}

.funding-capacity-hud-amounts > span:nth-child(odd) + span {
    border-left: 1px solid rgba(216, 207, 189, 0.72);
}

.funding-capacity-hud button.has-warnings {
    color: #a54438;
}

/* The old permanent boundary paragraph under the canvas, folded into the HUD. */
.funding-capacity-note {
    position: relative;
    margin-left: auto;
}

.funding-capacity-note > summary {
    display: grid;
    width: 16px;
    height: 16px;
    border: 1px solid var(--funding-line-strong);
    border-radius: 99px;
    color: var(--funding-muted);
    font-size: 0.56rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    place-items: center;
}

.funding-capacity-note > summary::-webkit-details-marker {
    display: none;
}

.funding-capacity-note p {
    position: absolute;
    z-index: 30;
    right: 0;
    bottom: calc(100% + 7px);
    width: 254px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--funding-line);
    border-radius: 8px;
    background: var(--funding-paper);
    color: var(--funding-muted);
    font-size: 0.64rem;
    line-height: 1.45;
    box-shadow: 0 12px 30px rgba(59, 50, 35, 0.16);
}

.funding-capacity-hud-amounts > span {
    display: grid;
    gap: 2px;
    padding: 7px 9px;
}

.funding-capacity-hud-amounts small,
.funding-capacity-hud footer > span {
    color: var(--funding-muted);
    font-size: 0.52rem;
}

.funding-capacity-hud-amounts b {
    color: var(--funding-ink);
    font-size: 0.68rem;
    font-weight: 700;
}

.funding-capacity-hud button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7e5e27;
    font-size: 0.61rem;
    font-weight: 700;
    cursor: pointer;
}

/* Selection inspector. Clicking a node fills this instead of opening a form
   over the node the advisor just clicked. */
.fundingmap-inspector {
    position: relative;
    z-index: 8;
    display: grid;
    width: 302px;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    border-left: 1px solid var(--funding-line);
    background: var(--funding-paper);
}

.fundingmap-inspector[hidden] {
    display: none;
}

/* In edit mode the rail hosts the form. The base .funding-editor rule is sized
   for the floating popover layer, which the plan-settings dialog still uses. */
.fundingmap-inspector.is-editing > .funding-editor {
    position: static;
    width: 100%;
    min-height: 100%;
    max-height: none;
    align-content: start;
    overflow: visible;
    border: 0;
    border-top: 3px solid var(--funding-editor-tone, var(--funding-source));
    border-radius: 0;
    box-shadow: none;
}

.fundingmap-inspector.is-editing > .funding-editor > footer {
    position: sticky;
    bottom: 0;
}

.fundingmap-inspector-selection {
    margin: 0;
    padding: 6px;
    list-style: none;
}

.fundingmap-inspector-selection button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.fundingmap-inspector-selection button:hover {
    background: var(--funding-canvas);
}

.fundingmap-inspector-selection i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 99px;
}

.fundingmap-inspector-selection span {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fundingmap-inspector-selection small {
    margin-left: auto;
    color: var(--funding-muted);
    font-size: 0.62rem;
    white-space: nowrap;
}

.fundingmap-inspector-more {
    padding: 6px 10px;
    color: var(--funding-muted);
    font-size: 0.66rem;
}

/* The inspector is a column of the frame, not an overlay, so opening it really
   narrows the canvas and no other overlay needs to know its width. An earlier
   attempt insetting them from a :has()-driven custom property did not work:
   Chrome does not re-resolve var() inside calc() on already-rendered elements
   when a :has() state change alters the inherited value. */
.fundingmap-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.fundingmap-inspector > header {
    border-left: 3px solid var(--fundingmap-tone, var(--funding-structure));
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--funding-line);
}


.fundingmap-inspector > header > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.fundingmap-inspector > header small {
    color: var(--funding-muted);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.fundingmap-inspector > header strong {
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.94rem;
    line-height: 1.25;
}

.fundingmap-inspector > header span {
    color: var(--funding-muted);
    font-size: 0.66rem;
}

.fundingmap-inspector > header button {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--funding-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.fundingmap-inspector > header button:hover {
    background: var(--funding-canvas);
}

.fundingmap-inspector-facts {
    display: grid;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--funding-line);
}

.fundingmap-inspector-facts > div {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
}

.fundingmap-inspector-facts > div + div {
    border-left: 1px solid var(--funding-line);
}

.fundingmap-inspector-facts dt {
    color: var(--funding-muted);
    font-size: 0.53rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.fundingmap-inspector-facts dd {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 700;
}

.fundingmap-inspector-placement {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--funding-line);
    color: var(--funding-muted);
    font-size: 0.64rem;
}

.fundingmap-inspector-placement button {
    padding: 3px 8px;
    border: 1px solid var(--funding-line);
    border-radius: 99px;
    background: var(--funding-canvas);
    color: #4f4a41;
    font-size: 0.62rem;
    cursor: pointer;
}

.fundingmap-inspector-placement button:hover {
    border-color: var(--funding-line-strong);
}

.fundingmap-inspector .funding-node-connection-list {
    padding: 10px 12px;
}

.fundingmap-inspector > footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--funding-line);
    background: var(--funding-paper);
}

/* Container highlighted while a card is dragged over it. */
.funding-embed-target rect[data-selector="body"],
.x6-node.funding-embed-target rect {
    stroke-width: 2.4px;
    stroke-dasharray: none;
}

.funding-svg-collapse-hit:hover {
    fill: #e5ddcc;
}

/* Palette filter. */
.funding-palette-search {
    display: flex;
    height: 30px;
    align-items: center;
    gap: 6px;
    margin: 0 9px 8px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
}

.funding-palette-search span {
    color: var(--funding-muted);
}

.funding-palette-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.68rem;
}

.funding-palette-empty {
    margin: 0;
    padding: 0 12px 12px;
    color: var(--funding-muted);
    font-size: 0.68rem;
}

.funding-palette-v2 details > summary b {
    margin-left: auto;
    color: var(--funding-muted);
    font-size: 0.6rem;
}

.funding-plan-v2.funding-density-compact .funding-palette-items button {
    height: 26px;
}

/* Editor fields. */
.funding-editor-primary input {
    font-size: 0.86rem !important;
}

.funding-prefix-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 9px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
}

.funding-prefix-input b {
    color: var(--funding-muted);
    font-size: 0.72rem;
}

.funding-prefix-input input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0;
    background: transparent;
}

.funding-editor-segmented {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 6px;
    flex-wrap: wrap;
}

.funding-editor-segmented legend {
    width: 100%;
    padding: 0 0 5px;
    color: var(--funding-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.funding-editor-segmented label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--funding-line);
    border-radius: 99px;
    font-size: 0.68rem;
    cursor: pointer;
}

.funding-editor-segmented label:has(input:checked) {
    border-color: var(--funding-editor-tone, var(--funding-line-strong));
    background: var(--funding-canvas);
    font-weight: 650;
}

.funding-editor-advanced > summary {
    padding: 6px 0;
    color: var(--funding-muted);
    font-size: 0.66rem;
    font-weight: 650;
    cursor: pointer;
}

.funding-editor-advanced[open] > summary {
    color: var(--funding-ink);
}

.funding-editor-advanced > * + * {
    margin-top: 7px;
}

.funding-editor-link {
    display: grid;
    gap: 5px;
}

.funding-editor-link-label,
.funding-editor-link > span {
    color: var(--funding-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.funding-account-picker {
    display: grid;
    gap: 6px;
}

.funding-account-current {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-canvas);
}

.funding-account-current b {
    overflow: hidden;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-account-current small {
    margin-left: auto;
    color: var(--funding-muted);
    font-size: 0.66rem;
    white-space: nowrap;
}

.funding-account-current button {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--funding-muted);
    cursor: pointer;
}

.funding-account-current button:hover {
    background: #eee7d9;
}

.funding-account-search {
    display: flex;
    height: 30px;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    background: var(--funding-paper);
}

.funding-account-search span {
    color: var(--funding-muted);
}

.funding-account-search input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0;
    background: transparent;
    font-size: 0.7rem;
}

.funding-account-options {
    max-height: 168px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    list-style: none;
}

.funding-account-options button {
    display: grid;
    width: 100%;
    align-items: baseline;
    gap: 2px 8px;
    padding: 7px 9px;
    border: 0;
    background: transparent;
    grid-template-columns: minmax(0, 1fr) auto;
    text-align: left;
    cursor: pointer;
}

.funding-account-options li + li button {
    border-top: 1px solid var(--funding-line);
}

.funding-account-options button:hover {
    background: var(--funding-canvas);
}

.funding-account-options button.is-selected {
    background: #eaf3ee;
}

.funding-account-options span {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-account-options small {
    grid-column: 1;
    color: var(--funding-muted);
    font-size: 0.62rem;
}

.funding-account-options b {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    font-size: 0.72rem;
    white-space: nowrap;
}

.funding-account-empty {
    padding: 9px;
    color: var(--funding-muted);
    font-size: 0.68rem;
}

.funding-editor-link small {
    color: var(--funding-muted);
    font-size: 0.63rem;
    line-height: 1.4;
}

.funding-plan-settings {
    width: 320px;
}

.funding-minimap {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 5;
    width: 182px;
    height: 114px;
    overflow: hidden;
    border: 1px solid var(--funding-line-strong);
    border-radius: 7px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 5px 15px rgba(53, 46, 35, 0.1);
}

.funding-minimap[hidden] {
    display: none;
}

/* Starter actions stay outside the canvas so they never cover a source. */
.funding-map-starter { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:10px 12px; border-bottom:1px solid var(--funding-line); background:var(--funding-paper); color:var(--funding-muted); font-size:12px; }
.funding-map-starter[hidden] { display:none; }
.funding-map-starter > strong { margin-right:4px; }

.funding-horizon-boundary {
    margin: 0;
    padding: 6px 12px;
    overflow: hidden;
    border-top: 1px solid var(--funding-line);
    background: var(--funding-paper);
    color: var(--funding-muted);
    font-size: 0.58rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The drawer owns the bottom edge while it is open. Lifting the minimap over it
   needs arithmetic against a percentage height that does not reliably win the
   cascade here, and the two are never both useful at once: the drawer is a
   focused list, the minimap is spatial orientation. */
.fundingmap-stage.has-drawer .funding-minimap {
    display: none;
}

.funding-bottom-drawer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    height: min(240px, 42%);
    overflow: auto;
    border-top: 1px solid var(--funding-line-strong);
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 -10px 28px rgba(53, 46, 35, 0.13);
}

.funding-bottom-drawer > header {
    display: flex;
    height: 38px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--funding-line);
}

.funding-bottom-drawer > header strong {
    font-size: 0.74rem;
}

.funding-bottom-drawer > header button {
    border: 0;
    background: transparent;
    color: var(--funding-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.funding-bottom-drawer > div {
    display: grid;
    max-height: calc(42vh - 38px);
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 7px;
    overflow: auto;
    padding: 10px 12px;
}

.funding-bottom-drawer > div > p {
    margin: 0;
    color: var(--funding-muted);
    font-size: 0.68rem;
}

.funding-drawer-row {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--funding-line);
    border-radius: 6px;
    background: var(--funding-paper);
    text-align: left;
    cursor: pointer;
}

.funding-drawer-row:hover {
    border-color: var(--funding-line-strong);
}

.funding-drawer-row span {
    overflow: hidden;
    font-size: 0.65rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-drawer-row strong {
    color: var(--funding-source);
    font-size: 0.72rem;
}

.funding-drawer-row small {
    color: var(--funding-muted);
    font-size: 0.55rem;
}

.funding-drawer-row.is-warning {
    border-left: 3px solid #b88a37;
}

.funding-popover-layer {
    position: absolute;
    inset: 0;
    z-index: 40;
    overflow: hidden;
    pointer-events: none;
}

.funding-popover-layer[hidden] {
    display: none;
}

.funding-editor {
    position: absolute;
    display: grid;
    width: min(410px, calc(100% - 24px));
    max-height: min(680px, calc(100% - 24px));
    overflow: auto;
    border: 1px solid var(--funding-line-strong);
    border-top: 3px solid var(--funding-editor-tone, var(--funding-source));
    border-radius: 9px;
    background: var(--funding-paper);
    box-shadow: 0 18px 46px rgba(43, 37, 28, 0.24);
    pointer-events: auto;
}

.funding-editor > header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--funding-line);
    background: var(--funding-paper);
}

.funding-editor > header > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.funding-editor > header small {
    color: var(--funding-muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.funding-editor > header strong {
    overflow: hidden;
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-editor > header button {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid var(--funding-line);
    border-radius: 50%;
    background: transparent;
    color: var(--funding-muted);
    font-size: 1rem;
    cursor: pointer;
}

.funding-editor-fields {
    display: grid;
    gap: 11px;
    padding: 13px;
}

.funding-editor-fields label {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.funding-editor-fields label > span {
    color: var(--funding-muted);
    font-size: 0.61rem;
    font-weight: 700;
}

.funding-editor-fields input,
.funding-editor-fields select,
.funding-editor-fields textarea {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--funding-line);
    border-radius: 5px;
    outline: 0;
    background: #fffefa;
    color: var(--funding-ink);
    font-size: 0.72rem;
}

.funding-editor [hidden] {
    display: none !important;
}

.funding-editor-fields textarea {
    min-height: 72px;
    resize: vertical;
}

.funding-editor-fields input:focus,
.funding-editor-fields select:focus,
.funding-editor-fields textarea:focus {
    border-color: var(--funding-source);
    box-shadow: 0 0 0 2px rgba(52, 120, 99, 0.13);
}

.funding-editor-fields > p {
    margin: 0;
    color: var(--funding-muted);
    font-size: 0.64rem;
    line-height: 1.5;
}

.funding-system-node-summary {
    display: grid;
    gap: 3px;
    padding: 11px;
    border: 1px solid color-mix(in srgb, var(--funding-source) 38%, var(--funding-line));
    border-radius: 7px;
    background: color-mix(in srgb, var(--funding-source) 7%, var(--funding-paper));
}

.funding-system-node-summary span,
.funding-system-node-summary small {
    color: var(--funding-muted);
    font-size: 0.62rem;
}

.funding-system-node-summary strong {
    color: var(--funding-source);
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1.2rem;
}

.funding-node-connection-list {
    display: grid;
    gap: 8px;
    padding-top: 3px;
    border-top: 1px solid var(--funding-line);
}

.funding-node-connection-list > h3 {
    margin: 6px 0 0;
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.92rem;
}

.funding-node-connections {
    display: grid;
    gap: 6px;
}

.funding-node-connections > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--funding-muted);
    font-size: 0.62rem;
}

.funding-node-connections > header span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--funding-line);
    text-align: center;
}

.funding-node-connections > p {
    margin: 0;
    color: var(--funding-muted);
    font-size: 0.62rem;
}

.funding-connection-row {
    display: grid;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--funding-line);
    border-radius: 6px;
    background: #fffefa;
}

.funding-connection-row > div:first-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.funding-connection-row > div:first-child strong,
.funding-connection-row > div:first-child span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-connection-row > div:first-child strong {
    font-size: 0.68rem;
}

.funding-connection-row > div:first-child span {
    color: var(--funding-muted);
    font-size: 0.59rem;
}

.funding-connection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.funding-connection-actions button {
    min-height: 26px;
    padding: 3px 7px;
    border: 1px solid var(--funding-line);
    border-radius: 4px;
    background: var(--funding-paper);
    color: var(--funding-account);
    font-size: 0.58rem;
    font-weight: 700;
    cursor: pointer;
}

.funding-connection-actions button.danger {
    margin: 0;
    color: #a54438;
}

.funding-map-canvas .x6-widget-transform-resize[data-position="top"],
.funding-map-canvas .x6-widget-transform-resize[data-position="left"],
.funding-map-canvas .x6-widget-transform-resize[data-position="top-left"],
.funding-map-canvas .x6-widget-transform-resize[data-position="top-right"],
.funding-map-canvas .x6-widget-transform-resize[data-position="bottom-left"] {
    display: none;
}

.funding-map-canvas .x6-widget-transform {
    border-color: var(--funding-source);
}

.funding-map-canvas .x6-widget-transform-resize {
    border-color: var(--funding-source);
    background: var(--funding-paper);
}

.funding-connection-direction {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 9px;
    border: 1px solid var(--funding-line);
    border-radius: 6px;
    background: #faf7f0;
}

.funding-connection-direction span {
    overflow: hidden;
    font-size: 0.65rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-connection-direction b {
    color: var(--funding-source);
}

.funding-connection-direction button {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--funding-account);
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
}

.funding-editor > footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-top: 1px solid var(--funding-line);
    background: var(--funding-paper);
}

.funding-editor > footer > span:first-child {
    margin-right: auto;
}

.funding-editor .button {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.64rem;
}

.funding-editor .danger {
    margin-right: auto;
    color: #a54438;
}

.funding-editor-error {
    margin: 0 13px 10px;
    padding: 8px 9px;
    border-left: 3px solid #b4473b;
    background: #fff3f0;
    color: #8d382f;
    font-size: 0.64rem;
}

.funding-horizon-product {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) 28px;
    background: var(--funding-canvas);
}

.funding-horizon-header {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--funding-line);
    background: var(--funding-paper);
}

.funding-horizon-header p,
.funding-horizon-header h2 {
    margin: 0;
}

.funding-horizon-header h2 {
    margin-top: 2px;
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    font-weight: 500;
}

.funding-horizon-state {
    display: grid;
    max-width: 330px;
    gap: 2px;
    padding: 8px 11px;
    border-left: 3px solid #b88a37;
    background: #fff8e9;
}

.funding-horizon-state.is-ready {
    border-left-color: var(--funding-source);
    background: #eff7f3;
}

.funding-horizon-state strong {
    font-size: 0.7rem;
}

.funding-horizon-state span {
    color: var(--funding-muted);
    font-size: 0.6rem;
    line-height: 1.4;
}

.funding-horizon-bands {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(270px, 1fr));
    gap: 10px;
    overflow: auto;
    padding: 12px;
    overscroll-behavior: contain;
}

.funding-horizon-band {
    display: grid;
    min-width: 270px;
    min-height: 0;
    align-content: start;
    grid-template-rows: auto auto auto minmax(130px, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--funding-line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.88);
}

.funding-horizon-band > header {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--funding-line);
}

.funding-horizon-band > header > div {
    display: grid;
    gap: 2px;
}

.funding-horizon-band > header span {
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.92rem;
    font-weight: 600;
}

.funding-horizon-band > header small {
    color: var(--funding-muted);
    font-size: 0.55rem;
}

.funding-horizon-band > header strong {
    color: var(--funding-source);
    font-size: 0.68rem;
}

.funding-horizon-subtotals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--funding-line);
}

.funding-horizon-subtotals span {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 7px 6px;
    border-right: 1px solid rgba(216, 207, 189, 0.7);
}

.funding-horizon-subtotals span:last-child {
    border-right: 0;
}

.funding-horizon-subtotals small {
    overflow: hidden;
    color: var(--funding-muted);
    font-size: 0.49rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-horizon-subtotals b {
    overflow: hidden;
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-horizon-target {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--funding-line);
    background: #f0f7f3;
    color: var(--funding-muted);
    font-size: 0.55rem;
}

.funding-horizon-target.has-shortfall {
    background: #fff6e7;
}

.funding-horizon-target b {
    color: var(--funding-ink);
}

.funding-horizon-card-list {
    display: grid;
    min-height: 150px;
    align-content: start;
    gap: 7px;
    overflow: auto;
    padding: 8px;
    transition: background 120ms ease;
}

.funding-horizon-card-list.is-drop-target {
    background: rgba(52, 120, 99, 0.1);
}

.funding-horizon-drop-hint {
    display: none;
    padding: 13px;
    border: 1px dashed #8db5a6;
    border-radius: 6px;
    color: var(--funding-source);
    font-size: 0.6rem;
    text-align: center;
}

.funding-horizon-card-list.is-drop-target .funding-horizon-drop-hint {
    display: block;
}

.funding-horizon-card {
    display: grid;
    gap: 7px;
    padding: 9px;
    border: 1px solid var(--funding-line);
    border-left: 3px solid var(--funding-account);
    border-radius: 6px;
    background: var(--funding-paper);
    box-shadow: 0 2px 7px rgba(53, 46, 35, 0.05);
    cursor: grab;
}

.funding-horizon-card:active {
    cursor: grabbing;
}

.funding-horizon-card:focus-visible {
    outline: 2px solid rgba(52, 120, 99, 0.4);
    outline-offset: 2px;
}

.funding-horizon-card > header,
.funding-horizon-card > div,
.funding-horizon-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.funding-horizon-card > header span {
    overflow: hidden;
    font-size: 0.65rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-horizon-card > header b {
    padding: 2px 5px;
    border-radius: 999px;
    background: #f2ede2;
    color: var(--funding-muted);
    font-size: 0.45rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.funding-horizon-card > header b.state-existing {
    background: #e7f1ec;
    color: #2e6e59;
}

.funding-horizon-card > div span {
    display: grid;
    gap: 1px;
}

.funding-horizon-card > div small {
    color: var(--funding-muted);
    font-size: 0.48rem;
}

.funding-horizon-card > div b {
    font-size: 0.61rem;
}

.funding-horizon-card > footer {
    padding-top: 5px;
    border-top: 1px solid rgba(216, 207, 189, 0.7);
    color: var(--funding-muted);
    font-size: 0.5rem;
}

.funding-horizon-card > footer strong {
    color: var(--funding-source);
    font-size: 0.55rem;
}

.funding-horizon-suggestion {
    margin: 8px;
    padding: 8px 9px;
    border: 1px solid #c8ad72;
    border-radius: 5px;
    background: #fff8e8;
    color: #74591e;
    font-size: 0.58rem;
    font-weight: 700;
    cursor: pointer;
}

.funding-horizon-settings {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.funding-horizon-settings > header {
    display: grid;
    gap: 3px;
}

.funding-horizon-settings > header p,
.funding-horizon-settings > header strong,
.funding-horizon-settings > header span {
    margin: 0;
}

.funding-horizon-settings > header strong {
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1rem;
}

.funding-horizon-settings > header span {
    color: var(--funding-muted);
    font-size: 0.62rem;
    line-height: 1.45;
}

.funding-horizon-settings form {
    display: grid;
    gap: 11px;
}

.funding-horizon-settings fieldset {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 9px;
    border: 1px solid var(--funding-line);
    border-radius: 6px;
}

.funding-horizon-settings legend {
    padding: 0 4px;
    color: var(--funding-muted);
    font-size: 0.62rem;
    font-weight: 750;
}

.funding-suffix-input {
    position: relative;
}

.funding-suffix-input input {
    padding-right: 26px;
}

.funding-suffix-input b {
    position: absolute;
    top: 50%;
    right: 9px;
    color: var(--funding-muted);
    font-size: 0.62rem;
    transform: translateY(-50%);
}

.funding-horizon-settings .button {
    min-height: 34px;
    font-size: 0.65rem;
}

.funding-plan-empty {
    display: flex;
    min-height: 460px;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: clamp(28px, 6vw, 72px);
    border: 1px solid var(--funding-line);
    border-radius: 10px;
    background: var(--funding-paper);
}

.funding-plan-empty > div {
    max-width: 680px;
}

.funding-plan-empty h2 {
    margin: 5px 0 9px;
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 450;
}

.funding-plan-empty p:last-child {
    margin: 0;
    color: var(--funding-muted);
    line-height: 1.6;
}

.funding-loading,
.funding-error {
    min-height: 420px;
}

@media (max-width: 1180px) {
    .funding-product-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .funding-capacity-hud {
        width: 226px;
    }

    .funding-horizon-bands {
        grid-template-columns: repeat(4, minmax(250px, 1fr));
    }
}

@media (max-width: 900px) {
    .funding-plan-v2 {
        height: max(700px, calc(100vh - 176px));
    }

    .funding-shared-header {
        gap: 8px;
    }

    .funding-product-tabs {
        min-width: 260px;
    }

    .funding-product-tabs button {
        min-width: 126px;
        padding-inline: 11px;
    }

    .funding-product-tabs small,
    .funding-plan-status-pill {
        display: none;
    }

    .funding-plan-context select {
        max-width: 175px;
    }

    .funding-editor-row {
        grid-template-columns: 1fr;
    }

    .funding-minimap {
        width: 150px;
        height: 94px;
    }

    .funding-horizon-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }
}

@media (max-width: 720px) {
    .advisor-tab-shell--funding {
        margin-inline: -6px;
    }

    .funding-plan-v2 {
        height: max(680px, calc(100vh - 150px));
        border-radius: 6px;
    }

    .funding-shared-header {
        min-height: 58px;
        padding-inline: 6px;
    }

    .funding-product-tabs {
        min-width: 0;
    }

    .funding-product-tabs button {
        min-width: 104px;
        padding-inline: 8px;
    }

    .funding-product-tabs span {
        font-size: 0.94rem;
    }

    .funding-plan-context label > span,
    .funding-save-state {
        display: none;
    }

    .funding-plan-context select {
        max-width: 118px;
    }

    .funding-product-shell,
    .funding-plan-v2.toolbox-collapsed .funding-product-shell {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .funding-toolbox-content {
        display: none;
    }

    .funding-toolbox-toggle {
        height: 100%;
        align-items: flex-start;
        justify-content: center;
        padding-top: 12px;
    }

    .funding-toolbox-toggle b {
        position: absolute;
        top: 46px;
        writing-mode: vertical-rl;
    }

    .funding-map-toolbar {
        gap: 5px;
        overflow-x: auto;
    }

    .funding-map-toolbar button {
        flex: 0 0 auto;
    }

    .funding-map-search {
        display: none;
    }

    .funding-zoom-controls {
        margin-left: auto;
    }

    .funding-capacity-hud {
        top: 9px;
        right: 9px;
        width: 190px;
        gap: 6px;
        padding-block: 8px 6px;
    }

    .funding-capacity-hud footer > span,
    .funding-minimap {
        display: none;
    }

    .funding-capacity-hud-amounts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .funding-capacity-hud-amounts > span:first-child {
        display: none;
    }

    .funding-horizon-boundary {
        white-space: normal;
    }

    .funding-horizon-bands {
        grid-template-columns: repeat(4, minmax(232px, 1fr));
        padding: 8px;
    }

    .funding-editor {
        width: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }

    .funding-plan-empty {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }
}

/* Funding workspace controls: map first, details on demand. Explicit control
   sizing prevents the advisor shell's generic label/input rules from stretching
   radios, search fields and connection actions inside the inspector. */
.funding-plan-v2 { font-size: 14px; min-height: 520px; }
.funding-plan-v2.is-fullscreen {
    position: fixed; inset: 0; z-index: 10000; width: 100%; height: 100dvh;
    min-height: 0; margin: 0; border: 0; border-radius: 0;
}
.funding-plan-v2 .funding-shared-header { min-height: 60px; padding: 0 16px; gap: 16px; flex-wrap: wrap; }
.funding-plan-v2 .funding-product-tabs { min-width: 0; gap: 20px; }
.funding-plan-v2 .funding-product-tabs button { min-width: 0; padding: 16px 0; }
.funding-plan-v2 .funding-product-tabs span { font-size: 16px; white-space: nowrap; }
.funding-plan-v2 .funding-plan-context { flex: 1; min-width: 0; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.funding-plan-v2 .funding-plan-picker { min-width: 120px; flex: 1; max-width: 320px; }
.funding-plan-v2 .funding-plan-picker > span { display: none; }
.funding-plan-v2 .funding-plan-picker select { width: 100%; max-width: none; min-height: 36px; font-size: 13px; }
.funding-plan-v2 .funding-plan-status-pill { font-size: 10px; }
.funding-plan-v2 .funding-save-state { display: block; width: auto; max-width: 170px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
.funding-plan-v2 .funding-view-switch button { font-size: 13px; white-space: nowrap; }
.funding-plan-v2 .funding-product-shell,
.funding-plan-v2.toolbox-collapsed .funding-product-shell { grid-template-columns: minmax(0,1fr); position: relative; }
.funding-plan-v2 .funding-toolbox {
    position: absolute; inset: 0 auto 0 0; width: 260px; max-width: 85%; z-index: 11;
    box-shadow: 8px 0 24px rgb(38 35 28 / 8%); border-right: 1px solid var(--funding-line);
}
.funding-plan-v2.toolbox-collapsed .funding-toolbox { display: none; }
.funding-plan-v2 .funding-toolbox-toggle { height: 42px; padding: 10px 14px; align-items: center; justify-content: flex-end; }
.funding-plan-v2 .funding-toolbox-toggle b { position: static; writing-mode: horizontal-tb; }
.funding-plan-v2 .funding-toolbox-content { display: block; overflow: auto; height: calc(100% - 42px); }
.funding-plan-v2 .funding-map-toolbar { gap: 8px; padding: 8px 12px; flex-wrap: wrap; overflow: visible; min-height: 52px; }
.funding-plan-v2 .funding-map-toolbar button,
.funding-plan-v2 .funding-view-menu > summary,
.funding-plan-v2 .funding-save-button { min-height: 34px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.funding-plan-v2 .funding-add-button { background: var(--funding-source); color: var(--funding-paper); border-color: var(--funding-source); }
.funding-plan-v2 .funding-map-search { display: flex; min-width: 130px; max-width: 300px; flex: 1; margin-right: auto; }
.funding-plan-v2 .funding-map-search input { font-size: 13px; }
.funding-plan-v2 .funding-view-menu { flex: 0 0 auto; }
.funding-plan-v2 .funding-view-menu-body { width: 250px; max-width: calc(100vw - 32px); padding: 12px; gap: 10px; z-index: 40; }
.funding-plan-v2 .funding-view-menu-body > button { display: block; width: 100%; text-align: left; }
.funding-plan-v2 .funding-view-menu-body p { font-size: 12px; line-height: 1.5; margin: 0; color: var(--funding-muted); }
.funding-plan-v2 .funding-funding-strip { grid-template-columns: minmax(130px,1fr) 1fr 1fr auto; gap: 12px; padding: 10px 16px; }
.funding-plan-v2 .funding-funding-strip header > strong { font-size: 13px; }
.funding-plan-v2 .funding-funding-strip header > span { font-size: 9px; }
.funding-plan-v2 .funding-funding-strip footer { gap: 0; }
.funding-plan-v2 .funding-funding-strip footer button { margin: 0; padding: 3px 0; font-size: 11px; }
.funding-plan-v2 .funding-ledger-lane { gap: 4px 8px; }
.funding-plan-v2 .funding-ledger-lane strong { font-size: 14px; }
.funding-plan-v2 .funding-map-frame { position: relative; min-width: 0; }
.funding-plan-v2 .fundingmap-inspector { width: 360px; max-width: 100%; min-width: 0; overflow: auto; overscroll-behavior: contain; }
.funding-plan-v2 .fundingmap-inspector > header { padding: 18px; }
.funding-plan-v2 .fundingmap-inspector > header strong { font-size: 21px; overflow-wrap: anywhere; }
.funding-plan-v2 .fundingmap-inspector > footer { flex-wrap: wrap; align-items: center; padding: 12px 16px; }
.funding-plan-v2 .fundingmap-inspector-facts { grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); margin: 0; }
.funding-plan-v2 .fundingmap-inspector-facts dd { font-size: 16px; overflow-wrap: anywhere; }
.funding-plan-v2 .fundingmap-inspector .funding-node-connection-list { padding: 18px; }
.funding-plan-v2 .funding-node-connection-list > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.funding-plan-v2 .funding-node-connection-list h3,
.funding-plan-v2 .funding-container-items h3 { font: 600 16px var(--f-font-ui, sans-serif); margin: 0; }
.funding-plan-v2 .funding-node-connections { gap: 8px; padding: 10px 0 0; }
.funding-plan-v2 .funding-node-connections > header,
.funding-plan-v2 .funding-node-connections > p { font-size: 12px; }
.funding-plan-v2 .funding-connection-row { padding: 10px 0; border: 0; border-bottom: 1px solid var(--funding-line); border-radius: 0; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 10px; }
.funding-plan-v2 .funding-connection-row > div:first-child strong { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.funding-plan-v2 .funding-connection-row > div:first-child span { font-size: 11px; white-space: normal; line-height: 1.5; }
.funding-plan-v2 .funding-connection-actions { flex-direction: column; gap: 6px; }
.funding-plan-v2 .funding-connection-actions button,
.funding-plan-v2 .funding-connection-actions summary { font: inherit; font-size: 12px; min-height: 28px; cursor: pointer; }
.funding-plan-v2 .funding-connection-actions details > div { display: grid; gap: 5px; margin-top: 6px; }
.funding-plan-v2 .funding-node-connection-list > header > button,
.funding-plan-v2 .funding-container-items button { border: 0; background: transparent; padding: 4px 0; font-size: 12px; color: var(--funding-source); text-align: left; }
.funding-plan-v2 .funding-container-items { padding: 18px; border-top: 1px solid var(--funding-line); }
.funding-plan-v2 .funding-container-items p { font-size: 12px; line-height: 1.5; color: var(--funding-muted); }
.funding-plan-v2 .funding-container-items > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--funding-line); }
.funding-plan-v2 .funding-inspector-actions { margin-right: auto; font-size: 12px; }
.funding-plan-v2 .funding-inspector-actions button { display: block; padding: 8px 0; border: 0; background: transparent; font-size: 12px; }
.funding-plan-v2 .funding-editor { font-size: 13px; width: min(420px,calc(100% - 24px)); }
.funding-plan-v2 .funding-editor > header { padding: 18px; gap: 12px; }
.funding-plan-v2 .funding-editor > header strong { font-size: 21px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.funding-plan-v2 .funding-editor > header small { font-size: 10px; }
.funding-plan-v2 .funding-editor-fields { gap: 18px; padding: 18px; }
.funding-plan-v2 .funding-editor label { min-width: 0; }
.funding-plan-v2 .funding-editor-fields label > span { font-size: 12px; font-weight: 600; }
.funding-plan-v2 .funding-editor input:not([type='checkbox']):not([type='radio']),
.funding-plan-v2 .funding-editor select,
.funding-plan-v2 .funding-editor textarea { width: 100%; min-width: 0; min-height: 40px; padding: 9px 10px; border: 1px solid var(--funding-line); border-radius: 5px; font: 400 14px var(--f-font-ui,sans-serif); background: var(--funding-paper); color: var(--funding-ink); }
.funding-plan-v2 .funding-editor input[type='checkbox'],
.funding-plan-v2 .funding-editor input[type='radio'] { width: 16px; height: 16px; min-height: 16px; min-width: 16px; flex: 0 0 16px; margin: 2px 0; padding: 0; accent-color: var(--funding-source); }
.funding-plan-v2 .funding-editor .funding-check { display: flex; align-items: flex-start; gap: 10px; }
.funding-plan-v2 .funding-editor .funding-check > span { font-size: 12px; font-weight: 400; line-height: 1.5; }
.funding-plan-v2 .funding-editor .funding-editor-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.funding-plan-v2 .funding-editor summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--funding-ink); padding: 8px 0; }
.funding-plan-v2 .funding-editor details > label,
.funding-plan-v2 .funding-editor details > .funding-editor-row { margin-top: 12px; }
.funding-plan-v2 .funding-editor details > summary small { display: block; padding-left: 16px; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--funding-muted); }
.funding-plan-v2 .funding-source-fields,
.funding-plan-v2 .funding-current-fields { margin: 0; padding: 8px 0; }
.funding-plan-v2 .funding-editor-help,
.funding-plan-v2 .funding-editor p { font-size: 12px; line-height: 1.5; color: var(--funding-muted); }
.funding-plan-v2 .funding-editor > footer { padding: 12px 18px; gap: 8px; }
.funding-plan-v2 .funding-editor .button,
.funding-plan-v2 .fundingmap-inspector > footer .button { min-height: 36px; padding: 8px 12px; font-size: 12px; line-height: 1.3; text-transform: none; letter-spacing: 0; }
.funding-plan-v2 .funding-connection-direction { grid-template-columns: minmax(0,1fr) 16px minmax(0,1fr); padding: 12px; }
.funding-plan-v2 .funding-connection-direction span { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.funding-plan-v2 .funding-account-search { display: flex; align-items: center; gap: 8px; height: auto; margin: 10px 0; }
.funding-plan-v2 .funding-account-search > span { flex: 0 0 auto; }
.funding-plan-v2 .funding-editor .funding-account-search input { border: 0; }
.funding-plan-v2 .funding-account-options { max-height: 220px; }
.funding-plan-v2 .funding-account-options button { min-height: 60px; padding: 10px; gap: 5px 12px; font-size: 12px; }
.funding-plan-v2 .funding-account-options button span { white-space: normal; overflow-wrap: anywhere; }
.funding-plan-v2 .funding-account-options button small { font-size: 10px; }
.funding-plan-v2 .funding-account-options button b { font-size: 12px; }
.funding-plan-v2 .funding-minimap { width: 144px; height: 96px; opacity: .85; }
/* Amount labels must not intercept a container port underneath them. The
   connection remains selectable through its line and the connection list. */
.funding-plan-v2 .x6-edge-labels { pointer-events: none; }
.funding-plan-v2 .funding-pointer-near-port .x6-edge,
.funding-plan-v2 .funding-pointer-near-port .x6-edge * { pointer-events: none; }
@media (max-width:1120px) {
    .funding-plan-v2 .funding-shared-header { gap: 0 20px; }
    .funding-plan-v2 .funding-plan-context { flex-basis: 70%; }
    .funding-plan-v2 .funding-save-state { max-width: 95px; }
    .funding-plan-v2 .funding-funding-strip { grid-template-columns: 1fr 1fr auto; }
    .funding-plan-v2 .funding-funding-strip > header { display: none; }
    .funding-plan-v2 .fundingmap-inspector:not([hidden]) { position: absolute; inset: 0 0 0 auto; z-index: 10; box-shadow: -12px 0 30px rgb(38 35 28 / 8%); }
}
@media (max-width:760px) {
    .funding-plan-v2 { height: max(620px,calc(100dvh - 120px)); }
    .funding-plan-v2.is-fullscreen { height: 100dvh; min-height: 0; }
    .funding-plan-v2 .funding-shared-header { padding: 0 10px; flex-direction: row; }
    .funding-plan-v2 .funding-product-tabs { width: auto; gap: 18px; }
    .funding-plan-v2 .funding-product-tabs button { padding: 10px 0; }
    .funding-plan-v2 .funding-plan-context { flex-basis: 100%; padding: 6px 0 10px; gap: 8px; }
    .funding-plan-v2 .funding-view-switch { order: 2; }
    .funding-plan-v2 .funding-plan-picker { max-width: none; }
    .funding-plan-v2 .funding-plan-status-pill { display: none; }
    .funding-plan-v2 .funding-save-state { max-width: 130px; margin-left: auto; order: 3; }
    .funding-plan-v2 .funding-map-toolbar { padding: 6px 8px; gap: 6px; }
    .funding-plan-v2 .funding-map-toolbar .funding-map-search { flex-basis: 180px; max-width: none; }
    .funding-plan-v2 .funding-funding-strip { grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px; }
    .funding-plan-v2 .funding-funding-strip .funding-ledger-lane { padding: 0; border: 0; display: block; }
    .funding-plan-v2 .funding-funding-strip .funding-ledger-lane > * { display: block; }
    .funding-plan-v2 .funding-funding-strip footer { grid-column: 1/-1; display: flex; gap: 16px; }
    .funding-plan-v2 .funding-view-menu-body { right: 0; }
    .funding-plan-v2 .fundingmap-inspector:not([hidden]) { width: min(380px,100%); }
    /* On phones, the selected item gets the workspace height. Close returns
       to the map toolbar and summary; the plan selector keeps orientation. */
    .funding-plan-v2 .funding-map-product:has(.fundingmap-inspector:not([hidden])) { grid-template-rows: minmax(0,1fr); }
    .funding-plan-v2 .funding-map-product:has(.fundingmap-inspector:not([hidden])) > .funding-map-toolbar,
    .funding-plan-v2 .funding-map-product:has(.fundingmap-inspector:not([hidden])) > .funding-map-summary,
    .funding-plan-v2:has(.fundingmap-inspector:not([hidden])) .funding-product-tabs,
    .funding-plan-v2:has(.fundingmap-inspector:not([hidden])) .funding-view-switch,
    .funding-plan-v2:has(.fundingmap-inspector:not([hidden])) .funding-save-state,
    .funding-plan-v2:has(.fundingmap-inspector:not([hidden])) .funding-save-button { display: none; }
}
@media (max-height:650px) {
    .funding-plan-v2.is-fullscreen .funding-funding-strip small { display: none; }
    .funding-plan-v2.is-fullscreen .funding-funding-strip { padding-block: 6px; }
    .funding-plan-v2.is-fullscreen .funding-editor-fields { gap: 12px; }
}

/* RE2 · From Real Estate. The strip is the Folio suggestion strip; these rules
   only place it above the workspace and fit the palette list into the rail. */
.funding-re-suggest { padding: 0 18px; }
.funding-re-suggest__note { margin: 10px 0 0; color: var(--f-dim, #6b6f66); font-size: 12px; }
.funding-re-palette ul { display: grid; gap: 6px; margin: 6px 0 4px; padding: 0; list-style: none; }
.funding-re-palette li { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--f-line, #e2ddd0); border-radius: 8px; background: var(--f-paper, #fffdf8); }
.funding-re-palette li > div { display: grid; gap: 1px; min-width: 0; }
.funding-re-palette li span { color: var(--f-bronze, #8a6a3d); font: 500 9.5px/1.4 var(--f-font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; }
.funding-re-palette li b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funding-re-palette li small { color: var(--f-dim, #6b6f66); font-size: 11.5px; }
.funding-re-palette li .folio-button { justify-self: start; }
