/* =====================================================================================================================
   Liabilities visuals: the Payoff page's debt chart (dtl-), the card spending rules and their alerts in the Investment
   Rules recipe (lbr-), and the Credit Utilization lens on the dashboard (lbu-).
   Loaded after liabilities-area.css and liabilities-insights.css, on their lb- tokens. One color story runs through it:
   debt starts in the liability rose and fades, through violet, into the paid-off blue (--lb-positive, the accent) as it
   is paid down. Surfaces stay neutral; color sits on lines, bars, glyphs and edges.
   ===================================================================================================================== */

:root {
    --dtl-c0: var(--lb-rose);
    --dtl-c2: var(--lb-positive);
    --dtl-c1: color-mix(in oklab, var(--dtl-c0) 50%, var(--dtl-c2));
    --dtl-fade: linear-gradient(90deg, var(--dtl-c0) 0%, var(--dtl-c1) 55%, var(--dtl-c2) 100%);
    --dtl-glass: rgba(255, 255, 255, .84);
    --dtl-glass-border: rgba(15, 23, 42, .09);
    --dtl-glass-shadow: 0 22px 44px -18px rgba(15, 23, 42, .32), 0 2px 6px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .7);
    --dtl-grid: rgba(15, 23, 42, .07);
    --dtl-ring: #FFFFFF;
}

[data-bs-theme="dark"] {
    --dtl-glass: rgba(21, 27, 40, .86);
    --dtl-glass-border: rgba(255, 255, 255, .12);
    --dtl-glass-shadow: 0 22px 44px -18px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06);
    --dtl-grid: rgba(255, 255, 255, .07);
    --dtl-ring: #151B28;
}

/* The TOTAL DEBT hero's "paid down" (the change, the dots, the swatches) in the paid-off blue too. :root lifts it over
   hero-sections.css's dark-theme --hx-pos, which loads later. */
:root .hx.hx-liabilities { --hx-pos: var(--lb-positive); }

/* The dashboards' "good" (liabilities-dashboards.css --lx-good: the plan's focus row and date pills, what paying more
   would do, the plan against the minimums) and the end of the hero pane's payoff road (--nwp-b, rose fading into it)
   are the paid-off blue as well. That file loads later, so the doubled :root outranks its own :root and dark rules; a
   plan with no date keeps its amber road (.lxp.is-falling sets --nwp-b on the pane itself). */
:root:root { --lx-good: var(--lb-positive); }
:root:root .hx.hx-liabilities { --nwp-b: var(--lb-positive); }

/* PAYOFF ORDER (liabilities-dashboards.css .lxo-row): each debt's bar starts in its kind's color and turns the paid-off
   blue in the month it clears. The row sets its color inline (--c and the fill's background), hence !important. */
.lxo-row .lxo-bar .rp-breakdown-fill {
    background: linear-gradient(90deg, var(--c, var(--lb-rose)) 0%, color-mix(in oklab, var(--c, var(--lb-rose)) 50%, var(--lb-positive)) 55%, var(--lb-positive) 100%) !important;
}

/* ------------------------------------------------------------------ Payoff: the debt chart */

.dtl-card .rc-card-body { overflow: visible; }
.dtl-card .lb-card-actions { gap: 8px; }
.dtl { display: flex; flex-direction: column; gap: 14px; min-width: 0; transition: opacity .2s ease; }
.dtl.is-preview { opacity: .82; }

/* Balance / Timeline */
.dtl-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--lb-neutral-soft); }
.dtl-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 11px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--lb-muted);
    font-size: var(--ci-fs-btn-xs, 12px);
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.dtl-seg-btn .tx-glyph { font-size: 11px; }
.dtl-seg-btn:hover { color: var(--lb-text); }
.dtl-seg-btn.is-on { background: var(--rc-card); color: var(--lb-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.dtl-seg-btn.is-on .tx-glyph { color: var(--lb-positive); }
.dtl-seg-btn:focus-visible { outline: 2px solid var(--lb-positive); outline-offset: 1px; }
.dtl-export-btn { width: 36px; height: 36px; background: var(--lb-neutral-soft); color: var(--lb-text); }
.dtl-export-btn:focus-visible { outline-color: var(--lb-positive); }
.dtl-export { z-index: 6; }
.dtl-export-list { min-width: 250px; z-index: 31; }
.dtl-scrim { position: fixed; inset: 0; z-index: 30; }

/* The strip: first win, halfway, debt-free, then it's yours. Neutral tiles, the glyph carries the hue of where it sits
   on the fade. */
.dtl-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.dtl-insight {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--rc-card-border);
    border-radius: 14px;
    background: var(--rc-card);
}
.dtl-insight.is-start { --dtl-tone: var(--dtl-c0); }
.dtl-insight.is-mid { --dtl-tone: var(--dtl-c1); }
.dtl-insight.is-end { --dtl-tone: var(--dtl-c2); }
.dtl-insight-glyph {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--ci-icon-pill);
    color: var(--dtl-tone);
    font-size: 12px;
}
.dtl-insight-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dtl-insight-text small { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lb-muted); }
.dtl-insight-text strong { font-family: var(--tx-font); font-size: 15px; font-variant-numeric: tabular-nums; color: var(--lb-text); }
.dtl-insight-text em { overflow: hidden; font-size: 11px; font-style: normal; color: var(--lb-muted); text-overflow: ellipsis; white-space: nowrap; }

/* Balance view */
/* Room on the right and under the axis for the debt-free pin, which sits on the last month at zero. */
.dtl-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; min-width: 0; margin-right: 24px; }
.dtl-y { position: relative; min-width: 42px; font-size: 10.5px; color: var(--lb-muted); font-variant-numeric: tabular-nums; text-align: right; }
.dtl-y span { position: absolute; right: 0; line-height: 1; transform: translateY(-50%); white-space: nowrap; }
.dtl-y span:last-child { transform: translateY(-90%); }

