:root {
  --bg: #07111b;
  --bg-2: #0d1d2d;
  --panel: rgba(7, 21, 32, 0.82);
  --panel-strong: rgba(7, 18, 28, 0.94);
  --card: rgba(10, 27, 40, 0.9);
  --line: rgba(140, 201, 255, 0.14);
  --line-strong: rgba(140, 201, 255, 0.26);
  --text: #edf5fb;
  --muted: #8ba8bb;
  --accent: #4cf2b1;
  --accent-warm: #ffb067;
  --accent-hot: #ff6273;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(76, 242, 177, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 116, 74, 0.12), transparent 28%),
    linear-gradient(180deg, #071019 0%, #091420 36%, #07111b 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(146, 196, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 196, 237, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, black 44%, transparent 90%);
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.7px, transparent 0.7px);
  background-size: 6px 6px;
  opacity: 0.06;
  pointer-events: none;
}

.aurora {
  position: fixed;
  border-radius: 999px;
  filter: blur(78px);
  opacity: 0.2;
  pointer-events: none;
}

.aurora-a {
  top: 5rem;
  left: 3%;
  width: 24rem;
  height: 24rem;
  background: #2cd6ff;
  animation: floatA 18s ease-in-out infinite;
}

.aurora-b {
  top: 16rem;
  right: 6%;
  width: 20rem;
  height: 20rem;
  background: #ff7f4b;
  animation: floatB 20s ease-in-out infinite;
}

.shell {
  position: relative;
  width: min(1460px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 1.6rem;
}

.card {
  background: linear-gradient(180deg, rgba(8, 24, 35, 0.82), rgba(7, 18, 28, 0.96));
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.9fr);
  gap: 1.15rem;
  padding: 1.35rem;
  margin-bottom: 1rem;
  animation: rise 0.7s ease;
}

.hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.5rem, 4vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero__lede {
  max-width: 68ch;
  margin: 0.9rem 0 1.05rem;
  color: #d2e4ef;
  line-height: 1.72;
}

.hero__meta,
.status-cluster,
.spotlight-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.metric-card,
.overlay-card,
.mini-metric,
.delta-card {
  background: rgba(7, 24, 35, 0.82);
  border: 1px solid rgba(146, 196, 237, 0.1);
  border-radius: 22px;
  padding: 0.95rem;
}

.metric-card__label,
.overlay-card__label,
.mini-metric span,
.delta-card span {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-card strong,
.overlay-card strong {
  display: block;
  margin-top: 0.65rem;
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
}

.metric-card__sub {
  display: block;
  margin-top: 0.45rem;
  color: #97b0c0;
  line-height: 1.45;
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.44rem 0.8rem;
  border-radius: 999px;
  background: rgba(76, 242, 177, 0.12);
  border: 1px solid rgba(76, 242, 177, 0.18);
  color: #e0fbef;
  font-size: 0.82rem;
}

.pill--muted {
  background: rgba(140, 201, 255, 0.08);
  border-color: rgba(140, 201, 255, 0.16);
  color: #cae0ee;
}

.pill--accent {
  background: rgba(255, 176, 103, 0.12);
  border-color: rgba(255, 176, 103, 0.22);
  color: #ffe9d7;
}

.pill--warning {
  background: rgba(255, 176, 103, 0.14);
  border-color: rgba(255, 176, 103, 0.28);
  color: #ffe7d0;
}

.pill--danger {
  background: rgba(255, 98, 115, 0.12);
  border-color: rgba(255, 98, 115, 0.28);
  color: #ffd9df;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.78fr);
  gap: 1rem;
}

.map-panel {
  padding: 1rem;
  animation: rise 0.9s ease;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.32rem;
}

.panel-header--tight {
  margin-bottom: 0.7rem;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.72rem;
  margin-bottom: 0.95rem;
}

.toolbar-field,
.toolbar-toggle,
.ghost-button {
  background: rgba(7, 23, 35, 0.78);
  border: 1px solid rgba(140, 201, 255, 0.12);
  border-radius: 18px;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.72rem 0.84rem;
  min-height: 4.65rem;
}

.toolbar-field span {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toolbar-field select,
.toolbar-field input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.toolbar-field input::placeholder {
  color: #7896aa;
}

.toolbar-field--search {
  grid-column: span 2;
}

.toolbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  color: #dce7ef;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0.9rem 1rem;
}

.ghost-button:hover,
.toolbar-field:hover,
.toolbar-toggle:hover {
  border-color: var(--line-strong);
}

.map-stage {
  position: relative;
  min-height: 860px;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(140, 201, 255, 0.12);
  background:
    radial-gradient(circle at top, rgba(76, 242, 177, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(7, 17, 26, 0.92), rgba(6, 12, 20, 0.98));
}

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

.map-stage__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 42%, rgba(5, 12, 18, 0.32) 100%),
    linear-gradient(180deg, rgba(7, 12, 18, 0.1), rgba(7, 12, 18, 0.32));
  pointer-events: none;
}

