/* VALUESAFE Web-GIS — Phase-2 design system.
   Principles: the brand chrome is dark so the white/red VALUESAFE logo sits on
   its native ground; the working surfaces are quiet and monochrome, so the only
   strong colour on screen is data (hazard, risk, damage classes). The red slash
   of the logo is the one signature: the active service level, and the marker
   for Phase-2 open-data layers.
   Type: Archivo (display at expanded width, body at normal width) and
   Martian Mono for every number, ID, code and licence. */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,300..800&family=Martian+Mono:wdth,wght@75..112.5,300..600&display=swap");

:root {
  /* brand */
  --brand: #EA1F1F;
  --brand-deep: #B8141A;
  /* chrome (header, landing, login panel) — dark in both themes */
  --chrome: #0F1215;
  --chrome-2: #171B20;
  --chrome-line: #262C34;
  --chrome-text: #EEF1F4;
  --chrome-mute: #8C96A2;
  /* working surfaces — light theme */
  --bg: #E6E9ED;
  --surface: #FFFFFF;
  --surface-2: #F3F5F7;
  --surface-3: #EAEDF1;
  --line: #E2E6EB;
  --line-strong: #CBD2DA;
  --ink: #14181D;
  --ink-2: #39414B;
  --mute: #66707C;
  --faint: #9AA3AE;
  --sel-bg: #14181D0D;
  --focus: #2F6FEB;
  --ok: #1D7447;   --ok-bg: #E3F2E9;   --ok-line: #B9DEC8;
  --warn: #8F5600; --warn-bg: #FBF0DA; --warn-line: #F0D49A;
  --bad: #B3202C;  --bad-bg: #FBE6E8;  --bad-line: #F1BCC1;
  --neu: #4F5A66;  --neu-bg: #EDF0F3;  --neu-line: #D5DBE2;
  --shadow-1: 0 1px 2px #1013170f, 0 2px 8px #1013170f;
  --shadow-2: 0 2px 6px #10131714, 0 14px 36px #10131724;
  --overlay-bg: #FFFFFFF2;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Archivo", system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --slant: -20deg;               /* the angle of the logo's red slash */
  --header-h: 56px;
  --side-w: 304px;
  --t-2xs: .625rem;   /* 10px  */
  --t-xs: .6875rem;   /* 11px  */
  --t-sm: .75rem;     /* 12px  */
  --t-md: .8125rem;   /* 13px  */
  --t-lg: .9375rem;   /* 15px  */
  --t-xl: 1.25rem;    /* 20px  */
  --t-2xl: 1.625rem;  /* 26px  */
  color-scheme: light;
  font-size: 16px;
}
@media (min-width: 1800px) { :root { font-size: 17px; --side-w: 320px; } }

body.dark-mode {
  --bg: #0B0D10;
  --surface: #14181D;
  --surface-2: #1A1F25;
  --surface-3: #212730;
  --line: #252B33;
  --line-strong: #353D47;
  --ink: #E9ECEF;
  --ink-2: #C3CAD2;
  --mute: #929CA8;
  --faint: #66707C;
  --sel-bg: #FFFFFF12;
  --focus: #6C9BFF;
  --ok: #6FD39C;   --ok-bg: #16301F;   --ok-line: #24503A;
  --warn: #F2BE5C; --warn-bg: #33270F; --warn-line: #5A4417;
  --bad: #FF8A93;  --bad-bg: #3A1A1E;  --bad-line: #62272E;
  --neu: #B4BDC7;  --neu-bg: #20262D;  --neu-line: #323A44;
  --shadow-1: 0 1px 2px #0006, 0 2px 8px #0005;
  --shadow-2: 0 2px 6px #0007, 0 16px 40px #0009;
  --overlay-bg: #14181DF2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 400 var(--t-md)/1.45 var(--f-body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); text-decoration-color: var(--brand); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; letter-spacing: -.01em; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow {
  margin: 0; font: 600 var(--t-2xs)/1.2 var(--f-display); font-variation-settings: "wdth" 125;
  letter-spacing: .09em; text-transform: uppercase; color: var(--mute);
}
/* the logo's red slash, used as a marker for Phase-2 open-data content */
.slash {
  display: inline-block; width: 5px; height: 11px; background: var(--brand); transform: skewX(var(--slant));
  border-radius: 1px; flex-shrink: 0; vertical-align: -1px;
}