.dtl-stage {
    position: relative;
    height: clamp(250px, 19vw, 330px);
    border-bottom: 1px solid var(--lw-box-border, var(--dtl-grid));
    outline: none;
    touch-action: pan-y;
    cursor: crosshair;
}
.dtl-stage:focus-visible { box-shadow: 0 0 0 2px var(--rc-card), 0 0 0 4px color-mix(in srgb, var(--lb-positive) 55%, transparent); border-radius: 6px; }
.dtl-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--dtl-grid); pointer-events: none; }
.dtl-vgrid { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--dtl-grid); pointer-events: none; }

.dtl-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; animation: dtl-reveal 1.1s cubic-bezier(.3, .7, .2, 1) both; }
.dtl-stop-start { stop-color: var(--dtl-c0); }
.dtl-stop-mid { stop-color: var(--dtl-c1); }
.dtl-stop-end { stop-color: var(--dtl-c2); }
.dtl-area { opacity: .3; }
[data-bs-theme="dark"] .dtl-area { opacity: .36; }
.dtl-line { fill: none; stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dtl-glow { fill: none; stroke-width: 9; stroke-linecap: round; opacity: .16; vector-effect: non-scaling-stroke; filter: blur(3px); }
.dtl-cards { fill: none; stroke: var(--lb-credit); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .9; vector-effect: non-scaling-stroke; }

/* A pin on the curve where a debt clears: its logo or glyph in a ring, its number in the hue of where it sits on the
   fade, and a dotted drop to the axis. Same-month payoffs stack upward. */
.dtl-drop {
    --dtl-hue: color-mix(in oklab, var(--dtl-c2) var(--dtl-t, 50%), var(--dtl-c0));
    position: absolute;
    bottom: 0;
    width: 0;
    margin-left: -1px;
    border-left: 2px dotted var(--dtl-hue);
    opacity: .5;
    pointer-events: none;
    transition: opacity .2s ease;
    animation: dtl-drop .5s ease-out both;
    animation-delay: calc(.55s + var(--dtl-i, 1) * 90ms);
}
.dtl-drop.is-hot, .dtl-drop.is-last { opacity: .95; }

.dtl-pin {
    --dtl-hue: color-mix(in oklab, var(--dtl-c2) var(--dtl-t, 50%), var(--dtl-c0));
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--dtl-ring);
    box-shadow: 0 0 0 2px var(--dtl-hue), 0 6px 16px -6px rgba(15, 23, 42, .45);
    transform: translate(-50%, calc(-50% - var(--dtl-stack, 0) * 40px));
    cursor: pointer;
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
    animation: dtl-pin .45s cubic-bezier(.2, 1.4, .4, 1) both;
    animation-delay: calc(.6s + var(--dtl-i, 1) * 90ms);
}
.dtl-pin:hover, .dtl-pin.is-hot, .dtl-pin:focus-visible {
    z-index: 5;
    box-shadow: 0 0 0 3px var(--dtl-hue), 0 0 0 7px color-mix(in srgb, var(--dtl-hue) 18%, transparent), 0 10px 22px -8px rgba(15, 23, 42, .5);
    transform: translate(-50%, calc(-50% - var(--dtl-stack, 0) * 40px)) scale(1.08);
    outline: none;
}
.dtl-pin-face { display: grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; }
.dtl-pin-face .lb-logo { border-radius: 50%; }
.dtl-pin-n {
    position: absolute;
    right: -5px;
    bottom: -4px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--dtl-ring);
    border-radius: 999px;
    background: var(--dtl-hue);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.dtl-pin.is-last { width: 42px; height: 42px; }
.dtl-pin.is-last .dtl-pin-face { width: 32px; height: 32px; }
.dtl-pin.is-last::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--dtl-c2) 40%, transparent);
    animation: dtl-ring 2.6s ease-out 1.8s infinite;
    pointer-events: none;
}

.dtl-cross {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px solid color-mix(in srgb, var(--lb-text) 28%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
.dtl-dot {
    --dtl-hue: color-mix(in oklab, var(--dtl-c2) var(--dtl-t, 50%), var(--dtl-c0));
    position: absolute;
    z-index: 4;
    width: 13px;
    height: 13px;
    margin: -6.5px 0 0 -6.5px;
    border: 3px solid var(--dtl-ring);
    border-radius: 50%;
    background: var(--dtl-hue);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--dtl-hue) 22%, transparent), 0 2px 6px rgba(15, 23, 42, .3);
    opacity: 0;
    pointer-events: none;
    transition: left .08s linear, top .08s linear, opacity .15s ease;
}
.dtl-cross.is-on, .dtl-dot.is-on { opacity: 1; }
.dtl.is-still .dtl-dot { transition: opacity .15s ease; }

