/* data.css — data views: deals, firms, firm detail, trends (.data-page) and the map (.globe-page).
   Builds on app.css tokens and components; only page-specific arrangement lives here.
   Restraint by design: hairline rules, tabular figures, no decoration that doesn't carry data. */

/* == shared: data sub-nav ================================================== */
.data-tabs {
    display: flex;
    gap: var(--sp-6);
    margin-top: var(--sp-6);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.data-tabs::-webkit-scrollbar { display: none; }
.data-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.data-tabs a:hover { color: var(--color-text); }
.data-tabs a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-accent); }

/* == shared: filter bar ==================================================== */
.filter-bar { margin: 0 0 var(--sp-6); }
.filter-fields {
    display: grid;
    /* at most four columns, each wide enough for "All countries" without truncating */
    grid-template-columns: repeat(auto-fill, minmax(max(11rem, (100% - 3 * var(--sp-4)) / 4), 1fr));
    align-items: end;
    gap: var(--sp-3) var(--sp-4);
}
.filter-fields .field { min-width: 0; }
/* sorting lives in the column heads on desktop; where the table stacks (no head row) it's a field.
   Hidden, the select is still submitted, so a filter change keeps the current sort. */
@media (min-width: 1024px) { .filter-fields .field--sort { display: none; } }
.filter-fields .field--action { justify-self: start; }
@media (max-width: 768px) {
    .filter-fields .field--action { grid-column: 1 / -1; justify-self: stretch; }
    .filter-fields .field--action button { width: 100%; }
}
.filter-fields label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); }
.filter-fields :is(select, input) { margin: 0; }

/* the drawer is only a drawer on phones; on wider screens it is a plain, always-open row */
.filter-drawer { margin: 0; border: 0; padding: 0; }
.filter-drawer > summary { display: none; }
@media (max-width: 768px) {
    .filter-drawer {
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-sm);
        padding: 0 var(--sp-4);
    }
    .filter-drawer > summary {
        display: flex;
        align-items: center;
        gap: var(--sp-2);
        min-height: 2.75rem;
        margin: 0;
        font-size: var(--text-sm);
        font-weight: 600;
        color: var(--color-text);
    }
    .filter-drawer > summary::after { margin-left: auto; }
    .filter-drawer[open] > summary { margin-bottom: var(--sp-2); }
    .filter-drawer .filter-fields { padding-bottom: var(--sp-4); }
    .filter-drawer .filter-fields { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
    .filter-count:not(:empty) {
        padding: 0.1rem 0.45rem;
        border-radius: var(--radius-sm);
        background: var(--color-accent-soft);
        color: var(--color-accent-hover);
        font-size: var(--text-xs);
        font-variant-numeric: tabular-nums;
    }
}

