/* My Atlas – the maps (379a, D553): the SVG world map (map/svgmap.js), the tile map's frame (app/glmap.js), fullscreen (map/fullscreen.js).
   On the my-gui tokens (load the my-gui stylesheets first). Every class starts with bmap-. */

/* ---- the host and the SVG ---- */
.bmap { position: relative; width: 100%; }
.bmap-svg { display: block; width: 100%; height: auto; touch-action: pan-x pan-y; cursor: grab; user-select: none; }
.bmap-svg.is-drag { cursor: grabbing; }
.bmap--armed .bmap-svg { touch-action: none; }   /* a touch selected the map: drag and pinch move it, not the page (C0053) */
.bmap--scroll { overflow-x: auto; }
.bmap--scroll .bmap-svg { min-width: 680px; }   /* a phone scrolls the map sideways */

/* ---- colours: a 7-step multi-hue ramp with orange bubbles on the dark theme, the my-gui sequence and accent on the light ones ---- */
:root {
  --bmap-r1: #2B2F6E; --bmap-r2: #2F3F9E; --bmap-r3: #2460C2; --bmap-r4: #1C85CC; --bmap-r5: #17A6BF; --bmap-r6: #22C3A2; --bmap-r7: #8BDB86;
  --bmap-bub: 255, 138, 61; --bmap-bub-edge: #FF8A3D; --bmap-bub-pri: #FFB070; --bmap-pin: #F4F1EA;
}
:root[data-theme="light"], :root[data-theme="beige"] {
  --bmap-r1: var(--m-seq-1); --bmap-r2: var(--m-seq-2); --bmap-r3: var(--m-seq-3); --bmap-r4: var(--m-seq-4); --bmap-r5: var(--m-seq-5); --bmap-r6: var(--m-seq-6); --bmap-r7: var(--m-seq-7);
  --bmap-bub: var(--m-accent-rgb); --bmap-bub-edge: var(--m-accent); --bmap-bub-pri: var(--m-accent); --bmap-pin: var(--m-text);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bmap-r1: var(--m-seq-1); --bmap-r2: var(--m-seq-2); --bmap-r3: var(--m-seq-3); --bmap-r4: var(--m-seq-4); --bmap-r5: var(--m-seq-5); --bmap-r6: var(--m-seq-6); --bmap-r7: var(--m-seq-7);
    --bmap-bub: var(--m-accent-rgb); --bmap-bub-edge: var(--m-accent); --bmap-bub-pri: var(--m-accent); --bmap-pin: var(--m-text);
  }
}

/* ---- countries: the ramp step (bmap-s1..7), dimmed, clickable, hatched ---- */
.bmap-c { fill: rgba(var(--m-ink), .07); stroke: var(--m-card-solid); stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .3s var(--m-ease), opacity .3s; }
.bmap-c.is-dim { fill: rgba(var(--m-ink), .06); }
.bmap-c.is-click { cursor: pointer; }
.bmap-c.is-click:hover { opacity: .85; }
.bmap-s1 { fill: var(--bmap-r1); }
.bmap-s2 { fill: var(--bmap-r2); }
.bmap-s3 { fill: var(--bmap-r3); }
.bmap-s4 { fill: var(--bmap-r4); }
.bmap-s5 { fill: var(--bmap-r5); }
.bmap-s6 { fill: var(--bmap-r6); }
.bmap-s7 { fill: var(--bmap-r7); }
.bmap-hatch { pointer-events: none; vector-effect: non-scaling-stroke; }
.bmap-hatch-line { stroke: rgba(var(--m-ink), .55); stroke-width: .65; }
.bmap-grat { stroke: rgba(var(--m-ink), .08); stroke-width: 1; }

/* ---- pins (points) and bubbles (one value per area) ---- */
.bmap-pin { fill: var(--bmap-pin); stroke: var(--m-card-solid); stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; }
.bmap-pin:hover, .bmap-pin:focus-visible { fill: var(--m-accent); outline: none; }
.bmap-bub { cursor: pointer; outline: none; }
.bmap-bub circle { fill: rgba(var(--bmap-bub), .18); stroke: var(--bmap-bub-edge); stroke-opacity: .8; stroke-width: 1.4; vector-effect: non-scaling-stroke; transition: fill .2s; }
.bmap-bub.is-pri circle { fill: rgba(var(--bmap-bub), .34); stroke: var(--bmap-bub-pri); stroke-opacity: 1; stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(var(--bmap-bub), .55)); }
.bmap-bub:hover circle, .bmap-bub:focus-visible circle { fill: rgba(var(--bmap-bub), .5); }
.bmap-bub:focus-visible circle { stroke: var(--m-ring); stroke-width: 3; }
.bmap-bub text { text-anchor: middle; font-family: var(--m-font); pointer-events: none; paint-order: stroke; stroke: var(--m-card-solid); stroke-width: 3px; stroke-linejoin: round; }
.bmap-bub-v { font-size: 12px; font-weight: 800; fill: var(--m-text); font-variant-numeric: tabular-nums; }
.bmap-bub-n { font-size: 10.5px; font-weight: 700; fill: var(--m-text-2); }