/* The glass bubble: the month under the pointer, or a debt's story. */
.dtl-bubble {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 8;
    width: 248px;
    padding: 12px 14px;
    border: 1px solid var(--dtl-glass-border);
    border-radius: 16px;
    background: var(--dtl-glass);
    box-shadow: var(--dtl-glass-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    color: var(--lb-text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility 0s linear .16s, transform .12s cubic-bezier(.2, .8, .2, 1);
}
.dtl-bubble.is-pin { width: 300px; }
.dtl-bubble.is-on { opacity: 1; visibility: visible; transition: opacity .16s ease, visibility 0s, transform .12s cubic-bezier(.2, .8, .2, 1); }
.dtl.is-still .dtl-bubble { transition: opacity .16s ease, visibility 0s; }
.dtl-bubble::after {
    content: "";
    position: absolute;
    left: var(--dtl-notch, 50%);
    bottom: -6px;
    width: 11px;
    height: 11px;
    margin-left: -5.5px;
    border-right: 1px solid var(--dtl-glass-border);
    border-bottom: 1px solid var(--dtl-glass-border);
    background: inherit;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: rotate(45deg);
}
.dtl-bubble.is-right::after,
.dtl-bubble.is-left::after { top: var(--dtl-notch, 50%); bottom: auto; margin: -5.5px 0 0; }
.dtl-bubble.is-right::after { left: -6px; transform: rotate(135deg); }
.dtl-bubble.is-left::after { left: auto; right: -6px; transform: rotate(-45deg); }
.dtl-bubble.is-lane::after { display: none; }

.dtl-b { display: flex; flex-direction: column; gap: 6px; }
.dtl-b-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dtl-b-date { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--lb-muted); }
.dtl-b-pct { font-size: 11px; font-weight: 700; color: var(--lb-positive); white-space: nowrap; }
.dtl-b-value { font-family: var(--tx-font); font-size: 24px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dtl-b-value.is-done { color: var(--lb-positive); }
.dtl-b-sub { margin-top: -4px; font-size: 11.5px; color: var(--lb-muted); }
.dtl-b-bar { position: relative; height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--lb-text) 9%, transparent); }
.dtl-b-bar span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--dtl-fade); background-size: 248px 100%; transition: width .15s ease; }
.dtl-b-split { display: flex; gap: 12px; font-size: 11.5px; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.dtl-b-done { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 0; padding: 7px 0 0; border-top: 1px solid var(--dtl-glass-border); list-style: none; }
.dtl-b-done li { position: relative; padding-left: 18px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dtl-b-done li::before { content: "\f00c"; position: absolute; left: 0; top: 1px; font: var(--fa-font-solid); font-size: 10px; color: var(--lb-positive); }
.dtl-b-done li.is-more { color: var(--lb-muted); }
.dtl-b-done li.is-more::before { content: none; }
.dtl-b-next { font-size: 11.5px; font-weight: 600; color: var(--lb-muted); }

.dtl-b-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dtl-b-face { flex: 0 0 auto; width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--dtl-ring), 0 0 0 3px var(--dtl-glass-border); }
.dtl-b-names { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; line-height: 1.25; }
.dtl-b-names strong { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.dtl-b-names small { font-size: 11px; color: var(--lb-muted); }
.dtl-b-order { flex: 0 0 auto; padding: 2px 8px; border: 1px solid var(--dtl-glass-border); border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--lb-muted); white-space: nowrap; }
.dtl-b-when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 8px 10px; border-radius: 11px; background: color-mix(in srgb, var(--lb-text) 4%, transparent); }
.dtl-b-eyebrow { width: 100%; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--lb-positive); }
.dtl-b-when strong { font-family: var(--tx-font); font-size: 20px; line-height: 1.1; }
.dtl-b-when small { font-size: 11.5px; color: var(--lb-muted); }
.dtl-b-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 2px 0 0; }
.dtl-b-facts div { display: flex; flex-direction: column; min-width: 0; }
.dtl-b-facts dt { font-size: 10px; font-weight: 600; color: var(--lb-muted); }
.dtl-b-facts dd { margin: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dtl-b-how { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0; padding-top: 7px; border-top: 1px solid var(--dtl-glass-border); font-size: 12px; line-height: 1.4; }
.dtl-b-how-label { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lb-muted); }
.dtl-b-frees { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--lb-positive); }
.dtl-b-frees::before { content: "\f062"; font: var(--fa-font-solid); font-size: 10px; transform: rotate(45deg); }
.dtl-b-frees.is-last::before { content: "\f11e"; transform: none; }

/* The time axis */
.dtl-axis { position: relative; height: 18px; margin: 12px 24px 0 calc(42px + 10px); font-size: 10.5px; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.dtl-axis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.dtl-axis span.is-edge:first-child { transform: none; }
.dtl-axis span.is-edge:last-child { transform: translateX(-100%); }

/* Timeline view: a lane per debt, in the order they clear. */
.dtl-lanes {
    --dtl-who-w: 190px;
    --dtl-cost: 92px;
    --dtl-pad-l: 6px;
    --dtl-pad-r: 74px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dtl-lane-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.dtl-lane {
    display: grid;
    grid-template-columns: var(--dtl-who-w) minmax(0, 1fr) var(--dtl-cost);
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 4px 0;
}
.dtl-lane + .dtl-lane { border-top: 1px dashed var(--dtl-grid); }
.dtl-lane-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dtl-lane-who .dtl-pin-face { flex: 0 0 auto; box-shadow: 0 0 0 1px var(--rc-card-border); }
.dtl-lane-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dtl-lane-name strong { overflow: hidden; font-size: 13px; color: var(--lb-text); text-overflow: ellipsis; white-space: nowrap; }
.dtl-lane-name small { overflow: hidden; font-size: 10.5px; color: var(--lb-muted); text-overflow: ellipsis; white-space: nowrap; }
.dtl-lane-cost { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.25; }
.dtl-lane-cost strong { font-size: 13px; color: var(--lb-text); }
.dtl-lane-cost small { font-size: 10.5px; color: var(--lb-muted); white-space: nowrap; }

.dtl-lane-track {
    --dtl-inner: (100% - var(--dtl-pad-l) - var(--dtl-pad-r));
    position: relative;
    display: block;
    height: 30px;
    margin: 0;
    padding: 0 var(--dtl-pad-r) 0 var(--dtl-pad-l);
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
}
.dtl-lane-track::before { content: ""; position: absolute; top: 50%; left: var(--dtl-pad-l); right: var(--dtl-pad-r); height: 2px; margin-top: -1px; border-radius: 1px; background: var(--lb-track); }
.dtl-lane-track:focus-visible { outline: 2px solid var(--lb-positive); outline-offset: 2px; }
.dtl-lane-bar {
    position: absolute;
    top: 50%;
    left: var(--dtl-pad-l);
    display: block;
    height: 12px;
    margin-top: -6px;
    border-radius: 999px;
    background: var(--dtl-fade);
    box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--dtl-c1) 60%, transparent);
    transform-origin: left center;
    animation: dtl-grow .9s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--dtl-i, 1) * 80ms);
}
.dtl-lane.is-focus .dtl-lane-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .32) 0 6px, transparent 6px 14px);
    background-size: 28px 100%;
    animation: dtl-stripes 1.4s linear infinite;
}
.dtl-lane-end { position: absolute; top: 50%; display: inline-flex; align-items: center; gap: 6px; transform: translate(-9px, -50%); pointer-events: none; }
.dtl-lane-cap {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--dtl-ring);
    border-radius: 50%;
    background: var(--dtl-c2);
    color: #FFFFFF;
    font-size: 8.5px;
    font-style: normal;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--dtl-c2) 50%, transparent);
}
.dtl-lane.is-last .dtl-lane-cap { width: 22px; height: 22px; font-size: 9.5px; }
.dtl-lane-end b { font-size: 11px; font-weight: 700; color: var(--lb-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dtl-lane-handoff { position: absolute; top: 5px; bottom: 5px; width: 0; margin-left: -1px; border-left: 2px dotted color-mix(in srgb, var(--lb-muted) 55%, transparent); }
.dtl-lane-track:hover .dtl-lane-bar, .dtl-lane-track.is-hot .dtl-lane-bar { filter: saturate(1.15) brightness(1.03); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dtl-c1) 18%, transparent), 0 4px 14px -4px color-mix(in srgb, var(--dtl-c1) 70%, transparent); }