/* == shared: results bar, meta lines, tags ================================= */
.data-page .results-bar {
    align-items: center;
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--color-border);
}
.results-count { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.export-links { display: flex; align-items: center; gap: var(--sp-2); }
.export-label { font-size: var(--text-sm); color: var(--color-text-faint); margin-right: var(--sp-1); }
.export-links svg { flex-shrink: 0; }
.filter-meta, .caveat-note {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
    margin: 0 0 var(--sp-3);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.clear-link { font-size: var(--text-sm); }
/* sourced from an automated, self-reported connector: the warn badge with a dashed edge */
.badge--unverified { border: 1px dashed currentColor; }
.c-target .badge { margin-left: var(--sp-1); }

/* == shared: ledger table ================================================== */
/* #deal-results scrolls sideways in app.css; on the data pages the table stacks into entries on
   phones instead, so the wrapper can stay unclipped and the header can stick to the viewport. */
.data-page #deal-results { overflow: visible; }
.ledger-table { width: 100%; }
.ledger-table thead th { background: var(--color-bg); }
.ledger-table tbody tr:nth-child(even) { background-color: transparent; }
.ledger-table tbody tr:hover { background-color: color-mix(in srgb, var(--color-text) 4%, transparent); }
.ledger-table td { padding-block: var(--sp-3); }
.ledger-table tbody tr:last-child td { border-bottom: 1px solid var(--color-border); }
.ledger-table .c-date { white-space: nowrap; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ledger-table :is(.c-firm, .c-target, .c-name) { min-width: 12ch; }
.ledger-table .c-target { color: var(--color-text); font-weight: 500; }
.ledger-table .c-amount { white-space: nowrap; color: var(--color-text); }
@media (min-width: 1024px) {
    .ledger-table .c-country { white-space: nowrap; }
    .ledger-table .clamp {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
}
/* teal is for action: header rule in a neutral line, links in text colour until hovered */
.ledger-table thead th { border-bottom-color: var(--color-border-strong); }
.ledger-table td a { color: var(--color-text); text-decoration-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.ledger-table td a:is(:hover, :focus-visible) { color: var(--color-accent); text-decoration-color: currentColor; }
@media (min-width: 1024px) {
    .ledger-table--stack thead th { position: sticky; top: var(--masthead-h); z-index: 1; }
}

/* sortable column heads: the whole cell is the button; the chevron shows which way it sorts */
.ledger-table th[aria-sort] { padding: 0; }
.ledger-table th .sort {
    --pico-background-color: transparent;
    --pico-border-color: transparent;
    --pico-color: currentColor;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: 0 var(--sp-4);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}
.ledger-table th.num .sort { justify-content: flex-end; }
.ledger-table th .sort:hover { color: var(--color-text); }
.ledger-table th .sort:active { transform: none; }
.ledger-table th .sort:focus-visible { outline-offset: -2px; }
.sort-icon { flex-shrink: 0; fill: currentColor; }
.sort-icon path { opacity: 0.35; transition: opacity var(--dur-fast) ease, fill var(--dur-fast) ease; }
.ledger-table th:is([aria-sort="ascending"], [aria-sort="descending"]) { color: var(--color-text); }
th[aria-sort="ascending"] .sort-icon .up,
th[aria-sort="descending"] .sort-icon .down { opacity: 1; fill: var(--color-accent); }
th[aria-sort="ascending"] .sort-icon .down,
th[aria-sort="descending"] .sort-icon .up { opacity: 0.15; }

/* below 1024px the eight columns don't fit: each row becomes a ledger entry — target and amount
   on top, then the firm, then the facts (two entries per row on tablets) */
@media (max-width: 1023px) {
    .ledger-table--stack thead {
        position: absolute;
        width: 1px; height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .ledger-table--stack, .ledger-table--stack tbody { display: block; }
    .ledger-table--stack tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: var(--sp-1) 0;
        padding: var(--sp-4) 0;
        border-bottom: 1px solid var(--color-border);
    }
    .ledger-table--stack tbody tr:hover { background: transparent; }
    .ledger-table--stack td, .ledger-table--stack tbody tr:last-child td { padding: 0; border: 0; min-width: 0; }
    .ledger-table--stack .c-target { order: 1; flex: 1 1 60%; padding-right: var(--sp-4); font-size: var(--text-base); font-weight: 600; }
    .ledger-table--stack .c-amount { order: 2; flex: 0 0 auto; margin-left: auto; font-size: var(--text-base); font-weight: 600; }
    .ledger-table--stack .c-firm { order: 3; flex: 1 0 100%; }
    /* forced line break before the facts, for tables without a firm column (firm detail) */
    .ledger-table--stack tbody tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
    .ledger-table--stack .c-firm::before { content: "Firm\00a0" / ""; color: var(--color-text-faint); }
    /* facts separated by space, not dots, so a wrapped line never starts with a separator */
    .ledger-table--stack :is(.c-date, .c-sector, .c-country, .c-type, .c-status) { order: 4; margin-right: var(--sp-4); color: var(--color-text-muted); }
}
@media (min-width: 641px) and (max-width: 1023px) {
    .ledger-table--stack tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-8); }
}

/* ranked tables (firms, league): rank, firm, deals, then the volume column takes the slack, with
   a share bar that grows into it beside the figure — the ranking reads at a glance */
.ledger-table--rank .rank { width: 3ch; padding-right: 0; color: var(--color-text-faint); }
.ledger-table--rank .c-name a { font-weight: 500; }
.ledger-table--rank .c-volume { width: 50%; }
.vol { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-4); }
.vol-amount { flex: 0 0 6.5ch; text-align: right; }   /* fixed, so every bar ends on the same line */
.share-bar {
    position: relative;
    flex: 1 1 auto;
    max-width: 24rem;
    height: 6px;
    background: var(--color-border);
}
/* magnitude is data, not interaction: a neutral fill, never the brand teal */
.share-bar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--share, 0) * 100%);
    background: var(--color-text-muted);
}
@media (max-width: 640px) {
    .ledger-table--rank :is(th, td) { padding-inline: var(--sp-2); }
    .ledger-table--rank th { white-space: normal; }
    .ledger-table--rank .c-volume { width: 40%; }
    .vol { gap: var(--sp-2); }
}
@media (max-width: 399px) { .share-bar { display: none; } }

