/* Reports > Budgets: the Budget Reports dashboard (Components/Pages/Admin/ReportsBudgets.razor and the BudgetReport* parts).
   Builds on the Reports tokens (--rp-*) and the Budgets hue (--bg-icon, --bg-icon-bg from budgets-area.css) so the
   page reads as a report about the Budgets area. Statuses use the report tones (positive, caution, negative); the heat
   grid has its own six-step ramp. The hero follows the Overview hero (the ah- recipe) in the Budgets hue. Phone first;
   the grid flattens below 1200px like the other reports. */

/* ------------------------------------------------------------------ Plan picker (first in the filter bar's own row) */
.rp-page-budgets .rpb-plan-group { flex: 0 1 auto; }
.rp-page-budgets .rpb-plan-select { width: clamp(220px, 22vw, 300px); }
.rp-page-budgets .rpb-plan-select .e-input-group { height: 36px; }
@media (max-width: 767.98px) {
    .rp-page-budgets .rpb-plan-select { flex: 1 1 auto; width: auto; min-width: 0; }
}
@media (max-width: 575.98px) {
    .rp-page-budgets .rpb-plan-select { width: 100%; }
}

/* ------------------------------------------------------------------ Period navigator (first in the filter bar) */
/* Back / forward through the plan's own periods plus a type-ahead over every period of the last two years. Beside the
   plan on the bar's first row (a hairline between them on wide screens); takes its own full row on a phone. */
.rp-page-budgets .rpb-period-nav { flex: 0 1 auto; }
.rp-page-budgets .rpb-period-controls { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.rp-page-budgets .rpb-period-step { flex: 0 0 auto; width: 34px; height: 34px; }
.rp-page-budgets .rpb-period-select { width: clamp(220px, 20vw, 290px); }
.rp-page-budgets .rpb-period-select .cs-field-glyph { color: var(--bg-icon); }
.rp-page-budgets .rpb-period-now { white-space: nowrap; }
@media (min-width: 768px) {
    .rp-page-budgets .rpb-plan-group + .rpb-period-nav { padding-left: 1.5rem; border-left: 1px solid var(--rp-card-border); }
}
@media (max-width: 767.98px) {
    .rp-page-budgets .rpb-period-controls { flex: 1 1 auto; }
    .rp-page-budgets .rpb-period-select { flex: 1 1 auto; width: auto; min-width: 0; }
}

/* ------------------------------------------------------------------ Hero (the Overview recipe in the Budgets hue) */
/* The card: the range's running totals drawn across the whole left side (spent solid, the budget dashed, the gap
   between them red where spending ran ahead and green where it stayed behind, the running period's projection
   dotted), the figures over it on glass, a period axis along the bottom whose slots show a card on hover and open
   the period, the plan-health panel on the right and the eight numbers along the bottom. Tuned separately for light
   and dark. Class names stay in rpb- so the global rp-hero-* rules from investments-retirement.css can't reach it. */
.ah.rpb-hero {
    --ah-bg: var(--bg-hero-bg);
    --ah-border: var(--bg-hero-border);
    --ah-text: var(--rp-text);
    --ah-muted: var(--rp-muted);
    --ah-badge-bg: var(--bg-icon-bg);
    --ah-badge-fg: var(--bg-icon);
    --ah-value-pill: rgba(255, 255, 255, .62);
    --ah-pill: rgba(255, 255, 255, .74);
    --ah-tiles-bg: rgba(255, 255, 255, .86);
    --ah-accent: var(--bg-icon);
    --rpb-line: #C026D3;
    --rpb-area: rgba(192, 38, 211, .2);
    --rpb-budget: rgba(11, 15, 25, .48);
    --rpb-heading: #7C3AED;
    --rpb-over: rgba(220, 38, 38, .1);
    --rpb-over-hatch: rgba(220, 38, 38, .14);
    --rpb-under: rgba(22, 163, 74, .12);
    --rpb-today: #0B0F19;
    --rpb-now-band: rgba(192, 38, 211, .05);
    --rpb-tag-bg: rgba(255, 255, 255, .88);
    --rpb-scrim: rgba(251, 242, 255, .78);
    --rpb-st-nearing: #CA8A04;
    --rpb-st-atrisk: #EA580C;
    --rpb-axis-h: 34px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 356px);
    grid-template-rows: auto auto;
    box-shadow: var(--bg-shadow);
}

[data-bs-theme="dark"] .ah.rpb-hero {
    --ah-value-pill: rgba(59, 31, 68, .55);
    --ah-pill: rgba(59, 31, 68, .5);
    --ah-tiles-bg: transparent;
    --rpb-line: #E879F9;
    --rpb-area: rgba(232, 121, 249, .3);
    --rpb-budget: rgba(243, 244, 250, .52);
    --rpb-heading: #C4B5FD;
    --rpb-over: rgba(248, 113, 113, .13);
    --rpb-over-hatch: rgba(248, 113, 113, .2);
    --rpb-under: rgba(34, 197, 94, .14);
    --rpb-today: #F3F4FA;
    --rpb-now-band: rgba(232, 121, 249, .06);
    --rpb-tag-bg: rgba(24, 18, 38, .8);
    --rpb-scrim: rgba(26, 18, 40, .7);
    --rpb-st-nearing: #FACC15;
    --rpb-st-atrisk: #FB923C;
}

.ah.rpb-hero.is-solo { grid-template-columns: minmax(0, 1fr); }
.ah.rpb-hero .rpb-hero-main { min-height: 384px; }
.ah.rpb-hero .rpb-hero-main::before {
    content: "";
    position: absolute;
    top: -45%;
    left: -12%;
    z-index: -1;
    width: 62%;
    height: 130%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--rpb-line) 16%, transparent), transparent);
    pointer-events: none;
}

