/* =====================================================================================================================
   Liabilities insights: the Payoff plan (pp-), the pay-more what-if sliders (lw-) and the Credit Cards sections (lc-).
   Loaded after liabilities-area.css, whose lb- tokens, glass tiles (ln-tile), bars and pills these build on; the page
   rows and boards come from ci-layout.css (ci-row, ci-board) with the lb-col-N spans below.
   The sliders are the Reports what-if slider (rpw-, reports-pages.css) in the liabilities tokens, with their own prefix
   so neither set of rules reaches the other. Paid down, saved or sooner reads in the paid-off blue (--lb-positive),
   and debt fades from the liability rose into it.
   ===================================================================================================================== */

:root {
    --lw-hue-1: var(--lb-positive);
    --lw-hue-2: #0EA5E9;
    --lw-hue-3: #64748B;
    --lw-hue-4: #0D9488;
    --lw-hue-5: #0891B2;
    --lw-hue-6: #9F1239;
    --lw-surface: #FFFFFF;
    --lw-box: rgba(15, 23, 42, .035);
    --lw-box-border: rgba(15, 23, 42, .09);
    --pp-required: #64748B;
    --pp-existing: #3E6A9A;
    --pp-extra: var(--lb-positive);
}

[data-bs-theme="dark"] {
    --lw-hue-1: var(--lb-positive);
    --lw-hue-2: #60A5FA;
    --lw-hue-3: #A9B4C6;
    --lw-hue-4: #2DD4BF;
    --lw-hue-5: #22D3EE;
    --lw-hue-6: #FDA4AF;
    --lw-surface: #171D2C;
    --lw-box: rgba(255, 255, 255, .035);
    --lw-box-border: rgba(255, 255, 255, .09);
    --pp-required: #94A3B8;
    --pp-existing: #8DB4DC;
    --pp-extra: var(--lb-positive);
}

/* ------------------------------------------------------------------ Row spans (ci-row is twelve columns) */

.lb-col-4 { grid-column: span 4; }
.lb-col-5 { grid-column: span 5; }
.lb-col-6 { grid-column: span 6; }
.lb-col-7 { grid-column: span 7; }
.lb-col-8 { grid-column: span 8; }
.lb-col-12 { grid-column: 1 / -1; }

@media (max-width: 1199.98px) {
    .lb-col-4, .lb-col-5, .lb-col-7, .lb-col-8 { grid-column: 1 / -1; }
}

@media (max-width: 767.98px) {
    .lb-col-6 { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ Payoff plan: hero */

/* The status, the journey line and the plan against minimums on the left; the glass tiles fill the rest of the width
   (three across in two rows, one row of six on a very wide window, two across then one on a narrow one). */
.ln-hero.pp-hero {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    align-items: stretch;
    gap: 18px 26px;
    padding: 22px;
}

.pp-lead { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pp-lead > .ln-muted { margin: 0; font-size: 12px; }

.pp-journey { display: flex; flex-direction: column; gap: 6px; }
.pp-journey-track {
    position: relative;
    height: 8px;
    margin: 12px 12px 4px;
    border-radius: 999px;
    /* Today in the liability rose, through violet, to the paid-off blue on the debt-free month. */
    background: linear-gradient(90deg, color-mix(in srgb, var(--lb-rose) 80%, transparent) 0%, color-mix(in oklab, var(--lb-rose) 50%, var(--lb-positive)) 55%, var(--lb-positive) 100%);
}
.pp-journey-dot {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2px solid var(--lb-rose);
    border-radius: 50%;
    background: var(--lw-surface);
    color: var(--lb-text);
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: default;
}
.pp-journey-dot.is-last { border-color: var(--lb-positive); background: var(--lb-positive); color: var(--lb-on-positive); }
[data-bs-theme="dark"] .pp-journey-dot.is-last { color: #0B1220; }
.pp-journey-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 600; color: var(--lb-muted); }
.pp-journey-ends span:last-child { color: var(--lb-positive); }
.pp-journey-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.pp-journey-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 9px 3px 4px;
    border-radius: 999px;
    background: var(--lb-neutral-soft);
    font-size: 11.5px;
    color: var(--lb-text);
}
.pp-journey-list li .fa-solid { font-size: 10px; color: var(--lb-icon); }
.pp-journey-list small { color: var(--lb-muted); white-space: nowrap; }
.pp-journey-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pp-journey-n { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--lb-icon-bg); color: var(--lb-icon); font-size: 10px; font-weight: 700; }
.pp-journey-list li.pp-journey-more { padding: 3px 9px; color: var(--lb-muted); }

.pp-versus {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--lb-positive-soft);
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--lb-text);
}
.pp-versus .fa-solid { margin-top: 3px; color: var(--lb-positive); }