.App { display: flex; flex-direction: column; height: 100vh; width: 100%; }

/* ── Top bar (brand chrome) ─────────────────────────────────────────────── */
.topbar {
  height: var(--header-h); flex-shrink: 0; position: relative; z-index: 2000;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 14px 0 18px; background: var(--chrome); color: var(--chrome-text);
  border-bottom: 1px solid var(--chrome-line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-wordmark { height: 22px; width: auto; display: block; }
.brand-mark { height: 24px; width: auto; display: none; }
.brand-product {
  font: 500 var(--t-2xs)/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--chrome-mute); padding-left: 12px; border-left: 1px solid var(--chrome-line); white-space: nowrap;
}

/* service levels: three slanted tabs, the active one is the logo's red slash */
.tiers { display: flex; align-items: center; gap: 2px; padding: 0 6px; }
.tier {
  position: relative; border: 0; background: none; height: 40px; min-width: 112px; padding: 0 20px;
  color: var(--chrome-mute); text-align: left; transition: color .2s ease;
}
.tier::before {
  content: ""; position: absolute; inset: 0; border-radius: 3px; transform: skewX(var(--slant));
  background: transparent; transition: background-color .25s ease;
}
.tier:hover { color: var(--chrome-text); }
.tier:hover::before { background: #FFFFFF0F; }
.tier.active { color: #fff; }
.tier.active::before { background: var(--brand); box-shadow: 0 6px 18px #EA1F1F40; }
.tier-in { position: relative; display: flex; flex-direction: column; gap: 3px; }
.tier-name { font: 650 var(--t-md)/1 var(--f-display); font-variation-settings: "wdth" 112; letter-spacing: .01em; }
.tier-scale { font: 400 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; opacity: .8; white-space: nowrap; }
.tier:focus-visible { outline: none; }
.tier:focus-visible::before { outline: 2px solid #fff; outline-offset: 2px; }

.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.top-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--chrome-line); background: var(--chrome-2); color: var(--chrome-text);
  font-weight: 500; font-size: var(--t-sm); white-space: nowrap; text-decoration: none;
}
.top-btn:hover { border-color: #3A424D; background: #1E232A; color: #fff; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none; color: var(--chrome-mute);
}
.icon-btn:hover { color: #fff; background: #FFFFFF10; }
.icon-btn .i-sun { display: none; }
body.dark-mode .icon-btn .i-sun { display: block; }
body.dark-mode .icon-btn .i-moon { display: none; }
.lang { display: inline-flex; padding: 2px; border-radius: var(--r-sm); background: var(--chrome-2); border: 1px solid var(--chrome-line); }
.lang-btn {
  border: 0; background: none; color: var(--chrome-mute); height: 26px; min-width: 30px; padding: 0 6px; border-radius: 4px;
  font: 500 var(--t-2xs)/1 var(--f-mono); letter-spacing: .04em;
}
.lang-btn:hover { color: #fff; }
.lang-btn.active { background: var(--chrome-text); color: var(--chrome); }
.user { display: flex; align-items: center; gap: 8px; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--chrome-line); min-width: 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: #262C34; color: var(--chrome-text); font: 600 var(--t-2xs)/1 var(--f-mono);
}
.user-name { font-size: var(--t-sm); color: var(--chrome-text); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user form { margin: 0; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.Dashboard { display: flex; flex: 1; min-height: 0; position: relative; }

.sidebar {
  width: var(--side-w); flex-shrink: 0; position: relative; z-index: 1001;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
  transition: margin-left .35s cubic-bezier(.2,.7,.2,1);
}
.sidebar.collapsed { margin-left: calc(-1 * var(--side-w)); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 14px 18px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.side-toggle {
  position: absolute; top: 14px; right: -13px; z-index: 5; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; background: var(--surface); color: var(--mute);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-1);
}
.side-toggle:hover { color: var(--ink); border-color: var(--ink); }
.side-open {
  position: absolute; top: 12px; left: 12px; z-index: 1000; display: none; gap: 8px; align-items: center;
  height: 34px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); box-shadow: var(--shadow-1); font-weight: 500; font-size: var(--t-sm);
}
.sidebar.collapsed ~ .map-area-wrapper .side-open { display: inline-flex; }

/* search */
.search { position: relative; }
.search > svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-input {
  width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: var(--t-md);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--faint); }
.search-input:hover { border-color: var(--line-strong); }
.search-input:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px var(--sel-bg); }
.search-input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 2000; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 4px;
}
.search-result-item {
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-sm); line-height: 1.35; color: var(--ink-2);
}
.search-result-item:hover { background: var(--surface-3); color: var(--ink); }
.search-result-item.local { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; color: var(--ink); }

/* hazard picker */
.side-block { margin-top: 18px; }
.side-block > .eyebrow { margin-bottom: 8px; }
.hazards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.hazards button {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 7px; border: 0; border-radius: 7px;
  background: none; color: var(--mute); font-size: var(--t-xs); font-weight: 500; line-height: 1;
  transition: background-color .15s, color .15s;
}
.hazards button svg.i { width: 20px; height: 20px; stroke-width: 1.5; }
.hazards button:hover { color: var(--ink); background: var(--surface-3); }
.hazards button.selected { background: var(--ink); color: var(--surface); box-shadow: var(--shadow-1); }

/* parameter panel */
.sidebar-controls { display: flex; flex-direction: column; margin-top: 4px; }
.hint { margin: 10px 2px 6px; font-size: var(--t-sm); color: var(--mute); line-height: 1.4; }
.hint.empty { display: flex; gap: 8px; align-items: flex-start; padding: 12px; margin-top: 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.hint.empty svg.i { margin-top: 1px; color: var(--faint); }
.section-title {
  display: flex; align-items: center; gap: 8px; margin: 20px 0 6px;
  font: 600 var(--t-2xs)/1.2 var(--f-display); font-variation-settings: "wdth" 125; letter-spacing: .09em;
  text-transform: uppercase; color: var(--mute);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title.phase2 { color: var(--ink); }
.section-note { margin: 6px 2px 0; font-size: var(--t-xs); line-height: 1.45; color: var(--faint); }

.opt {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 8px; margin: 1px 0;
  border-radius: var(--r-sm); cursor: pointer; user-select: none; color: var(--ink-2); font-size: var(--t-md); line-height: 1.3;
  transition: background-color .15s, color .15s;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .box {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.opt .box::after {
  content: ""; width: 10px; height: 10px; opacity: 0; background: var(--surface);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.3l2.4 2.4 5.2-5.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.3l2.4 2.4 5.2-5.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.opt input:checked + .box { background: var(--ink); border-color: var(--ink); }
.opt input:checked + .box::after { opacity: 1; }
.opt input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt:hover { background: var(--surface-2); color: var(--ink); }
.opt:hover .box { border-color: var(--ink-2); }
.opt.selected { background: var(--sel-bg); color: var(--ink); font-weight: 600; }
.opt.selected::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.opt.disabled { opacity: .45; pointer-events: none; }
.opt .count { margin-left: auto; font: 400 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; color: var(--mute); white-space: nowrap; }
.opt .badge { margin-left: auto; }

.granularity { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.granularity .opt { margin: 0; border: 1px solid var(--line); font-size: var(--t-sm); }
.granularity .opt.checked { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.opacity-slider-container { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin: 10px 2px 0; font-size: var(--t-xs); color: var(--mute); }
.opacity-slider-container input[type=range] { width: 100%; accent-color: var(--ink); height: 18px; }

/* sidebar footer: partners + disclaimer */
.side-foot { flex-shrink: 0; padding: 12px 14px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-links { display: flex; gap: 14px; margin-bottom: 10px; }
.footer-link { font-size: var(--t-xs); color: var(--mute); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.footer-link:hover { color: var(--ink); }
.footer-link svg.i { width: 12px; height: 12px; }
.partners-list { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.partners-list img { height: 18px; max-width: 58px; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.partners-list img.tile { height: 20px; border-radius: 3px; filter: none; opacity: .9; }
.partners-list:hover img { filter: none; opacity: 1; }
body.dark-mode .partners-list img:not(.tile) { filter: brightness(0) invert(1); opacity: .7; }
.map_disclaimer { margin: 10px 0 0; font-size: 9.5px; line-height: 1.4; color: var(--faint); }
.credits { margin: 6px 0 0; font-size: 9.5px; color: var(--faint); }
.credits a { color: var(--mute); }

/* ── Map area ───────────────────────────────────────────────────────────── */
.map-area-wrapper { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.map-image-container { flex: 1; position: relative; min-height: 0; background: var(--bg); }
#map { position: absolute; inset: 0; }

.float { background: var(--overlay-bg); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); color: var(--ink); }
@supports (backdrop-filter: blur(8px)) {
  .float { backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
}

.map-controls { position: absolute; right: 12px; bottom: 34px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ctrl-group { display: flex; flex-direction: column; padding: 3px; gap: 2px; }
.ctrl-group button {
  width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); padding: 0;
  display: grid; place-items: center; position: relative;
}
.ctrl-group button:hover { background: var(--surface-3); color: var(--ink); }
.ctrl-group button.on { background: var(--ink); color: var(--surface); }
.ctrl-group button .ctrl-text { font: 600 11px/1 var(--f-mono); font-variation-settings: "wdth" 87.5; letter-spacing: -.02em; }
.basemap { position: relative; }
.basemap-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--ink); font-size: var(--t-sm); font-weight: 500; white-space: nowrap;
}
.basemap-btn svg.i { color: var(--mute); }
.basemap-btn .chev { width: 14px; height: 14px; transition: transform .2s ease; }
.basemap-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.basemap-btn:hover svg.i { color: var(--ink); }
/* basemap menu: opens upwards, each option previews the Barberino tile of that basemap */
.basemap-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 1100; width: 248px; padding: 10px 6px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  animation: rise .18s cubic-bezier(.2,.7,.2,1);
}
.basemap-menu[hidden] { display: none; }
.basemap-menu .eyebrow { padding: 0 8px 8px; }
.basemap-menu ul { list-style: none; margin: 0; padding: 0; }
.basemap-menu li {
  display: grid; grid-template-columns: 46px 1fr 14px; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-sm); color: var(--ink-2);
}
.basemap-menu li:hover, .basemap-menu li:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.basemap-menu li[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.basemap-menu li img { width: 46px; height: 32px; object-fit: cover; border-radius: 4px; background: var(--surface-3); box-shadow: 0 0 0 1px var(--line); }
.basemap-menu li[aria-selected="true"] img { box-shadow: 0 0 0 2px var(--ink); }
.basemap-menu li svg.i { width: 14px; height: 14px; stroke-width: 2; visibility: hidden; }
.basemap-menu li[aria-selected="true"] svg.i { visibility: visible; }

.coords {
  position: absolute; left: 140px; bottom: 8px; z-index: 999; display: flex; align-items: center; gap: 10px;
  font: 400 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; color: var(--ink-2);
  padding: 5px 8px; border-radius: var(--r-sm);
}
.coords:empty { display: none; }

.legend-container {
  position: absolute; left: 12px; bottom: 40px; z-index: 1000; width: 272px; max-height: calc(100% - 64px); overflow-y: auto;
  padding: 12px 14px 12px;
}
.legend-container[hidden] { display: none; }
.legend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.legend-title { margin: 2px 0 10px; font: 650 var(--t-md)/1.25 var(--f-display); font-variation-settings: "wdth" 108; color: var(--ink); }
.legend-total { font: 400 var(--t-2xs)/1 var(--f-mono); color: var(--mute); white-space: nowrap; }
.legend-item { display: grid; grid-template-columns: 12px 1fr 64px 40px; align-items: center; gap: 8px; min-height: 20px; }
.legend-item.wide .legend-label { grid-column: 2 / 5; }
.legend-color { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px #0000001a; }
.legend-color.hatch { background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 4px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend-color.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.legend-label { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.2; }
.legend-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.legend-bar i { display: block; height: 100%; border-radius: 2px; }
.legend-count { font: 400 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; color: var(--mute); text-align: right; }
.legend-source { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--t-2xs); line-height: 1.4; color: var(--mute); display: flex; gap: 6px; align-items: baseline; }

.maplibregl-ctrl-attrib { font: 400 10px/1.3 var(--f-body) !important; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--overlay-bg) !important; color: var(--mute); }
.maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
body.dark-mode .maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-bottom-right { right: 2px; }
.maplibregl-ctrl-scale {
  background: transparent !important; border-color: var(--ink-2) !important; color: var(--ink-2) !important;
  font: 400 9.5px/1.4 var(--f-mono) !important; font-variation-settings: "wdth" 87.5;
}
.maplibregl-ctrl-bottom-left { left: 4px; bottom: 2px; }
.maplibregl-popup-content { font-family: var(--f-body); font-size: var(--t-sm); padding: 6px 10px; border-radius: var(--r-sm); }

.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2500; max-width: 30rem;
  display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: var(--r-md);
  background: var(--chrome); color: var(--chrome-text); font-size: var(--t-sm); box-shadow: var(--shadow-2);
}
.toast[hidden] { display: none; }

/* loading: a thin indeterminate bar along the top edge of the map */
.loading-overlay { position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 1999; overflow: hidden; background: transparent; pointer-events: none; }
.loading-overlay[hidden] { display: none; }
.loading-bar { position: absolute; inset: 0; }
.loading-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--brand);
  animation: loadbar 1.1s cubic-bezier(.5,0,.3,1) infinite;
}
@keyframes loadbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ── Feature card (building / cluster / cell) ───────────────────────────── */
.feature-panel {
  position: absolute; top: 12px; right: 12px; z-index: 1500; width: 26.5rem; max-width: calc(100% - 24px);
  max-height: calc(100% - 24px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  animation: rise .25s cubic-bezier(.2,.7,.2,1);
}
.feature-panel[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fp-head { padding: 16px 18px 0; position: relative; flex-shrink: 0; }
.fp-eyebrow { margin: 0 34px 6px 0; }
.feature-panel h4 { margin: 0; padding-right: 36px; font: 650 var(--t-xl)/1.15 var(--f-display); font-variation-settings: "wdth" 110; letter-spacing: -.005em; color: var(--ink); }
.feature-panel h4 .mono { font-weight: 500; font-size: .86em; }
.feature-panel .sub { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font: 400 var(--t-2xs)/1.3 var(--f-mono); font-variation-settings: "wdth" 87.5; color: var(--mute); }
.feature-panel .sub span { white-space: nowrap; }
.feature-panel .sub span + span::before { content: "·"; margin-right: 12px; color: var(--faint); }
.close-btn {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; border: 0; background: var(--surface-2); color: var(--mute);
}
.close-btn:hover { background: var(--ink); color: var(--surface); }
.info-tabs {
  display: flex; gap: 0; margin: 14px 0 0; padding: 0 12px; border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex-shrink: 0;
}
.info-tabs::-webkit-scrollbar { display: none; }
.info-tabs.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.info-tabs.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.info-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.info-tabs button {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none;
  padding: 9px 6px 10px; font-size: var(--t-sm); font-weight: 500; color: var(--mute); white-space: nowrap;
}
.info-tabs button::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 0; height: 2px; border-radius: 2px; background: transparent; }
.info-tabs button:hover { color: var(--ink); }
.info-tabs button.active { color: var(--ink); font-weight: 600; }
.info-tabs button.active::after { background: var(--ink); }
.info-content { overflow-y: auto; padding: 8px 18px 12px; scrollbar-width: thin; }
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--t-md); }
.info-row:last-child { border-bottom: 0; }
.info-row > span:first-child { color: var(--ink-2); }
.info-row > span:last-child { text-align: right; color: var(--ink); font-weight: 500; }
.info-row .num { font: 500 var(--t-sm)/1.2 var(--f-mono); font-variation-settings: "wdth" 87.5; }
.info-row small { display: block; font-size: var(--t-2xs); font-weight: 400; color: var(--mute); margin-top: 2px; }
/* class chip: the class number printed on its own legend colour */
.cls { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cls i {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px; font-style: normal;
  font: 600 var(--t-2xs)/1 var(--f-mono); box-shadow: inset 0 0 0 1px #0000001a;
}
.fp-section { display: flex; align-items: center; gap: 8px; margin: 16px 0 4px; font: 600 var(--t-2xs)/1.2 var(--f-display); font-variation-settings: "wdth" 125; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.fp-section.current { color: var(--ink); }
.fp-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.open-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.open-item:last-child { border-bottom: 0; }
.open-item .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; font-size: var(--t-md); }
.open-item .top b { flex: 1 1 50%; min-width: 0; font-weight: 500; color: var(--ink-2); }
.open-item .top > span { flex: 0 1 auto; max-width: 52%; text-align: right; font-weight: 500; color: var(--ink); }
.open-item .top > span .cls { white-space: normal; justify-content: flex-end; text-align: right; }
.open-item .top > span small { display: block; margin-top: 3px; font-size: var(--t-2xs); font-weight: 400; line-height: 1.35; color: var(--mute); }
.num { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-weight: 500; font-size: .93em; }
.open-item .curve { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.open-item .curve span { font: 400 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; padding: 4px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.open-item .curve span b { color: var(--ink); font-weight: 600; }
.open-item .src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: var(--t-2xs); line-height: 1.35; color: var(--mute); }
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); }
.verified svg.i { width: 12px; height: 12px; stroke-width: 2; }
.unverified { color: var(--warn); }
.method { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; }
.age-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 28px; }
.age-bars span { width: 9px; background: var(--ink-2); border-radius: 2px 2px 0 0; }
.age-axis { display: block; margin-top: 3px; font: 400 9px/1 var(--f-mono); color: var(--mute); }
.panel-actions { display: flex; flex-shrink: 0; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.panel-actions:empty { display: none; }
.note { font-size: var(--t-xs); color: var(--mute); padding: 4px 0; line-height: 1.4; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: var(--t-sm); font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: border-color .15s, background-color .15s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn svg.i { width: 14px; height: 14px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primary:hover { background: var(--ink-2); color: var(--surface); }
.btn.sm { height: 26px; padding: 0 9px; font-size: var(--t-xs); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px; border-radius: 4px; white-space: nowrap;
  font: 500 var(--t-2xs)/1 var(--f-mono); font-variation-settings: "wdth" 87.5; letter-spacing: 0;
  background: var(--neu-bg); color: var(--neu); box-shadow: inset 0 0 0 1px var(--neu-line);
}
.badge.open, .badge.success, .badge.verified { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.badge.share_alike, .badge.warning, .badge.to_confirm { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.badge.blocked, .badge.failed, .badge.alert, .badge.restricted { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.badge.phase2 { background: var(--ink); color: var(--surface); box-shadow: none; }
.badge.gate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 2001; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0A0C0F99; }
.modal-overlay[hidden] { display: none; }
.modal-wrapper {
  position: relative; width: 100%; max-width: 1180px; max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden;
  animation: rise .25s cubic-bezier(.2,.7,.2,1);
}
.modal-scroll { overflow-y: auto; overflow-x: hidden; padding: 28px 32px 32px; scrollbar-width: thin; }
.modal-wrapper > .close-btn { top: 18px; right: 18px; z-index: 3; width: 34px; height: 34px; }

/* data & sources */
.sources-head {
  position: sticky; top: -28px; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin: -28px -32px 0; padding: 28px 80px 14px 32px; background: var(--surface);
}
.sources h2 { margin: 6px 0 0; font: 700 var(--t-2xl)/1.1 var(--f-display); font-variation-settings: "wdth" 115; letter-spacing: -.01em; }
.sources .lead { font-size: var(--t-sm); color: var(--mute); margin: 4px 0 14px; max-width: 62rem; line-height: 1.5; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); margin: 22px 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi { padding: 14px 16px 14px 0; }
.kpi + .kpi { padding-left: 16px; border-left: 1px solid var(--line); }
.kpi b { display: block; font: 700 1.75rem/1 var(--f-display); font-variation-settings: "wdth" 118; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 6px; font-size: var(--t-xs); color: var(--mute); line-height: 1.3; }
.kpi.alert b { color: var(--bad); }
.sources .section-title { margin-top: 26px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.vs-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.vs-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font: 600 var(--t-2xs)/1.2 var(--f-display); font-variation-settings: "wdth" 115; letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
}
.vs-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); line-height: 1.4; }
.vs-table tr:last-child td { border-bottom: 0; }
.vs-table tbody tr:hover td { background: var(--surface-2); }
.vs-table td b { color: var(--ink); font-weight: 600; }
.vs-table td small { display: block; margin-top: 3px; font-size: var(--t-2xs); color: var(--mute); }
.vs-table .num { text-align: right; font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-xs); color: var(--ink); white-space: nowrap; }
.vs-table .when { white-space: nowrap; }
.vs-table .code { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-xs); }
.vs-table .caveat { display: flex; gap: 4px; color: var(--warn); }
.vs-table .caveat svg.i { width: 12px; height: 12px; margin-top: 1px; }
.hz-chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }
.hz-chip svg.i { width: 14px; height: 14px; color: var(--mute); }
.issue-list { margin: 0; padding: 0; list-style: none; }
.issue-list li { margin: 0 0 3px; font-size: var(--t-xs); }
.issue-list li b { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-weight: 500; color: var(--ink); }

/* ── Landing: service levels (always on the dark brand chrome) ─────────── */
.landing { padding: 0; background: #0B0D10E8; align-items: stretch; overflow-y: auto; }
@supports (backdrop-filter: blur(8px)) { .landing { background: #0B0D10D6; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }
.landing-inner {
  width: 100%; max-width: 1180px; margin: auto; padding: 28px 32px 24px; color: var(--chrome-text);
  display: flex; flex-direction: column; min-height: 100%;
  opacity: 0; transition: opacity .3s ease;   /* shown once the translations are in (gis.js adds .ready) */
}
.landing.ready .landing-inner { opacity: 1; }
.landing-inner { animation: reveal .3s ease 2.5s forwards; }   /* safety net if a script fails to load */
@keyframes reveal { to { opacity: 1; } }
.landing-top { display: flex; justify-content: flex-end; align-items: center; }
.landing .grid-eyebrow { margin-bottom: 12px; color: var(--chrome-mute); }
.landing-hero { margin: 1vh 0 4vh; max-width: 760px; }
.landing-logo { display: block; height: 48px; width: auto; align-self: flex-start; }
.landing-thesis {
  margin: 20px 0 8px; font: 600 1.75rem/1.15 var(--f-display); font-variation-settings: "wdth" 110; letter-spacing: -.015em; color: #fff;
}
.layers-sub { margin: 0; font-size: var(--t-lg); color: var(--chrome-mute); line-height: 1.5; max-width: 620px; }
.layer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.layer-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; cursor: pointer; text-align: left;
  background: var(--chrome-2); border: 1px solid var(--chrome-line); border-radius: var(--r-lg); overflow: hidden; color: var(--chrome-text);
  transition: border-color .2s ease, transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease;
}
.layer-card:hover { border-color: #3A424D; transform: translateY(-2px); }
.layer-card.open { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 18px 40px #0008; }
.card-cover { position: relative; aspect-ratio: 2 / 1; background: #171B21; overflow: hidden; }
.card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.layer-card:hover .card-cover img { transform: scale(1.03); }
.scale-chip {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
  font: 500 var(--t-2xs)/1 var(--f-mono); color: #fff; padding: 5px 8px; border-radius: 4px; background: #0B0D10C7;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-name { margin: 0; font: 700 var(--t-xl)/1 var(--f-display); font-variation-settings: "wdth" 118; letter-spacing: -.005em; color: #fff; }
.card-level {
  position: relative; display: grid; place-items: center; width: 22px; height: 22px; font: 600 var(--t-2xs)/1 var(--f-mono); color: #fff;
}
.card-level::before { content: ""; position: absolute; inset: 0; border-radius: 3px; transform: skewX(var(--slant)); background: #FFFFFF1A; }
.layer-card.open .card-level::before { background: var(--brand); }
.card-level span { position: relative; }
.card-scope { margin-left: auto; font: 400 var(--t-2xs)/1 var(--f-mono); color: var(--chrome-mute); white-space: nowrap; }
.layer-description { margin: 12px 0 0; font-size: var(--t-md); line-height: 1.5; color: #C9D0D8; }
.card-details { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--chrome-line); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--t-xs); line-height: 1.4; }
.card-details dt { color: var(--chrome-mute); font: 500 var(--t-2xs)/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .03em; }
.card-details dd { margin: 0; color: #D5DBE1; }
.landing-actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; }
.landing-actions .hint-line { font-size: var(--t-sm); color: var(--chrome-mute); }
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 26px; border: 0; background: none;
  color: #fff; font: 650 var(--t-lg)/1 var(--f-display); font-variation-settings: "wdth" 110; text-decoration: none; isolation: isolate;
}
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--slant)); background: var(--brand);
  box-shadow: 0 10px 28px #EA1F1F4D; transition: background-color .2s ease, transform .2s ease;
}
.cta:hover { color: #fff; }
.cta:hover::before { background: var(--brand-deep); }
.cta svg.i { transition: transform .2s ease; }
.cta:hover svg.i { transform: translateX(3px); }
.cta:focus-visible { outline: none; }
.cta:focus-visible::before { outline: 2px solid #fff; outline-offset: 3px; }
.landing-foot {
  margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.landing-foot .partners-list { gap: 22px; justify-content: flex-start; }
.landing-foot .partners-list img { height: 20px; max-width: 80px; filter: brightness(0) invert(1); opacity: .72; }
.landing-foot .partners-list img.tile { height: 24px; filter: none; opacity: .95; }
.landing-foot .partners-list:hover img:not(.tile) { opacity: 1; filter: brightness(0) invert(1); }
.landing-foot small { font: 400 var(--t-2xs)/1.4 var(--f-mono); color: var(--chrome-mute); }

/* ── Login ─────────────────────────────────────────────────────────────── */
body.login-body { overflow: auto; background: var(--surface); }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); }
.login-brand {
  position: relative; display: flex; flex-direction: column; padding: 40px 48px 32px; background: var(--chrome); color: var(--chrome-text); overflow: hidden;
}
.login-brand .landing-logo { height: 40px; }
.login-hero { margin: auto 0; padding: 40px 0; }
.login-thesis { margin: 0 0 12px; max-width: 560px; font: 650 2.25rem/1.1 var(--f-display); font-variation-settings: "wdth" 110; letter-spacing: -.02em; color: #fff; }
.login-sub { margin: 0; max-width: 480px; font-size: var(--t-lg); line-height: 1.5; color: var(--chrome-mute); }
.login-zoom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 44px 0 0; max-width: 640px; }
.login-zoom figure { margin: 0; }
.login-zoom img { display: block; width: 100%; aspect-ratio: 5 / 3; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--chrome-line); }
.login-zoom figcaption { display: flex; justify-content: space-between; margin-top: 8px; font: 400 var(--t-2xs)/1 var(--f-mono); color: var(--chrome-mute); }
.login-zoom figcaption b { font-family: var(--f-body); font-weight: 600; font-size: var(--t-xs); color: var(--chrome-text); }
.login-brand .landing-foot { margin-top: 0; padding-top: 0; }
.login-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-main .lang { position: absolute; top: 20px; right: 20px; background: var(--surface-2); border-color: var(--line); }
.login-main .lang-btn { color: var(--mute); }
.login-main .lang-btn:hover { color: var(--ink); }
.login-main .lang-btn.active { background: var(--ink); color: var(--surface); }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { margin: 8px 0 24px; font: 700 var(--t-2xl)/1.15 var(--f-display); font-variation-settings: "wdth" 112; letter-spacing: -.01em; color: var(--ink); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.field input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: var(--t-md);
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sel-bg); }
.login-card .submit {
  width: 100%; height: 44px; margin-top: 8px; border: 0; border-radius: var(--r-sm); background: var(--ink); color: var(--surface);
  font: 600 var(--t-md)/1 var(--f-display); font-variation-settings: "wdth" 110; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-card .submit:hover { background: var(--ink-2); }
.login-card .alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-bottom: 16px; border-radius: var(--r-sm); font-size: var(--t-sm); background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.login-card .alert.success, .login-card .alert.info { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.login-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: var(--t-sm); }
.login-foot a { color: var(--mute); text-decoration: none; }
.login-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ── Motion preferences ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .user-name, .brand-product, .top-btn span { display: none; }
  .top-btn { padding: 0 8px; }
  .tier { min-width: 0; padding: 0 16px; }
}
@media (max-width: 960px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 10px 0 14px; }
  .brand-wordmark { display: none; }
  .brand-mark { display: block; }
  .tiers { justify-self: center; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; box-shadow: var(--shadow-2); }
  .feature-panel { width: 360px; }
  .layer-grid { grid-template-columns: 1fr; }
  .layer-card { flex-direction: row; }
  .card-cover { width: 40%; aspect-ratio: auto; flex-shrink: 0; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4) { padding-left: 0; border-left: 0; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 28px 24px; }
  .login-hero { padding: 28px 0; }
  .login-thesis { font-size: 1.75rem; }
  .login-zoom { margin-top: 24px; }
}
@media (max-width: 640px) {
  .tier-scale, .lang { display: none; }
  .tier { padding: 0 12px; }
  .user { display: none; }
  .feature-panel { top: auto; bottom: 12px; max-height: 62%; }
  .legend-container { width: calc(100% - 24px); }
  .layer-card { flex-direction: column; }
  .card-cover { width: 100%; aspect-ratio: 5 / 2; }
  .landing-inner { padding: 24px 16px; }
  .landing-thesis { font-size: 1.5rem; }
  .modal-scroll { padding: 20px 16px; }
  .sources-head { top: -20px; margin: -20px -16px 0; padding: 20px 64px 12px 16px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi + .kpi { padding-left: 0; border-left: 0; }
  .table-wrap { overflow-x: auto; }
  .login-zoom { grid-template-columns: 1fr 1fr 1fr; }
  .login-main { padding: 28px 16px 40px; }
}
