/* GENM V14 Who holds the debt, worldwide
/* ----------------------------------------------------------
Styles for partials/genm-tools/worldwide-holders.hbs and
assets/js/tools/worldwide-holders.js. Every rule is scoped to .genm-ww.
Colors come from genm-tokens.css; the globe's own colors (ocean, land,
coast) are set in the script. Figures use .genm-figures (genm.css).
Layout: the globe panel and the holders list sit side by side on wide
screens and stack with no gap band on phones. The stage keeps a square
shape (shorter on wide screens), so its height is reserved before
three.js arrives and nothing moves.
*/

.genm-ww {
    --genm-ww-ivory: #F4EEDC;   /* Second layer placeholder (Bryan to choose) */
    --genm-ww-line: color-mix(in srgb, var(--genm-navy) 18%, transparent);

    margin-top: 48px;
    scroll-margin-top: 16px;
}

.genm-ww * {
    box-sizing: border-box;
}

.genm-ww .genm-ww-title {
    margin: 0 0 10px;
}

.genm-ww-intro {
    max-width: 760px;
    margin: 0 0 10px;
}

.genm-ww-month {
    margin: 0 0 14px;
    font-family: var(--genm-font-sans);
    font-size: 15px;
    font-weight: 600;
}

.genm-ww-month-tag {
    color: var(--genm-navy);
    border-bottom: 2px solid var(--genm-gold);
}

/* The three notes are always visible: custodial basis, holdings not flows, revisions */
.genm-ww-notes {
    display: grid;
    gap: 8px;
    max-width: 860px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.5;
}

.genm-ww-notes li {
    margin: 0;
    padding: 8px 12px;
    border-left: 3px solid var(--genm-gold);
    background: color-mix(in srgb, var(--genm-navy) 5%, transparent);
}

.genm-ww-status {
    margin: 0 0 12px;
}

.genm-ww-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.genm-ww-tile {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--genm-navy);
    color: var(--genm-cream);
}

.genm-ww-tile dt {
    font-size: 13px;
    color: var(--genm-muted);
}

.genm-ww-tile dd {
    margin: 0;
}

.genm-ww-value {
    margin-top: 4px !important;
    font-size: clamp(19px, 4.4vw, 24px);
    font-weight: 500;
    line-height: 1.2;
    color: var(--genm-gold);
    overflow-wrap: anywhere;
}

.genm-ww-label {
    margin-top: 6px !important;
    font-size: 11px;
    line-height: 1.5;
}

.genm-ww-layer {
    display: inline-flex;
    margin: 0 0 8px;
    border: 1px solid var(--genm-navy);
    border-radius: 999px;
    overflow: hidden;
}

.genm-ww-layer-prompt {
    margin: 0 0 12px;
}

/* ---------- globe and list ---------- */
.genm-ww-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

@media (min-width: 900px) {
    .genm-ww-view {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

.genm-ww-panel {
    overflow: hidden;
    border-radius: 12px;
    background: var(--genm-navy);
    color: var(--genm-cream);
}

.genm-ww-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 560px;
    overflow: hidden;
}

.genm-ww-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    touch-action: pan-y;
}

.genm-ww-canvas:active {
    cursor: grabbing;
}

.genm-ww-stage-note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--genm-muted);
}

.genm-ww-stage-note[hidden] {
    display: none;
}

/* Pop-up for the selected holder, inside the globe so it never covers the list */
.genm-ww-card {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: 340px;
    padding: 10px 12px;
    border: 1px solid var(--genm-gold);
    border-radius: 10px;
    background: color-mix(in srgb, var(--genm-navy-panel) 94%, transparent);
    color: var(--genm-cream);
    font-size: 13px;
    line-height: 1.45;
}

.genm-ww-card[hidden] {
    display: none;
}

.genm-ww-card p,
.genm-ww-card dl {
    margin: 0;
}

.genm-ww-card-name {
    padding-right: 28px;
    font-weight: 600;
    font-size: 15px;
}