.pp-tiles-box { min-width: 0; container-type: inline-size; container-name: pptiles; }
.pp-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; height: 100%; }
.pp-tiles .pp-tile { grid-column: span 2; gap: 5px; min-width: 0; padding: 14px 15px; }
.pp-tiles.has-5 .pp-tile:nth-child(n+4),
.pp-tiles.has-4 .pp-tile { grid-column: span 3; }
.pp-tiles .pp-tile .ln-tile-value { font-size: 22px; line-height: 1.15; }
.pp-tiles .pp-tile .ln-tile-detail { font-size: 12px; }
.pp-tiles .pp-tile .ln-tile-detail strong { color: var(--lb-text); }
.pp-tile-means { margin: auto 0 0; padding-top: 6px; font-size: 11px; line-height: 1.4; color: var(--lb-muted); }
.ln-tile .ln-tile-value.ln-positive { color: var(--lb-positive); }
.ln-tile .ln-tile-value.ln-caution { color: var(--lb-caution); }
.pp-tile-means strong { color: var(--lb-text); font-variant-numeric: tabular-nums; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.pp-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pp-bar-split { height: 6px; margin-top: 4px; }
.pp-fill-cost { background: var(--lb-glow-cost, var(--lb-caution)); }
.pp-fill-progress { background: var(--lb-positive); }
.pp-fill-muted { background: color-mix(in srgb, var(--lb-text) 30%, transparent); }
.pp-compare { display: grid; gap: 4px; margin-top: 4px; }
.pp-compare-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: center; }
.pp-compare-row em { font-style: normal; font-size: 10.5px; color: var(--lb-muted); }
.pp-compare-row .ln-bar { height: 6px; }
.pp-budget { display: flex; gap: 2px; height: 8px; margin-top: 4px; overflow: hidden; border-radius: 999px; background: var(--lb-track); }
.pp-budget-seg { display: block; height: 100%; }
.pp-budget-seg.is-required { background: var(--pp-required); }
.pp-budget-seg.is-existing { background: var(--pp-existing); }
.pp-budget-seg.is-extra { background: var(--pp-extra); }
.ln-dot.pp-budget-seg { height: 8px; }

/* A preview on screen (the slider is moving): the figures are a what-if until it is let go. */
.pp-hero.is-preview { border-color: color-mix(in srgb, var(--lb-caution) 55%, transparent); }

@container pptiles (min-width: 1240px) {
    .pp-tiles.has-6 .pp-tile { grid-column: span 1; }
    .pp-tiles.has-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .pp-tiles.has-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pp-tiles.has-5 .pp-tile,
    .pp-tiles.has-5 .pp-tile:nth-child(n+4),
    .pp-tiles.has-4 .pp-tile { grid-column: span 1; }
}

@container pptiles (max-width: 600px) {
    .pp-tiles .pp-tile,
    .pp-tiles.has-5 .pp-tile:nth-child(n+4) { grid-column: span 3; }
    .pp-tiles.has-5 .pp-tile:last-child { grid-column: 1 / -1; }
}

@container pptiles (max-width: 360px) {
    .pp-tiles .pp-tile,
    .pp-tiles.has-5 .pp-tile:nth-child(n+4) { grid-column: 1 / -1; }
}

