:root {
  color-scheme: dark;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071019;
}

.cesium-attribution {
  position: fixed;
  right: 12px;
  bottom: 76px;
  z-index: 18;
  padding: 3px 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.88);
  color: #1f2933;
  font: 600 11px/1.2 "Segoe UI", sans-serif;
  pointer-events: none;
}

#scene {
  position: fixed;
  inset: 0;
}

.station-label,
.heading-label {
  position: fixed;
  z-index: 3;
  top: 16px;
  color: #fff;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 3px #000, 0 0 7px #000;
  pointer-events: none;
}

.heading-label {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.view-metrics {
  display: grid;
  gap: 2px;
  color: #eef4f7;
  font-size: 12px;
  font-weight: 400;
}

.day-arc {
  display: block;
  width: 160px;
  height: 35px;
  margin: 0 0 2px auto;
  border: 1px solid rgba(213, 232, 245, 0.35);
  background: rgba(4, 14, 23, 0.72);
}

.view-metrics > span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  pointer-events: auto;
  cursor: help;
}

.view-metrics .simulation-moment {
  margin-top: 2px;
  color: #f5cd53;
  font-weight: 600;
}

.metric-key {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

.metric-overall {
  background: #ffd04a;
}

.metric-field {
  background: #4fd4e8;
}

.degree-label {
  position: fixed;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 1px 4px;
  border: 1px solid rgba(229, 187, 67, 0.62);
  border-radius: 2px;
  color: #ffe18a;
  background: rgba(8, 16, 22, 0.72);
  font-size: 10px;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  pointer-events: none;
}

.station-label {
  left: 18px;
  max-width: calc(100vw - 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heading-label {
  right: 18px;
  color: #f5cd53;
}

.terrain-marker-label {
  position: fixed;
  z-index: 5;
  display: grid;
  min-width: 42px;
  height: 22px;
  padding: 0 6px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 2px solid #fff;
  border-radius: 11px;
  color: #071019;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 4px #000;
  pointer-events: none;
}

.terrain-marker-label[hidden] {
  display: none;
}

.marker-overall-label {
  background: #ffd04a;
}

.marker-field-label {
  background: #4fd4e8;
}

.terrain-marker-label.edge-marker {
  border-style: dashed;
  opacity: 0.88;
}

.loading-message {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #eef4f7;
  background: #101b23;
  font-size: 16px;
  text-align: center;
}

.loading-message[hidden] {
  display: none;
}

.cursor-information {
  position: fixed;
  z-index: 8;
  max-width: 260px;
  padding: 5px 7px;
  border: 1px solid rgba(235, 245, 250, 0.82);
  border-radius: 3px;
  color: #fff;
  background: rgba(7, 16, 25, 0.9);
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.55);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-line;
  pointer-events: none;
}

.cursor-information[hidden] {
  display: none;
}

.controls-panel {
  position: fixed;
  z-index: 4;
  left: 16px;
  bottom: 16px;
  width: min(288px, calc(100vw - 32px));
  padding: 9px;
  font-size: 11px;
  border: 1px solid rgba(142, 170, 188, 0.72);
  border-radius: 5px;
  color: #f6f9fb;
  background: rgba(13, 25, 34, 0.87);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.15), 2px 3px 12px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(6px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.controls-collapse {
  position: sticky;
  z-index: 3;
  top: 0;
  float: right;
  width: 34px;
  min-height: 26px;
  margin: -7px -7px 5px 6px;
  padding: 0;
}

.controls-panel.collapsed {
  width: 46px;
  max-height: 42px;
  padding: 5px;
  overflow: hidden;
}

.controls-panel.collapsed > :not(.controls-collapse) {
  display: none;
}

.controls-panel.collapsed .controls-collapse {
  float: none;
  width: 34px;
  margin: 0;
}

.control-row {
  display: grid;
  grid-template-columns: 101px minmax(0, 1fr) 43px;
  gap: 6px;
  align-items: center;
  min-height: 29px;
}

.control-row + .control-row {
  margin-top: 4px;
}

.direction-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 7px;
}

button {
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid #718390;
  border-radius: 3px;
  color: #eef4f7;
  background: rgba(42, 57, 67, 0.95);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.source-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 5px;
}

.source-select-row select {
  min-width: 0;
  height: 25px;
  font-size: 10px;
}

.temperature-scale {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: auto minmax(105px, 1fr) auto;
  gap: 4px;
  align-items: center;
  min-height: 14px;
  margin: 0 0 1px;
  color: #eff6fa;
  font-size: 10px;
}

.temperature-scale[hidden] {
  display: none;
}

.temperature-scale i {
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(90deg, #285dcc, #39cdd2, #f4d74a, #dc3e2f);
}

button:hover {
  border-color: #76afe0;
  background: rgba(55, 80, 96, 0.97);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #f0bd35;
  outline-offset: 2px;
}

.measurement-row select {
  min-width: 0;
  height: 30px;
  border: 1px solid #718390;
  border-radius: 3px;
  color: #eef4f7;
  background: rgba(42, 57, 67, 0.95);
}

.geographic-label {
  position: fixed;
  z-index: 3;
  max-width: 180px;
  padding: 2px 5px;
  border: 1px solid rgba(223, 236, 245, 0.58);
  border-radius: 3px;
  color: #f6fbff;
  background: rgba(9, 24, 34, 0.78);
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.55);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

button[aria-pressed="true"],
.direction-row button.active {
  border-color: #f2c74e;
  color: #fff5d4;
  background: rgba(57, 106, 145, 0.98);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 132, 0.45), 0 0 7px rgba(73, 151, 213, 0.6);
}

.control-row input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #f0bd35;
}

.control-row input[type="range"]:disabled {
  opacity: 0.34;
}

.control-row output {
  overflow: hidden;
  color: #dce8ee;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-row {
  grid-template-columns: 126px 74px minmax(112px, 1fr);
}

.measurement-row output {
  overflow: visible;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}

.weather-row output {
  color: #bfeaff;
  font-weight: 600;
}

.control-label {
  display: grid;
  min-height: 32px;
  padding: 0 10px;
  place-items: center start;
  border: 1px solid #718390;
  border-radius: 3px;
  color: #eef4f7;
  background: rgba(42, 57, 67, 0.72);
  font-size: 12px;
}

.playback-button {
  width: 100%;
  text-align: left;
}

.playback-button[aria-pressed="true"]::before {
  content: "▶";
  margin-right: 6px;
  color: #ffe18a;
}

.sun-position-value {
  overflow: hidden;
  color: #ffe18a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visibility-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 20px;
  padding: 0 2px 3px;
  color: #cad9e2;
  font-size: 10px;
}

.visibility-legend > span:not(:first-child) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#visibility-mode-label {
  margin-right: auto;
  color: #ffe18a;
}

