:root {
  --bg: #07111f;
  --bg-deep: #030914;
  --panel: rgba(8, 20, 36, 0.9);
  --panel-solid: #0b1728;
  --panel-soft: rgba(15, 31, 51, 0.82);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(103, 232, 249, 0.28);
  --text: #edf7ff;
  --muted: #91a6bb;
  --dim: #60758b;
  --cyan: #45e0e8;
  --cyan-soft: #a5f3fc;
  --blue: #4f72ff;
  --indigo: #7c83ff;
  --amber: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --radius: 18px;
}

body.theme-day {
  --bg: #edf4f8;
  --bg-deep: #dce8ef;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #f8fbfd;
  --panel-soft: rgba(239, 246, 250, 0.92);
  --line: rgba(15, 39, 58, 0.14);
  --line-strong: rgba(8, 145, 178, 0.28);
  --text: #10263a;
  --muted: #506b80;
  --dim: #71879a;
  --cyan: #0891b2;
  --cyan-soft: #0e7490;
  --blue: #3158dc;
  --indigo: #5b5bd6;
  --shadow: 0 18px 55px rgba(32, 67, 88, 0.2);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

#app,
#map { width: 100%; height: 100%; }

#map { background: var(--bg-deep); }

.leaflet-container { font: inherit; }

.leaflet-control-zoom {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
  color: var(--text) !important;
  background: var(--panel) !important;
  border-color: var(--line) !important;
}

.leaflet-control-attribution {
  color: var(--dim) !important;
  background: color-mix(in srgb, var(--panel-solid) 80%, transparent) !important;
}

.leaflet-control-attribution a { color: var(--cyan) !important; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.topbar {
  position: fixed;
  z-index: 1100;
  top: 14px;
  left: 50%;
  display: flex;
  width: min(1060px, calc(100vw - 28px));
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  transform: translateX(-50%);
}

.brand {
  display: flex;
  min-width: 150px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-compass {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #03111d;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.24);
  font-size: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  letter-spacing: -0.045em;
  font-size: 21px;
  font-weight: 760;
}

.wordmark strong { color: var(--text); }
.wordmark span { color: var(--cyan); }
.brand small { align-self: flex-start; color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.metric-button {
  display: flex;
  min-width: 250px;
  height: 46px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.metric-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.metric-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: var(--cyan-soft);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.08);
}

.metric-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.metric-copy small { color: var(--dim); font-size: 9px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-copy strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--dim); font-size: 17px; }

.search-wrap {
  position: relative;
  display: flex;
  min-width: 200px;
  height: 46px;
  flex: 1;
  align-items: center;
}

.search-wrap > span {
  position: absolute;
  z-index: 1;
  left: 13px;
  color: var(--dim);
  font-size: 22px;
  transform: translateY(-1px);
  pointer-events: none;
}

#region-search {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 40px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--panel-soft);
  transition: border-color 0.18s, box-shadow 0.18s;
}

#region-search::placeholder { color: var(--dim); }
#region-search:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }

.search-results {
  position: absolute;
  top: 53px;
  right: 0;
  left: 0;
  display: none;
  overflow: hidden;
  padding: 6px;
  border-radius: 14px;
}

.search-results.open { display: block; }

.search-result {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.search-result:hover,
.search-result.active { background: rgba(34, 211, 238, 0.1); }
.search-result b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.search-result em { color: var(--cyan); font-size: 11px; font-style: normal; font-weight: 800; }
.search-empty { padding: 12px; color: var(--muted); font-size: 12px; }

.top-actions { display: flex; gap: 5px; }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.icon-button:hover,
.icon-button.active { color: var(--cyan-soft); border-color: var(--line-strong); background: rgba(34, 211, 238, 0.08); }

.region-panel,
.ranking-panel {
  position: fixed;
  z-index: 1050;
  top: 90px;
  bottom: 26px;
  width: min(370px, calc(100vw - 28px));
  overflow: auto;
  border-radius: var(--radius);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}

.region-panel { left: 14px; padding: 22px; transform: translateX(calc(-100% - 30px)); opacity: 0; }
.region-panel.open { transform: translateX(0); opacity: 1; }

.ranking-panel { right: 14px; padding: 20px; transform: translateX(calc(100% + 30px)); opacity: 0; }
.ranking-panel.open { transform: translateX(0); opacity: 1; }

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.panel-close:hover { color: var(--text); border-color: var(--line-strong); }
.panel-close.static { position: static; flex: 0 0 auto; }

.region-breadcrumb,
.eyebrow {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.region-heading { padding-right: 32px; }
.region-heading h2 { margin: 6px 0 3px; font-size: clamp(22px, 3vw, 29px); letter-spacing: -0.04em; line-height: 1.08; }
.region-country { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.country-code { padding: 2px 6px; color: var(--cyan-soft); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 9px; font-weight: 850; }

.metric-hero {
  margin: 20px -4px 14px;
  padding: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(79, 70, 229, 0.07));
}

.metric-hero small { color: var(--muted); font-size: 11px; }
.metric-hero strong { display: block; margin: 4px 0 2px; color: var(--text); font-size: 29px; letter-spacing: -0.04em; }
.metric-hero span { color: var(--dim); font-size: 10px; }

.rank-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.rank-chip { padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.rank-chip small { display: block; color: var(--dim); font-size: 9px; text-transform: uppercase; }
.rank-chip b { display: block; margin-top: 3px; font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel-soft) 78%, transparent); }
.stat-card small { display: block; overflow: hidden; color: var(--dim); font-size: 9px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.stat-card b { display: block; overflow: hidden; margin-top: 4px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.positive { color: #34d399 !important; }
.negative { color: var(--danger) !important; }

.panel-section { margin-top: 18px; }
.panel-section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 9px; }
.panel-section h3 { margin: 0; font-size: 12px; }
.panel-section-head small { color: var(--dim); font-size: 9px; }

.sparkline-wrap { padding: 10px 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.sparkline-wrap svg { display: block; width: 100%; height: 92px; overflow: visible; }
.sparkline-labels { display: flex; justify-content: space-between; padding: 0 3px; color: var(--dim); font-size: 9px; }

.raw-list { display: grid; gap: 7px; }
.raw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.raw-row b { color: var(--text); font-size: 12px; }

.panel-actions { display: flex; gap: 7px; margin-top: 18px; }
.panel-actions button { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); cursor: pointer; font-size: 11px; font-weight: 750; }
.panel-actions button:hover { border-color: var(--line-strong); color: var(--cyan-soft); }

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -0.035em; }

.rank-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 17px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.rank-mode button { padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.rank-mode button.active { color: #02121d; background: var(--cyan); }
.ranking-context { min-height: 31px; margin: 8px 2px 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ranking-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.ranking-list li { counter-increment: rank; }
.rank-item { display: grid; width: 100%; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 11px; background: var(--panel-soft); cursor: pointer; text-align: left; }
.rank-item:hover { border-color: var(--line-strong); transform: translateX(-2px); }
.rank-number { display: grid; width: 24px; height: 24px; place-items: center; color: var(--cyan); border: 1px solid var(--line-strong); border-radius: 8px; font-size: 9px; font-weight: 900; }
.rank-name { min-width: 0; }
.rank-name b { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { color: var(--dim); font-size: 9px; }
.rank-value { color: var(--cyan-soft); font-size: 11px; font-weight: 850; white-space: nowrap; }

.legend {
  position: fixed;
  z-index: 1000;
  right: 14px;
  bottom: 25px;
  width: min(330px, calc(100vw - 28px));
  padding: 15px;
  border-radius: 15px;
  transition: right 0.25s;
}

body.rank-open .legend { right: 400px; }
.legend-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.legend-heading h2 { margin: 4px 0 0; font-size: 14px; }
.coverage-pill { padding: 4px 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; white-space: nowrap; }
.legend-scale { display: grid; grid-template-columns: repeat(7, 1fr); height: 9px; margin-top: 13px; overflow: visible; border-radius: 999px; }
.legend-bin { position: relative; min-width: 0; }
.legend-bin:first-child { border-radius: 999px 0 0 999px; }
.legend-bin:last-child { border-radius: 0 999px 999px 0; }
.legend-bin span { position: absolute; top: 13px; left: 0; color: var(--dim); font-size: 8px; transform: translateX(-35%); white-space: nowrap; }
.legend-bin:last-child span { right: 0; left: auto; transform: translateX(20%); }
.legend-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 25px; color: var(--dim); font-size: 9px; }
.legend-foot span { display: flex; align-items: center; gap: 5px; }
.no-data-swatch { display: inline-block; width: 9px; height: 9px; border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 2px; background: #344456; }
.legend-foot button { padding: 0; border: 0; background: transparent; color: var(--cyan); cursor: pointer; font-size: 9px; font-weight: 800; }

.map-note {
  position: fixed;
  z-index: 900;
  bottom: 27px;
  left: 52px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.mobile-sheet-button { display: none; }

.modal-layer {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 18, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.22s, visibility 0.22s;
}

.modal-layer.hidden { visibility: hidden; opacity: 0; pointer-events: none; }

.welcome-card {
  display: grid;
  overflow: hidden;
  width: min(1040px, 100%);
  min-height: 560px;
  grid-template-columns: 1.04fr 0.96fr;
  border: 1px solid rgba(103, 232, 249, 0.19);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(10, 27, 47, 0.98), rgba(4, 13, 25, 0.99));
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.62);
}

.welcome-visual { position: relative; overflow: hidden; min-height: 420px; background: radial-gradient(circle at 54% 46%, rgba(33, 196, 210, 0.22), transparent 34%), radial-gradient(circle at 18% 15%, rgba(79, 70, 229, 0.24), transparent 28%), #061321; }
.welcome-visual::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 70%, rgba(4, 13, 25, 0.98)), linear-gradient(0deg, rgba(4, 13, 25, 0.72), transparent 40%); content: ""; }
.europe-grid { position: absolute; top: 13%; left: 12%; width: 75%; aspect-ratio: 1; opacity: 0.85; border: 1px solid rgba(103, 232, 249, 0.18); border-radius: 48% 41% 53% 37%; background: repeating-linear-gradient(28deg, transparent 0 18px, rgba(103, 232, 249, 0.06) 19px 20px), repeating-linear-gradient(116deg, transparent 0 23px, rgba(124, 131, 255, 0.08) 24px 25px), radial-gradient(circle at 55% 43%, rgba(69, 224, 232, 0.35), rgba(52, 78, 157, 0.15) 40%, transparent 66%); filter: drop-shadow(0 0 30px rgba(34, 211, 238, 0.15)); transform: rotate(-7deg); }
.map-orbit { position: absolute; border: 1px solid rgba(103, 232, 249, 0.16); border-radius: 50%; }
.orbit-one { top: 22%; left: 20%; width: 66%; aspect-ratio: 1; }
.orbit-two { top: 33%; left: 30%; width: 45%; aspect-ratio: 1; }
.map-pin { position: absolute; z-index: 2; width: 10px; height: 10px; border: 2px solid #c4fbff; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 7px rgba(69, 224, 232, 0.12), 0 0 22px var(--cyan); }
.pin-one { top: 35%; left: 56%; }
.pin-two { top: 57%; left: 38%; }
.pin-three { top: 46%; left: 70%; }
.visual-label { position: absolute; z-index: 3; bottom: 40px; left: 40px; display: flex; flex-direction: column; padding: 13px 17px; border: 1px solid rgba(103, 232, 249, 0.23); border-radius: 14px; background: rgba(4, 18, 33, 0.72); backdrop-filter: blur(12px); }
.visual-label b { color: #e9feff; font-size: 24px; letter-spacing: -0.04em; }
.visual-label small { color: #91b7c4; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }

.welcome-copy { display: flex; flex-direction: column; justify-content: center; padding: 55px 52px 50px 32px; }
.welcome-kicker { color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: 0.17em; text-transform: uppercase; }
.welcome-wordmark { margin-top: 18px; font-size: 28px; }
.welcome-copy h1 { max-width: 390px; margin: 13px 0 15px; color: #f4fbff; font-size: clamp(37px, 5vw, 57px); letter-spacing: -0.065em; line-height: 0.98; }
.welcome-copy > p { max-width: 430px; margin: 0; color: #9bb0c3; font-size: 14px; line-height: 1.65; }
.welcome-stats { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0; }
.welcome-stats span { padding: 7px 9px; color: #8fa7ba; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 9px; background: rgba(15, 31, 51, 0.56); font-size: 9px; }
.welcome-stats b { color: #e7faff; }
.welcome-actions { display: flex; align-items: center; gap: 14px; }
.primary-button { display: flex; min-width: 170px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; color: #00141c; border: 0; border-radius: 11px; background: linear-gradient(135deg, #8ef3f5, #3dd6e0); box-shadow: 0 12px 35px rgba(34, 211, 238, 0.22); cursor: pointer; font-size: 12px; font-weight: 850; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 40px rgba(34, 211, 238, 0.3); }
.text-button { padding: 8px 0; color: #91a6bb; border: 0; background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; }
.text-button:hover { color: #bdf9fb; }
.welcome-source { margin-top: 23px; color: #526b7e; font-size: 9px; }

.catalog-card { overflow: auto; width: min(930px, 100%); max-height: min(760px, calc(100dvh - 36px)); padding: 26px; border-radius: 24px; }
.catalog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.catalog-head h2 { margin: 5px 0; font-size: 27px; letter-spacing: -0.045em; }
.catalog-head p { margin: 0; color: var(--muted); font-size: 11px; }
.catalog-groups { display: grid; gap: 19px; margin-top: 19px; }
.catalog-group h3 { margin: 0 0 9px; color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric-card { position: relative; min-height: 105px; padding: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); cursor: pointer; text-align: left; }
.metric-card::after { position: absolute; right: -15px; bottom: -28px; width: 78px; height: 78px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 68%); content: ""; }
.metric-card:hover,
.metric-card.active { border-color: var(--line-strong); background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), var(--panel-soft)); transform: translateY(-1px); }
.metric-card.active::before { position: absolute; top: 0; right: 13px; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--cyan); content: ""; }
.metric-card b { display: block; margin-bottom: 5px; font-size: 12px; }
.metric-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.metric-card small { display: block; margin-top: 9px; color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.catalog-roadmap { margin-top: 22px; padding: 13px 15px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(124, 131, 255, 0.04); }
.catalog-roadmap span { color: var(--indigo); font-size: 9px; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.catalog-roadmap p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }

.drawer {
  position: fixed;
  z-index: 4100;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  overflow: auto;
  color: var(--text);
  border-left: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.4);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel-solid) 94%, transparent); backdrop-filter: blur(14px); }
.drawer-head h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -0.04em; }
.drawer-body { padding: 22px 24px 50px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.drawer-body h3 { margin: 24px 0 8px; color: var(--text); font-size: 12px; }
.drawer-body ul { display: grid; gap: 7px; margin: 0; padding-left: 19px; }
.method-lead { padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(79, 70, 229, 0.05)); }
.method-lead b { color: var(--text); font-size: 14px; }
.method-lead p { margin: 7px 0 0; }
.source-list { display: grid; gap: 8px; }
.source-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); text-decoration: none; }
.source-link:hover { border-color: var(--line-strong); }
.source-link span { min-width: 0; }
.source-link b { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-link small { display: block; margin-top: 2px; color: var(--dim); font-size: 8px; }
.source-link i { color: var(--cyan); font-style: normal; }
.method-note { padding: 10px 12px; border-left: 3px solid var(--amber); background: rgba(251, 191, 36, 0.06); }
.drawer-backdrop { position: fixed; z-index: 4000; inset: 0; visibility: hidden; background: rgba(2, 8, 18, 0.62); opacity: 0; transition: opacity 0.2s, visibility 0.2s; }
.drawer-backdrop.open { visibility: visible; opacity: 1; }

.loading-screen { position: fixed; z-index: 6000; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: radial-gradient(circle at 50% 40%, #112b43, #050c17 57%); transition: opacity 0.35s, visibility 0.35s; }
.loading-screen.done { visibility: hidden; opacity: 0; pointer-events: none; }
.loading-mark { position: relative; display: grid; width: 74px; height: 74px; place-items: center; margin-bottom: 16px; border: 1px solid rgba(103, 232, 249, 0.27); border-radius: 50%; }
.loading-mark::before { position: absolute; inset: 9px; border: 1px dashed rgba(103, 232, 249, 0.25); border-radius: 50%; content: ""; animation: spin 5s linear infinite; }
.loading-mark b { color: #c6fbff; font-size: 15px; letter-spacing: -0.03em; }
.loading-mark span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #45e0e8; box-shadow: 0 0 12px #45e0e8; }
.loading-mark span:nth-child(1) { top: 7px; left: 34px; }
.loading-mark span:nth-child(2) { right: 8px; bottom: 19px; }
.loading-mark span:nth-child(3) { bottom: 13px; left: 14px; }
.wordmark-large { color: #edfaff; font-size: 30px; }
.loading-screen p { margin: 8px 0 15px; color: #7890a4; font-size: 11px; }
.loading-track { overflow: hidden; width: 180px; height: 3px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); }
.loading-track i { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, transparent, #45e0e8, transparent); animation: load 1.25s ease-in-out infinite; }

.toast { position: fixed; z-index: 7000; bottom: 28px; left: 50%; visibility: hidden; min-width: 220px; max-width: calc(100vw - 30px); padding: 11px 15px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel-solid); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 15px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; text-align: center; font-size: 11px; }
.toast.open { visibility: visible; opacity: 1; transform: translate(-50%, 0); }

.region-tooltip { padding: 2px; }
.region-tooltip b { display: block; max-width: 220px; overflow: hidden; color: #f8fbff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.region-tooltip small { display: block; margin-top: 2px; color: #9fb4c8; font-size: 9px; }
.region-tooltip strong { display: block; margin-top: 7px; color: #75edf1; font-size: 14px; }
.euratlas-tooltip.leaflet-tooltip { padding: 9px 10px; border: 1px solid rgba(103, 232, 249, 0.24); border-radius: 10px; background: rgba(5, 15, 28, 0.94); box-shadow: 0 12px 35px rgba(0, 0, 0, 0.42); }
.euratlas-tooltip.leaflet-tooltip::before { border-top-color: rgba(5, 15, 28, 0.94); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(350%); } }

@media (max-width: 900px) {
  .brand { min-width: auto; }
  .brand .wordmark,
  .brand small { display: none; }
  .metric-button { min-width: 220px; }
  body.rank-open .legend { right: 14px; }
  .welcome-card { grid-template-columns: 0.8fr 1.2fr; }
  .welcome-copy { padding-right: 34px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .topbar { top: 8px; width: calc(100vw - 16px); min-height: 52px; padding: 5px; border-radius: 15px; }
  .brand { padding: 4px; }
  .brand-compass { width: 38px; height: 38px; }
  .metric-button { display: none; }
  .search-wrap { height: 40px; min-width: 0; }
  .top-actions .icon-button { width: 36px; height: 36px; }
  #ranking-button,
  #reset-button { display: none; }
  .region-panel,
  .ranking-panel { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; max-height: min(72dvh, 620px); border-radius: 20px; }
  .region-panel { transform: translateY(calc(100% + 20px)); }
  .ranking-panel { transform: translateY(calc(100% + 20px)); }
  .region-panel.open,
  .ranking-panel.open { transform: translateY(0); }
  .legend { right: 8px; bottom: 59px; left: 8px; width: auto; padding: 11px 12px; }
  .legend-heading h2 { font-size: 12px; }
  .legend-foot { margin-top: 22px; }
  .map-note { display: none; }
  .mobile-sheet-button { position: fixed; z-index: 1200; right: 8px; bottom: 8px; left: 8px; display: flex; height: 44px; align-items: center; justify-content: space-between; padding: 0 15px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
  .mobile-sheet-button strong { font-size: 11px; }
  .welcome-card { display: block; min-height: 0; max-height: calc(100dvh - 24px); overflow: auto; border-radius: 22px; }
  .welcome-visual { min-height: 215px; }
  .welcome-visual::after { background: linear-gradient(0deg, rgba(4, 13, 25, 1), transparent 75%); }
  .visual-label { bottom: 18px; left: 18px; }
  .welcome-copy { padding: 20px 22px 28px; }
  .welcome-wordmark { margin-top: 8px; }
  .welcome-copy h1 { margin-top: 8px; font-size: 37px; }
  .welcome-copy > p { font-size: 12px; }
  .welcome-stats { margin: 16px 0; }
  .welcome-actions { align-items: stretch; flex-direction: column; gap: 4px; }
  .primary-button { width: 100%; }
  .welcome-source { margin-top: 12px; }
  .catalog-card { padding: 18px 14px; border-radius: 20px; }
  .catalog-head h2 { font-size: 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 86px; }
  .drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

