/* Funding Plan: Funding Map + Horizon */

.advisor-tab-shell--funding {
    gap: 0;
}

.funding-plan-v2 {
    --funding-ink: #26231c;
    --funding-muted: #756e60;
    --funding-line: #d8cfbd;
    --funding-line-strong: #bfb39c;
    --funding-paper: #fffdf8;
    --funding-canvas: #f8f4eb;
    --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(760px, calc(100vh - 196px));
    overflow: hidden;
    border: 1px solid var(--funding-line);
    border-radius: 10px;
    background: var(--funding-paper);
    color: var(--funding-ink);
    box-shadow: 0 8px 26px rgba(59, 50, 35, 0.07);
}

.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,
.funding-capacity-summary small {
    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: 12px;
}

.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-context label {
    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-capacity-summary {
    display: grid;
    min-width: 210px;
    gap: 4px;
    padding: 4px 0 4px 13px;
    border-left: 1px solid #b8cfc5;
}

.funding-capacity-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.funding-capacity-summary strong {
    color: var(--funding-source);
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 0.88rem;
    white-space: nowrap;
}

.funding-capacity-summary strong span {
    color: var(--funding-muted);
    font-family: var(--advisor-font-sans, sans-serif);
    font-size: 0.56rem;
    font-weight: 600;
}

.funding-capacity-summary > small:last-child {
    letter-spacing: 0;
    text-transform: none;
}

.funding-capacity-summary.is-over {
    border-left-color: #c8796e;
}

.funding-capacity-summary.is-over strong {
    color: #a54438;
}

.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 {
    display: grid;
    gap: 10px;
    padding: 2px 12px 14px;
}

.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-tool-field-row,
.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-review-capacity {
    width: calc(100% - 18px);
    margin: 8px 9px 0;
    font-size: 0.66rem !important;
}

.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-map-toolbar > div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.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-map-drawer-actions {
    margin-left: auto;
}

.funding-zoom-controls output {
    min-width: 40px;
    color: var(--funding-muted);
    font-size: 0.64rem;
    text-align: center;
}

.funding-map-frame {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(255,255,255,.88), transparent 28%),
        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-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid rgba(216, 207, 189, 0.72);
}

.funding-capacity-hud-amounts > span {
    display: grid;
    gap: 2px;
    padding: 7px 9px;
}

.funding-capacity-hud-amounts > span + span {
    border-left: 1px solid rgba(216, 207, 189, 0.72);
}

.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;
}

.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;
}

.funding-map-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: grid;
    width: min(440px, calc(100% - 40px));
    gap: 7px;
    padding: 22px;
    border: 1px dashed var(--funding-line-strong);
    border-radius: 9px;
    background: rgba(255, 253, 248, 0.82);
    color: var(--funding-muted);
    text-align: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.funding-map-empty[hidden] {
    display: none;
}

.funding-map-empty strong {
    color: var(--funding-ink);
    font-family: var(--advisor-font-display, "Newsreader", serif);
    font-size: 1.05rem;
}

.funding-map-empty span {
    font-size: 0.7rem;
    line-height: 1.5;
}

.funding-map-boundary,
.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;
}

.funding-bottom-drawer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9;
    max-height: 42%;
    overflow: hidden;
    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-category select {
    border-left: 4px solid var(--funding-editor-tone, var(--funding-source));
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--funding-editor-tone, var(--funding-source)) 9%, #fffefa), #fffefa 32%);
    font-weight: 700;
}

.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-map-drawer-actions {
        display: none !important;
    }

    .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-capacity-summary,
    .funding-shared-history {
        display: none;
    }

    .funding-plan-context select {
        max-width: 175px;
    }

    .funding-tool-field-row,
    .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-map-boundary,
    .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-college-evidence {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(240px, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin: 10px 0;
    padding: 12px 16px;
    border: 1px solid rgba(47, 127, 115, 0.22);
    border-radius: 13px;
    background: #f2faf7;
}

.funding-college-evidence > div:first-child,
.funding-college-evidence > div:nth-child(2),
.funding-college-evidence > div:nth-child(2) span {
    display: grid;
    gap: 3px;
}

.funding-college-evidence > div:nth-child(2) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.funding-college-evidence span,
.funding-college-evidence small { color: #61727e; font-size: 0.72rem; }

@media (max-width: 820px) {
    .funding-college-evidence { grid-template-columns: 1fr; }
}