.visibility-swatch {
  display: inline-block;
  width: 14px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #ffd36a;
}

.hidden-swatch {
  background: #56636d;
}

.controls-panel[data-visibility-mode="hatch"] .visible-swatch {
  background: #b6b7a2;
}

.controls-panel[data-visibility-mode="hatch"] .hidden-swatch {
  border-style: dashed;
  background: #425468;
}

.controls-panel[data-visibility-mode="duotone"] .visible-swatch {
  background: #ffd04a;
}

.controls-panel[data-visibility-mode="duotone"] .hidden-swatch {
  background: #1646ad;
}

.observatory-scales {
  position: fixed;
  z-index: 4;
  inset: 0;
  color: #fff3c7;
  font-size: 11px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

.observatory-scales[hidden] {
  display: none;
}

.azimuth-scale {
  position: absolute;
  left: 50%;
  top: 80px;
  width: min(720px, calc(100vw - 460px));
  height: 47px;
  transform: translateX(-50%);
  border-bottom: 1px solid rgba(255, 234, 158, 0.86);
}

.elevation-scale {
  position: absolute;
  right: 24px;
  top: 145px;
  width: 142px;
  height: min(430px, calc(100vh - 280px));
  border-left: 1px solid rgba(255, 234, 158, 0.86);
}

.scale-axis-title {
  position: absolute;
  color: #f5cd53;
  font-weight: 600;
}

.azimuth-scale .scale-axis-title {
  left: 0;
  top: 0;
}

.elevation-scale .scale-axis-title {
  left: 8px;
  top: -22px;
  white-space: nowrap;
}

.azimuth-ticks,
.elevation-ticks {
  position: absolute;
  inset: 0;
}

.azimuth-tick,
.elevation-tick {
  position: absolute;
  color: #f6f9fb;
  white-space: nowrap;
}

.azimuth-tick {
  bottom: 5px;
  transform: translateX(-50%);
}

.azimuth-tick::after {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 1px;
  height: 7px;
  background: #fff3c7;
  content: "";
}

.elevation-tick {
  left: 8px;
  transform: translateY(-50%);
  font-size: 11px;
}

.elevation-tick::before {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  width: 7px;
  height: 1px;
  background: #fff3c7;
  content: "";
}

.scale-centre-line {
  position: absolute;
  background: #f0bd35;
}

.azimuth-scale .scale-centre-line {
  left: 50%;
  bottom: -5px;
  width: 2px;
  height: 14px;
}

.elevation-scale .scale-centre-line {
  left: -6px;
  top: 50%;
  width: 14px;
  height: 2px;
}

.scale-hud {
  position: fixed;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 54px;
  gap: 12px;
  align-items: end;
  padding: 11px 12px;
  border: 1px solid rgba(142, 170, 188, 0.72);
  border-radius: 5px;
  color: #f6f9fb;
  background: rgba(13, 25, 34, 0.84);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 2px 3px 12px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.scale-copy {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  gap: 5px;
}

.scale-title {
  color: #dce8ee;
  font-size: 11px;
  text-transform: uppercase;
}

.scale-hud .compass {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.scale-bar {
  position: relative;
  height: 9px;
  border: 1px solid #f4f7f8;
  border-top: 0;
}

.scale-bar::before,
.scale-bar::after {
  position: absolute;
  bottom: -1px;
  width: 1px;
  height: 7px;
  background: #f4f7f8;
  content: "";
}

.scale-bar::before {
  left: 50%;
}

.scale-bar::after {
  right: 0;
}

.scale-secondary {
  color: #bacad4;
  font-size: 11px;
  text-align: right;
}

.compass {
  display: grid;
  justify-items: center;
  gap: 1px;
  color: #fff;
  font-size: 11px;
}

.compass img {
  width: 44px;
  height: 44px;
  filter: invert(95%) sepia(11%) saturate(650%) hue-rotate(346deg) brightness(104%);
}

@media (max-width: 700px) {
  .controls-panel {
    bottom: 10px;
  }

  .scale-hud {
    right: 10px;
    bottom: auto;
    top: 48px;
    grid-template-columns: minmax(150px, 210px) 46px;
  }

  .view-metrics {
    display: none;
  }

  .compass img {
    width: 38px;
    height: 38px;
  }

  .azimuth-scale {
    left: auto;
    right: 75px;
    width: calc(100vw - 110px);
    transform: none;
  }
}

@media (max-width: 520px) {
  .station-label {
    max-width: calc(100vw - 36px);
  }

  .heading-label {
    top: 41px;
    left: 18px;
    right: auto;
  }

  .view-metrics {
    display: none;
  }

  .controls-panel {
    padding: 9px;
  }

  .control-row {
    grid-template-columns: 113px minmax(0, 1fr) 48px;
  }
}