/* == shared: pager, empty state, source line =============================== */
.data-page .pager { justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-6); }
.data-page .pager-status { font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.data-page .empty-state {
    margin-top: var(--sp-2);
    padding: var(--sp-8) var(--sp-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.data-source {
    margin: var(--sp-12) 0 0;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-sm);
    color: var(--color-text-faint);
}

/* == shared: chart modules ================================================= */
.chart-module { margin: 0; }
.data-page .chart-module > header {
    display: block;
    margin: 0 0 var(--sp-4);
    padding: 0;
    background: none;
    border: 0;
}
.block-title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--color-text);
}
.block-sub { margin: var(--sp-1) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.chart-box--sm { height: 260px; }
.chart-box--legend { height: 320px; }   /* room for a legend below the plot */
@media (max-width: 640px) { .chart-box--legend { height: 360px; } }
.chart-foot { margin: var(--sp-3) 0 0; font-size: var(--text-xs); color: var(--color-text-faint); }
.chart-data .ledger-table thead th { position: static; }

/* == Trends ================================================================ */
.chart-grid { display: grid; gap: var(--sp-6); }
@media (min-width: 1024px) {
    .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid .chart-module--wide, .chart-grid.is-single > .chart-module { grid-column: 1 / -1; }
}
.chart-note { margin: var(--sp-4) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.league { margin-top: var(--space-section); }
.league > h2 { margin: 0; }
.section-dek { margin: var(--sp-2) 0 var(--sp-6); color: var(--color-text-muted); }

/* == Firm detail =========================================================== */
.firm-head .fact-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4) var(--sp-10);
    margin: var(--sp-6) 0 0;
}
.firm-head .fact-row dt {
    margin: 0 0 var(--sp-1);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}
