/* Opt-in, native Short/Full GEN control; no change to existing balance disclosures. The amount itself is the
   control (no Full/Short label): a pointer and, on hover, a dotted underline show it can be selected. */
.gen-balance { position:relative; display:inline-block; max-inline-size:100%; min-inline-size:0; vertical-align:middle; white-space:normal; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
/* The amount takes its text's height, so it sits on the line or row it is in like any text; its 44px target is an
   invisible layer centred on the text (::before), not padding that lifts the text 6-8px above its row. */
.gen-balance > summary { position:relative; display:block; min-block-size:0; padding-block:0; list-style:none; cursor:pointer; line-height:1.4; border-radius:.25rem; overflow-wrap:anywhere; }
/* Stat captions style every descendant span; keep those labels outside this control. */
.gen-balance > summary span { display:inline; font:inherit; letter-spacing:inherit; text-transform:none; color:inherit; }
.gen-balance > summary::-webkit-details-marker { display:none; }
.gen-balance > summary::before { content:""; position:absolute; inset-inline:0; inset-block-start:50%; block-size:2.75rem; translate:0 -50%; }
.gen-balance > summary .gen-balance__content { display:inline-block; max-inline-size:100%; }
.gen-balance:not([open]) .gen-balance__full, .gen-balance[open] .gen-balance__short { display:none; }
.gen-balance__unit { white-space:nowrap; }
/* An amount and its unit never split (docs/BALANCE-AMOUNTS.md): the short amount is one unbreakable line. Only the
   exact amount, up to 18 decimals, wraps. */
.gen-balance:not([open]), .gen-balance:not([open]) > summary { white-space:nowrap; overflow-wrap:normal; }
.gen-balance > summary:hover .gen-balance__content { text-decoration:underline dotted; text-underline-offset:.2em; }
.gen-balance--metric { font:500 22px/1.4 var(--font-d); letter-spacing:-.02em; }
.gen-balance--headline { font:500 var(--page-title-size)/var(--page-title-leading) var(--font-d); letter-spacing:var(--page-title-tracking); }
.gen-balance--metric .gen-balance__unit, .gen-balance--headline .gen-balance__unit { font:500 13px var(--font-b); letter-spacing:0; }
/* stacked=True: a standalone amount with a badge or note directly under it. Its target is the same centred invisible
   layer as every amount, at 24px (WCAG 2.2 AA), so it never reaches the badge below and needs no room above. */
.gen-balance--stacked > summary::before { block-size:1.5rem; }
/* size="table": the numeric table cell's type (table.data td.num), for amounts read beside a table's own. */
.gen-balance--table { font-family:var(--font-m); font-size:12.5px; font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
/* mode="inline": the amount reads as part of its sentence. Targets inside a sentence are exempt from
   the minimum target size (WCAG 2.5.8 Inline), so the summary keeps the line's own height. */
.gen-balance--inline { display:inline; vertical-align:baseline; }
.gen-balance--inline > summary { display:inline; min-block-size:0; padding-block:0; line-height:inherit; }
/* Touch: the inline toggle grows its padding to a 44px target without moving the line it sits in. */
@media (pointer:coarse) { .gen-balance--inline > summary { padding-block:.8rem; } }
.gen-balance--inline > summary .gen-balance__content { display:inline; }
/* The control has no details content, but the empty content slot still ends the line in Chromium; a
   browser without ::details-content keeps that break and nothing else. Kept as its own rule. */
.gen-balance--inline::details-content { display:none; }
.gen-balance-headline { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 10px; min-width:0; max-width:100%; }
.gen-balance-headline h1 { margin:0; }
/* Transparent live-value wrappers preserve the shared amount's baseline and native hidden state. */
.gen-balance-flow:not([hidden]) { display:contents; }
/* Unavailable amounts keep metric type inside the stat strip (.bstat span restyles every span). */
.bstat .gen-balance.is-unavailable, .bstat .gen-balance.is-unavailable span { display:inline; font:500 22px/1.4 var(--font-d); letter-spacing:-.02em; text-transform:none; color:var(--ink); }
.bstat .gen-balance.is-unavailable .gen-balance__unit { font:500 13px var(--font-b); letter-spacing:0; }
/* compact=True: in a dense phone row (32px) the amount's invisible target is 24px, the WCAG 2.2 AA minimum, so the
   rows stay compact; desktop keeps 44px. Same breakpoint as the compact breakdown rows (640px). Only the target layer
   changes, so no key/value or table rule on the summary can undo it. */
@media (max-width:640px) { .gen-balance--compact > summary::before { block-size:1.5rem; } }