/* The guides and the axis cover the lanes' inner track exactly, so a payoff month lines up across every lane. */
.dtl-lanes-guides,
.dtl-axis.is-lanes {
    position: absolute;
    left: calc(var(--dtl-who-w) + 12px + var(--dtl-pad-l));
    right: calc(var(--dtl-cost) + 12px + var(--dtl-pad-r));
}
.dtl-lanes-guides { top: -6px; bottom: 22px; pointer-events: none; }
.dtl-lane-guide {
    --dtl-hue: color-mix(in oklab, var(--dtl-c2) var(--dtl-t, 50%), var(--dtl-c0));
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dotted color-mix(in srgb, var(--lb-muted) 40%, transparent);
}
.dtl-lane-guide.is-last { border-left-color: color-mix(in srgb, var(--dtl-c2) 55%, transparent); }
.dtl-lane-guide b { display: none; }
.dtl-axis.is-lanes { position: relative; left: auto; right: auto; margin: 4px calc(var(--dtl-cost) + 12px + var(--dtl-pad-r)) 0 calc(var(--dtl-who-w) + 12px + var(--dtl-pad-l)); }

/* Legend and hint */
.dtl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.dtl-legend { font-size: 11.5px; color: var(--lb-muted); }
.dtl-key-line { display: inline-block; width: 22px; height: 4px; border-radius: 2px; background: var(--dtl-fade); }
.dtl-key-dash { display: inline-block; width: 18px; height: 0; border-top: 2px dashed var(--lb-credit); }
.dtl-key-pin { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--dtl-c1); color: #FFFFFF; font-size: 9px; font-style: normal; font-weight: 800; }
.dtl-key-handoff { display: inline-block; width: 0; height: 12px; border-left: 2px dotted var(--lb-muted); }
.dtl-hint { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; color: var(--lb-light); }
.dtl-hint .tx-glyph { font-size: 10px; }
.dtl-never { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--lb-caution); }

/* While the card is saved as an image: no controls, no hover state. */
.dtl-card.is-capturing .dtl-cross,
.dtl-card.is-capturing .dtl-dot,
.dtl-card.is-capturing [data-dtl-chrome],
.dtl-card.is-capturing .dtl-bubble { display: none !important; }
.dtl-card.is-capturing * { animation: none !important; transition: none !important; }

@media (max-width: 575.98px) {
    .dtl-card .rc-card-head { flex-wrap: wrap; }
    .dtl-card .lb-card-actions { justify-content: space-between; width: 100%; }
    .dtl-pin { width: 30px; height: 30px; }
    .dtl-pin .dtl-pin-face { width: 22px; height: 22px; }
    .dtl-pin.is-last { width: 34px; height: 34px; }
    .dtl-axis span:not(.is-edge):nth-child(odd) { display: none; }
    .dtl-axis.is-lanes span:not(.is-edge) { display: none; }
    .dtl-insight-text em { display: none; }
}

@media (max-width: 767.98px) {
    .dtl-lanes { --dtl-who-w: 118px; --dtl-cost: 0px; --dtl-pad-r: 66px; }
    .dtl-lane { gap: 8px; }
    .dtl-lane-cost { display: none; }
    .dtl-lane-name small { display: none; }
    .dtl-bubble, .dtl-bubble.is-pin { width: min(272px, calc(100vw - 64px)); }
    .dtl-hint { display: none; }
}