@media (max-width: 1399.98px) {
    .ln-hero.pp-hero { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .ln-hero.pp-hero { padding: 16px; }
}

/* ------------------------------------------------------------------ Payoff plan: Make it yours */

.pp-studio-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 30px; align-items: start; }
.pp-studio-part { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pp-studio-part > .ln-toggle { margin-top: 2px; }
.pp-studio-part > .ln-muted { margin: 0; font-size: 12px; }

.ln-strategies.pp-strategies { margin: 0; gap: 10px; }
.ln-strategy.pp-strategy { gap: 7px; height: 100%; padding: 14px; border-radius: 14px; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.ln-strategy.pp-strategy:hover { border-color: var(--lb-icon); }
.ln-strategy.pp-strategy:focus-visible { outline: 2px solid var(--lb-icon); outline-offset: 2px; }
/* Selected strategy: neutral surface, whisper-faint diagonal hatch, accent edge + corner check. No red fill. */
.ln-strategy.pp-strategy { position: relative; }
.ln-strategy.pp-strategy.is-selected {
    background-color: var(--lb-input-bg);
    background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--lb-text) 5%, transparent) 0 1px, transparent 1px 9px);
    border-color: color-mix(in srgb, var(--lb-icon) 70%, transparent);
    box-shadow: none;
}
.pp-strategy.is-selected .pp-strategy-tags { padding-right: 34px; }
.pp-strategy-mark { position: absolute; right: 12px; bottom: 11px; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 15px; color: var(--lb-icon); background: var(--lb-input-bg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lb-icon) 35%, transparent); }
.pp-strategy-mark .fa-solid { color: inherit; }
.pp-strategy .ln-strategy-title { font-size: 15px; }
.pp-strategy-figures { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pp-strategy-figures > span { display: flex; flex-direction: column; gap: 1px; }
.pp-strategy-figures small { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pp-strategy-figures strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.ln-strategy small.pp-strategy-why { line-height: 1.4; }
.pp-strategy-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 2px; }
.pp-strategy-compare { font-size: 11px; font-weight: 600; color: var(--lb-muted); }
.pp-strategy-compare.is-good { color: var(--lb-positive); }

.pp-save { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 11.5px; color: var(--lb-muted); }
.pp-save.is-saved .fa-solid { color: var(--lb-positive); }
.pp-save.is-preview { color: var(--lb-caution); }
.pp-save.is-error { color: var(--lb-negative); }

@media (max-width: 1199.98px) {
    .pp-studio-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .ln-strategies.pp-strategies { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ What-if sliders (lw-) */

.lw { --lw-color: var(--lb-positive); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 20px; }
.lw-head label { margin: 0; }

.lw-total {
    display: grid;
    /* The headline takes what it needs (never more than 46%), the results the rest. */
    grid-template-columns: fit-content(46%) minmax(0, 1fr);
    align-items: center;
    gap: 10px 32px;
    padding: 14px 16px;
    border: 1px solid var(--lw-box-border);
    border-radius: 14px;
    background: var(--lw-box);
    transition: background-color .3s ease, border-color .3s ease;
}
.lw-total.is-on { border-color: color-mix(in srgb, var(--lb-positive) 35%, transparent); background: var(--lb-positive-soft); }
.lw-total-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.lw-caption { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lb-muted); }
.lw-value { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--lb-text); white-space: nowrap; }
.lw-total.is-on .lw-value { color: var(--lb-positive); }
.lw-value small { margin-left: 2px; font-size: 13px; font-weight: 500; color: var(--lb-muted); }
.lw-sub { font-size: 12px; color: var(--lb-muted); }

.lw-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px 20px; min-width: 0; transition: opacity .2s ease; }
.lw-results.is-stale { opacity: .5; }
.lw-result { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lw-result small { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lb-muted); }
.lw-result strong { font-size: 17px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--lb-text); }
.lw-result em { min-height: 1em; font-style: normal; font-size: 11.5px; color: var(--lb-muted); }
.lw-result em.ln-positive { color: var(--lb-positive); font-weight: 600; }
.lw .lw-quiet { color: var(--lb-muted); }

.lw-total-meter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lw-meter-track { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: var(--lb-track); }
.lw-meter-seg { height: 100%; background: var(--lw-color); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.lw-meter-seg + .lw-meter-seg { box-shadow: inset 2px 0 0 var(--lw-surface); }
.lw-meter-note { font-size: 11.5px; color: var(--lb-muted); }
.lw-meter-note strong { color: var(--lb-positive); }

.lw-slider { position: relative; min-width: 0; }
.lw-ticks { position: absolute; inset: 50% 10px auto; height: 0; pointer-events: none; }
.lw-ticks i { position: absolute; left: calc(var(--p, 0) * 100%); width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--lb-text); opacity: .38; }

.lw-range {
    --lw-fill: 0%;
    display: block;
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.lw-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lw-color) 0 var(--lw-fill), var(--lb-track) var(--lw-fill) 100%);
}
.lw-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--lb-track); }
.lw-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--lw-color); }
.lw-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
    border: 3px solid var(--lw-surface);
    border-radius: 50%;
    background: var(--lw-color);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .28);
    transition: transform .12s ease;
    -webkit-appearance: none;
}
.lw-range::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--lw-surface); border-radius: 50%; background: var(--lw-color); box-shadow: 0 1px 6px rgba(0, 0, 0, .28); }
.lw-range:hover::-webkit-slider-thumb,
.lw-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.lw-range:focus { outline: none; }
.lw-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lw-color) 35%, transparent); }
.lw-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lw-color) 35%, transparent); }