.firm-head .fact-row dd { margin: 0; color: var(--color-text); text-align: start; }
/* the current crumb repeats the h1 just below it: one line is enough */
.firm-head nav.kicker [aria-current] { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firm-head nav.kicker a { display: inline-flex; align-items: center; min-height: 1.5rem; }
.firm-head .fact-row a { display: inline-flex; align-items: center; gap: var(--sp-1); }
/* key figures use the shared .stat-grid/.stat; on phones (2 columns) an odd last figure spans */
.key-figures { margin: 0 0 var(--sp-10); }
@media (max-width: 599px) { .key-figures > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.firm-grid { display: grid; gap: var(--sp-8); margin-bottom: var(--sp-12); }
.firm-grid > section { max-width: var(--measure); }
@media (min-width: 1024px) {
    .firm-grid.has-chart { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
}
.firm-grid .block-title { margin-bottom: var(--sp-3); }
.firm-deals > h2 { display: flex; align-items: baseline; gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.firm-deals .count {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text-faint);
    font-variant-numeric: tabular-nums;
}
.firm-more { margin: var(--sp-4) 0 0; }

/* == The Map ===============================================================
   Self-contained: the map fills the viewport under the masthead, with flat overlay cards
   (surface + hairline, no blur) for the title, status, details panel, hint and view toggle. */
body.globe-page { background: var(--color-bg); overflow: hidden; }
body.globe-page > main { padding: 0; }
#globe-wrap { position: relative; height: calc(100dvh - var(--masthead-h)); overflow: hidden; }
#globe { width: 100%; height: 100%; }

.globe-card {
    position: absolute;
    z-index: var(--z-raised);
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-surface-1);
    color: var(--color-text);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}

/* pins are real buttons (keyboard + screen reader); keep the global button chrome off them */
#globe .globe-pin {
    display: block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    line-height: 0;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6));
}
#globe .globe-pin svg { display: block; transform-origin: 50% 100%; transition: transform var(--dur-fast) var(--ease-out); }
#globe .globe-pin.is-selected svg { transform: scale(1.15); }
#globe .globe-pin:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* title card: the page's h1, what is shown, sector toggles and a list alternative to the pins */
#globe-legend {
    display: block;
    top: var(--sp-4);
    left: var(--sp-4);
    width: min(22rem, calc(100% - 2 * var(--sp-4)));
    padding: var(--sp-4);
}
#globe-legend h1 { margin: 0; font-size: var(--text-lg); line-height: var(--leading-snug); }
.globe-summary { margin: var(--sp-1) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); width: auto; margin: var(--sp-3) 0 0; box-shadow: none; }
.chip-row > .sector-chip { flex: 0 0 auto; }   /* Pico stretches [role=group] children */
.sector-chip {
    --pico-background-color: transparent;
    --pico-border-color: var(--color-border);
    --pico-color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    width: auto;
    min-height: 2.25rem;
    margin: 0;
    padding: 0 var(--sp-3);
    border: 1px solid var(--pico-border-color);
    border-radius: var(--radius-sm);
    background-color: var(--pico-background-color);
    color: var(--pico-color);
    opacity: 1;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
/* off: outline, muted text, hollow dot. on: filled surface, full text, filled dot */
.sector-chip { --pico-color: var(--color-text-muted); }
.sector-chip:hover { --pico-border-color: var(--color-border-hover); --pico-color: var(--color-text); }
.sector-chip[aria-pressed="true"] {
    --pico-background-color: var(--color-surface-3);
    --pico-border-color: var(--color-border-hover);
    --pico-color: var(--color-text);
}
.legend-dot {
    box-sizing: border-box;
    display: inline-block;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--chip-color);
    background: transparent;
}
.sector-chip[aria-pressed="true"] .legend-dot, .globe-list .legend-dot { background: var(--chip-color); }
.chip-count { color: var(--color-text-faint); font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .sector-chip { min-height: 2.75rem; } }