/* The chart */
.ah.rpb-hero .rpb-hero-chart { inset: 0 0 var(--rpb-axis-h) 0; }
.ah.rpb-hero .rpb-hero-svg { animation-duration: 1.4s; }
.rpb-hero-area-0 { stop-color: var(--rpb-area); }
.rpb-hero-area-1 { stop-color: var(--rpb-area); stop-opacity: 0; }
.rpb-hero-line, .rpb-hero-glow { stroke: var(--rpb-line); }
.ah.rpb-hero .rpb-hero-line { stroke-width: 2.5; }
.rpb-hero-budget { fill: none; stroke: var(--rpb-budget); stroke-width: 1.6; stroke-dasharray: 6 5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rpb-hero-projected { fill: none; stroke: var(--rpb-heading); stroke-width: 2.25; stroke-dasharray: 1.5 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rpb-hero-band-over { fill: var(--rpb-over); }
.rpb-hero-band-under { fill: var(--rpb-under); }
.rpb-hero-hatch { fill: var(--rpb-over-hatch); }
.rpb-hero-today { stroke: var(--rpb-today); stroke-width: 1; stroke-dasharray: 2 4; opacity: .4; vector-effect: non-scaling-stroke; }
.rpb-hero-boundary { stroke: var(--ah-border); stroke-width: 1; opacity: .8; vector-effect: non-scaling-stroke; }
.rpb-hero-now-band { fill: var(--rpb-now-band); }

.rpb-hero-dot {
    position: absolute;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--rpb-line);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rp-card) 88%, transparent), 0 0 18px 2px color-mix(in srgb, var(--rpb-line) 55%, transparent);
    animation: rpb-pop .45s cubic-bezier(.2, .8, .2, 1) 1.2s both;
}

.rpb-hero-dot::after {
    content: "";
    position: absolute;
    inset: -7px;
    border: 2px solid var(--rpb-line);
    border-radius: 50%;
    opacity: 0;
    animation: rpb-pulse 2.4s ease-out 1.7s infinite;
}

.rpb-hero-dot.is-over::after { border-color: var(--rp-negative); }

.rpb-hero-today-label {
    position: absolute;
    top: 10px;
    z-index: 1;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rpb-tag-bg);
    border: 1px solid color-mix(in srgb, var(--ah-border) 80%, transparent);
    color: var(--ah-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    transform: translateX(-50%);
    animation: rpb-fade .4s ease 1.25s both;
}

.rpb-hero-today-label.is-end { transform: translateX(calc(-100% + 10px)); }

.rpb-hero-tag {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--rpb-tag, var(--ah-border)) 55%, transparent);
    border-radius: 9px;
    background: var(--rpb-tag-bg);
    box-shadow: 0 6px 16px rgba(15, 10, 30, .1);
    color: var(--ah-muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    animation: rpb-fade .4s ease 1.25s both;
}

.rpb-hero-tag b { font-size: 12px; font-weight: 700; color: var(--ah-text); }
.rpb-hero-tag.is-start { transform: translate(12px, -50%); }
.rpb-hero-tag.is-end { transform: translate(calc(-100% - 12px), -50%); }
.rpb-hero-tag.is-above.is-end { transform: translate(calc(-100% + 8px), calc(-100% - 14px)); }
.rpb-hero-tag.is-above.is-start { transform: translate(-8px, calc(-100% - 14px)); }
.rpb-hero-tag.is-budget { --rpb-tag: var(--rpb-budget); }
.rpb-hero-tag.is-spent { --rpb-tag: var(--rpb-line); }
.rpb-hero-tag.is-heading { --rpb-tag: var(--rpb-heading); }
.rpb-hero-tag.is-heading.rp-tone-negative b { color: var(--rp-negative); }
.rpb-hero-tag.is-heading.rp-tone-caution b { color: var(--rp-caution); }
.rpb-hero-tag.is-heading.rp-tone-positive b { color: var(--rp-positive); }

/* You and your partner: a capsule at each finished period's end and today (you blue at the bottom, partner amber on
   top) from zero up to the spending line, the split under the spent tag, the band under the figures, the split in each
   period's card and under each "most over" line. The couple palette (--rp-you / --rp-partner), never the violet. */
.ah.rpb-hero.has-couple .rpb-hero-main { min-height: 424px; }
.rpb-split {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 9px;
    margin-left: -4.5px;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--rp-card) 85%, transparent), 0 6px 16px rgba(15, 10, 30, .18);
    transform-origin: bottom;
    animation: rpb-grow .6s cubic-bezier(.2, .8, .2, 1) 1.05s both;
}

.rpb-split > span { display: block; min-height: 2px; flex-basis: 0; }
.rpb-split-you { background: linear-gradient(to top, color-mix(in srgb, var(--rp-you) 70%, transparent), var(--rp-you)); }
.rpb-split-partner { background: linear-gradient(to top, color-mix(in srgb, var(--rp-partner) 75%, transparent), var(--rp-partner)); }
.rpb-hero-tag.is-split { flex-direction: column; align-items: flex-start; gap: 3px; padding: 5px 10px; }
.rpb-tag-row { display: inline-flex; align-items: baseline; gap: .3rem; }
.rpb-tag-who { gap: 10px; font-size: 10.5px; }
.rpb-tag-who > span { display: inline-flex; align-items: center; gap: 3px; }
.rpb-tag-who b { font-size: 11px; }
.rpb-tag-who .rp-dot, .rpb-axis-tip-who .rp-dot, .rpb-cb-who .rp-dot { width: 7px; height: 7px; margin: 0 2px 0 0; }
.rpb-key-split { display: inline-block; width: 6px; height: 12px; border-radius: 3px; background: linear-gradient(to top, var(--rp-you) 0 60%, var(--rp-partner) 60% 100%); }

.rpb-couple-band {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(520px, 100%);
    margin-top: 6px;
    padding: 9px 12px 10px;
    border: 1px solid color-mix(in srgb, var(--ah-border) 80%, transparent);
    border-radius: 14px;
    background: var(--ah-pill);
    backdrop-filter: blur(6px);
}