/* ---- the buttons (top right) and the OpenStreetMap credit of the detail layer (ODbL, 298a) ---- */
.bmap-ctl { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.bmap-ctl .m-btn { width: 30px; height: 30px; padding: 0; font-size: 16px; font-weight: 800; }
.bmap-none { margin: 0; padding: 40px 16px; text-align: center; font-size: 13px; color: var(--m-text-2); }   /* no shapes: the message instead of the map */
.bmap-attr { position: absolute; left: 8px; bottom: 6px; z-index: 2; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; color: var(--m-text-2); background: var(--m-card-solid); opacity: .9; pointer-events: none; }

/* ---- the legend under a map card ---- */
.bmap-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px 14px; border-top: 1px solid var(--m-line); }
.bmap-key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; color: var(--m-text-2); }
.bmap-key i { flex: none; width: 22px; height: 10px; border-radius: 3px; }
.bmap-key--ramp i { background: linear-gradient(90deg, var(--bmap-r1), var(--bmap-r3), var(--bmap-r5), var(--bmap-r7)); }
.bmap-key--bub i { width: 10px; height: 10px; border-radius: 50%; background: rgba(var(--bmap-bub), .35); box-shadow: inset 0 0 0 1.5px var(--bmap-bub-edge); }
.bmap-key--hatch i { background: repeating-linear-gradient(45deg, rgba(var(--m-ink), .55) 0 1.3px, transparent 1.3px 4px); box-shadow: inset 0 0 0 1px rgba(var(--m-ink), .2); }
.bmap-key--pin i { width: 8px; height: 8px; border-radius: 50%; background: var(--bmap-pin); }

