:root {
  --bg: #0b1a1c;
  --panel: #0f2224;
  --card: #132c30;
  --card-2: #173439;
  --line: #21413f;
  --line-2: #2a4e4d;
  --text: #e4f1ef;
  --muted: #8fb2ae;
  --faint: #5f817d;
  --teal: #20b2aa;
  --teal-2: #17c7ba;
  --amber: #f2b84b;
  --up: #57d6a8;
  --down: #f2907f;
  --warn: #e8b04b;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--teal);
  color: #04201e;
  padding: 6px 10px;
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  left: 12px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11.5px;
}

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
}

.warn {
  color: var(--down);
}

/* Header */

.top {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand .word {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 11.5px;
}

.brand .place {
  color: var(--muted);
  font-size: 12px;
  padding-left: 10px;
  border-left: 1px solid var(--line-2);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-2);
  border: 1px solid rgba(23, 199, 186, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-2);
  box-shadow: 0 0 8px rgba(23, 199, 186, 0.9);
  animation: blink 1.4s ease-in-out infinite;
}

.quota {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.quota .short {
  display: none;
}

.quota .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-2);
  animation: glow 2.4s ease-in-out infinite;
}

.quota .dot.out {
  background: var(--warn);
  animation: none;
}

.links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}

.links a {
  color: var(--muted);
}

a.cta {
  white-space: nowrap;
  color: #04201e;
  background: var(--teal-2);
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 600;
}

a.cta:hover {
  text-decoration: none;
  background: #34d8cb;
}

.progress {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  z-index: 20;
}

.progress i {
  display: block;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--teal-2), transparent);
  animation: slide 1s linear infinite;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 580px) 1fr;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.searchbar {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  gap: 8px;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.search input:focus {
  outline: 2px solid rgba(23, 199, 186, 0.45);
  border-color: var(--teal);
}

.search button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal-2);
  color: #04201e;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search button.secondary {
  background: transparent;
  color: var(--amber);
  border: 1px solid rgba(242, 184, 75, 0.45);
}

.search button.secondary.on {
  background: rgba(242, 184, 75, 0.15);
}

.search button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.examples,
.history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.history:empty {
  display: none;
}

.chip {
  border: 1px solid var(--line-2);
  background: var(--card);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.chip:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.chip.hist {
  background: transparent;
}

.pinbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.06);
  font-size: 12px;
}

.pinbar > span:nth-child(2) {
  flex: 1;
}

.notice {
  position: relative;
  margin: 10px 16px 0;
  padding: 12px 34px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--card);
  animation: rise 0.35s ease both;
}

.notice h2 {
  font-size: 14px;
  margin: 0 0 8px;
}

.notice .close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
}

.result {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 8px;
}