.rpb-cb-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.rpb-cb-title { display: inline-flex; align-items: center; gap: .4rem; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ah-text); }
.rpb-cb-title .tx-glyph { color: var(--rp-you); }
.rpb-cb-moves { font-size: 11px; color: var(--ah-muted); }
.rpb-cb-row { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 10px; }
.rpb-cb-who { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ah-muted); white-space: nowrap; }
.rpb-cb-who b { font-size: 14px; font-weight: 700; color: var(--ah-text); }
.rpb-cb-who small { font-size: 11px; font-weight: 700; }
.rpb-cb-who.is-you small { color: var(--rp-you); }
.rpb-cb-who.is-partner small { color: var(--rp-partner); }
.rpb-cb-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--rp-track); }
.rpb-cb-bar > span { display: block; height: 100%; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.rpb-cb-bar > .is-you { background: var(--rp-you); border-radius: 999px 0 0 999px; }
.rpb-cb-bar > .is-partner { background: var(--rp-partner); border-radius: 0 999px 999px 0; }
.rpb-solo-note { white-space: normal; }
.rpb-solo-note > .tx-glyph { color: var(--ah-muted); }

/* The figures over the chart */
.ah.rpb-hero .rpb-hero-content { flex: 1 1 auto; gap: 7px; max-width: min(640px, 100%); padding: 18px 22px 12px; }
.ah.rpb-hero .rpb-hero-content::before {
    content: "";
    position: absolute;
    inset: -40px -140px -20px -80px;
    z-index: -1;
    background: radial-gradient(ellipse 58% 62% at 32% 42%, var(--rpb-scrim), transparent 74%);
    pointer-events: none;
}

.ah.rpb-hero .rpb-hero-badge { opacity: 1; }
.rpb-hero-help { margin-left: .2rem; }
.rpb-hero-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--ah-muted); }
.rpb-hero-plan strong { font-weight: 650; color: var(--ah-text); }
.ah.rpb-hero .rpb-hero-value-pill { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 2px; padding: 4px 12px 6px; border-radius: 14px; backdrop-filter: blur(6px); }
.ah.rpb-hero .rpb-hero-value { font-size: clamp(32px, 4.4vw, 50px); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.ah.rpb-hero.rp-tone-negative .rpb-hero-value { color: var(--rp-negative); }
.ah.rpb-hero.rp-tone-positive .rpb-hero-value { color: var(--rp-positive); }
.rpb-hero-value-word { font-size: 16px; font-weight: 650; color: var(--ah-text); }
.rpb-hero-sub { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ah-muted); }
.rpb-hero-sub strong { font-weight: 650; color: var(--ah-text); }
.rpb-hero-change { font-size: 12.5px; font-weight: 600; }
.ah.rpb-hero .rpb-hero-pills { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.rpb-hero-pills .ah-pill { backdrop-filter: blur(6px); }
.rpb-hero-pills .ah-pill > .tx-glyph { color: var(--ah-badge-fg); }
.rpb-hero-pills .ah-pill.rp-tone-negative > .tx-glyph, .rpb-hero-pills .ah-pill.rp-tone-negative b { color: var(--rp-negative); }
.rpb-hero-pills .ah-pill.rp-tone-caution > .tx-glyph, .rpb-hero-pills .ah-pill.rp-tone-caution b { color: var(--rp-caution); }
.rpb-hero-pills .ah-pill.rp-tone-positive > .tx-glyph { color: var(--rp-positive); }
.rpb-hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: auto; padding-top: 10px; }
.rpb-hero-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 10.5px; color: var(--ah-muted); }
.rpb-hero-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.rpb-key { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--rpb-line); border-radius: 2px; }
.rpb-key.is-budget { border-top: 2px dashed var(--rpb-budget); }
.rpb-key.is-heading { border-top: 2.5px dotted var(--rpb-heading); }

/* The period axis: one slot per period, a card on hover, a click opens the period */
.rpb-hero-axis {
    position: relative;
    z-index: 2;
    flex: 0 0 var(--rpb-axis-h);
    height: var(--rpb-axis-h);
    border-top: 1px solid color-mix(in srgb, var(--ah-border) 85%, transparent);
    background: color-mix(in srgb, var(--rp-card) 32%, transparent);
}

.rpb-axis-col {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--ah-muted);
    font: inherit;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.rpb-axis-col + .rpb-axis-col { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--ah-border) 70%, transparent); }
.rpb-axis-col::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 900px;
    background: linear-gradient(to top, color-mix(in srgb, var(--rpb-line) 15%, transparent), transparent 70%);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.rpb-axis-col:hover, .rpb-axis-col:focus-visible { background: color-mix(in srgb, var(--rpb-line) 10%, transparent); color: var(--ah-text); outline: none; }
.rpb-axis-col:hover::before, .rpb-axis-col:focus-visible::before { opacity: 1; }
.rpb-axis-col:focus-visible { box-shadow: inset 0 0 0 2px var(--rp-focus); }
.rpb-axis-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.rpb-axis-label::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--rp-positive); }
.rpb-axis-col.is-over .rpb-axis-label::before { background: var(--rp-negative); }
.rpb-axis-col.is-dead .rpb-axis-label::before { background: var(--ah-border); }
.rpb-axis-col.is-current .rpb-axis-label { color: var(--ah-text); }
.rpb-axis-col.is-quiet .rpb-axis-label { visibility: hidden; }
.rpb-axis-col.is-solo { justify-content: flex-start; padding-left: 16px; }
.rpb-axis-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    color: color-mix(in srgb, var(--ah-muted) 80%, transparent);
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.rpb-axis-tick::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 5px; background: var(--ah-border); }
.rpb-axis-tick.is-today { color: var(--ah-text); }

.rpb-axis-tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 170px;
    padding: 9px 11px;
    border: 1px solid var(--rp-tip-border);
    border-radius: 12px;
    background: var(--rp-tip-bg);
    box-shadow: var(--rp-tip-shadow);
    color: var(--rp-tip-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}

.rpb-axis-tip strong { font-size: 12.5px; font-weight: 700; }
.rpb-axis-tip b { font-size: 14px; font-weight: 700; }
.rpb-axis-tip-meta { font-size: 11px; color: var(--rp-tip-note); }
.rpb-axis-tip-who { display: inline-flex; gap: 10px; font-size: 11.5px; color: var(--rp-tip-note); }
.rpb-axis-tip-who > span { display: inline-flex; align-items: center; gap: 3px; }
.rpb-axis-tip-who b { font-size: 12px; color: var(--rp-tip-text); }
.rpb-axis-col.is-start .rpb-axis-tip { left: 8px; transform: translate(0, 4px); }
.rpb-axis-col.is-end .rpb-axis-tip { left: auto; right: 8px; transform: translate(0, 4px); }
.rpb-axis-col:hover .rpb-axis-tip, .rpb-axis-col:focus-visible .rpb-axis-tip { opacity: 1; transform: translate(-50%, 0); }
.rpb-axis-col.is-start:hover .rpb-axis-tip, .rpb-axis-col.is-start:focus-visible .rpb-axis-tip,
.rpb-axis-col.is-end:hover .rpb-axis-tip, .rpb-axis-col.is-end:focus-visible .rpb-axis-tip { transform: translate(0, 0); }