@keyframes dtl-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dtl-pin { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes dtl-drop { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dtl-ring { 0% { opacity: .9; transform: scale(.85); } 70%, 100% { opacity: 0; transform: scale(1.35); } }
@keyframes dtl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dtl-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }

@media (prefers-reduced-motion: reduce) {
    .dtl-svg, .dtl-pin, .dtl-drop, .dtl-lane-bar, .dtl-lane.is-focus .dtl-lane-bar::after, .dtl-pin.is-last::after { animation: none; }
    .dtl-dot, .dtl-bubble { transition: opacity .15s ease, visibility 0s; }
}
:root[data-a11y-reduce-motion="on"] .dtl * { animation: none !important; }

/* ------------------------------------------------------------------ Card spending rules (lbr-), the Investment Rules recipe
   The same card as investments-rules.css .ivr-card on the liability tokens: the state's tone runs the 4px left edge,
   the corner wash, the state pill and the live line; alerts sit on a timeline by day with a tone bar and dot. */

:root {
    --lbr-card-bg: #FFFFFF;
    --lbr-card-wash: 8%;
    --lbr-card-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    --lbr-card-hover-shadow: 0 10px 24px rgba(31, 42, 68, .10);
    --lbr-tile-border: #E4E7EF;
    --lbr-watch: #D97706;
    --lbr-high: #EA580C;
    --lbr-dot-ring: var(--rc-card, #FFFFFF);
}

[data-bs-theme="dark"] {
    --lbr-card-bg: rgba(255, 255, 255, .03);
    --lbr-card-wash: 12%;
    --lbr-card-shadow: 0 0 0 transparent;
    --lbr-card-hover-shadow: 0 10px 24px rgba(0, 0, 0, .38);
    --lbr-tile-border: #232A3A;
    --lbr-watch: #FBBF24;
    --lbr-high: #FB923C;
    --lbr-dot-ring: var(--rc-card, #151B28);
}

.lbr-state-ok, .lbr-sev-ok { --lbr-tone: var(--lb-positive); }
.lbr-state-watch, .lbr-sev-watch { --lbr-tone: var(--lbr-watch); }
.lbr-state-high, .lbr-sev-high { --lbr-tone: var(--lbr-high); }
.lbr-state-over, .lbr-sev-over { --lbr-tone: var(--lb-negative); }
.lbr-state-paused { --lbr-tone: var(--lb-muted); }

.lbr-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .lbr-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .lbr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ci-mark-paid { --ci-mark: var(--lb-positive); }
.lbr-busy { display: inline-flex; align-items: center; color: var(--lb-positive); }

.lbr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lbr-grid > li { display: flex; min-width: 0; }
.lbr-grid > li > .lbr-card { flex: 1 1 auto; }
@media (max-width: 767.98px) { .lbr-grid { grid-template-columns: minmax(0, 1fr); } }

.lbr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px 12px 18px;
    border: 1px solid var(--lbr-tile-border);
    border-radius: 16px;
    background:
        radial-gradient(ellipse 60% 75% at 100% 100%, color-mix(in srgb, var(--lbr-tone, var(--lb-positive)) var(--lbr-card-wash), transparent) 0%, transparent 100%),
        var(--lbr-card-bg);
    box-shadow: inset 4px 0 0 var(--lbr-tone, var(--lb-positive)), var(--lbr-card-shadow);
    color: var(--lb-text);
    text-align: left;
    transition: border-color .15s ease, box-shadow .2s ease;
}
.lbr-card.is-clickable { cursor: pointer; }
.lbr-card.is-clickable:hover { border-color: color-mix(in srgb, var(--lbr-tone) 30%, var(--lbr-tile-border)); box-shadow: inset 4px 0 0 var(--lbr-tone), var(--lbr-card-hover-shadow); }
.lbr-card:has(.lbr-card-open:focus-visible) { outline: 2px solid var(--lbr-tone); outline-offset: 2px; }

.lbr-card-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.lbr-card-glyph { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: var(--lb-icon-bg); color: var(--lb-icon); font-size: 13px; }
.lbr-card-titles { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding-top: 1px; }
.lbr-card-name {
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: none;
    color: var(--lb-text);
    font-family: var(--tx-font);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lbr-card-open { cursor: pointer; }
.lbr-card-open:focus-visible { outline: none; }
.lbr-card-open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.lbr-card-tags, .lbr-state, .lbr-menu, .lbr-card-fired, .lbr-progress { position: relative; z-index: 2; }
.lbr-card-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lbr-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--lbr-tile-border); border-radius: 999px; color: var(--lb-muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.lbr-tag .tx-glyph { font-size: 9px; color: var(--lb-light); }
.lbr-state {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--lbr-tone) 13%, transparent);
    color: var(--lbr-tone);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.lbr-condition { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--lb-text); overflow-wrap: anywhere; }
.lbr-live { margin: 0; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--lbr-tone); font-variant-numeric: tabular-nums; }
.lbr-card.is-paused .lbr-condition, .lbr-card.is-paused .lbr-live, .lbr-card.is-paused .lbr-progress { opacity: .62; }

.lbr-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.lbr-bar { position: relative; display: block; height: 6px; border-radius: 999px; background: var(--lb-track); }
.lbr-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--lbr-tone) 55%, transparent), var(--lbr-tone));
    transform-origin: left center;
    animation: dtl-grow .8s cubic-bezier(.2, .8, .2, 1) both;
}
.lbr-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--lbr-card-bg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lb-text) 14%, transparent); }
.lbr-tick.is-passed { background: var(--lbr-tone); box-shadow: none; }
.lbr-progress-text { font-size: 11px; font-weight: 700; color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbr-next { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--lb-muted); }
.lbr-next .tx-glyph { font-size: 10px; color: var(--lb-light); }

.lbr-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px dashed var(--lbr-tile-border);
    font-size: 11.5px;
    color: var(--lb-muted);
}
.lbr-notify { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lbr-notify-glyph { color: var(--lb-icon); font-size: 11.5px; }
.lbr-unread { white-space: nowrap; }
.lbr-unread.has-unread { color: var(--lb-accent); font-weight: 700; }
.lbr-period { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; white-space: nowrap; }
.lbr-period .tx-glyph { font-size: 10px; }
.lbr-card-scope { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11.5px; color: var(--lb-muted); }
.lbr-faces { display: inline-flex; flex: 0 0 auto; }
.lbr-faces .lbr-face { border-radius: 50%; box-shadow: 0 0 0 2px var(--rc-card, #FFFFFF); }
.lbr-faces .lbr-face + .lbr-face { margin-left: -6px; }
.lbr-scope-cards { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbr-card-fired { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 11px; color: var(--lb-light); }
.lbr-card-fired .tx-glyph { font-size: 10px; color: var(--lbr-tone); }
.lbr-card-compact { gap: 5px; height: 100%; padding: 12px 14px 12px 16px; }
.lbr-card-compact .lbr-card-name { font-size: 14px; }

/* The dashboard carousel holds the card itself (no frame around it). */
.lb-carousel-item.lbr-carousel-item { padding: 0; border: 0; background: none; cursor: default; }
.lb-carousel-item.lbr-carousel-item:hover { background: none; }

/* The limit menu */
.lbr-menu { flex: 0 0 auto; margin: -4px -6px 0 0; }
.lbr-menu:has(.lbr-menu-list) { z-index: 40; }
.lbr-menu-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--lb-muted); font-size: 14px; cursor: pointer; }
.lbr-menu-btn:hover:not(:disabled), .lbr-menu-btn[aria-expanded="true"] { background: var(--lb-neutral-soft); color: var(--lb-text); }
.lbr-menu-btn:disabled { opacity: .45; cursor: default; }
.lbr-menu-btn:focus-visible { outline: 2px solid var(--lb-positive); outline-offset: 1px; }
.lbr-menu-scrim { position: fixed; inset: 0; z-index: 25; }
.lbr-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 184px;
    padding: 6px;
    border: 1px solid var(--lbr-tile-border);
    border-radius: 12px;
    background: var(--lb-menu-bg);
    box-shadow: var(--lb-shadow);
    animation: lb-fade .14s ease-out both;
}
.lbr-menu-list button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--lb-text); font-size: var(--ci-fs-option); text-align: left; cursor: pointer; }
.lbr-menu-list button .tx-glyph { width: 14px; color: var(--lb-icon); text-align: center; }
.lbr-menu-list button:hover, .lbr-menu-list button:focus-visible { background: var(--rc-row-hover); outline: none; }
.lbr-menu-list button.is-critical, .lbr-menu-list button.is-critical .tx-glyph { color: var(--lb-negative); }

