/* GENM debt charts (Phase 10, Batches 1 to 3: CL5, CL6, CL3, CL8 and the Cash section)
/* ----------------------------------------------------------
Loaded by the Debt Sphere, Yield Curve and cash pages (their "head" parts). Markup: partials/genm-tools/chart-section.hbs. The panel,
stamp, table and text look come from genm-bars.css (the classes .genm-bar and .genm-bar-*); this file adds only
what the two charts need: their heights and the donut's room for labels. Colors and fonts come only from
genm-tokens.css. Nothing here animates. Sizes are in px because Source sets the root font size to 10px.
*/

.genm-dc .genm-dc-area {
    width: 100%;
    height: clamp(260px, 50vw, 420px);
    touch-action: pan-y;
}

.genm-dc .genm-dc-donut {
    width: 100%;
    height: clamp(390px, 100vw, 440px);
    touch-action: pan-y;
}

.genm-dc .genm-dc-area[hidden],
.genm-dc .genm-dc-donut[hidden] {
    display: none;
}

/* The table's row names may wrap, so three columns fit a phone without sideways scrolling */
.genm-dc .genm-bar-table tbody th {
    min-width: 7em;
    white-space: normal;
}

@media (max-width: 480px) {
    .genm-dc .genm-bar-table {
        font-size: 12px;
    }

    .genm-dc .genm-bar-table td,
    .genm-dc .genm-bar-table thead th:not(:first-child) {
        padding-right: 8px;
    }
}

.genm-dc .genm-dc-donut + .genm-bar-summary {
    margin-top: 20px;
}

/* Phase 10 Batch 2: CL3 the yield change histogram and CL8 the foreign holders treemap */
.genm-dc .genm-dc-histogram {
    width: 100%;
    height: clamp(360px, 70vw, 440px);
    touch-action: pan-y;
}

.genm-dc .genm-dc-treemap {
    width: 100%;
    height: clamp(420px, 110vw, 560px);
    touch-action: pan-y;
}

.genm-dc .genm-dc-histogram[hidden],
.genm-dc .genm-dc-treemap[hidden],
.genm-dc .genm-dc-list[hidden] {
    display: none;
}

.genm-dc .genm-dc-key {
    margin-top: 8px;
}

.genm-dc .genm-dc-histogram + .genm-bar-summary,
.genm-dc .genm-dc-key + .genm-bar-summary {
    margin-top: 16px;
}

/* CL8 sits inside the Who holds the debt section, which already has the page margins */
.genm-dc.genm-dc-nested {
    margin: 48px 0 0;
}

.genm-dc.genm-dc-nested > .genm-home-inner {
    max-width: none;
    padding: 0;
}

.genm-dc .genm-home-h3 {
    margin: 0 0 10px;
}

.genm-dc .genm-dc-list {
    margin: 16px 0 0;
}

.genm-dc .genm-dc-list-title,
.genm-dc .genm-dc-how-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-ol {
    margin: 0;
    padding-left: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.genm-dc .genm-dc-ol li {
    margin: 0;
}

.genm-dc .genm-dc-how {
    margin: 16px 0 0;
}

.genm-dc .genm-dc-how p {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--genm-muted);
}

/* CL8: the custody and revision sentences sit directly under the lede, on the page, so they travel with the chart */
.genm-dc .genm-dc-custody {
    max-width: 760px;
    margin: -10px 0 8px;
}

.genm-dc .genm-dc-custody + .genm-dc-custody {
    margin-top: 0;
}

/* Phase 10 Batch 3: the Cash section (V3 the cash balance area, V7 the plain range bar). One hue (the gold chart token); no zones,
   no thresholds, no color that means good or bad. The bar is HTML and CSS, so it reads without the chart library. */
.genm-dc .genm-dc-range {
    margin: 28px 0 0;
}

.genm-dc .genm-dc-range-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-range-bar {
    position: relative;
    height: 12px;
    margin: 22px 8px 0;
    border-radius: 6px;
    background: var(--genm-navy-track);
}

.genm-dc .genm-dc-range-marker {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 3px solid var(--genm-cream);
    background: var(--genm-gold);
}

.genm-dc .genm-dc-range-marker[hidden] {
    display: none;
}

.genm-dc .genm-dc-range-ends {
    display: flex;
    justify-content: space-between;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--genm-muted);
}

.genm-dc .genm-dc-range-list {
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
}

.genm-dc .genm-dc-range-list div {
    margin: 0;
}

.genm-dc .genm-dc-range-list dt {
    margin: 0;
    font-size: 13px;
    color: var(--genm-muted);
}