/* Plan health: the ring (health outside, the latest period's line statuses inside), the statuses, health by period */
.ah.rpb-hero .rpb-health { gap: 12px; padding: 16px 16px 14px; }
.rpb-health { --rpb-g0: #C026D3; --rpb-g1: #F0ABFC; --rpb-glow: rgba(192, 38, 211, .35); }
.rpb-health.rp-tone-positive { --rpb-g0: #16A34A; --rpb-g1: #4ADE80; --rpb-glow: rgba(34, 197, 94, .35); }
.rpb-health.rp-tone-caution { --rpb-g0: #D97706; --rpb-g1: #FCD34D; --rpb-glow: rgba(245, 158, 11, .35); }
.rpb-health.rp-tone-negative { --rpb-g0: #DC2626; --rpb-g1: #FB7185; --rpb-glow: rgba(239, 68, 68, .35); }
.rpb-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rpb-health-head .rp-eyebrow-sm { color: var(--bg-icon); }
.rpb-health-band { display: inline-flex; align-items: center; gap: .35rem; padding: 3px 9px; border-radius: 999px; background: var(--rp-tone-soft); color: var(--rp-tone); font-size: 11px; font-weight: 700; white-space: nowrap; }
.rpb-health-band::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rpb-health-body { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 16px; }

.rpb-gauge { position: relative; width: 136px; aspect-ratio: 1; }
.rpb-gauge svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rpb-gauge-ticks { fill: none; stroke: color-mix(in srgb, var(--rp-muted) 32%, transparent); stroke-width: 3.5; stroke-dasharray: 1.4 6.5587; }
.rpb-gauge-track { fill: none; stroke: var(--rp-track); stroke-width: 12; }
.rpb-gauge-arc { fill: none; stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--rpb-glow)); animation: rpb-gauge-in 1.2s cubic-bezier(.2, .8, .2, 1) .15s both; }
.rpb-gauge-stop-0 { stop-color: var(--rpb-g0); }
.rpb-gauge-stop-1 { stop-color: var(--rpb-g1); }
.rpb-gauge-inner { fill: none; stroke: var(--rp-track); stroke-width: 6; }
.rpb-gauge-seg { fill: none; stroke: var(--rpb-st); stroke-width: 6; animation: rpb-fade .5s ease .7s both; }
.rpb-gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; pointer-events: none; }
.rpb-gauge-center strong { font-family: var(--tx-font); font-size: 36px; font-weight: 750; line-height: 1; letter-spacing: -.03em; color: var(--rp-text); }
.rpb-gauge-center small { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rp-muted); }

.rpb-gauge-seg.is-ontrack, .rpb-health-legend .is-ontrack { --rpb-st: var(--rp-positive); }
.rpb-gauge-seg.is-nearing, .rpb-health-legend .is-nearing { --rpb-st: var(--rpb-st-nearing); }
.rpb-gauge-seg.is-atrisk, .rpb-health-legend .is-atrisk { --rpb-st: var(--rpb-st-atrisk); }
.rpb-gauge-seg.is-over, .rpb-health-legend .is-over { --rpb-st: var(--rp-negative); }

.rpb-health-lines { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rpb-health-caption { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rp-muted); }
.rpb-health-legend { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rpb-health-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12.5px; color: var(--rp-muted); }
.rpb-health-legend li b { font-size: 13px; color: var(--rp-text); }
.rpb-health-legend li.is-zero { opacity: .5; }
.rpb-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--rpb-st); }

.rpb-health-trend { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--ah-border) 80%, transparent); }
.rpb-health-trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rpb-health-trend-title { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rp-muted); }
.rpb-health-delta { font-size: 11.5px; font-weight: 650; color: var(--rp-muted); white-space: nowrap; }
.rpb-health-cols { display: flex; align-items: stretch; justify-content: space-evenly; gap: 5px; height: 62px; }
.rpb-health-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; max-width: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.rpb-health-track { display: flex; flex: 1 1 auto; align-items: flex-end; width: 100%; border-radius: 5px; background: var(--rp-track); overflow: hidden; }
.rpb-health-bar { display: block; width: 100%; min-height: 3px; border-radius: 5px 5px 0 0; background: linear-gradient(to top, color-mix(in srgb, var(--rp-tone) 50%, transparent), var(--rp-tone)); transition: height .5s ease, filter .15s ease; }
.rpb-health-col small { font-size: 9.5px; font-weight: 600; line-height: 1; color: var(--rp-muted); white-space: nowrap; }
.rpb-health-col.is-current small { color: var(--rp-text); }
.rpb-health-col.is-current .rpb-health-track { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rp-tone) 60%, transparent); }
.rpb-health-col.is-quiet small { visibility: hidden; }
.rpb-health-col:hover .rpb-health-bar, .rpb-health-col:focus-visible .rpb-health-bar { filter: brightness(1.12); }
.rpb-health-col:focus-visible { border-radius: 6px; outline: 2px solid var(--rp-focus); outline-offset: 2px; }

.rpb-health-over { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--ah-border) 80%, transparent); }
.rpb-health-over ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rpb-over-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 6px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--rp-text);
    font: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease;
}

