:root {
  --bg: #ece7dd;
  --panel: rgba(248, 244, 236, 0.95);
  --ink: #101827;
  --muted: #516071;
  --line: rgba(16, 24, 39, 0.12);
  --accent: #9b5d26;
  --ok: #1f9d55;
  --warn: #c05621;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #ece4d4, #dfe8ec);
}

body {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
}

.panel {
  padding: 2rem 1.4rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  z-index: 10;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0.45rem 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.controls {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.legend {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.legend-hidden {
  display: none;
}

.legend-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.legend-unit {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.legend-ramp {
  margin-top: 0.8rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 39, 0.14);
  background: linear-gradient(
    90deg,
    #30123b 0%,
    #4145ab 10%,
    #4675ed 20%,
    #39a2fc 30%,
    #1bcfd4 40%,
    #24eca6 50%,
    #61fc6c 60%,
    #a4fc3b 70%,
    #d1e834 78%,
    #f3c63a 84%,
    #fe9b2d 90%,
    #f36315 96%,
    #7a0403 100%
  );
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: var(--muted);
}

.controls-title {
  margin-bottom: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0;
  color: var(--muted);
}

.control-row input {
  width: 1rem;
  height: 1rem;
}

.opacity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.8rem;
  margin: 0.25rem 0 0.8rem 1.65rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.opacity-row input[type="range"] {
  grid-column: 1 / 2;
  width: 100%;
  accent-color: var(--accent);
}

.opacity-row output {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(192, 86, 33, 0.14);
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(31, 157, 85, 0.14);
}

#cesiumContainer {
  width: 100%;
  height: 100vh;
}

.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-bottom {
  z-index: 2;
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #cesiumContainer {
    height: min(72vh, 760px);
  }
}