.genm-dc .genm-dc-range-list dd {
    margin: 2px 0 0;
    font-size: 16px;
    line-height: 1.4;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-range-position[hidden],
.genm-dc [data-dc="range-position"][hidden],
.genm-dc [data-dc="range-tag"][hidden] {
    display: none;
}

@media (min-width: 640px) {
    .genm-dc .genm-dc-range-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.genm-dc .genm-dc-range-list + .genm-bar-summary {
    margin-top: 16px;
}

/* Phase 10 Batch 3, PR 3: the Debt limit timeline (V6). Gold and cream only tell the two lines apart; the suspended dates (a solid bar) and the
   stretches with no limit line (a dotted line) look different on purpose, and nothing here is a zone, a threshold or a color that means good or
   bad. Tokens only. */
.genm-dc .genm-dc-timeline {
    width: 100%;
    height: clamp(400px, 115vw, 520px);
    touch-action: pan-y;
}

.genm-dc .genm-dc-timeline[hidden],
.genm-dc .genm-bar-tablewrap[hidden] {
    display: none;
}

.genm-dc .genm-dc-key {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.genm-dc .genm-dc-key li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-key-mark {
    flex: 0 0 28px;
    display: block;
    margin-top: 6px;
    height: 0;
    box-sizing: border-box;
}

.genm-dc .genm-dc-key-limit {
    border-top: 3px solid var(--genm-gold);
}

.genm-dc .genm-dc-key-debt {
    border-top: 2px solid var(--genm-cream);
}

.genm-dc .genm-dc-key-suspended {
    border-top: 8px solid var(--genm-gold);
    margin-top: 3px;
}

.genm-dc .genm-dc-key-noline {
    border-top: 2px dotted var(--genm-cream);
}

.genm-dc .genm-dc-key-event {
    flex-basis: 10px;
    width: 10px;
    height: 10px;
    margin: 3px 9px 0;
    border: 1px solid var(--genm-gold);
    background: var(--genm-cream);
    transform: rotate(45deg);
}

.genm-dc .genm-dc-event {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--genm-gold);
    background: var(--genm-navy-track);
    border-radius: 4px;
}

.genm-dc .genm-dc-event p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-event p + p {
    margin-top: 4px;
}

.genm-dc .genm-dc-event .genm-dc-event-date {
    font-size: 13px;
    color: var(--genm-muted);
}

.genm-dc .genm-dc-event a {
    color: var(--genm-gold);
    overflow-wrap: anywhere;
}

.genm-dc .genm-dc-stretches-wrap {
    margin: 24px 0 0;
}

.genm-dc .genm-dc-stretches {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.genm-dc .genm-dc-stretches li {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--genm-cream);
}

.genm-dc .genm-dc-stretch-suspended {
    border-left: 8px solid var(--genm-gold);
    padding-left: 8px;
}

.genm-dc .genm-dc-stretch-noline {
    border-left: 2px dotted var(--genm-cream);
    padding-left: 14px;
}

.genm-dc .genm-dc-events-table tbody td:nth-child(3) {
    min-width: 14em;
    white-space: normal;
}

.genm-dc .genm-dc-events-table a {
    color: var(--genm-gold);
}

.genm-dc .genm-bar-asof {
    margin: 4px 0 0;
}

/* Phase 10 Batch 4: V5 Replay (#replay, partials/genm-tools/replay-section.hbs and replay-side.hbs). One column on a phone; two equal columns from
760px. Both sides use exactly the same rules, so neither window is given more weight. Colors and fonts come only from genm-tokens.css. */
.genm-rpl .genm-rpl-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 12px 0 8px;
}

.genm-rpl .genm-rpl-btn {
    min-width: 88px;
    min-height: 44px;
    padding: 8px 16px;
    font: inherit;
    font-size: 15px;
    color: var(--genm-cream);
    background: var(--genm-navy-panel);
    border: 1px solid var(--genm-gold);
    border-radius: 6px;
    cursor: pointer;
}

.genm-rpl .genm-rpl-btn:hover,
.genm-rpl .genm-rpl-btn[aria-pressed="true"] {
    background: var(--genm-navy-track);
}

.genm-rpl .genm-rpl-btn:focus-visible,
.genm-rpl .genm-rpl-range:focus-visible {
    outline: 2px solid var(--genm-gold);
    outline-offset: 2px;
}

.genm-rpl .genm-rpl-scrub {
    font-size: 15px;
    color: var(--genm-cream);
}

.genm-rpl .genm-rpl-range {
    flex: 1 1 220px;
    min-width: 0;
    min-height: 44px;
    accent-color: var(--genm-gold);
}

.genm-rpl .genm-rpl-daylabel {
    margin: 4px 0 14px;
    font-size: 16px;
    color: var(--genm-cream);
    overflow-wrap: anywhere;
}

/* Written when the visitor scrubs, pauses or resets: read by screen readers, not shown */
.genm-rpl .genm-rpl-announce {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.genm-rpl .genm-rpl-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

@media (min-width: 760px) {
    .genm-rpl .genm-rpl-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 24px;
    }
}

.genm-rpl .genm-rpl-side {
    min-width: 0;
}

.genm-rpl .genm-rpl-ended {
    margin: 4px 0 8px;
    padding: 6px 10px;
    border-left: 3px solid var(--genm-gold);
    color: var(--genm-cream);
}

.genm-rpl .genm-rpl-ended[hidden] {
    display: none;
}

.genm-rpl .genm-rpl-readout {
    margin: 8px 0 12px;
}

.genm-rpl .genm-rpl-readout > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--genm-navy-track);
}

.genm-rpl .genm-rpl-readout dt {
    color: var(--genm-muted);
}

.genm-rpl .genm-rpl-readout dd {
    margin: 0;
    color: var(--genm-cream);
}

.genm-rpl .genm-rpl-canvas {
    width: 100%;
    height: clamp(220px, 46vw, 300px);
    touch-action: pan-y;
}

.genm-rpl .genm-rpl-canvas[hidden] {
    display: none;
}

.genm-rpl .genm-rpl-fig {
    margin: 10px 0;
}

.genm-rpl .genm-rpl-caption {
    margin-top: 4px;
    font-size: 13px;
    color: var(--genm-muted);
}

.genm-rpl .genm-rpl-events {
    margin: 6px 0 14px;
    padding-left: 18px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.genm-rpl .genm-rpl-events li {
    margin: 4px 0;
}

/* Replay: a long table scrolls inside its own box, and the source links read on the dark panel */
.genm-rpl .genm-bar-tablewrap {
    max-height: 360px;
    overflow-y: auto;
}

.genm-rpl .genm-rpl-events a {
    color: var(--genm-gold);
    text-decoration: underline;
}
