/* Budget page cleanup: one coherent classic Sankey implementation. */
.year-rail,
.measure-explainer,
.adjusted-fix-note{display:none!important}

.flow-viewport.budget-v2-classic{overflow-x:auto!important;overflow-y:hidden!important;background:linear-gradient(180deg,#fffdf9 0%,#fbfaf7 100%)}
/*
  IMPORTANT: the Sankey uses absolute x coordinates in a 1460 unit SVG viewBox.
  If the canvas is allowed to stretch wider than 1460px when the browser is
  zoomed out, SVG ribbons stretch while cards/node bars remain at fixed px
  coordinates. That is what made the graph fall apart below 100% zoom.
  Keep one fixed logical canvas and let the viewport scroll/center it instead.
*/
.flow-viewport.budget-v2-classic .flow-canvas{
  width:1460px!important;
  min-width:1460px!important;
  max-width:1460px!important;
  margin-left:auto;
  margin-right:auto;
  flex:0 0 1460px;
  background:
    radial-gradient(circle at 50% 50%,rgba(255,255,255,.98),rgba(255,255,255,.82) 42%,transparent 67%),
    linear-gradient(180deg,rgba(181,18,71,.018),transparent 22%,transparent 78%,rgba(32,138,119,.018));
}
.flow-viewport.budget-v2-classic .flow-svg{width:1460px!important;max-width:none!important}
.flow-viewport.budget-v2-classic .flow-ribbon{opacity:.68!important;transition:opacity .16s ease,filter .16s ease;mix-blend-mode:multiply}
.flow-viewport.budget-v2-classic .flow-ribbon.revenue{fill:url(#bv2-revenue-gradient)!important}
.flow-viewport.budget-v2-classic .flow-ribbon.finance{fill:url(#bv2-finance-gradient)!important;opacity:.76!important}
.flow-viewport.budget-v2-classic .flow-ribbon.expense{opacity:.75!important}

/* Cards have dedicated side columns. They must never sit on top of the ribbons. */
.flow-viewport.budget-v2-classic .flow-card{opacity:1!important;filter:none!important;box-shadow:0 10px 24px rgba(24,27,29,.055);width:246px;border-color:rgba(17,19,21,.11)}
.flow-viewport.budget-v2-classic .flow-card.source{left:24px!important;background:rgba(255,255,255,.97)}
.flow-viewport.budget-v2-classic .flow-card.target{left:1190px!important;width:246px;background:color-mix(in srgb,var(--card-color,#a9163b) 7%,white)}
.flow-viewport.budget-v2-classic .flow-card.finance-source{border-left-color:#6c50c5!important;background:linear-gradient(145deg,#fff,#f1ecff)}
.flow-viewport.budget-v2-classic .flow-card.center{left:606px!important;width:250px}
.flow-viewport.budget-v2-classic .flow-card .flow-amount{letter-spacing:-.035em}
.flow-viewport.budget-v2-classic .flow-card .flow-share{opacity:.76}

/* Node bars sit between cards and the ribbon field. */
.flow-viewport.budget-v2-classic .flow-node-bar{width:14px;border-radius:5px;box-shadow:none!important;opacity:1}
.flow-viewport.budget-v2-classic .flow-node-bar.source{left:294px!important;background:#208a77}
.flow-viewport.budget-v2-classic .flow-node-bar.finance{background:#6c50c5!important}
.flow-viewport.budget-v2-classic .flow-node-bar.center{left:895px!important;width:22px;border-radius:3px;background:linear-gradient(180deg,#15191b,#0d1012)}
.flow-viewport.budget-v2-classic .flow-node-bar.target{left:1158px!important;filter:saturate(.95)}
.flow-viewport.budget-v2-classic .budget-v2-center{background:linear-gradient(145deg,#15191b,#0f1214);color:#fff;border-color:#111416;box-shadow:0 26px 64px rgba(17,20,22,.19)}
.flow-viewport.budget-v2-classic .budget-v2-center .flow-kicker,
.flow-viewport.budget-v2-classic .budget-v2-center .flow-share{color:#c9c6c0}
.flow-viewport.budget-v2-classic .flow-rail{display:none!important}

/* A contiguous central stack means ribbons visually join instead of floating as separate hoses. */
.flow-viewport.budget-v2-classic .budget-layout-stable .flow-ribbon{shape-rendering:geometricPrecision}
.flow-viewport.budget-v2-classic .budget-layout-stable .flow-node-bar.center{box-shadow:0 0 0 1px rgba(17,20,22,.035)}

/* Hover isolates the selected money flow while keeping the overall context visible. */
.flow-viewport.budget-v2-classic .flow-canvas.has-hover .flow-ribbon{opacity:.16!important}
.flow-viewport.budget-v2-classic .flow-canvas.has-hover .flow-card{opacity:.62!important}
.flow-viewport.budget-v2-classic .flow-canvas.has-hover .flow-ribbon.is-hovered{opacity:.98!important;filter:saturate(1.12) drop-shadow(0 5px 7px rgba(17,20,22,.10))}
.flow-viewport.budget-v2-classic .flow-canvas.has-hover .flow-card.is-hovered{opacity:1!important;filter:none!important;box-shadow:0 14px 34px rgba(24,27,29,.10)}

.control-panel .segmented{grid-template-columns:repeat(2,minmax(0,1fr))}
.control-panel .segmented button{white-space:nowrap}
.current-model-note{color:#544493!important}

/* Clean time series in the same warm expense palette as the rest of the site. */
.history-chart.budget-v2-history,
.history-chart.stable-history{min-height:310px;padding:18px 20px 12px;overflow:hidden}
.history-line-svg,
.stable-history-svg{display:block;width:100%;height:auto;min-height:270px;overflow:visible}
.history-grid-line,
.stable-history-grid{stroke:rgba(17,19,21,.075);stroke-width:1}
.budget-v2-history-area{fill:url(#budget-v2-history-area)}
.stable-history-area{fill:url(#stable-history-area-gradient)}
.history-line,
.stable-history-line{fill:none;stroke:#c62b55;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 4px 10px rgba(198,43,85,.12))}
.history-point,
.stable-history-point{fill:#fff7fa;stroke:#c62b55;stroke-width:4;transition:r .12s ease,fill .12s ease,stroke .12s ease}
.history-point-link:hover .history-point,
.history-point-link:focus .history-point,
.stable-history-point-link:hover .stable-history-point,
.stable-history-point-link:focus .stable-history-point{r:8;fill:#f7dce5;stroke:#a9163b}
.history-point-link.current .history-point,
.stable-history-point-link.current .stable-history-point{fill:#c62b55;stroke:#fff}
.history-year-label,
.stable-history-year{fill:#67686b;font-size:12px;font-weight:800;font-family:inherit}
.history-value-label,
.stable-history-value{fill:#7d1532;font-size:11px;font-weight:850;font-family:inherit}
.history-axis-label,
.stable-history-axis{fill:#77787a;font-size:10px;font-family:inherit}

@media(max-width:820px){
  .flow-viewport.budget-v2-classic{overscroll-behavior-x:contain}
  .history-chart.budget-v2-history,
  .history-chart.stable-history{overflow-x:auto}
  .history-line-svg,
  .stable-history-svg{min-width:760px}
}