.globe-list { margin: var(--sp-3) 0 0; border-top: 1px solid var(--color-border); }
.globe-list > summary { padding-top: var(--sp-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.globe-list > summary:hover { color: var(--color-text); }
.globe-list ul { max-height: 40vh; margin: var(--sp-2) 0 0; padding: 0; overflow-y: auto; }
.globe-list li { list-style: none; margin: 0; padding: 0; }
.globe-list li button {
    --pico-background-color: transparent;
    --pico-border-color: transparent;
    --pico-color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: var(--sp-1) var(--sp-2);
    text-align: left;
    font-weight: 500;
}
.globe-list li button:hover { --pico-background-color: var(--color-surface-2); }
.globe-list .list-name { flex: 1 1 0; min-width: 0; }
.globe-list .list-meta { flex: none; margin-left: auto; color: var(--color-text-faint); font-weight: 400; font-variant-numeric: tabular-nums; }

/* loading / error card, centred over the map */
.globe-status {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 2 * var(--sp-4));
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* first-contact hint: pointer and touch wording, gone after the first interaction */
#globe-hint {
    bottom: var(--sp-4);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    transition: opacity var(--dur-base) var(--ease-out), visibility 0s;
}
#globe-hint.is-dismissed { opacity: 0; visibility: hidden; transition-delay: 0s, var(--dur-base); }
.hint-touch { display: none; }
@media (hover: none) {
    .hint-pointer { display: none; }
    .hint-touch { display: inline; }
}

/* projection: two-button segmented control */
#proj-toggle {
    bottom: var(--sp-4);
    left: var(--sp-4);
    display: flex;
    gap: 2px;
    width: auto;           /* Pico stretches [role=group] full width */
    margin: 0;
    padding: 2px;
}
#proj-toggle button {
    --pico-background-color: transparent;
    --pico-border-color: transparent;
    --pico-color: var(--color-text-muted);
    flex: none;
    min-height: 2.25rem;
    margin: 0;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    font-weight: 500;
}
#proj-toggle button:hover { --pico-color: var(--color-text); }
#proj-toggle button[aria-pressed="true"] { --pico-background-color: var(--color-surface-3); --pico-color: var(--color-text); }
@media (pointer: coarse) { #proj-toggle button { min-height: 2.75rem; } }

/* company detail panel */
#pin-panel {
    position: fixed;
    top: calc(var(--masthead-h) + var(--sp-4));
    right: var(--sp-4);
    z-index: var(--z-panel);
    width: min(22rem, calc(100vw - 2 * var(--sp-4)));
    max-height: calc(100dvh - var(--masthead-h) - 2 * var(--sp-4));
    overflow-y: auto;
    padding: var(--sp-4);
}
#pin-panel header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-2); }
#pin-panel p { margin: 0 0 var(--sp-2); color: var(--color-text-muted); }
#panel-name { margin: 0; font-size: var(--text-lg); line-height: var(--leading-snug); }
#panel-close {
    --pico-background-color: transparent;
    --pico-border-color: transparent;
    --pico-color: var(--color-text-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    margin: calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)) 0 0;
    padding: 0;
}
#panel-close:hover { --pico-color: var(--color-text); --pico-background-color: var(--color-surface-2); }
#panel-close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
#pin-panel .approx { color: var(--color-text-faint); }
#panel-total { color: var(--color-text); font-variant-numeric: tabular-nums; }
#panel-deals { margin: var(--sp-3) 0 0; padding: 0; }
#panel-deals .panel-deal {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
    margin: 0;
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--color-border);
}
.panel-deal a { font-weight: 600; }
.panel-deal-amount { margin-left: auto; font-variant-numeric: tabular-nums; }
.panel-deal-meta { flex: 1 0 100%; font-size: var(--text-sm); color: var(--color-text-faint); font-variant-numeric: tabular-nums; }

/* MapLibre's own controls, re-skinned from white to the card surface (ids outrank its stylesheet) */
#globe .maplibregl-ctrl-group {
    background: var(--color-surface-1);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}
#globe .maplibregl-ctrl-group button {
    width: 2.25rem;
    height: 2.25rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
}
#globe .maplibregl-ctrl-group button + button { border-top: 1px solid var(--color-border); }
#globe .maplibregl-ctrl-group button:hover { background-color: var(--color-surface-2); }
/* the stock icons are dark glyphs drawn for a white control; invert them for the navy one */
#globe .maplibregl-ctrl-icon, #globe .maplibregl-ctrl-attrib-button { filter: invert(1) brightness(0.85); }
#globe .maplibregl-ctrl-attrib {
    background-color: var(--color-surface-1);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
#globe .maplibregl-ctrl-attrib a { color: var(--color-text-muted); }
#globe .maplibregl-ctrl-attrib a:hover { color: var(--color-text); }
#globe .maplibregl-ctrl-attrib-button { background-color: transparent; min-height: 0; padding: 0; border: 0; }
@media (pointer: coarse) {
    #globe .maplibregl-ctrl-group button { width: 2.75rem; height: 2.75rem; }
}

@media (max-width: 640px) {
    #globe-legend { top: var(--sp-3); left: var(--sp-3); width: calc(100% - 2 * var(--sp-3)); padding: var(--sp-3); }
    /* phones know pinch and tap; the hint would only crowd the controls along the bottom edge */
    #globe-hint { display: none; }
    /* sit above the map attribution line */
    #proj-toggle { left: var(--sp-3); bottom: 2.25rem; }
    #pin-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 60dvh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom: 0;
    }
}