.rpb-over-row:hover:not(:disabled), .rpb-over-row:focus-visible { background: var(--rp-row-hover); outline: none; }
.rpb-over-row:focus-visible { box-shadow: inset 0 0 0 2px var(--rp-focus); }
.rpb-over-row:disabled { cursor: default; }
.rpb-over-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: color-mix(in srgb, var(--rp-cat) 18%, transparent); color: var(--rp-cat); font-size: 10.5px; }
.rpb-over-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rpb-over-text { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rpb-over-split { display: block; width: min(120px, 100%); height: 3px; border-radius: 2px; background: var(--rp-partner); overflow: hidden; }
.rpb-over-split > span { display: block; height: 100%; background: var(--rp-you); }
.rpb-over-row b { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* The range in numbers: 8 across on wide screens, 4 by 2, then 2 by 4 */
.ah.rpb-hero .rpb-hero-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rpb-hero-tile { width: 100%; border: 0; border-radius: 0; font: inherit; text-align: left; cursor: pointer; }
.rpb-hero-tile:focus-visible { outline: 2px solid var(--rp-focus); outline-offset: -2px; }
.rpb-hero-tile .rp-hero-tile-chip { background: var(--bg-icon-bg); color: var(--bg-icon); transition: transform .15s ease; }
.rpb-hero-tile:hover .rp-hero-tile-chip { transform: scale(1.06); }
.rpb-hero-tile .rp-hero-tile-note { font-weight: 600; }

@keyframes rpb-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes rpb-pulse { 0% { opacity: .7; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes rpb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rpb-grow { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: scaleY(1); } }
@keyframes rpb-gauge-in { from { stroke-dasharray: 0 400; } }

@media (min-width: 1400px) {
    .ah.rpb-hero .rpb-hero-tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .ah.rpb-hero { grid-template-columns: minmax(0, 1fr); }
    .ah.rpb-hero .rpb-health { margin: 0 14px 14px; }
}

@media (min-width: 640px) and (max-width: 991.98px) {
    .ah.rpb-hero .rpb-health { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; align-items: start; column-gap: 22px; }
    .rpb-health-head { grid-column: 1 / -1; }
    .rpb-health-body { grid-column: 1; grid-row: 2 / span 2; }
    .rpb-health-trend, .rpb-health-over { grid-column: 2; padding: 0 0 0 22px; border-top: 0; border-left: 1px solid color-mix(in srgb, var(--ah-border) 80%, transparent); }
    .rpb-health-trend + .rpb-health-over { padding-top: 12px; }
}

@media (max-width: 767.98px) {
    .ah.rpb-hero .rpb-hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .ah.rpb-hero .rpb-hero-main { min-height: 0; }
    .ah.rpb-hero .rpb-hero-content { order: 1; padding: 14px 14px 10px; }
    .ah.rpb-hero .rpb-hero-content::before { display: none; }
    .ah.rpb-hero .rpb-hero-chart { position: relative; inset: auto; order: 2; flex: 0 0 180px; height: 180px; }
    .ah.rpb-hero .rpb-hero-axis { order: 3; }
    .rpb-hero-today-label { top: 4px; }
    .rpb-hero-tag { display: none; }
    .ah.rpb-hero.has-couple .rpb-hero-main { min-height: 0; }
    .rpb-cb-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rpb-cb-bar { grid-column: 1 / -1; grid-row: 1; }
    .rpb-cb-who.is-partner { justify-content: flex-end; }
    .rpb-hero-legend-range { flex-basis: 100%; }
    .rpb-health-body { grid-template-columns: 116px minmax(0, 1fr); gap: 12px; }
    .rpb-gauge { width: 116px; }
    .rpb-gauge-center strong { font-size: 30px; }
}

/* ------------------------------------------------------------------ Needs attention */
/* Anything to act on pulses: a ring that breathes out from the element and an icon that beats, in the element's own
   tone (red for over, amber for at risk). Used by the hero and by the Budgets page (insight pills, line status, buckets,
   the alerts card). Reduced motion keeps the icon and drops the motion. */
.rpb-attn { position: relative; }
.rpb-attn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    animation: rpb-attn-ring 2.2s ease-out infinite;
}

.rpb-attn-icon { display: inline-block; animation: rpb-attn-beat 2.2s ease-in-out infinite; }
.rpb-attn-dot { position: relative; }
.rpb-attn-dot::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--rp-card);
    border-radius: 50%;
    background: var(--rp-negative);
    animation: rpb-attn-beat 2.2s ease-in-out infinite;
}

.rpb-health-legend li.is-attn b { color: var(--rpb-st); }
.rpb-pill-btn { border: 0; font: inherit; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.rpb-pill-btn:hover, .rpb-pill-btn:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--rp-negative) 25%, transparent); outline: none; }
.rpb-pill-btn:focus-visible { box-shadow: 0 0 0 2px var(--rp-focus); }
.rpb-pill-go { font-size: 9px !important; opacity: .7; }

@keyframes rpb-attn-ring {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rpb-attn-color, var(--rp-tone, var(--rp-negative))) 60%, transparent); }
    70%, 100% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--rpb-attn-color, var(--rp-tone, var(--rp-negative))) 0%, transparent); }
}

@keyframes rpb-attn-beat {
    0%, 30%, 100% { transform: scale(1); }
    10% { transform: scale(1.28); }
    20% { transform: scale(.94); }
}

/* ------------------------------------------------------------------ The Budgets page's entrance (is-animated) */
/* The headline spins up (chipInReports.countUp), the tick ring winds in, the health arc sweeps with a little
   overshoot and drops a spark at its end, the status arcs follow one after another, the score pops, the legend slides
   in row by row with its counts spinning, and the tiles rise in sequence. */