.lw-scale { display: flex; justify-content: space-between; gap: 12px; margin-top: -8px; font-size: 10.5px; color: var(--lb-muted); }

.lw-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lw-presets-label { margin-right: 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lb-muted); }
.lw-preset {
    padding: 4px 11px;
    border: 1px solid var(--lw-box-border);
    border-radius: 999px;
    background: transparent;
    color: var(--lb-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.lw-preset:hover { border-color: var(--lb-positive); color: var(--lb-positive); }
.lw-preset.is-active { border-color: var(--lb-positive); background: var(--lb-positive-soft); color: var(--lb-positive); }
.lw-preset:focus-visible { outline: 2px solid var(--lb-positive); outline-offset: 2px; }

/* The exact-amount box beside the quick picks. */
.lw-amount {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 auto;
    padding: 3px 10px;
    border: 1px solid var(--lb-input-border);
    border-radius: 999px;
    background: var(--lb-input-bg);
    font-size: 12px;
    color: var(--lb-muted);
    cursor: text;
}
.lw-amount input { width: 68px; padding: 0; border: 0; background: transparent; color: var(--lb-text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.lw-amount:focus-within { border-color: var(--lb-positive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lb-positive) 22%, transparent); }

/* One loan: today's payment against the pick, as two bars. */
.lw-compare { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--lb-text); }
.lw-compare-label { font-weight: 600; white-space: nowrap; }
.lw-compare strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-compare .ln-bar-fill { background: var(--lb-positive); transition: width .25s cubic-bezier(.2, .8, .2, 1); }
.lw-compare .ln-bar-fill.lw-fill-today { background: color-mix(in srgb, var(--lb-text) 34%, transparent); }
.lw-note { margin: 0; font-size: 11.5px; }
.lw-apply { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 12px; color: var(--lb-muted); }
.lw-reset,
.lw-card .rc-card-actions .lb-link-btn { font-size: 12px; }

/* A loan area: one row per loan, every row on the same three tracks so the sliders line up. */
.lw-card .rc-card-body { container-type: inline-size; container-name: lw; }
.lw-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.lw-row {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr) 9.5rem;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 6px;
    border-top: 1px solid var(--lw-box-border);
    border-radius: 10px;
    transition: background-color .2s ease;
}
.lw-row:first-child { border-top: 0; }
.lw-row:hover,
.lw-row:focus-within { background: color-mix(in srgb, var(--lw-color) 7%, transparent); }
.lw-label { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-width: 0; margin: 0; cursor: pointer; }
.lw-chip { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ci-icon-pill); color: var(--lw-color); font-size: 13px; }
.lw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--lb-text); }
.lw-usual { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--lb-muted); }
.lw-out { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 0; text-align: right; }
.lw-out strong { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-out small { font-size: 11px; color: var(--lb-muted); }

@container lw (max-width: 560px) {
    .lw-board .lw-total { grid-template-columns: minmax(0, 1fr); }
    .lw-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
    .lw-row .lw-slider { grid-column: 1 / -1; grid-row: 2; }
}

@container lw (min-width: 900px) {
    .lw-row { grid-template-columns: 300px minmax(0, 1fr) minmax(11rem, 17rem); }
    .lw-out small { white-space: nowrap; }
}

/* In a loan's own column (its card, the flyout) the headline stacks when there is no room for two columns. */
.lw-loan { container-type: inline-size; container-name: lwloan; }
@container lwloan (max-width: 420px) {
    .lw-loan .lw-total { grid-template-columns: minmax(0, 1fr); }
    .lw-loan .lw-compare { grid-template-columns: minmax(0, 1fr) auto; }
    .lw-loan .lw-compare .ln-bar { grid-column: 1 / -1; order: 1; }
    .lw-loan .lw-compare .ln-bar + strong { order: 0; }
}

.pp-extra { container-type: inline-size; container-name: ppextra; }
@container ppextra (max-width: 520px) {
    .pp-extra .lw-total { grid-template-columns: minmax(0, 1fr); }
    .pp-extra .lw-amount { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lw-meter-seg, .lw-total, .lw-row, .lw-results, .lw-compare .ln-bar-fill, .lw-range::-webkit-slider-thumb { transition: none; }
}

/* ------------------------------------------------------------------ Payoff plan: chart, this month, order, a little more */

/* The scale's labels and grid lines sit where the line is drawn: the view sets --pp-top and --pp-mid from the model's
   own axis (DebtPayoffPlanModel.ChartScaleStyle); the values here are that axis today (4% of headroom), as a fallback. */
.pp-chart { --pp-chart-h: clamp(230px, 17vw, 300px); --pp-top: 3.846%; --pp-mid: 51.923%; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.pp-chart .ln-chart {
    height: var(--pp-chart-h);
    border-bottom: 1px solid var(--lw-box-border);
    background: linear-gradient(to bottom,
        transparent calc(var(--pp-top) - .5px), var(--lw-box-border) calc(var(--pp-top) - .5px), var(--lw-box-border) calc(var(--pp-top) + .5px), transparent calc(var(--pp-top) + .5px),
        transparent calc(var(--pp-mid) - .5px), var(--lw-box-border) calc(var(--pp-mid) - .5px), var(--lw-box-border) calc(var(--pp-mid) + .5px), transparent calc(var(--pp-mid) + .5px));
}
.pp-chart-y { display: grid; height: var(--pp-chart-h); font-size: 10.5px; color: var(--lb-muted); font-variant-numeric: tabular-nums; text-align: right; }
.pp-chart-y span { grid-area: 1 / 1; align-self: start; position: relative; line-height: 1; transform: translateY(-50%); }
.pp-chart-y span:nth-child(1) { top: var(--pp-top); }
.pp-chart-y span:nth-child(2) { top: var(--pp-mid); }
.pp-chart-y span:nth-child(3) { top: 100%; transform: translateY(-90%); }
.pp-chart-marks { grid-column: 2; }
.pp-chart-marks { position: relative; height: 22px; margin-top: 2px; }
.pp-chart-mark {
    position: absolute;
    top: 2px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: var(--lb-icon-bg);
    color: var(--lb-icon);
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    cursor: default;
}
.pp-chart-mark.is-last { background: var(--lb-positive); color: var(--lb-on-positive); }
[data-bs-theme="dark"] .pp-chart-mark.is-last { color: #0B1220; }
.pp-chart-mark.is-key { position: static; display: inline-grid; margin: 0; }

.pp-pay { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.pp-pay li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 11px; }
.pp-pay li.is-focus { background: var(--lb-icon-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lb-icon) 45%, transparent); }
.pp-pay-glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ci-icon-pill); color: var(--lb-icon); font-size: 12px; }
.pp-pay-name { display: flex; flex-direction: column; min-width: 0; }
.pp-pay-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--lb-text); }
.pp-pay-name small { font-size: 11px; color: var(--lb-muted); }
.pp-pay-amount { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--lb-text); }
.pp-pay-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: auto 0 0; padding: 10px 10px 0; border-top: 1px solid var(--lw-box-border); font-size: 12.5px; color: var(--lb-muted); }
.pp-pay-total strong { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--lb-text); }