.foot {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

.foot p {
  margin: 0 0 4px;
}

.foot a {
  color: var(--muted);
}

/* Intro and place header */

.intro {
  animation: rise 0.5s ease both;
}

.intro h1 {
  font-size: 19px;
  line-height: 1.3;
  margin: 6px 0 8px;
}

.intro p {
  color: var(--muted);
  margin: 0 0 10px;
}

.intro .points {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.place {
  margin-bottom: 12px;
  animation: rise 0.4s ease both;
}

.place h1 {
  font-size: 22px;
  margin: 4px 0 0;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pairhead h1 {
  font-size: 18px;
}

.vs {
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
  margin: 0 4px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
}

.badge {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-2);
  border: 1px solid rgba(23, 199, 186, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #04201e;
  flex: none;
}

.tag.sa {
  background: var(--teal-2);
}

.tag.sb {
  background: var(--amber);
}

.within {
  margin: 2px 0 0;
  color: var(--muted);
}

.why {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.why::before {
  content: "●";
  margin-right: 6px;
  color: var(--teal-2);
}

.why.counted::before {
  color: var(--warn);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

button.primary,
button.ghost {
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  border: 0;
  background: var(--teal-2);
  color: #04201e;
}

button.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  border: 1px solid var(--line-2);
  background: transparent;
  font-weight: 500;
}

button.ghost:hover {
  border-color: var(--teal);
}

button.small {
  padding: 3px 9px;
  font-size: 11.5px;
}

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 8px;
}

.card h2 .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(23, 199, 186, 0.12);
  color: var(--teal-2);
  font-size: 11px;
  letter-spacing: 0;
}

.hero {
  background: radial-gradient(120% 140% at 0% 0%, rgba(23, 199, 186, 0.13), transparent 55%), var(--card);
}

.hero .big {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hero .num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(23, 199, 186, 0.25);
}

.hero .unit {
  color: var(--muted);
  font-size: 14px;
}

.hero .range {
  color: var(--muted);
  font-size: 12px;
}

.pairhero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero.mini {
  margin-bottom: 10px;
}

.hero.mini.sb {
  background: radial-gradient(120% 140% at 0% 0%, rgba(242, 184, 75, 0.14), transparent 55%), var(--card);
}

.hero.mini .num {
  font-size: 26px;
}

.minihead {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-title {
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.3;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.delta,
.ref {
  display: inline-block;
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 8px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  margin-top: 6px;
}

.delta.up,
.up {
  color: var(--up);
}

.delta.down,
.down {
  color: var(--down);
}

.chart {
  margin: 8px 0 0;
}

.chart figcaption,
.caption {
  color: var(--faint);
  font-size: 11px;
  margin-top: 2px;
}

.dotplot {
  width: 100%;
  height: auto;
  display: block;
}

.dotplot .lbl {
  fill: var(--muted);
  font-size: 12px;
}

.dotplot .val {
  fill: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dotplot .tick {
  fill: var(--faint);
  font-size: 11px;
}

.dotplot .track {
  stroke: var(--line-2);
  stroke-width: 1;
}

.dotplot .band {
  fill: rgba(23, 199, 186, 0.22);
}

.dotplot .pt.pub {
  fill: none;
  stroke: #8fb2ae;
  stroke-width: 2;
}

.dotplot .pt.same {
  fill: #8fb2ae;
}

.dotplot .pt.now {
  fill: var(--teal-2);
  animation: pulse 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.kpi {
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
}

.kpi .k {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi .n {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Tables */

.scroll {
  overflow-x: auto;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.grid th,
.grid td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.grid thead th {
  color: var(--faint);
  font-weight: 500;
  font-size: 11.5px;
}

.grid thead th.sa {
  color: var(--teal-2);
}

.grid thead th.sb {
  color: var(--amber);
}

.grid tbody th {
  font-weight: 500;
}

.grid tr:last-child th,
.grid tr:last-child td {
  border-bottom: 0;
}

.grid tbody tr {
  transition: background 0.15s;
}

.grid tbody tr:hover {
  background: rgba(23, 199, 186, 0.05);
}

.grid .num {
  text-align: right;
  white-space: nowrap;
}

.grid .sub {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 400;
}

.grid .chg {
  font-weight: 600;
}

.grid.small th,
.grid.small td {
  font-size: 11.5px;
  padding: 5px 6px;
}

.grid .ep {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare td.me,
.compare th.me,
.compare td.sb {
  color: var(--text);
}

.compare td {
  color: var(--muted);
}

.compare .v {
  display: block;
}

.compare .bar {
  display: block;
  height: 4px;
  margin-top: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.compare .bar i {
  display: block;
  height: 100%;
  width: 0;
  margin-left: auto;
  border-radius: 2px;
  background: #8fb2ae;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.compare td.s0 .bar i,
.compare td.sa .bar i {
  background: linear-gradient(90deg, #0f8f86, var(--teal-2));
  box-shadow: 0 0 6px rgba(23, 199, 186, 0.6);
}

.compare td.sb .bar i {
  background: linear-gradient(90deg, #b9832a, var(--amber));
  box-shadow: 0 0 6px rgba(242, 184, 75, 0.5);
}

.compare td.s2 .bar i {
  background: #56736f;
}

.prose p {
  margin: 0 0 6px;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* 3D bars: a front face, a top face skewed back and a side face skewed up */

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

.key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.key.s0 i,
.key.sa i {
  background: var(--teal-2);
}

.key.s1 i {
  background: #a9c8c4;
}

.key.s2 i {
  background: #6d8e8a;
}

.key.sb i {
  background: var(--amber);
}

.plot3d {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 170px;
  padding: 26px 8px 0 2px;
}

.plot3d .cat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.plot3d .stack {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-2);
}

.b3 {
  --d: 6px;
  position: relative;
  width: clamp(7px, 26%, 22px);
  height: 0;
  background: linear-gradient(180deg, var(--f1), var(--f2));
  transition: height 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.b3::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(-1 * var(--d));
  width: 100%;
  height: var(--d);
  background: var(--t);
  transform-origin: left bottom;
  transform: skewX(-45deg);
}

.b3::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: var(--d);
  height: 100%;
  background: var(--sd);
  transform-origin: left top;
  transform: skewY(-45deg);
}

.b3:hover {
  filter: brightness(1.15);
}

.b3 .tip {
  position: absolute;
  bottom: calc(100% + var(--d) + 3px);
  left: 50%;
  transform: translateX(-30%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.n2 .b3 .tip {
  font-size: 9.5px;
}

.b3.s0,
.b3.sa {
  --f1: #3fe9da;
  --f2: #12a297;
  --t: #94f6ed;
  --sd: #0c7068;
}

.b3.sb {
  --f1: #ffd27a;
  --f2: #db9529;
  --t: #ffe6b0;
  --sd: #9c6718;
}

.b3.s1 {
  --f1: #b4d1cd;
  --f2: #6f918d;
  --t: #d9ebe8;
  --sd: #4c6866;
}

.b3.s2 {
  --f1: #6f908c;
  --f2: #455f5c;
  --t: #91aca8;
  --sd: #314644;
}

.cat-label {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Notes, request, trace */

.notes ul {
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
}

.notes li {
  margin-bottom: 4px;
}

.request pre {
  margin: 8px 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
}

.request code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #bfe7e2;
}

.reqblock + .reqblock,
.traceblock + .traceblock {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.reqhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.trace-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.tid {
  color: var(--teal-2);
}

/* Candidates, errors and loading */

.cands {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--card-2);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.cand:hover {
  border-color: var(--teal);
  transform: translateX(2px);
}

.cand .name {
  font-weight: 600;
  flex: 1;
}

.loading .shimmer {
  height: 12px;
  border-radius: 6px;
  margin: 8px 0;
  background: linear-gradient(90deg, var(--card-2), var(--line-2), var(--card-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.w40 {
  width: 40%;
}

.w60 {
  width: 60%;
}

.w90 {
  width: 90%;
}

/* Map */

.mapwrap {
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
}

#map.nomap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.legend {
  position: absolute;
  left: 12px;
  bottom: 28px;
  max-width: 360px;
  background: rgba(15, 34, 36, 0.92);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  animation: rise 0.4s ease both;
}

.legend .lg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.legend .sw {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.legend .sw.sa {
  background: rgba(23, 199, 186, 0.6);
  border: 2px solid var(--teal-2);
}

.legend .sw.sb {
  background: rgba(242, 184, 75, 0.6);
  border: 2px solid var(--amber);
}

.legend .sw.ctx {
  background: rgba(143, 178, 174, 0.25);
  border: 1px dashed #8fb2ae;
}

.pin {
  --c: var(--teal-2);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #04201e;
  box-shadow: 0 0 10px var(--c);
  position: relative;
}

.pin::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--c);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pin.sb {
  --c: var(--amber);
}

.drawbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 90px));
  background: rgba(15, 34, 36, 0.96);
  border: 1px solid rgba(242, 184, 75, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: rise-centred 0.3s ease both;
}

.drawbar .dtitle {
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 2px;
}

.drawbar .meter {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.drawbar .meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-2), var(--amber));
  transition: width 0.2s;
}

.drawbar.over .meter i {
  background: var(--down);
}

.drawbar .dfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.drawbar .spacer {
  flex: 1;
}

.mapboxgl-ctrl-group {
  background: var(--panel) !important;
}

.mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
  filter: invert(1) hue-rotate(180deg);
}

/* Motion */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* For elements centred with translateX(-50%): a plain "rise" would end at transform: none. */
@keyframes rise-centred {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(23, 199, 186, 0.12);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(23, 199, 186, 0.04);
  }
}

@keyframes ping {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(300%);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Narrow screens: search, then the map, then the comparison */

@media (max-width: 900px) {
  .top {
    gap: 10px;
    padding: 0 12px;
  }

  .brand .place,
  .links a:not(.cta),
  .live {
    display: none;
  }

  .quota {
    font-size: 11px;
  }

  .quota .long {
    display: none;
  }

  .quota .short {
    display: inline;
  }

  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .panel {
    display: contents;
  }

  .searchbar {
    order: 1;
    background: var(--panel);
  }

  .search button span {
    display: none;
  }

  .notice {
    order: 2;
  }

  .mapwrap {
    order: 3;
    height: 44vh;
    min-height: 280px;
  }

  .result {
    order: 4;
    overflow: visible;
    padding: 12px;
  }

  .foot {
    order: 5;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pairhero {
    grid-template-columns: 1fr;
  }

  .legend {
    bottom: 32px;
    max-width: calc(100% - 24px);
    padding: 6px 8px;
  }

  .legend .lg.muted {
    display: none;
  }

  .drawbar {
    width: calc(100% - 24px);
    top: auto;
    bottom: 40px;
  }
}