/* Recent alerts: All / Unread, a timeline by day */
.lbr-btn-ghost { display: inline-flex; align-items: center; gap: .4rem; min-height: 30px; padding: 4px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--lb-muted); font-size: var(--ci-fs-btn-xs, 12px); font-weight: 600; cursor: pointer; }
.lbr-btn-ghost:hover:not(:disabled) { background: var(--lb-neutral-soft); color: var(--lb-text); }
.lbr-btn-ghost:disabled { opacity: .5; cursor: default; }
.lbr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lbr-chip { display: inline-flex; align-items: center; gap: .35rem; padding: 4px 11px; border: 1px solid var(--lbr-tile-border); border-radius: 999px; background: transparent; color: var(--lb-muted); font-size: 12px; font-weight: 600; line-height: 1.5; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.lbr-chip:hover { color: var(--lb-text); }
.lbr-chip[aria-pressed="true"] { border-color: transparent; background: var(--lb-icon-bg); color: var(--lb-icon); }
.lbr-chip-count { padding: 0 6px; border-radius: 999px; background: var(--lb-neutral-soft); font-size: 10.5px; }

.lbr-timeline { display: flex; flex-direction: column; gap: 16px; }
.lbr-day { min-width: 0; }
.lbr-day-label { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lb-muted); }
.lbr-events { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 0 20px; list-style: none; }
.lbr-events::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 2px; border-radius: 1px; background: var(--lb-track); }
.lbr-event { position: relative; min-width: 0; }
.lbr-event-dot { position: absolute; top: 14px; left: -20px; width: 12px; height: 12px; border-radius: 50%; background: var(--lbr-tone); box-shadow: 0 0 0 3px var(--lbr-dot-ring); }
.lbr-event-body { min-width: 0; overflow: hidden; border: 1px solid var(--lbr-tile-border); border-radius: 14px; background: var(--lbr-card-bg); box-shadow: inset 3px 0 0 var(--lbr-tone); }
.lbr-event.is-unread .lbr-event-body { border-color: color-mix(in srgb, var(--lbr-tone) 32%, var(--lbr-tile-border)); background: color-mix(in srgb, var(--lbr-tone) 5%, var(--lbr-card-bg)); }
.lbr-event-main { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 12px 6px 14px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }

/* Hover / focus: the alert's own tone as diagonal stripes on a transparent ground (a 20px tile holds exactly two
   stripes, so the slow drift is seamless), over a soft wash that fades to the right. Light stays airy; dark lifts the
   tone so the stripes read on the dark card. The body's edge picks up the tone too. */
.lbr-event-main {
    --lbr-stripe-mix: 11%;
    --lbr-wash-mix: 7%;
}
[data-bs-theme="dark"] .lbr-event-main {
    --lbr-stripe-mix: 20%;
    --lbr-wash-mix: 12%;
}
.lbr-event-main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(135deg, color-mix(in srgb, var(--lbr-tone) var(--lbr-stripe-mix), transparent) 0 25%, transparent 25% 50%),
        linear-gradient(90deg, color-mix(in srgb, var(--lbr-tone) var(--lbr-wash-mix), transparent) 0%, transparent 85%);
    background-size: 20px 20px, 100% 100%;
    background-position: 0 0, 0 0;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, .25) 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, .25) 100%);
    opacity: 0;
    transition: opacity .2s ease;
}
.lbr-event-main:hover::before,
.lbr-event-main:focus-visible::before {
    opacity: 1;
    animation: lbr-stripe-drift 1.4s linear infinite;
}
.lbr-event-body:has(> .lbr-event-main:hover) { border-color: color-mix(in srgb, var(--lbr-tone) 38%, var(--lbr-tile-border)); }
.lbr-event-main:hover .lbr-event-title-text { color: color-mix(in srgb, var(--lbr-tone) 22%, var(--lb-text)); }

@keyframes lbr-stripe-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 20px 0, 0 0; }
}
.lbr-event-main:focus-visible { outline: 2px solid var(--lbr-tone); outline-offset: -2px; border-radius: 14px; }
.lbr-event-title { display: flex; align-items: flex-start; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--lb-text); }
.lbr-event-glyph { flex: 0 0 auto; margin-top: 1px; color: var(--lbr-tone); font-size: 11px; }
.lbr-event-title-text { display: -webkit-box; flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lbr-unread-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--lb-accent); }
.lbr-event-message { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.45; color: var(--lb-muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lbr-event.is-expanded .lbr-event-message, .lbr-event.is-expanded .lbr-event-title-text { display: block; -webkit-line-clamp: unset; }
.lbr-event-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 0 10px 9px 14px; font-size: 11px; color: var(--lb-light); }
.lbr-event-time, .lbr-event-figures { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbr-event-figures { color: var(--lb-muted); }
.lbr-rule-chip { min-width: 0; max-width: 100%; padding: 1px 8px; overflow: hidden; border: 1px solid var(--lbr-tile-border); border-radius: 999px; background: transparent; color: var(--lb-text); font-size: 10.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.lbr-rule-chip:hover { border-color: var(--lbr-tone); color: var(--lbr-tone); }
.lbr-details { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--lb-accent); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.lbr-details .tx-glyph { font-size: 9px; }
.lbr-details:hover { background: var(--rc-row-hover); }
.lbr-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; text-align: center; }
.lbr-empty p { max-width: 40ch; margin: 0; font-size: 13px; color: var(--lb-muted); }
.lbr-empty-chip { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--lb-icon-bg); color: var(--lb-icon); font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
    .lbr-bar-fill, .lbr-menu-list { animation: none; }
    .lbr-event-main:hover::before, .lbr-event-main:focus-visible::before { animation: none; }
}

/* ------------------------------------------------------------------ Credit Utilization lens (lbu-)
   The figure and its band, a banded meter with a glowing "You" marker, the cards as glass vials filled to their own
   share (one dashed 30% line through all of them), and what it means in dollars. Healthy is the paid-off blue. */

:root {
    --lbu-healthy: var(--lb-positive);
    --lbu-watch: #D97706;
    --lbu-high: #DC2626;
    --lbu-glass: linear-gradient(90deg, rgba(15, 23, 42, .05) 0%, rgba(255, 255, 255, .7) 38%, rgba(15, 23, 42, .03) 100%);
    --lbu-glass-edge: rgba(15, 23, 42, .12);
}

[data-bs-theme="dark"] {
    --lbu-watch: #FBBF24;
    --lbu-high: #F87171;
    --lbu-glass: linear-gradient(90deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .09) 38%, rgba(255, 255, 255, .02) 100%);
    --lbu-glass-edge: rgba(255, 255, 255, .14);
}