.rpb-gauge-spark { fill: #FFFFFF; stroke: var(--rpb-g0); stroke-width: 2; filter: drop-shadow(0 0 6px var(--rpb-glow)); }
.rpb-hero.is-animated .rpb-gauge-spark { animation: rpb-spark 2.6s ease-out 1.55s both; }
.rpb-hero.is-animated .rpb-gauge-ticks { transform-box: fill-box; transform-origin: center; animation: rpb-wind 1.3s cubic-bezier(.2, .8, .2, 1) both; }
.rpb-hero.is-animated .rpb-gauge-arc { animation: rpb-gauge-in 1.6s cubic-bezier(.3, 1.25, .45, 1) .15s both; }
.rpb-hero.is-animated .rpb-gauge-seg { animation: rpb-gauge-in .75s cubic-bezier(.2, .8, .2, 1) calc(.85s + (var(--i, 0) * .2s)) both; }
.rpb-hero.is-animated .rpb-gauge-center strong { animation: rpb-pop .7s cubic-bezier(.2, 1.4, .4, 1) .2s both; }
.rpb-hero.is-animated .rpb-gauge-center small, .rpb-hero.is-animated .rpb-health-band { animation: rpb-fade .5s ease 1.2s both; }
.rpb-hero.is-animated .rpb-health-legend li { animation: rpb-slide .5s cubic-bezier(.2, .8, .2, 1) calc(.9s + (var(--i, 0) * .12s)) both; }
.rpb-hero.is-animated .rpb-hero-value-pill { animation: rpb-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.rpb-hero.is-animated .rpb-hero-tile { animation: rpb-rise .55s cubic-bezier(.2, .8, .2, 1) calc(.25s + (var(--i, 0) * .06s)) both; }
.rpb-hero [data-count-to].is-counting { font-variant-numeric: tabular-nums; text-shadow: 0 3px 8px color-mix(in srgb, currentColor 30%, transparent); }
.rpb-hero [data-count-to].is-counted { animation: rpb-settle .45s cubic-bezier(.2, 1.4, .4, 1); }

@keyframes rpb-wind { from { opacity: 0; transform: rotate(-140deg) scale(.85); } to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes rpb-slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rpb-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rpb-settle { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes rpb-spark {
    0% { opacity: 0; r: 1; }
    15% { opacity: 1; r: 6; }
    30% { r: 4.5; }
    100% { opacity: 1; r: 4.5; }
}

/* ------------------------------------------------------------------ Layout: pairs and the two stacks */
/* Paired chart rows end on one line (the shorter card's chart centers in the extra room). The middle cards sit in
   two stacks, wide and narrow, packed by BudgetReportBoard so a short card never leaves a hole beside a long one;
   the last card of each stack stretches so both stacks end together. Below 1200px the stacks and the paired rows go
   half and half, and below 992px everything is one column, like the rest of the Reports grid. */
.rpb .rp-card { scroll-margin-top: 16px; }
.rpb .rp-grid.rpb-pair { align-items: stretch; }
.rpb .rpb-pair > .rp-card, .rpb-stack > .rp-card { display: flex; flex-direction: column; }
.rpb .rpb-pair > .rp-card > .rp-card-body { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: center; }
.rpb-stacks { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; gap: 1rem; min-width: 0; }
.rpb-stacks.is-single { grid-template-columns: minmax(0, 1fr); }
.rpb-stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.rpb-stack > .rp-card:last-child { flex: 1 1 auto; }
.rpb-stack > .rp-card > .rp-card-body { display: flex; flex: 1 1 auto; flex-direction: column; }
.rpb-stack > .rp-card > .rp-card-body > .rp-empty-line { margin: auto 0; }
.rpb .rp-card.rp-flash { animation: rpb-flash 1.6s ease; }

@keyframes rpb-flash {
    0%, 100% { box-shadow: var(--rc-shadow, none); }
    25% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg-icon) 55%, transparent), 0 14px 40px color-mix(in srgb, var(--bg-icon) 22%, transparent); }
}

@media (max-width: 1199.98px) {
    .rpb-stacks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .rpb .rpb-pair > .rp-col-7, .rpb .rpb-pair > .rp-col-5 { grid-column: span 6; }
}

@media (max-width: 991.98px) {
    .rpb-stacks { grid-template-columns: minmax(0, 1fr); }
    .rpb-stack > .rp-card:last-child { flex: 0 0 auto; }
}

@media (max-width: 575.98px) {
    .rpb-stacks, .rpb-stack { gap: .75rem; }
}

/* ------------------------------------------------------------------ Scoreboard (every line) */
.rpb-board { display: flex; flex-direction: column; gap: 12px; }
.rpb-board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rpb-search { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 180px; max-width: 360px; }
.rpb-search > .tx-glyph { position: absolute; left: 11px; font-size: 12px; color: var(--rp-muted); pointer-events: none; }
.rpb-search > .rp-input { width: 100%; padding-left: 30px; }
.rpb-sort { display: inline-flex; align-items: center; gap: 8px; }
.rpb-sort .cs-select { min-width: 200px; }
.rpb-board-count { margin-left: auto; }

.rpb-lines { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rpb-line {
    --rp-cat: var(--rp-indigo);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 14px;
    padding: 12px 14px;
    border: 1px solid var(--rp-tile-border);
    border-radius: 14px;
    background: var(--rp-tile);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.rpb-line:hover { border-color: var(--rp-border); box-shadow: var(--rp-shadow); }
.rpb-line.is-paused { opacity: .6; }
.rpb-line-chip { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--rp-cat) 16%, transparent); color: var(--rp-cat); font-size: 14px; }
.rpb-line-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rpb-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rpb-line-name { padding: 0; border: 0; background: none; font-family: var(--tx-font); font-size: 14.5px; font-weight: 650; color: var(--rp-text); text-align: left; cursor: pointer; }
.rpb-line-name:hover:not(:disabled), .rpb-line-name:focus-visible { color: var(--rp-indigo); text-decoration: underline; outline: none; }
.rpb-line-name:disabled { cursor: default; }
.rpb-line-status { display: inline-flex; align-items: center; gap: .3rem; font-size: 12px; font-weight: 600; color: var(--rp-tone); }
.rpb-line-trend { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.rpb-bullet { position: relative; height: 14px; border-radius: 7px; background: var(--rp-track); overflow: hidden; }
.rpb-bullet-track { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--rp-cat) 14%, transparent); }
.rpb-bullet-fill { position: absolute; top: 3px; bottom: 3px; left: 0; display: flex; border-radius: 4px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
/* Past the budget mark: a light hatch over the blended red that fades in after the seam. */
.rpb-bullet-over {
    position: absolute; top: 3px; bottom: 3px; border-radius: 0 4px 4px 0;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .30) 0 3px, transparent 3px 7px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 min(18px, 60%));
    mask-image: linear-gradient(90deg, transparent 0, #000 min(18px, 60%));
}
.rpb-bullet-alert { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rp-caution); opacity: .8; }
.rpb-bullet-target { position: absolute; top: -1px; bottom: -1px; width: 3px; border-radius: 2px; background: var(--rp-text); }
.rpb-line-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 12.5px; color: var(--rp-muted); }
.rpb-line-figures strong { color: var(--rp-text); }

/* Period strip: one column per period (the latest six), its height the share of the budget used, colored by how the
   period landed, the percent above and the period below; the current period is ringed. */