#map canvas {
  filter: saturate(0.9) brightness(0.84) contrast(1.06);
}

.map-overlay {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  display: flex;
  gap: 0.75rem;
  pointer-events: none;
}

.overlay-card {
  min-width: 11.5rem;
  background: rgba(7, 20, 31, 0.72);
  backdrop-filter: blur(12px);
}

.overlay-card--selection {
  margin-left: auto;
}

.legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
  padding: 0 0.2rem;
}

.legend__title {
  display: block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.legend p,
.muted-copy,
.spotlight-empty,
.history-meta span {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.legend__scale {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  white-space: nowrap;
}

.gradient-bar {
  width: 180px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #33f1b6 0%, #ffd25c 52%, #ff5f73 100%);
}

.side-panel {
  display: grid;
  gap: 1rem;
}

.side-card {
  padding: 1rem;
}

.spotlight-card {
  animation: rise 1s ease;
}

.spotlight-content {
  display: grid;
  gap: 0.95rem;
}

.spotlight-metrics,
.delta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.mini-metric strong,
.delta-card strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.28rem;
  line-height: 1.15;
}

.delta-positive {
  color: #4cf2b1;
}

.delta-negative {
  color: #ffb067;
}

.delta-neutral {
  color: #dce9f2;
}

.section-block {
  display: grid;
  gap: 0.65rem;
}

.section-block__head h3,
.pulse-section h3 {
  margin: 0;
  font-size: 0.96rem;
}

.mix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.mix-chip {
  min-width: 8.5rem;
  padding: 0.75rem 0.8rem;
  border-radius: 18px;
  background: rgba(7, 23, 35, 0.8);
  border: 1px solid rgba(140, 201, 255, 0.1);
}

.mix-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.2rem;
}

.sample-listings {
  display: grid;
  gap: 0.75rem;
}

.sample-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  padding: 0.75rem;
  border-radius: 22px;
  background: rgba(7, 23, 35, 0.82);
  border: 1px solid rgba(140, 201, 255, 0.12);
  transition: transform 140ms ease, border-color 140ms ease;
}

.sample-card:hover {
  transform: translateY(-2px);
  border-color: rgba(76, 242, 177, 0.28);
}

.sample-card__image {
  min-height: 92px;
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(76, 242, 177, 0.3), rgba(28, 82, 136, 0.3)),
    center / cover no-repeat;
}

.sample-card__body strong {
  display: block;
  line-height: 1.35;
}

.sample-card__meta,
.sample-card__detail {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pulse-section {
  display: grid;
  gap: 0.7rem;
}

.pulse-section + .pulse-section {
  margin-top: 1rem;
}

.mix-list,
.hotspot-list {
  display: grid;
  gap: 0.72rem;
}

.mix-row,
.hotspot-row {
  padding: 0.85rem;
  border-radius: 20px;
  background: rgba(7, 23, 35, 0.82);
  border: 1px solid rgba(140, 201, 255, 0.1);
}

.mix-row__head,
.hotspot-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.mix-row strong,
.hotspot-row strong {
  font-size: 1rem;
}

.mix-row p,
.hotspot-row p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.mix-row__bar {
  margin-top: 0.78rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.mix-row__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #33f1b6 0%, #16b8ff 100%);
}

.hotspot-row {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.hotspot-row:hover,
.hotspot-row.is-selected {
  transform: translateY(-2px);
  border-color: rgba(76, 242, 177, 0.28);
  background: rgba(10, 30, 43, 0.94);
}

.history-block {
  display: grid;
  gap: 0.8rem;
}

#historySparkline {
  width: 100%;
  height: 116px;
  background: rgba(7, 23, 35, 0.7);
  border-radius: 22px;
  border: 1px solid rgba(140, 201, 255, 0.1);
}

.spotlight-empty {
  padding: 0.35rem 0.1rem 0.2rem;
}

.empty-state {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(340px, calc(100% - 2rem));
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: rgba(8, 20, 31, 0.92);
  border: 1px solid rgba(255, 176, 103, 0.24);
  color: #ffe7d5;
  display: grid;
  gap: 0.35rem;
}

.maplibregl-ctrl-group {
  border: 1px solid rgba(140, 201, 255, 0.15);
  box-shadow: none;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  background: rgba(7, 20, 31, 0.88);
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(30px, 22px, 0);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-28px, 24px, 0);
  }
}

@media (max-width: 1220px) {
  .workspace,
  .hero {
    grid-template-columns: 1fr;
  }

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

  .toolbar-field--search {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 1rem, 100%);
  }

  .hero {
    padding: 1rem;
  }

  .hero__stats,
  .spotlight-metrics,
  .delta-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-field--search {
    grid-column: auto;
  }

  .map-overlay,
  .legend,
  .panel-header {
    flex-direction: column;
  }

  .overlay-card--selection {
    margin-left: 0;
  }

  .map-stage {
    min-height: 620px;
  }

  .sample-card {
    grid-template-columns: 1fr;
  }
}
