/* Night-time lights dashboard — premium dark theme, immersive hero, advanced map, exports & a11y.
 * Shared by the FR and EN sites (dash_shared/map_ext.css), loaded after style.css and ext.css. */

/* ================================================================ tokens: a deep "night" dark theme */
:root { --focus: #1F4E8C; --spark: #00704A; --night-0: #03060d; --night-1: #071222; }
:root[data-theme="dark"] {
  --page: #060a12; --surface: #0d141f; --surface-2: #131c2a;
  --ink: #edf1f6; --ink-2: #b4bfcc; --muted: #8b97a7; --grid: #1d2836; --axis: #34445a;
  --border: rgba(160, 190, 230, .13); --focus: #F5C242; --spark: #F5C242;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --page: #060a12; --surface: #0d141f; --surface-2: #131c2a;
    --ink: #edf1f6; --ink-2: #b4bfcc; --muted: #8b97a7; --grid: #1d2836; --axis: #34445a;
    --border: rgba(160, 190, 230, .13); --focus: #F5C242; --spark: #F5C242;
  }
}

/* ================================================================ global ergonomics */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a:focus-visible, button:focus-visible { border-radius: 8px; }
.icon-btn { width: 40px; height: 40px; }
.lang-btn { height: 40px; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; }
.seg button { min-height: 40px; }
input[type="search"], select { min-height: 40px; }
:root[data-theme="dark"] .topbar { background: linear-gradient(120deg, #02150f 0%, #003524 48%, #00553A 100%); }
:root[data-theme="dark"] .tabs { background: rgba(9, 14, 22, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .uc:not(.uc-ai) {
  background: linear-gradient(180deg, #0f1724 0%, var(--surface) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; }
:root[data-theme="dark"] .kpi { border-top-color: #00A86A; }
:root[data-theme="dark"] .kpi .value { color: #fff; }
:root[data-theme="dark"] .seg { background: var(--surface-2); }
:root[data-theme="dark"] table.data th { background: #111a27; }
:root[data-theme="dark"] .banner { background: #2a2210; }
.kpi .value { font-variant-numeric: tabular-nums; }
.kpi.kin { animation: kin .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes kin { from { opacity: 0; transform: translateY(10px); } }
body:has(#page-map:not([hidden])) .ai-fab { display: none; }
.js-plotly-plot .plotly .modebar { background: transparent !important; }
.js-plotly-plot .plotly .modebar-btn path { fill: var(--ink-2) !important; }
.js-plotly-plot .plotly .modebar-btn:hover path { fill: var(--ink) !important; }

/* ---- CSV buttons */
.csv-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  font: 600 .86rem/1 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, background .15s; }
.csv-btn svg { width: 18px; height: 18px; }
.csv-btn:hover { border-color: var(--afdb-light); background: var(--surface-2); }
.csv-btn.small { min-height: 40px; font-size: .8rem; }
#page-regions .toolbar .csv-btn { margin-left: auto; }
.csv-row { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.card.flush > .csv-row { margin: 8px 8px 0; }

/* ---- toast */
.mx-toast { position: fixed; left: 50%; bottom: 28px; z-index: 6000; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; font: 600 .9rem/1.2 var(--font); color: #fff; background: rgba(10, 16, 26, .94);
  border: 1px solid rgba(245, 194, 66, .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.mx-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ================================================================ HERO */
.hx { position: relative; overflow: hidden; isolation: isolate; color: #eef2f7; background: var(--night-0);
  border-bottom: 1px solid rgba(245, 194, 66, .22); }
.hx-sky { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 75% at 74% 48%, rgba(63, 127, 199, .20), transparent 70%),
    radial-gradient(45% 70% at 0% 105%, rgba(0, 112, 74, .38), transparent 70%),
    radial-gradient(30% 40% at 100% 0%, rgba(245, 194, 66, .07), transparent 70%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 58%, #050b15 100%); }
.hx-sky::after { content: ""; position: absolute; inset: 0; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent 60%), radial-gradient(1px 1px at 33% 68%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 47% 14%, rgba(255,255,255,.45), transparent 60%), radial-gradient(1px 1px at 58% 82%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 8% 88%, rgba(255,255,255,.35), transparent 60%), radial-gradient(1.2px 1.2px at 27% 41%, rgba(255,240,200,.5), transparent 60%),
    radial-gradient(1px 1px at 41% 93%, rgba(255,255,255,.3), transparent 60%), radial-gradient(1px 1px at 92% 12%, rgba(255,255,255,.4), transparent 60%); }
.hx::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(245, 194, 66, .7), transparent); }
.hx-inner { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 5vw, 60px) 16px clamp(22px, 3.5vw, 44px);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 56px); align-items: center; min-height: min(640px, 74vh); }
.hx-copy { min-width: 0; }
.hx-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 700 .74rem/1.2 var(--font); letter-spacing: .16em; text-transform: uppercase; color: #c9d6e6; }
.hx-dot { width: 8px; height: 8px; border-radius: 50%; background: #F5C242; box-shadow: 0 0 0 4px rgba(245, 194, 66, .15), 0 0 14px #F5C242; }
.hx-title { margin: .45em 0 .38em; font-size: clamp(2.1rem, 4.7vw, 3.95rem); line-height: 1.02; font-weight: 800; letter-spacing: -.028em; color: #fff; text-wrap: balance; }
.hx-title span { display: block; background: linear-gradient(92deg, #F5C242 0%, #ffe9b0 55%, #F5C242 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-country { margin: 0 0 14px; font-size: 1.12rem; color: #d6dfea; }
.hx-country b { color: #fff; font-weight: 700; }
.hx-pitch { margin: 0; max-width: 54ch; font-size: clamp(1rem, 1.25vw, 1.13rem); line-height: 1.62; color: #b9c6d6; }
.hx-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hx-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 700 .98rem/1 var(--font);
  text-decoration: none; transition: transform .18s, box-shadow .18s, background .18s, border-color .18s; }
.hx-btn.primary { color: #1b1400; background: linear-gradient(135deg, #F7CD5E, #E9A91F); box-shadow: 0 8px 28px rgba(245, 194, 66, .28); }
.hx-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(245, 194, 66, .38); }
.hx-btn.ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .05); }
.hx-btn.ghost:hover { border-color: #F5C242; background: rgba(245, 194, 66, .08); }
.hx-spark { color: #F5C242; }
.hx-btn:focus-visible, .hx-play:focus-visible { outline: 3px solid #F5C242; outline-offset: 3px; border-radius: 999px; }
.hx-meta { margin: 22px 0 0; font-size: .82rem; color: #93a3b8; letter-spacing: .02em; }
.hx-vis { position: relative; margin: 0; min-width: 0; height: clamp(380px, 60vh, 580px); display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.hx-frame { position: relative; min-height: 0; }
.hx-frame::before { content: ""; position: absolute; inset: 8% 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(245, 194, 66, .10), transparent); filter: blur(10px); }
.hx-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.1s ease;
  filter: saturate(1.25) brightness(1.35) drop-shadow(0 0 6px rgba(255, 170, 90, .55)) drop-shadow(0 0 18px rgba(245, 120, 60, .35)); }
.hx-img.on { opacity: 1; }
.hx-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hx-grat { fill: none; stroke: rgba(160, 190, 230, .08); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hx-adm1 { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hx-glow { fill: rgba(245, 194, 66, .03); stroke: rgba(245, 194, 66, .5); stroke-width: 4; }
.hx-edge { fill: none; stroke: rgba(255, 230, 163, .6); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: hx-draw 2.8s .2s cubic-bezier(.3, .6, .2, 1) forwards; }
@keyframes hx-draw { to { stroke-dashoffset: 0; } }
.hx-cap { display: grid; gap: 8px; }
.hx-yearrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hx-year { font-size: clamp(3.4rem, 7vw, 6rem); font-weight: 200; line-height: .86; letter-spacing: -.045em; font-variant-numeric: tabular-nums;
  color: #ffe6a3; text-shadow: 0 0 34px rgba(245, 194, 66, .45); }
.hx-year.tick { animation: hx-tick .55s ease; }
@keyframes hx-tick { from { opacity: .3; transform: translateY(8px); filter: blur(3px); } }
.hx-play { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .3); transition: background .15s, border-color .15s; }
.hx-play:hover { border-color: #F5C242; background: rgba(245, 194, 66, .12); }
.hx-play svg { width: 18px; height: 18px; }
.hx-track { display: flex; gap: 4px; }
.hx-track i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .14); transition: background .4s, box-shadow .4s; }
.hx-track i.past { background: rgba(245, 194, 66, .45); }
.hx-track i.now { background: #F5C242; box-shadow: 0 0 10px #F5C242; }
.hx-idx { font-size: .86rem; color: #b9c6d6; }
.hx-idx b { color: #fff; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.hx-idx small { color: #93a3b8; }
.hx-src { color: #93a3b8; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 860px) {
  .hx-inner { grid-template-columns: 1fr; min-height: 0; gap: 0; padding-top: 22px; }
  .hx-copy { display: contents; }
  .hx-eyebrow { order: 1; justify-self: start; } .hx-title { order: 2; } .hx-country { order: 3; }
  .hx-vis { order: 4; height: min(46vh, 360px); margin: 6px 0 18px; }
  .hx-pitch { order: 5; } .hx-cta { order: 6; } .hx-meta { order: 7; }
  .hx-year { font-size: 3.2rem; }
}
@media (max-width: 420px) { .hx-btn { width: 100%; justify-content: center; } .hx-title { font-size: 2.05rem; } }

/* ================================================================ MAP */
#page-map { gap: 10px; }
.mx { position: relative; display: grid; grid-template-columns: 320px minmax(0, 1fr); height: clamp(540px, calc(100vh - 150px), 960px);
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #05080f; box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
  transition: grid-template-columns .26s ease; }
.mx.mx--collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.mx.mx--collapsed .mx-panel { visibility: hidden; }
.mx:fullscreen { height: 100vh !important; border-radius: 0; border: 0; }
.mx.mx--fs { position: fixed; inset: 0; z-index: 5000; height: 100vh !important; height: 100dvh !important; border-radius: 0; border: 0; }
.mx-noscroll, .mx-noscroll body { overflow: hidden; }

/* ---- panel */
.mx-panel { position: relative; z-index: 5; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); color: var(--ink);
  border-right: 1px solid var(--border); }
.mx-ph { display: flex; align-items: center; gap: 8px; padding: 12px 10px 6px 16px; }
.mx-grab { display: none; }
.mx-ph-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; font-weight: 750; }
.mx-ph-t svg { flex: none; width: 20px; height: 20px; color: var(--afdb); }
:root[data-theme="dark"] .mx-ph-t svg { color: #F5C242; }
.mx-ph-t small { display: none; min-width: 0; font-weight: 500; font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-pbody { flex: 1; overflow: auto; padding: 6px 16px 18px; display: grid; gap: 10px; align-content: start; scrollbar-width: thin; }
.mx-search { position: relative; }
.mx-search input { width: 100%; min-height: 44px; padding: 8px 36px 8px 38px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .92rem; }
.mx-search input::placeholder { color: var(--muted); }
.mx-search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.mx-search-ic { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.mx-search-ic svg { width: 20px; height: 20px; }
.mx-kbd { position: absolute; right: 10px; top: 11px; }
kbd, .mx-kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 600 .74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; }
.mx-res { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); max-height: 320px; overflow: auto; }
.mx-res li { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.mx-res li .n { font-weight: 650; }
.mx-res li .t { font-size: .76rem; color: var(--ink-2); }
.mx-res li[aria-selected="true"], .mx-res li:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 #F5C242; }
.mx-res li.none { color: var(--ink-2); cursor: default; box-shadow: none; background: none; }
.mx-modes { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.mx-mode { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 58px; padding: 9px 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.mx-mode:hover { border-color: color-mix(in srgb, var(--afdb-light) 60%, var(--border)); }
.mx-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mx-mode:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mx-mode.on { border-color: var(--afdb); background: color-mix(in srgb, var(--afdb) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--afdb); }
:root[data-theme="dark"] .mx-mode.on { border-color: rgba(245, 194, 66, .7); background: rgba(245, 194, 66, .07); box-shadow: inset 3px 0 0 #F5C242; }
.mx-mode-t { display: grid; gap: 1px; min-width: 0; }
.mx-mode-t b { font-size: .92rem; font-weight: 700; }
.mx-mode-t small { font-size: .76rem; color: var(--ink-2); }
.mx-mode-ic { width: 38px; height: 38px; border-radius: 10px; background-color: #070d18; border: 1px solid rgba(255, 255, 255, .08); }
.mx-ic-lights { background-image: radial-gradient(circle at 34% 40%, #fff3c4 0 2px, #fe9f6d 3px, #8c2981 6px, transparent 9px), radial-gradient(circle at 70% 64%, #fcfdbf 0 1.5px, #de4968 3px, transparent 6px), radial-gradient(circle at 66% 26%, #fe9f6d 0 1px, transparent 3px); }
.mx-ic-swipe { background-image: linear-gradient(90deg, #3b0f70 0 50%, transparent 50%), radial-gradient(circle at 70% 50%, #fcfdbf 0 2px, #de4968 4px, transparent 8px), linear-gradient(90deg, transparent calc(50% - 1px), #F5C242 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
.mx-ic-dark { background-image: radial-gradient(circle at 32% 36%, #f5c242 0 3px, transparent 4px), radial-gradient(circle at 66% 62%, #d7263d 0 3.5px, transparent 4.5px), radial-gradient(circle at 30% 72%, #d7263d 0 2.5px, transparent 3.5px), radial-gradient(circle at 70% 28%, #f5c242 0 2px, transparent 3px); }
.mx-ic-indicator { background-image: linear-gradient(135deg, #e34948 0 30%, #d9d8d2 30% 55%, #6da7ec 55% 78%, #2a78d6 78%); opacity: .9; }
.mx-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: -2px 0 4px 14px; padding: 2px 0 2px 12px; border-left: 2px solid var(--border); }
.mx-sub label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
.mx-sub .mx-wide { grid-column: 1 / -1; }
.mx-sub select { width: 100%; font-size: .88rem; background: var(--surface-2); }
.mx-note, .mx-desc { grid-column: 1 / -1; margin: 0; font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
.mx-h { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font: 700 .72rem/1 var(--font); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.mx-sw { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 42px; cursor: pointer; font-size: .9rem; font-weight: 600; position: relative; }
.mx-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mx-sw-ui { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); transition: background .18s, border-color .18s; }
.mx-sw-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .18s, background .18s; }
.mx-sw input:checked + .mx-sw-ui { background: var(--afdb); border-color: var(--afdb); }
.mx-sw input:checked + .mx-sw-ui::after { transform: translateX(18px); background: #fff; }
:root[data-theme="dark"] .mx-sw input:checked + .mx-sw-ui { background: #F5C242; border-color: #F5C242; }
:root[data-theme="dark"] .mx-sw input:checked + .mx-sw-ui::after { background: #1b1400; }
.mx-sw input:focus-visible + .mx-sw-ui { outline: 3px solid var(--focus); outline-offset: 2px; }
.mx-sw-k { width: 26px; height: 16px; border-radius: 4px; }
.mx-k-ind { background: radial-gradient(circle at 20% 50%, var(--t1) 0 3.5px, transparent 4px), radial-gradient(circle at 45% 50%, var(--t2) 0 3.5px, transparent 4px), radial-gradient(circle at 70% 50%, var(--t3) 0 3.5px, transparent 4px), radial-gradient(circle at 95% 50%, var(--t4) 0 3.5px, transparent 4px); }
.mx-k-tour { border: 2px dashed #E3A500; background: rgba(245, 194, 66, .12); }
:root[data-theme="dark"] .mx-k-tour { border-color: #F5C242; }
.mx-k-bnd { border: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent); }
.mx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mx-lbl { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.mx-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.mx-seg button { min-height: 36px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 8px; cursor: pointer; font: 600 .8rem/1 var(--font); color: var(--ink-2); background: transparent; }
.mx-seg button.on { background: var(--afdb); color: #fff; }
:root[data-theme="dark"] .mx-seg button.on { background: #F5C242; color: #1b1400; }
.mx-range { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.mx-range span { display: flex; justify-content: space-between; }
.mx-range output { font-variant-numeric: tabular-nums; color: var(--ink); }
.mx-range input { width: 100%; min-height: 32px; accent-color: var(--afdb); }
:root[data-theme="dark"] .mx-range input { accent-color: #F5C242; }
.mx-panel .mx-ibtn { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.mx-collapse svg { transition: transform .25s; }

/* ---- stage (always night-dark) */
.mx-stage { position: relative; min-width: 0; overflow: hidden; container-type: inline-size; container-name: stage; color: #eef2f7; }
.mx-map { position: absolute !important; inset: 0; z-index: 0; }
.mx .leaflet-container { background: radial-gradient(120% 90% at 50% 40%, #0a1424 0%, #05080f 70%); font: inherit; outline-offset: -3px; }
.mx .leaflet-container:focus-visible { outline: 3px solid #F5C242; }
.mx-stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 120px rgba(0, 0, 0, .55); }
.mx .mx-img { transition: opacity .45s ease; }
.mx .leaflet-zoom-anim .mx-img { transition: opacity .45s ease, transform .25s cubic-bezier(0, 0, .25, 1); }
.mx .mx-tiles { filter: brightness(.9) saturate(.8); }
.mx-glass { background: rgba(9, 14, 23, .82); }
.mx-ibtn, .mx-year, .mx-time, .mx-leg, .mx-help, .mx-open, .mx-sl { -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3); }
.mx-ibtn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 11px; cursor: pointer; color: #e9eef5;
  background: rgba(9, 14, 23, .82); border: 1px solid rgba(255, 255, 255, .14); transition: background .15s, border-color .15s, color .15s; }
.mx-ibtn svg { width: 20px; height: 20px; }
.mx-ibtn:hover { border-color: rgba(245, 194, 66, .7); color: #fff; }
.mx-ibtn[aria-pressed="true"], .mx-ibtn[aria-expanded="true"]:not(.mx-collapse) { background: #F5C242; color: #1b1400; border-color: #F5C242; }
.mx-ibtn.sm { width: 32px; height: 32px; font-size: .9rem; }
.mx-stage :focus-visible { outline: 3px solid #F5C242; outline-offset: 2px; }
.mx-tools { position: absolute; z-index: 12; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.mx-tsep { height: 4px; }
.mx-open { position: absolute; z-index: 12; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border-radius: 12px; cursor: pointer; font: 700 .88rem/1 var(--font); color: #fff; background: rgba(9, 14, 23, .85); border: 1px solid rgba(245, 194, 66, .55); }
.mx-open svg { width: 18px; height: 18px; color: #F5C242; }
.mx:not(.mx--collapsed) .mx-open { display: none; }
.mx-year { position: absolute; z-index: 10; top: 12px; left: 14px; display: grid; gap: 2px; padding: 8px 14px 9px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 14, 23, .62), rgba(9, 14, 23, .35)); }
.mx--collapsed .mx-year { top: 64px; }
.mx-year .y { font-size: clamp(2.2rem, 6cqi, 3.7rem); font-weight: 200; line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #ffe6a3; text-shadow: 0 0 26px rgba(245, 194, 66, .55); }
.mx-year .y.tick { animation: hx-tick .45s ease; }
.mx-year small { font: 700 .66rem/1.2 var(--font); letter-spacing: .14em; text-transform: uppercase; color: #c9d6e6; }

/* ---- timeline */
.mx-time { position: absolute; z-index: 12; left: 14px; bottom: 14px; width: min(640px, calc(100% - 300px)); display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 6px 8px; border-radius: 18px; background: rgba(9, 14, 23, .84); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.mx-play { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; color: #1b1400;
  background: linear-gradient(135deg, #F7CD5E, #E9A91F); box-shadow: 0 4px 16px rgba(245, 194, 66, .35); }
.mx-play svg { width: 20px; height: 20px; }
.mx-play[aria-pressed="true"] { box-shadow: 0 0 0 4px rgba(245, 194, 66, .25), 0 4px 16px rgba(245, 194, 66, .35); }
.mx-slider { flex: 1; min-width: 0; display: grid; gap: 0; }
.mx-slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; --p: 100%; }
.mx-slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #F5C242 var(--p), rgba(255, 255, 255, .2) var(--p)); }
.mx-slider input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #F5C242 var(--p), rgba(255, 255, 255, .2) var(--p)); }
.mx-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #ffe6a3; border: 3px solid #E9A91F; box-shadow: 0 0 12px rgba(245, 194, 66, .7); }
.mx-slider input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #ffe6a3; border: 3px solid #E9A91F; box-shadow: 0 0 12px rgba(245, 194, 66, .7); }
.mx-slider input:focus-visible { outline: none; }
.mx-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(245, 194, 66, .55); }
.mx-slider:has(input:focus-visible) { outline: 2px solid #F5C242; outline-offset: 4px; border-radius: 6px; }
.mx-ticks { position: relative; height: 16px; margin: 0 10px; font: 600 .66rem/1.3 var(--font); color: #a3b1c2; font-variant-numeric: tabular-nums; }
.mx-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.mx-ticks span:first-child { transform: translateX(-30%); } .mx-ticks span:last-child { transform: translateX(-70%); }
.mx-ticks span.on { color: #ffe6a3; }
.mx-speed { flex: none; min-width: 48px; height: 40px; padding: 0 10px; border-radius: 11px; cursor: pointer; font: 700 .86rem/1 var(--font); color: #e9eef5;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); font-variant-numeric: tabular-nums; }
.mx-speed:hover { border-color: rgba(245, 194, 66, .7); }

/* ---- legends */
.mx-legends { position: absolute; z-index: 11; right: 12px; bottom: 58px; width: 252px; display: flex; flex-direction: column; gap: 8px; }
.mx-leg { padding: 10px 12px; border-radius: 12px; background: rgba(9, 14, 23, .84); border: 1px solid rgba(255, 255, 255, .12); color: #e3e9f0; font-size: .78rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.mx-leg h4 { margin: 0 0 6px; font: 700 .7rem/1.3 var(--font); letter-spacing: .07em; text-transform: uppercase; color: #c9d6e6; }
.mx-leg .ramp { height: 10px; border-radius: 3px; margin: 4px 0 3px; }
.mx-leg .ticks { display: flex; justify-content: space-between; color: #aab7c7; font-variant-numeric: tabular-nums; font-size: .72rem; }
.mx-leg .lg-it { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.mx-leg .lg-na { margin-top: 6px; color: #aab7c7; font-size: .72rem; }
.mx-leg .sw { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.mx-leg .sw.dot { border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; width: 10px; height: 10px; }
.mx-leg .sw.dash { border: 2px dashed #F5C242; background: rgba(245, 194, 66, .12); width: 16px; }

/* ---- swipe */
.mx-swipe { position: absolute; inset: 0; z-index: 9; pointer-events: none; --sx: 50%; }
.mx-swl { position: absolute; top: 0; bottom: 0; left: var(--sx); width: 30px; margin-left: -15px; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.mx-swl::before { content: ""; position: absolute; top: 0; bottom: 0; left: 14px; width: 2px; background: #ffe6a3; box-shadow: 0 0 12px rgba(245, 194, 66, .9), 0 0 2px #000; }
.mx-swh { position: absolute; top: 50%; left: var(--sx); transform: translate(-50%, -50%); display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  border-radius: 50%; cursor: ew-resize; touch-action: none; pointer-events: auto; color: #1b1400; background: linear-gradient(135deg, #F7CD5E, #E9A91F);
  border: 3px solid #fff8e1; box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 22px rgba(245, 194, 66, .6); }
.mx-swh svg { width: 22px; height: 22px; }
.mx-swh:focus-visible, .mx-play:focus-visible { border-radius: 50%; outline: 3px solid #fff; outline-offset: 3px; }
.mx-swipe.drag .mx-swh { transform: translate(-50%, -50%) scale(1.08); }
.mx-sl { position: absolute; top: 14px; padding: 7px 13px; border-radius: 999px; font: 750 1.05rem/1 var(--font); font-variant-numeric: tabular-nums; color: #fff;
  background: rgba(9, 14, 23, .82); border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap; }
.mx-sl.l { right: calc(100% - var(--sx) + 14px); }
.mx-sl.r { left: calc(var(--sx) + 14px); color: #ffe6a3; border-color: rgba(245, 194, 66, .5); }

/* ---- help popover */
.mx-help { position: absolute; z-index: 14; top: 12px; right: 62px; width: min(300px, calc(100% - 80px)); padding: 12px 14px; border-radius: 14px;
  background: rgba(9, 14, 23, .94); border: 1px solid rgba(255, 255, 255, .16); color: #e3e9f0; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.mx-help-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mx-help dl { margin: 0; display: grid; gap: 7px; }
.mx-help dl div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; font-size: .84rem; }
.mx-help dt { display: flex; gap: 4px; } .mx-help dd { margin: 0; color: #c9d6e6; }
.mx-help kbd { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }

/* ---- loading */
.mx-loading { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; color: #c9d6e6; font-size: .9rem;
  background: radial-gradient(60% 60% at 50% 45%, #0d1a2e, #05080f); transition: opacity .4s; }
.mx-loading.done { opacity: 0; pointer-events: none; }
.mx-spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(245, 194, 66, .18); border-top-color: #F5C242; animation: mxspin .9s linear infinite; }
@keyframes mxspin { to { transform: rotate(360deg); } }
.mx-stage .map-fallback { z-index: 21; background: #05080f; color: #c9d6e6; }

/* ---- Leaflet chrome inside the map */
.mx .leaflet-control-attribution { background: rgba(5, 8, 15, .72) !important; color: #a3b1c2; font-size: 10.5px; border-radius: 6px 0 0 0; }
.mx .leaflet-control-attribution a { color: #d6dfea; }
.mx .leaflet-control-scale-line { background: rgba(5, 8, 15, .6); color: #dfe6ee; border-color: #a3b1c2; text-shadow: none; }
.mx .leaflet-bottom.leaflet-right { z-index: 11; }
.mx-tip { padding: 7px 11px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(9, 14, 23, .94); color: #eef2f7; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); font: 500 12.5px/1.4 var(--font); }
.mx-tip b { font-weight: 700; } .mx-tip span { display: block; color: #c9d6e6; } .mx-tip .mx-tip-n { display: block; color: #fff; font-size: 13px; }
.mx-tip.leaflet-tooltip-top::before { border-top-color: rgba(9, 14, 23, .94); }
.mx-tip.leaflet-tooltip-bottom::before { border-bottom-color: rgba(9, 14, 23, .94); }
.mx-tip.leaflet-tooltip-left::before { border-left-color: rgba(9, 14, 23, .94); }
.mx-tip.leaflet-tooltip-right::before { border-right-color: rgba(9, 14, 23, .94); }
.mx-hl { animation: mxhl 1.4s ease-in-out 2; }
@keyframes mxhl { 50% { stroke-opacity: .35; } }
.mx-pop .leaflet-popup-content-wrapper { border-radius: 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
.mx-pop .leaflet-popup-tip { background: var(--surface); }
.mx-pop .leaflet-popup-content { margin: 14px 16px 14px; font: 13px/1.45 var(--font); }
.mx-pop a.leaflet-popup-close-button { width: 32px; height: 32px; top: 6px; right: 6px; font: 22px/30px var(--font); color: var(--ink-2); border-radius: 8px; }
.mx-pop a.leaflet-popup-close-button:hover { color: var(--ink); background: var(--surface-2); }
.mxp { display: grid; gap: 10px; }
.mxp-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-right: 26px; }
.mxp-h h3 { margin: 2px 0 0; font-size: 1.08rem; line-height: 1.2; }
.mxp-lv { font: 700 .68rem/1.2 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mxp-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 700 .72rem/1.3 var(--font); color: var(--ink);
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); white-space: nowrap; }
.mxp-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.mxp-spark { margin: 0; padding: 8px 10px 4px; border-radius: 12px; background: var(--surface-2); color: var(--spark); }
.mxp-spark figcaption { display: flex; justify-content: space-between; font-size: .74rem; color: var(--ink-2); }
.mxp-spark figcaption b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mxp-spark svg { display: block; overflow: visible; }
.mxp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.mxp-grid dt { font-size: .7rem; color: var(--ink-2); }
.mxp-grid dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.mxp-grid dd small { font-weight: 500; color: var(--ink-2); }
.mx-source { margin: 0; }

/* ---- narrow stage (tablet / collapsed layouts) */
@container stage (max-width: 820px) {
  .mx-time { left: 10px; right: 10px; width: auto; bottom: 30px; }
  .mx-legends { top: 96px; left: 12px; right: auto; bottom: auto; width: min(224px, calc(100% - 80px)); }
  .mx-ticks span:not(:first-child):not(:last-child):not(.on) { visibility: hidden; }
}
@container stage (max-width: 820px) and (min-width: 1px) { .mx--collapsed .mx-legends { top: 150px; } }

/* ---- phones: the panel becomes a bottom sheet */
@media (max-width: 760px) {
  #page-map { margin: 0 -4px; }
  .mx { display: block; height: calc(100svh - 128px); min-height: 500px; border-radius: 14px; }
  .mx.mx--collapsed .mx-panel { visibility: visible; }
  .mx-stage { position: absolute; inset: 0; }
  .mx-panel { position: absolute; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 74%; border-right: 0; border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0; box-shadow: 0 -14px 36px rgba(0, 0, 0, .45); transition: transform .28s ease; }
  .mx--collapsed .mx-panel { transform: translateY(calc(100% - 58px)); }
  .mx--collapsed .mx-pbody { visibility: hidden; }
  .mx-ph { min-height: 58px; padding: 14px 8px 6px 16px; cursor: pointer; }
  .mx-grab { display: block; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--axis); }
  .mx-ph-t small { display: block; }
  .mx-collapse svg { transform: rotate(-90deg); }
  .mx--collapsed .mx-collapse svg { transform: rotate(90deg); }
  .mx-open { display: none !important; }
  .mx--collapsed .mx-year { top: 10px; }
  .mx-year { top: 10px; left: 10px; padding: 6px 10px; }
  .mx-tools { top: 10px; right: 10px; gap: 5px; }
  .mx-time { bottom: 82px; left: 8px; right: 8px; padding: 6px 10px 4px 6px; gap: 8px; }
  .mx-legends, .mx--collapsed .mx-legends { top: auto; bottom: 156px; left: 10px; width: min(210px, calc(100% - 76px)); }
  .mx[data-bm="indicator"] .mx-legends, .mx[data-bm="swipe"] .mx-legends, .mx[data-bm="dark"] .mx-legends { bottom: 82px; }
  .mx-leg { padding: 8px 10px; }
  .mx .leaflet-bottom { bottom: 58px; }
  .mx .leaflet-control-scale { display: none; }
  .mx-help { right: 58px; }
  .mx-sl { font-size: .9rem; padding: 6px 10px; top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .hx-img, .mx .mx-img, .mx, .mx-panel, .kpi.kin, .hx-year.tick, .mx-year .y.tick, .mx-hl, .hx-edge { transition: none !important; animation: none !important; }
  .hx-edge { stroke-dashoffset: 0; }
  .mx-spin { animation-duration: 2.4s; }
}
@media (forced-colors: active) { .mx-swl::before { background: CanvasText; } .mx-sw-ui { border-color: CanvasText; } }
.hx-country { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.hx-flag { height: 1.35em; width: auto; margin-right: 10px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.28), 0 4px 14px rgba(0,0,0,.45); }