.lbu { --lbu-tone: var(--lbu-healthy); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lbu.lbu-tone-caution { --lbu-tone: var(--lbu-watch); }
.lbu.lbu-tone-negative { --lbu-tone: var(--lbu-high); }
.lbu.is-sample .lbu-meter, .lbu.is-sample .lbu-figure { opacity: .6; }

.lbu-head { display: flex; flex-direction: column; gap: 2px; }
.lbu-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.lbu-value { font-family: var(--tx-font); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.01em; color: var(--lbu-tone); font-variant-numeric: tabular-nums; }
.lbu-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--lb-text); }
.lbu-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lbu-tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lbu-tone) 18%, transparent); }
.lbu-sentence { margin: 4px 0 0; font-size: 12.5px; color: var(--lb-muted); font-variant-numeric: tabular-nums; }

/* The meter: three bands, the fill to your share, the marks and you. */
.lbu-meter { position: relative; height: 14px; margin: 26px 0 24px; }
.lbu-zones { position: absolute; inset: 0; display: grid; grid-template-columns: 30fr 40fr 30fr; gap: 3px; }
.lbu-zones span { border-radius: 4px; }
.lbu-zones span:first-child { border-radius: 999px 4px 4px 999px; }
.lbu-zones span:last-child { border-radius: 4px 999px 999px 4px; }
.lbu-zones .is-healthy { background: color-mix(in srgb, var(--lbu-healthy) 14%, transparent); }
.lbu-zones .is-watch { background: color-mix(in srgb, var(--lbu-watch) 14%, transparent); }
.lbu-zones .is-high { background: color-mix(in srgb, var(--lbu-high) 14%, transparent); }
/* The fill carries the whole band gradient across the meter and shows it up to your share, so its end is the color of
   the band you are in. */
.lbu-fill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    right: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lbu-healthy) 0%, var(--lbu-healthy) 26%, var(--lbu-watch) 50%, var(--lbu-high) 80%);
    clip-path: inset(0 calc(100% - var(--lbu-at)) 0 0 round 999px);
    animation: lbu-clip 1s cubic-bezier(.2, .8, .2, 1) .1s both;
}
.lbu-mark { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 1.5px dashed color-mix(in srgb, var(--lb-text) 28%, transparent); font-style: normal; }
.lbu-mark b { position: absolute; top: calc(100% + 7px); left: 0; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--lb-muted); white-space: nowrap; }
.lbu-mark.is-ideal { border-left-color: color-mix(in srgb, var(--lbu-healthy) 60%, transparent); }
.lbu-mark.is-ideal b { color: var(--lbu-healthy); }
.lbu-you {
    position: absolute;
    top: 50%;
    left: clamp(9px, var(--lbu-at), calc(100% - 9px));
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 3px solid var(--rc-card, #FFFFFF);
    border-radius: 50%;
    background: var(--lbu-tone);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lbu-tone) 24%, transparent), 0 4px 10px rgba(15, 23, 42, .25);
    animation: lbu-you .9s cubic-bezier(.2, .8, .2, 1) .1s both;
}
.lbu-you::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--lbu-tone) 50%, transparent); animation: dtl-ring 2.8s ease-out 1.2s infinite; }
.lbu-you b {
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--lbu-tone);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    transform: translateX(-50%);
    white-space: nowrap;
}
[data-bs-theme="dark"] .lbu-you b { color: #0B1220; }

.lbu-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 11px; font-weight: 600; color: var(--lb-muted); }
.lbu-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lbu-legend i { width: 8px; height: 8px; border-radius: 50%; }
.lbu-legend .is-healthy i { background: var(--lbu-healthy); }
.lbu-legend .is-watch i { background: var(--lbu-watch); }
.lbu-legend .is-high i { background: var(--lbu-high); }

/* Card by card: glass vials */
.lbu-cards { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rc-card-border); }
.lbu-cards-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.lbu-cards-head span { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; color: var(--lb-muted); }
.lbu-cards-head small { font-size: 11px; color: var(--lb-light); }
/* Every part of a vial has a set height, so the one dashed 30% line can run across the row at the same height in each
   tube: 4px padding + 15px name + 5px + 24px logo + 5px under the tube, then 30% of the tube. */
.lbu-vials {
    --lbu-tube-h: 112px;
    --lbu-under: 53px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    margin: 0;
    padding: 4px 30px 0 2px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}