/* 298b: the MapLibre renderer (app/glmap.js) fills the host at the world map's proportions */
.bmap--gl { aspect-ratio: 900 / 441; min-height: 260px; overflow: hidden; border-radius: inherit; }
.bmap--gl .maplibregl-canvas { outline: none; }
:root { --bmap-ctl-inv: invert(.9); }
:root[data-theme="light"], :root[data-theme="beige"] { --bmap-ctl-inv: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bmap-ctl-inv: none; } }
.bmap--gl .maplibregl-ctrl.maplibregl-ctrl-attrib, .bmap--gl .maplibregl-ctrl-attrib.maplibregl-compact, .bmap--gl .maplibregl-ctrl-attrib.maplibregl-compact-show { font-size: 10px; background: var(--m-card-solid); color: var(--m-text-2); border-radius: 0; margin: 0; }   /* the sea colour, the app text; the vendor sheet comes later, so the selector is stronger */
.bmap--gl .maplibregl-ctrl-attrib a, .bmap--gl .maplibregl-ctrl-attrib-button { color: var(--m-text-2); }
.bmap--gl .maplibregl-ctrl-attrib-button { background-color: transparent; filter: var(--bmap-ctl-inv); }
.bmap--gl .maplibregl-ctrl-group { background: var(--m-card-solid); border: 1px solid var(--m-line-strong); box-shadow: none; }
.bmap--gl .maplibregl-ctrl-group button { color: var(--m-text); }
.bmap--gl .maplibregl-ctrl-group button + button { border-top: 1px solid var(--m-line); }
.bmap--gl .maplibregl-ctrl-group button:hover { background: rgba(var(--m-ink), .08); }
.bmap--gl .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: var(--bmap-ctl-inv); }
.bmap--gl .bmap-globe[aria-pressed="true"], .bmap--gl .bmap-mode[aria-expanded="true"] { background: rgba(var(--m-ink), .14); }
.bmap-tip .maplibregl-popup-content { padding: 4px 8px; font-size: 12px; background: var(--m-card-solid); color: var(--m-text); border-radius: 6px; }
.bmap-tip .maplibregl-popup-tip { display: none; }
.bmap--gl .bmap-reset { color: #333; }   /* MapLibre's buttons are white on both themes */
/* 298b b4b: the radar pulse of the trip going on now (the rings animate through motion.css .app-now-ring) */
.app-gl-now { width: 40px; height: 40px; cursor: pointer; }
.app-gl-now svg { display: block; overflow: visible; }
.bmap-mv { fill-opacity: .72; stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: grab; }
.bmap-svg.is-mv .bmap-mv, .bmap-svg.is-mv { cursor: grabbing; }
.bmap-mv:focus-visible { outline: 2px solid var(--m-focus, currentColor); }

/* 345: fullscreen button in the top-right corner of every map (map/fullscreen.js); the zoom buttons move below it */
.bmap-fs { position: absolute; right: 10px; top: 10px; z-index: 3; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bmap:has(> .bmap-fs) > .bmap-ctl { top: 48px; }
.bmap--gl:has(> .bmap-fs) .maplibregl-ctrl-top-right { top: 38px; }
.bmap.bmap-fs-on { background: var(--m-card-solid, var(--m-bg, #000)); }
.bmap.bmap-fs-on, .bmap.bmap-fs-css { width: 100%; height: 100%; aspect-ratio: auto; max-width: none; border-radius: 0; }
.bmap.bmap-fs-on .bmap-svg, .bmap.bmap-fs-css .bmap-svg { height: 100%; }
.bmap.bmap-fs-css { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 2147483000; background: var(--m-card-solid, var(--m-bg, #000)); }
html.bmap-fs-lock, html.bmap-fs-lock body { overflow: hidden; }
/* 345: what fills the window sits in the top layer (popover), so a window around the map cannot hold it in */
/* !important: a page sizes its own map (sticky, a fixed height, an aspect ratio), none of it may hold in fullscreen */
.bmap-fs-full, .bmap-fs-full[popover] { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important; max-width: none !important; max-height: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; overflow: hidden; z-index: 2147483000; transform: none !important; animation: none !important; filter: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; contain: none !important; container-type: normal !important; aspect-ratio: auto !important; color: var(--m-text); background: var(--m-card-solid, var(--m-bg, #000)); }
.bmap-fs-full .bmap-svg { width: 100%; height: 100% !important; max-height: none !important; }
.bmap-fs-box .bmap.bmap-fs-css { position: relative !important; inset: auto !important; width: 100% !important; height: 100% !important; min-height: 0; max-height: none !important; z-index: auto; aspect-ratio: auto !important; }
/* with layer switches: one scrolling column on the left (map switches, comparison, layers, legend of the points), the map beside it */
.bmap-fs-box > .bmap-fs-off { display: none !important; }
.bmap-fs-box.bmap-fs-sided { --bmap-side: 260px; display: block; overflow-y: auto !important; }
.bmap-fs-box > .bmap-fs-side { width: var(--bmap-side); margin: 0 !important; padding: 10px 14px !important; border: 0 !important; border-right: 1px solid var(--m-line) !important; border-bottom: 1px solid var(--m-line) !important; min-width: 0; }
.bmap-fs-box > .app-coll-leg.bmap-fs-side { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; justify-content: flex-start; gap: 4px; }
.bmap-fs-box > .app-layers-fold:not([open]) ~ .app-coll-leg, .bmap-fs-box > .app-coll-leg:empty { display: none !important; }
.bmap-fs-side .app-layers { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0 0 !important; border: 0 !important; }
.bmap-fs-side .app-layers > .app-muted:first-child { display: none; }
.bmap-fs-box > .app-map-head.bmap-fs-side { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; }
.bmap-fs-side .m-seg { flex-direction: column; align-items: stretch; max-width: 100%; overflow: visible; }
.bmap-fs-side .m-seg > button { justify-content: flex-start; flex: none; }
.bmap-fs-side .m-seg > button[aria-selected="true"] { background: var(--m-raise); box-shadow: var(--m-raise-sh); }
.bmap-fs-side .m-seg-ind { display: none; }
.bmap-fs-side.app-map-head .app-save { margin-left: 0; }
.bmap-fs-side .app-cmp-q { max-width: 100%; width: 100%; }
.bmap-fs-box.bmap-fs-sided > .bmap-fs-main { position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: var(--bmap-side) !important; width: auto !important; height: auto !important; min-width: 0; min-height: 0; max-height: none !important; margin: 0 !important; aspect-ratio: auto !important; border-radius: 0; }
@media (max-width: 640px) {
  .bmap-fs-box.bmap-fs-sided { display: flex; flex-direction: column; }
  .bmap-fs-box > .bmap-fs-side { flex: none; width: 100%; max-height: 22vh; overflow: auto; border-right: 0 !important; }
  .bmap-fs-box.bmap-fs-sided > .bmap-fs-main { position: relative !important; inset: auto !important; flex: 1 0 55vh; width: 100% !important; }
}
/* a window opened from the full map, in the top layer above it */
.m-modal.bmap-fs-over { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; overflow: visible; color: var(--m-text); }
/* the detailed map is on its way (the library, the style, the first tiles) */
.bmap-loading { position: relative; min-height: 200px; }
.bmap-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 4; border-radius: 50%; border: 3px solid rgba(var(--m-ink), .18); border-top-color: var(--m-accent); animation: bmap-spin .8s linear infinite; pointer-events: none; }
@keyframes bmap-spin { to { transform: rotate(360deg); } }