.genm-ww-card-value {
    margin-top: 2px !important;
    font-size: 20px;
    color: var(--genm-gold);
}

.genm-ww-card-list > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.genm-ww-card-list dt {
    color: var(--genm-muted);
}

.genm-ww-card-list dd {
    margin: 0;
}

.genm-ww-card-foot {
    margin-top: 6px !important;
    font-size: 11px;
    color: var(--genm-muted);
}

.genm-ww-card-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--genm-cream);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.genm-ww-card-close:focus-visible,
.genm-ww-item:focus-visible {
    outline: 2px solid var(--genm-gold);
    outline-offset: -2px;
}

.genm-ww-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
    padding: 8px 14px 12px;
    border-top: 1px solid var(--genm-navy-track);
    font-size: 13px;
}

.genm-ww-speed {
    display: flex;
    align-items: center;
    gap: 10px;
}

.genm-ww-speed input {
    width: 120px;
    margin: 0;
    accent-color: var(--genm-gold);
}

.genm-ww-legend {
    color: var(--genm-muted);
}

.genm-ww-swatch {
    display: inline-block;
    width: 6px;
    height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
    background: var(--genm-gold);
}

.genm-ww .genm-ww-side-title {
    margin: 0 0 8px;
    font-family: var(--genm-font-sans);
    font-size: 15px;
    font-weight: 600;
}

.genm-ww-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 900px) {
    .genm-ww-list {
        max-height: 560px;
        overflow-y: auto;
    }
}

.genm-ww-list li {
    margin: 0;
}

.genm-ww-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid var(--genm-ww-line);
    border-radius: 0;
    background: transparent;
    color: var(--genm-navy);
    font-family: var(--genm-font-sans);
    font-size: 14px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

.genm-ww-item:hover {
    background: color-mix(in srgb, var(--genm-gold) 14%, transparent);
}

.genm-ww-item[aria-pressed="true"] {
    background: var(--genm-navy);
    color: var(--genm-gold);
}

.genm-ww-rank {
    color: inherit;
    opacity: 0.7;
}

.genm-ww-amt {
    white-space: nowrap;
}

/* ---------- the plain table (no JavaScript needed for its names and headings) ---------- */
.genm-ww-table-wrap {
    margin: 20px 0 0;
    overflow-x: auto;
}

.genm-ww-table {
    width: 100%;
    max-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
}

.genm-ww-table caption {
    margin: 0 0 8px;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}

.genm-ww-table th,
.genm-ww-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--genm-ww-line);
    text-align: left;
    font-weight: 400;
}

.genm-ww-table thead th {
    font-weight: 600;
}

.genm-ww-table td {
    text-align: right;
    white-space: nowrap;
}

.genm-ww-table thead th:not(:first-child) {
    text-align: right;
}

.genm-ww-source {
    margin: 14px 0 0;
}

.genm-ww-source a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--genm-gold);
    text-underline-offset: 3px;
}

/* Link inside the navy no-JavaScript note */
.genm-ww .genm-tool-noscript a {
    color: var(--genm-gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ----------------------------------------------------------
Net purchases panel (partials/genm-tools/net-purchases.hbs, assets/js/tools/net-purchases.js, GENM-060). It shares the
.genm-ww frame, title, month line and status line above.
*/

.genm-np .genm-np-panel[hidden],
.genm-np .genm-np-note[hidden],
.genm-np .genm-np-saved[hidden],
.genm-np .genm-ww-month[hidden] {
    display: none;
}

.genm-np-value {
    margin: 12px 0 4px;
    font-size: 2rem;
    line-height: 1.15;
    color: var(--genm-navy);
}

.genm-np-note,
.genm-np-saved {
    max-width: 760px;
    margin: 0 0 12px;
    font-size: 0.9375rem;
    color: var(--genm-navy);
}

.genm-np-chart {
    margin: 16px 0 0;
}

.genm-np-source {
    margin-top: 8px;
}
