.ub {
    --ub-line: var(--line, #94a3b8);
    --ub-accent: #086b81;
    display: grid;
    gap: 1.2rem;
    min-width: 0;
}
main.ub > * { animation: none; }
.ub :is(h1, h2, h3, p) { margin: 0; }
.ub a { text-underline-offset: .18em; overflow-wrap: anywhere; }
.ub-crumb, .ub-legend, .ub-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.ub-crumb { font-size: .875rem; }
.ub-crumb a::after { content: "›"; display: inline-block; margin-inline-start: .6rem; color: currentColor; }
.ub-hero {
    border: 1px solid var(--ub-line);
    border-radius: 1rem;
    background: linear-gradient(115deg, #063d52, #0c596a);
    color: #f7fbfc;
    padding: clamp(1.1rem, 3vw, 1.9rem);
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.4rem;
}
.ub-hero h1 { color: inherit; font-size: clamp(2.05rem, 5vw, 3.6rem); line-height: 1.1; overflow-wrap: anywhere; margin-bottom: .65rem; }
.ub-hero p { color: inherit; max-width: 56ch; }
.ub-hero .ub-kicker { margin-bottom: .55rem; color: #c6edf3; }
.ub-total { min-width: max-content; display: grid; justify-items: end; line-height: 1.1; }
.ub-total strong { font-size: clamp(1.65rem, 3vw, 2.7rem); }
.ub-total span { font-size: .875rem; margin-top: .25rem; color: #d0ebee; }
.ub-note, .ub-history, .ub-sources {
    border: 1px solid var(--ub-line);
    padding: 1rem 1.2rem;
    border-radius: .8rem;
    display: grid;
    gap: .45rem;
}
.ub-note { border-inline-start: .3rem solid #168aa3; }
.ub-note h2, .ub-sources h2 { font-size: 1.1rem; }
.ub-filters {
    display: grid;
    grid-template-columns: minmax(0,1.6fr) repeat(2,minmax(0,1fr)) max-content;
    gap: .8rem;
    align-items: end;
}
.ub-filters--countries { grid-template-columns: minmax(0,1.6fr) repeat(3,minmax(0,1fr)) max-content; }
.ub-filters label { display: grid; gap: .28rem; font-weight: 600; }
.ub :is(input, select, button) { min-height: 44px; }
.ub-filters :is(input, select) {
    width: 100%;
    padding: .45rem .65rem;
    color: inherit;
    background: transparent;
    border: 1px solid var(--ub-line);
    border-radius: .55rem;
}
.ub button {
    padding: .45rem .8rem;
    border: 1px solid var(--ub-accent);
    border-radius: .55rem;
    background: var(--ub-accent);
    color: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
.ub-map, .ub-results, .ub-regions { display: grid; gap: .65rem; }
.ub [hidden] { display: none !important; }
.ub-sectionhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; align-items: center; }
.ub-sectionhead > h2 > span { font-size: .85em; margin-inline-start: .2em; }
.ub-frame { position: relative; }
.ub-frame > canvas {
    width: 100%;
    height: clamp(22rem, 55vw, 33rem);
    display: block;
    border-radius: .8rem;
    border: 1px solid var(--ub-line);
    cursor: grab;
    touch-action: none;
}
.ub-frame > canvas:active { cursor: grabbing; }
.ub-frame > canvas:focus-visible { outline: 3px solid #328bad; outline-offset: 3px; }
.ub-controls { position: absolute; top: .65rem; right: .65rem; display: grid; gap: .25rem; }
.ub-controls button { min-width: 44px; font-size: 1.22rem; }
.ub-selection { border: 1px solid var(--ub-line); border-radius: .65rem; padding: .75rem; }
.ub-selection ul { margin: .4rem 0; padding: 0; list-style: none; }
.ub-selection li { display: flex; gap: .5rem; justify-content: space-between; padding: .24rem; }
.ub-selection li span { text-align: end; }
.ub-map-status:empty { display: none; }
.ub-badge {
    border-radius: 1rem;
    padding: .18rem .53rem;
    font-weight: 650;
    font-size: .78rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    vertical-align: middle;
    color: #0f2231;
    background: #dce3ec;
}
.ub-badge::before { content: ""; flex: 0 0 .6rem; height: .6rem; border-radius: 50%; background: #64748b; }
.ub-badge[data-quality=excellent] { background: #cdeef2; }
.ub-badge[data-quality=excellent]::before { background: #007a91; }
.ub-badge[data-quality=good] { background: #d2ecd7; }
.ub-badge[data-quality=good]::before { background: #23814c; }
.ub-badge[data-quality=sufficient] { background: #f7e7b2; }
.ub-badge[data-quality=sufficient]::before { background: #9b6b0b; }
.ub-badge[data-quality=poor] { background: #f5dbe5; }
.ub-badge[data-quality=poor]::before { background: #a03e65; }
.ub-list, .ub-regions ul {
    padding: 0;
    margin: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .55rem;
}
.ub-list li, .ub-regions a, .ub-history dl > div {
    border: 1px solid var(--ub-line);
    border-radius: .6rem;
    padding: .72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}
.ub-list li div { min-width: 0; }
.ub-list li a { font-weight: 650; }
.ub-list li small { display: block; margin-top: .2rem; }
.ub-list li .ub-badge { max-width: 50%; }
.ub-list li small, .ub-regions a span { font-variant-numeric: tabular-nums; }
.ub-pages { justify-content: center; padding-top: .4rem; }
.ub-regions ul { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ub-history dl { margin: .35rem 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.ub-history dd { margin: 0; text-align: end; }
.ub-history dt { font-weight: 700; }
.ub-coordinates { font-variant-numeric: tabular-nums; }
.ub-sources { font-size: .875rem; }
@media (max-width: 780px) {
    .ub-filters, .ub-filters--countries { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ub-filters label:first-child { grid-column: 1 / -1; }
    .ub-regions ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
    .ub-hero { display: grid; gap: .8rem; }
    .ub-total { display: flex; justify-items: start; align-items: baseline; gap: .5rem; }
    .ub-list, .ub-history dl { grid-template-columns: 1fr; }
    .ub-frame > canvas { height: 23rem; }
}

.ub-legend a[aria-current="true"] { font-weight: 750; text-decoration-thickness: 2px; }
.ub-badge[data-quality=clear]::before { background: #23814c; }
.ub-badge[data-quality=warning]::before { background: #9b6b0b; }
.ub-badge[data-quality=avoid]::before { background: #b65a1c; }
.ub-badge[data-quality=closed]::before { background: #ba2640; }
.ub-badge[data-quality=closed_permanent]::before { background: #781d39; }
.ub-badge[data-quality=outside]::before { background: #8798a8; }
@media (min-width: 781px) {
    .ub-filters { grid-template-columns: minmax(0,1.6fr) repeat(3,minmax(0,1fr)) max-content; }
    .ub-filters--countries { grid-template-columns: minmax(0,1.6fr) repeat(4,minmax(0,1fr)) max-content; }
}
.ub-badge[data-quality=cold]::before { background: #1d5da8; }
.ub-badge[data-quality=cool]::before { background: #0c7481; }
.ub-badge[data-quality=warm]::before { background: #896108; }
.ub-badge[data-quality=hot]::before { background: #b53e2f; }

.ub-report-table { overflow: auto; }
.ub-report-table table { border-collapse: collapse; width: 100%; }
.ub-report-table th, .ub-report-table td { padding: .5rem; border-bottom: 1px solid var(--ub-line); text-align: end; }
.ub-report-table th:first-child { text-align: start; }

.ub-badge[data-quality=closure_reported]::before { background: #ba2640; }

.ub-basemap { position: absolute; inset: 1px; border-radius: .8rem; overflow: hidden; pointer-events: none; }
.ub-frame > canvas { position: relative; }
@media (max-width: 520px) {
    .ub-selection:not([hidden]) {
        position: fixed; inset: auto 0 0; z-index: 30; max-height: 55vh; overflow: auto;
        border-radius: .8rem .8rem 0 0; color: var(--text, #152330);
        background: var(--surface, #f6f6ef); box-shadow: 0 -.25rem 1rem #0004;
    }
}

.ub-map-near { display:flex; flex-wrap:wrap; align-items:end; gap:.45rem; }
.ub-map-near[hidden] { display:none; }
.ub-map-near label { display:grid; gap:.15rem; font-size:.83rem; }
.ub-map-near select { color:inherit; background:var(--bg, #fff); border:1px solid var(--ub-line); border-radius:.35rem; padding:.24rem .4rem; }
.ub-marker-details { margin:.45rem 0; font-size:.91rem; }
.ub-marker-details p { margin:.18rem 0; }

.ub-detail-map .ub-frame > canvas { height: min(48vh, 19rem); }

.ub-model-badge { border: 2px dashed currentColor; }

.ub .ub-osm-credit { display:none; }
.ub-map[data-ub-vector=ready] .ub-osm-credit {
    display:block; position:absolute; left:.35rem; bottom:.35rem; padding:.1rem .35rem;
    border-radius:.25rem; font-size:.73rem; background:var(--bg,#fff); color:var(--text,#243444);
}