.pp-order { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; container-type: inline-size; container-name: pporder; }
.pp-order-row {
    display: grid;
    grid-template-columns: 30px minmax(170px, 1.25fr) 96px minmax(120px, 3fr) 108px minmax(120px, 170px);
    gap: 6px 16px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 12px;
}
.pp-order-row + .pp-order-row { border-top: 1px solid var(--lw-box-border); }
.pp-order-row.is-focus { background: var(--lb-icon-bg); border-top-color: transparent; }
.pp-order-row.is-focus + .pp-order-row { border-top-color: transparent; }
.pp-order-row small { font-size: 11px; color: var(--lb-muted); }
.pp-order-debt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-order-debt .ln-step-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13.5px; color: var(--lb-text); }
.pp-order-debt .ln-step-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-order-debt .ln-step-name .fa-solid { color: var(--lb-icon); font-size: 12px; }
.pp-order-balance,
.pp-order-end,
.pp-order-cost { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; color: var(--lb-text); }
.pp-order-balance { align-items: flex-end; }
.pp-order-balance strong,
.pp-order-end strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-order-cost { align-items: flex-end; gap: 4px; text-align: right; }
.pp-order-cost strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pp-order-time .ln-bar { height: 10px; border-radius: 999px; }
.pp-order-time .ln-bar-fill { border-radius: 999px; }
/* Each debt's bar starts in the rose and turns the paid-off blue in the month it clears. */
.pp-order-time .ln-bar-fill { background: linear-gradient(90deg, var(--lb-rose) 0%, color-mix(in oklab, var(--lb-rose) 50%, var(--lb-positive)) 55%, var(--lb-positive) 100%); }