.lbu-vials::before {
    content: "";
    position: absolute;
    left: 0;
    right: 26px;
    bottom: calc(var(--lbu-under) + var(--lbu-tube-h) * .3);
    z-index: 3;
    height: 0;
    border-top: 1.5px dashed color-mix(in srgb, var(--lb-text) 34%, transparent);
    pointer-events: none;
}
.lbu-vials::after {
    content: attr(data-line);
    position: absolute;
    right: 0;
    bottom: calc(var(--lbu-under) + var(--lbu-tube-h) * .3 - 7px);
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    color: var(--lb-muted);
    pointer-events: none;
}
.lbu-vial {
    --lbu-c: var(--lbu-healthy);
    position: relative;
    display: flex;
    flex: 1 0 64px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    max-width: 104px;
    padding: 2px 0 4px;
    border-radius: 12px;
    outline: none;
    cursor: default;
}
.lbu-vial.is-caution { --lbu-c: var(--lbu-watch); }
.lbu-vial.is-negative { --lbu-c: var(--lbu-high); }
.lbu-vial.is-none { --lbu-c: var(--lb-light); }
.lbu-vial:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lb-positive) 55%, transparent); }
.lbu-vial-pct { font-size: 12.5px; font-weight: 800; color: var(--lbu-c); font-variant-numeric: tabular-nums; }
.lbu-tube {
    position: relative;
    display: block;
    width: 38px;
    height: var(--lbu-tube-h);
    overflow: hidden;
    border: 1px solid var(--lbu-glass-edge);
    border-radius: 12px 12px 19px 19px;
    background: color-mix(in srgb, var(--lb-text) 3%, transparent);
    box-shadow: inset 0 -6px 12px -8px rgba(15, 23, 42, .18);
}
.lbu-vial.is-none .lbu-tube { border-style: dashed; }
.lbu-liquid {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--lbu-fill);
    min-height: 3px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--lbu-c) 70%, #FFFFFF) 0%, var(--lbu-c) 55%, color-mix(in srgb, var(--lbu-c) 80%, #000000) 100%);
    transform-origin: bottom center;
    animation: lbu-pour 1.1s cubic-bezier(.2, .8, .2, 1) var(--lbu-delay, .15s) both;
}
.lbu-vial.is-none .lbu-liquid,
.lbu-vial.is-empty .lbu-liquid { display: none; }
.lbu-wave { position: absolute; left: 0; bottom: calc(100% - 1px); width: 200%; height: 7px; fill: color-mix(in srgb, var(--lbu-c) 70%, #FFFFFF); animation: lbu-wave 2.6s linear infinite; }
.lbu-shine { position: absolute; inset: 0; z-index: 2; background: var(--lbu-glass); border-radius: inherit; pointer-events: none; }
.lbu-vial-pct { height: 16px; line-height: 16px; }
.lbu-vial-logo { display: grid; place-items: center; height: 24px; }
.lbu-vial-name { max-width: 100%; height: 15px; overflow: hidden; font-size: 11px; font-weight: 600; line-height: 15px; color: var(--lb-text); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.lbu-more { align-self: center; flex: 0 0 auto; padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--lb-muted); white-space: nowrap; }
.lbu-vial:hover .lbu-tube, .lbu-vial:focus-visible .lbu-tube { border-color: color-mix(in srgb, var(--lbu-c) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lbu-c) 14%, transparent), inset 0 -6px 12px -8px rgba(15, 23, 42, .18); }

/* The vial's glass tooltip: over the top of its tube (the row scrolls sideways, so nothing may hang outside it). */
.lbu-tip {
    position: absolute;
    top: 20px;
    left: 50%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 188px;
    padding: 10px 12px;
    border: 1px solid var(--dtl-glass-border);
    border-radius: 14px;
    background: var(--dtl-glass);
    box-shadow: var(--dtl-glass-shadow);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    color: var(--lb-text);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.lbu-vial:hover .lbu-tip, .lbu-vial:focus-visible .lbu-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .15s ease, transform .15s ease, visibility 0s; }
.lbu-vial:first-child .lbu-tip { left: 0; transform: translate(0, 6px); }
.lbu-vial.is-end .lbu-tip { left: auto; right: 0; transform: translate(0, 6px); }
.lbu-vial:first-child:hover .lbu-tip, .lbu-vial:first-child:focus-visible .lbu-tip,
.lbu-vial.is-end:hover .lbu-tip, .lbu-vial.is-end:focus-visible .lbu-tip { transform: none; }
.lbu-vial:hover, .lbu-vial:focus-visible { z-index: 5; }
.lbu-tip strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.lbu-tip small { margin-top: -3px; font-size: 10.5px; color: var(--lb-muted); }
.lbu-tip-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.lbu-tip-row em { font-style: normal; color: var(--lb-muted); }
.lbu-tip-row b { font-variant-numeric: tabular-nums; }
.lbu-tip-room { margin-top: 2px; padding-top: 5px; border-top: 1px solid var(--dtl-glass-border); font-size: 11.5px; font-weight: 700; color: var(--lbu-c); }

/* What it means in dollars */
.lbu-hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.lbu-hint { --lbu-h: var(--lbu-healthy); display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border: 1px solid var(--rc-card-border); border-radius: 12px; background: var(--rc-card); }
.lbu-hint.is-caution { --lbu-h: var(--lbu-watch); }
.lbu-hint.is-accent { --lbu-h: var(--lb-accent); }
.lbu-hint-glyph { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; background: var(--ci-icon-pill); color: var(--lbu-h); font-size: 11.5px; }
.lbu-hint-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lbu-hint-text small { overflow: hidden; font-size: 10.5px; color: var(--lb-muted); text-overflow: ellipsis; white-space: nowrap; }
.lbu-hint-text strong { font-size: 14px; color: var(--lb-text); font-variant-numeric: tabular-nums; }

@keyframes lbu-clip { from { clip-path: inset(0 100% 0 0 round 999px); } }
@keyframes lbu-pour { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lbu-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes lbu-you { from { left: 9px; opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .lbu-fill, .lbu-liquid, .lbu-wave, .lbu-you, .lbu-you::after { animation: none; }
}
:root[data-a11y-reduce-motion="on"] .lbu * { animation: none !important; }

/* ------------------------------------------------------------------ Loading bones for the new layouts */
.lbr-bone-card { display: flex; flex-direction: column; padding: 12px 14px 12px 18px; border: 1px solid var(--lbr-tile-border); border-radius: 16px; box-shadow: inset 4px 0 0 color-mix(in srgb, var(--lb-text) 10%, transparent); }
.lbu-bone-vials { display: flex; justify-content: space-around; gap: 10px; padding-top: 12px; border-top: 1px solid var(--rc-card-border); }
.lbu-bone-vial { width: 38px; height: 150px; border-radius: 12px 12px 19px 19px; }
.lbu-bone-hints { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }

/* blend-bars.css fades every breakdown fill's end to transparent; the payoff order's bars end in the paid-off blue,
   so keep that end solid. */
.lxo-row .lxo-bar .rp-breakdown-fill {
    -webkit-mask-image: none;
    mask-image: none;
}