.rpb-periods { display: flex; align-items: flex-end; gap: 4px; padding-left: 12px; border-left: 1px solid var(--rp-tile-border); }
.rpb-period {
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px; width: 36px; padding: 4px 2px; border: 1px solid transparent; border-radius: 8px;
    background: none; font-family: inherit; color: var(--rp-muted); cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
.rpb-period:hover:not(:disabled), .rpb-period:focus-visible { background: color-mix(in srgb, var(--rp-tone) 10%, transparent); outline: none; border-color: color-mix(in srgb, var(--rp-tone) 35%, transparent); }
.rpb-period:disabled { cursor: default; opacity: .55; }
.rpb-period-pct { font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--rp-tone); white-space: nowrap; }
.rpb-period.rp-tone-neutral .rpb-period-pct { color: var(--rp-muted); }
.rpb-period-col { position: relative; display: flex; align-items: flex-end; width: 10px; height: 30px; border-radius: 5px; background: var(--rp-track); overflow: hidden; }
.rpb-period-fill {
    display: block; width: 100%; border-radius: 5px;
    background: linear-gradient(to top, color-mix(in srgb, var(--rp-tone) 45%, transparent), var(--rp-tone));
    transition: height .5s cubic-bezier(.2, .8, .2, 1);
}
.rpb-period.is-dead .rpb-period-col { background: transparent; box-shadow: inset 0 0 0 1px var(--rp-tile-border); }
.rpb-period-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; line-height: 1.1; }
.rpb-period.is-current { border-color: color-mix(in srgb, var(--rp-tone) 45%, transparent); background: color-mix(in srgb, var(--rp-tone) 7%, transparent); }
.rpb-period.is-current .rpb-period-label { color: var(--rp-text); }
.rpb-period.is-current .rpb-period-col { box-shadow: 0 0 10px -1px color-mix(in srgb, var(--rp-tone) 55%, transparent); }
.rpb-periods-more { align-self: center; padding: 2px 6px; border-radius: 999px; background: var(--rp-neutral-soft); color: var(--rp-muted); font-size: 10.5px; font-weight: 700; }
.rpb-board-key { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.rpb-board-key + .rpb-board-count { margin-left: 0; }
.rpb-board-key-col { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.rpb-board-key-col i { display: block; width: 4px; border-radius: 2px; }
.rpb-board-key-col i:nth-child(1) { height: 6px; background: var(--rp-positive); }
.rpb-board-key-col i:nth-child(2) { height: 9px; background: var(--rp-caution); }
.rpb-board-key-col i:nth-child(3) { height: 12px; background: var(--rp-negative); }

@media (max-width: 767.98px) {
    .rpb-line { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
    .rpb-periods, .rpb-board-key { display: none; }
    .rpb-board-count { margin-left: 0; }
}

/* ------------------------------------------------------------------ Heat grid (lines by period) */
:root {
    --rpb-heat-0: var(--rp-neutral-soft);
    --rpb-heat-1: #DCFCE7;
    --rpb-heat-2: #BBF7D0;
    --rpb-heat-3: #FDE68A;
    --rpb-heat-4: #FDBA74;
    --rpb-heat-5: #F87171;
    --rpb-heat-text-5: #FFFFFF;
}
[data-bs-theme="dark"] {
    --rpb-heat-1: rgba(34, 197, 94, .22);
    --rpb-heat-2: rgba(34, 197, 94, .42);
    --rpb-heat-3: rgba(251, 191, 36, .45);
    --rpb-heat-4: rgba(251, 146, 60, .6);
    --rpb-heat-5: rgba(248, 113, 113, .85);
}
.rpb-heat-cell.lv-1, .rpb-heat-swatch.lv-1 { background: var(--rpb-heat-1); }
.rpb-heat-cell.lv-2, .rpb-heat-swatch.lv-2 { background: var(--rpb-heat-2); }
.rpb-heat-cell.lv-3, .rpb-heat-swatch.lv-3 { background: var(--rpb-heat-3); }
.rpb-heat-cell.lv-4, .rpb-heat-swatch.lv-4 { background: var(--rpb-heat-4); }
.rpb-heat-cell.lv-5, .rpb-heat-swatch.lv-5 { background: var(--rpb-heat-5); color: var(--rpb-heat-text-5); }

.rpb-heat-wrap { display: flex; flex-direction: column; gap: 10px; }
.rpb-heat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rpb-heat-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.rpb-heat-swatch { width: 14px; height: 10px; border-radius: 2px; }
.rpb-heat-scroll { overflow-x: auto; }
.rpb-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.rpb-heat th { padding: 4px 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--rp-muted); text-align: center; white-space: nowrap; }
.rpb-heat th.is-current, .rpb-heat td.is-current .rpb-heat-cell { outline: 1px dashed var(--rp-muted); outline-offset: -1px; }
.rpb-heat th.rpb-heat-name, .rpb-heat td.rpb-heat-total { text-align: left; }
.rpb-heat th.rpb-heat-name { position: sticky; left: 0; z-index: 1; min-width: 150px; background: var(--rp-card); text-align: left; }
.rpb-heat tbody th.rpb-heat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: 0; color: var(--rp-text); }
.rpb-heat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rp-cat); flex: 0 0 auto; }
.rpb-heat-line { font-size: 12.5px; font-weight: 600; text-align: left; }
.rpb-heat td { padding: 0; text-align: center; }
.rpb-heat-cell { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 52px; height: 30px; padding: 0 4px; border: 0; border-radius: 6px; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--rp-text); cursor: pointer; transition: transform .12s ease; }
.rpb-heat-cell:hover, .rpb-heat-cell:focus-visible { transform: scale(1.06); outline: 2px solid var(--rp-focus); outline-offset: 1px; }
.rpb-heat-cell.lv-0 { color: var(--rp-muted); }
.rpb-heat-cell.is-dead { cursor: default; background: transparent; border: 1px dashed var(--rp-tile-border); }
.rpb-heat-cell.is-dead:hover { transform: none; outline: none; }
.rpb-heat-total { padding: 0 8px !important; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.rpb-heat tr.is-paused .rpb-heat-line { opacity: .6; }

/* ------------------------------------------------------------------ Rollover, goals, couple */
.rpb-roll-lines { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.rpb-roll-line { --rp-cat: var(--rp-indigo); display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--rp-tile-border); font-size: 13px; }
.rpb-roll-line .rpb-line-name { font-size: 13px; }
.rpb-roll-line .rpb-line-name .tx-glyph { margin-right: 4px; color: var(--rp-cat); }
.rpb-roll-spark { width: 80px; height: 22px; margin-left: auto; }
.rpb-roll-line > .rp-num { min-width: 64px; text-align: right; font-weight: 650; }

.rpb-goals { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rpb-goal { --rp-cat: var(--rp-positive); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 14px; border: 1px solid var(--rp-tile-border); border-radius: 14px; background: var(--rp-tile); }
.rpb-goal-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rpb-goal-state { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; font-size: 12px; font-weight: 650; }
.rpb-goal-track { position: relative; height: 10px; border-radius: 5px; background: var(--rp-track); overflow: hidden; }
.rpb-goal-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--rp-cat); transition: width .5s ease; }
.rp-tone-caution .rpb-goal-fill { background: var(--rp-caution); }