@container pporder (max-width: 820px) {
    .pp-order-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
    .pp-order-time { grid-column: 2 / -1; }
    .pp-order-end { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; }
    .pp-order-cost { grid-column: 3; }
}

.pp-more { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pp-more-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lw-box-border);
    border-radius: 12px;
    background: var(--lw-box);
    color: var(--lb-text);
    font-size: 12.5px;
    text-align: left;
}
button.pp-more-row { cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
button.pp-more-row:hover { border-color: var(--lb-positive); background: var(--lb-positive-soft); }
button.pp-more-row:focus-visible { outline: 2px solid var(--lb-positive); outline-offset: 2px; }
.pp-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pp-more-head span { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-more-row .ln-bar-fill { background: var(--lb-positive); }
.pp-more-row.is-current .ln-bar-fill { background: color-mix(in srgb, var(--lb-text) 34%, transparent); }
.pp-more-row small { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 11px; color: var(--lb-muted); }
.pp-more-row small em { font-style: normal; }

/* ------------------------------------------------------------------ Credit Cards (lc-) */

/* The hero's ring is utilization: the paid-off blue under 30%, amber to 70%, red above. */
.lc-ring.is-caution .ln-ring-fill { stroke: var(--lb-caution); }
.lc-ring.is-negative .ln-ring-fill { stroke: var(--lb-negative); }
.lc-ring.is-none .ln-ring-fill { stroke: transparent; }
.lc-teal { color: var(--lb-glow-reserve, #0D9488); }
@media (min-width: 1400px) {
    .ln-hero.ln-area-hero.lc-hero { grid-template-columns: minmax(340px, 470px) minmax(0, 1fr); }
}
.lc-hero-tiles .ln-tile { padding: 13px 14px; }
.lc-hero-tiles .ln-tile .ln-tile-value { font-size: 20px; line-height: 1.15; }
.lc-hero-tiles .ln-tile .ln-tile-value.is-missing { font-size: 14px; }

.lc-fill-positive { background: var(--lb-positive); }
.lc-fill-caution { background: var(--lb-caution); }
.lc-fill-negative { background: var(--lb-negative); }
.lc-fill-none { background: var(--lb-track); }
.lc-text-positive { color: var(--lb-positive); }
.lc-text-caution { color: var(--lb-caution); }
.lc-text-negative { color: var(--lb-negative); }
.lc-text-none { color: var(--lb-muted); }

/* A utilization bar with the 30% mark standing proud of it. */
.ln-bar.lc-use-bar,
.ln-bar.lc-tile-bar { position: relative; overflow: visible; border-radius: 999px; }
.lc-use-bar .ln-bar-fill,
.lc-tile-bar .ln-bar-fill { border-radius: 999px; transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.lc-tile-bar { height: 6px; margin-top: 5px; }
.lc-bar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--lb-text); opacity: .5; }
.lc-use-bar.is-empty { background: repeating-linear-gradient(135deg, var(--lb-track) 0 6px, transparent 6px 12px); }

/* The view menu (a SegmentedScroller): no margin of its own inside the page's stack, and no wider than its labels need. */
.seg-scroller.lc-viewbar { max-width: 920px; margin: 0; }

/* Compare your cards. */
.lc-table-card .rc-card-body { padding-top: 2px; }
.ln-table.lc-table { min-width: 900px; }
.ln-table.lc-table th, .ln-table.lc-table td { padding-left: 10px; padding-right: 10px; }
.lc-table td small { margin-top: 1px; }
/* The table's own "td small" is muted: a status line under a cell keeps its status color. */
.ln-table.lc-table td small.ln-positive { color: var(--lb-positive); }
.ln-table.lc-table td small.ln-caution { color: var(--lb-caution); }
.ln-table.lc-table td small.ln-negative { color: var(--lb-negative); }
.lc-use { display: inline-flex; align-items: center; gap: 9px; min-width: 150px; }
.lc-use .lc-use-bar { flex: 1 1 auto; min-width: 84px; height: 7px; }
.lc-use-text { min-width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lc-flag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--lb-accent-soft); color: var(--lb-accent); font-size: 10px; font-weight: 700; }
.lc-due { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--lb-neutral-soft); color: var(--lb-muted); font-size: 10.5px; font-weight: 700; }
.lc-due.is-late { background: var(--lb-negative-soft); color: var(--lb-negative); }
.lc-due.is-imminent { background: var(--lb-caution-soft); color: var(--lb-caution); }
.lc-due.is-settled,
.lc-due.is-minpaid { background: var(--lb-positive-soft); color: var(--lb-positive); }
.lc-habit { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--lb-neutral-soft); color: var(--lb-text); font-size: 11px; font-weight: 600; }
.lc-habit.is-positive { background: var(--lb-positive-soft); color: var(--lb-positive); }
.lc-habit.is-negative { background: var(--lb-negative-soft); color: var(--lb-negative); }

/* What stands out. */
/* Across the page: as many columns as fit at 380px or more, never more than three (a column is at least 30% wide). */
.lc-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(30%, min(100%, 380px)), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.lc-insights > li { display: flex; min-width: 0; }
.lc-insight {
    --lc-tone: var(--lb-muted);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lw-box-border);
    border-radius: 13px;
    background: var(--lw-box);
    color: var(--lb-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.lc-insight.is-critical { --lc-tone: var(--lb-negative); }
.lc-insight.is-caution { --lc-tone: var(--lb-caution); }
.lc-insight.is-positive { --lc-tone: var(--lb-positive); }
.lc-insight.is-neutral { --lc-tone: var(--lb-accent); }
.lc-insight:hover { border-color: color-mix(in srgb, var(--lc-tone) 55%, transparent); background: color-mix(in srgb, var(--lc-tone) 8%, transparent); }
.lc-insight:focus-visible { outline: 2px solid var(--lc-tone); outline-offset: 2px; }
.lc-insight-glyph { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--ci-icon-pill); color: var(--lc-tone); font-size: 13px; }
.lc-insight-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lc-insight-text strong { font-size: 13px; line-height: 1.3; }
.lc-insight-text small { font-size: 11.5px; line-height: 1.4; color: var(--lb-muted); }
.lc-insight-go { font-size: 10px; color: var(--lb-muted); }

/* Utilization by card. */
.lc-usage { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; container-type: inline-size; container-name: lcusage; }
.lc-usage-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(160px, 2fr) minmax(150px, 210px);
    align-items: center;
    gap: 6px 18px;
    padding: 12px 6px;
    border-top: 1px solid var(--lw-box-border);
}
.lc-usage-row:first-child { border-top: 0; }
.lc-usage-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; color: var(--lb-text); text-align: left; cursor: pointer; }
.lc-usage-card:hover strong { color: var(--lb-rose); }
.lc-usage-card:focus-visible { outline: 2px solid var(--lb-rose); outline-offset: 3px; border-radius: 8px; }
.lc-usage-name { display: flex; flex-direction: column; min-width: 0; }
.lc-usage-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lc-usage-name small { font-size: 11px; color: var(--lb-muted); }
.lc-usage-meter { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lc-usage-meter .lc-use-bar { height: 10px; }
.lc-usage-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lc-usage-out { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; text-align: right; }
.lc-usage-out strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.lc-usage-out small { font-size: 11px; color: var(--lb-muted); }
.lc-usage-out small.ln-positive { color: var(--lb-positive); }
.lc-usage-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: auto; padding-top: 12px; font-size: 11.5px; color: var(--lb-muted); }
.lc-usage-legend span { display: inline-flex; align-items: center; gap: 6px; }

@container lcusage (max-width: 620px) {
    .lc-usage-row { grid-template-columns: minmax(0, 1fr) auto; }
    .lc-usage-meter { grid-column: 1 / -1; grid-row: 2; }
}

.lc-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--lb-accent); text-decoration: none; }
.lc-link:hover { text-decoration: underline; }
.lc-link:focus-visible { outline: 2px solid var(--lb-accent); outline-offset: 2px; border-radius: 4px; }

/* The statement cycles spread across the page instead of one long column. */
.lb-page-cards .lb-cycle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; }
.lb-page-cards .lb-minimum-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }

@media (prefers-reduced-motion: reduce) {
    .lc-use-bar .ln-bar-fill, .lc-tile-bar .ln-bar-fill, .lc-insight { transition: none; }
}