.rpb-couple { display: flex; flex-direction: column; gap: 12px; }
.rpb-couple-sentence { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--rp-text); }
.rpb-couple-total { display: flex; flex-direction: column; gap: 6px; }
.rpb-couple-legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--rp-muted); }
.rpb-couple-legend.is-partner { justify-content: flex-end; }
.rpb-couple-legend strong { color: var(--rp-text); }
.rpb-couple-bar { display: block; height: 14px; border-radius: 7px; background: var(--rp-track); }
.rpb-couple-lines { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rpb-couple-line { --rp-cat: var(--rp-indigo); display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(0, 2fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.rpb-couple-line .rpb-line-name { font-size: 12.5px; font-weight: 600; }
.rpb-couple-line .rpb-line-name .tx-glyph { margin-right: 4px; color: var(--rp-cat); }
.rpb-couple-line-bar { display: block; height: 10px; border-radius: 5px; background: var(--rp-track); overflow: hidden; }
.rpb-couple-line-figures { display: inline-flex; gap: 10px; font-weight: 650; white-space: nowrap; }
.rp-text-you { color: var(--rp-you); }
.rp-text-partner { color: var(--rp-partner); }

@media (max-width: 575.98px) {
    .rpb-couple-line { grid-template-columns: minmax(0, 1fr) auto; }
    .rpb-couple-line-bar { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ Money moves */
.rpb-moves { display: flex; flex-direction: column; gap: 14px; }
.rpb-moves-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.rpb-moves-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rpb-timeline { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rpb-move { display: grid; grid-template-columns: 58px auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; transition: background-color .15s ease; }
.rpb-move:hover { background: var(--rp-row-hover); }
.rpb-move-when { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--rp-muted); }
.rpb-move-when strong { color: var(--rp-text); }
.rpb-move-when small { font-size: 10.5px; white-space: nowrap; }
.rpb-move-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--rp-tone-soft); color: var(--rp-tone); font-size: 12px; }
.rpb-move-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--rp-text); }
.rpb-move-text em { font-style: normal; font-weight: 600; }
.rpb-move-text small { font-size: 11.5px; color: var(--rp-muted); }
.rpb-move.is-partner .rpb-move-text small { color: var(--rp-partner); }

@media (max-width: 575.98px) {
    .rpb-moves-flows { grid-template-columns: minmax(0, 1fr); }
    .rpb-move { grid-template-columns: auto minmax(0, 1fr); }
    .rpb-move-when { grid-column: 1 / -1; flex-direction: row; gap: 8px; }
}

/* ------------------------------------------------------------------ Alerts and automations */
.rpb-alerts { display: flex; flex-direction: column; gap: 12px; }
.rpb-alerts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rpb-alert-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rpb-alert { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.rpb-alert-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: var(--rp-tone-soft); color: var(--rp-tone); font-size: 11px; }
.rpb-alert-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 12.5px; color: var(--rp-text); }
.rpb-alert-text small { font-size: 11px; color: var(--rp-muted); }
.rpb-automations { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rpb-automation { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border: 1px solid var(--rp-tile-border); border-radius: 12px; background: var(--rp-tile); }
.rpb-automation.is-off { opacity: .65; }
.rpb-automation-fires { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--rp-accent-soft); color: var(--rp-accent); font-size: 14px; font-weight: 700; }
.rpb-automation-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 13px; color: var(--rp-text); }
.rpb-automation-text small { flex-basis: 100%; font-size: 11.5px; line-height: 1.45; color: var(--rp-muted); }

@media (max-width: 767.98px) {
    .rpb-alerts-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ Table, welcome */
.rpb-grid .rp-grid-name { display: inline-flex; align-items: center; gap: 8px; }
.rpb-grid-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: color-mix(in srgb, var(--rp-cat) 16%, transparent); color: var(--rp-cat); font-size: 10px; }

.rpb-welcome { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; background: var(--bg-hero-bg); border-color: var(--bg-hero-border); }
.rpb-welcome h2 { margin: 0; font-family: var(--tx-font); font-size: 22px; font-weight: 650; color: var(--rp-text); }
.rpb-welcome-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--bg-icon); color: #FFFFFF; font-size: 20px; box-shadow: 0 10px 24px rgba(192, 38, 211, .3); }
[data-bs-theme="dark"] .rpb-welcome-icon { color: #10131C; }
.rpb-welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }

/* ------------------------------------------------------------------ Print */
@media print {
    body.rp-printing .rpb-board-tools, body.rp-printing .rpb-heat-tools, body.rp-printing .rp-show-all { display: none !important; }
    body.rp-printing .ah.rpb-hero { background: #FFFFFF; box-shadow: none; }
    body.rp-printing .rpb-axis-tip, body.rp-printing .rpb-hero-dot::after { display: none !important; }
    body.rp-printing .rpb-stacks { display: block; }
    body.rp-printing .rpb-stack > * { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .rpb-heat-cell, .rpb-line, .rpb-axis-col, .rpb-axis-tip, .rpb-health-bar, .rpb-period, .rpb-period-fill { transition: none !important; }
    .rpb-attn::after, .rpb-attn-icon, .rpb-attn-dot::after, .rpb-hero.is-animated *, .rpb-gauge-spark,
    .rpb-hero-dot, .rpb-hero-dot::after, .rpb-hero-tag, .rpb-split, .rpb-gauge-arc, .rpb-gauge-seg, .rpb .rp-card.rp-flash { animation: none !important; }
}
