@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&display=swap");

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: "IBM Plex Sans", sans-serif;
  color: #fff;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* ── Loader ────────────────────────────────────────────────────────────── */

#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

#loader-bar {
  width: 160px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

#loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-100%);
  animation: bar 1.2s ease-in-out infinite;
}

@keyframes bar {
  to {
    transform: translateX(100%);
  }
}

/* ── Landing ───────────────────────────────────────────────────────────── */

#landing {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    linear-gradient(rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.52)),
    url("../textures/milky_way.jpg") center 38% / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  transition:
    opacity 0.9s ease,
    visibility 0.9s ease;
}

#landing.landing-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* vignette + blue glow behind title */
#landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 50%,
      transparent 25%,
      rgba(0, 0, 0, 0.6) 100%
    ),
    radial-gradient(
      ellipse 80% 65% at 50% 40%,
      rgba(40, 80, 180, 0.26) 0%,
      transparent 65%
    );
  pointer-events: none;
}

#landing-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px 24px;
  max-width: 560px;
}

#landing-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}

#landing-title {
  font-size: clamp(52px, 11vw, 110px);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
  margin: 0;
}

#landing-desc {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.52);
  margin: 4px 0 0;
}

#landing-enter {
  margin-top: 12px;
  padding: 10px 36px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.25s,
    color 0.25s;
}

#landing-enter:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.85);
}

#landing-arrow {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: landing-pulse 2.4s ease-in-out infinite;
}

#landing-arrow::before,
#landing-arrow::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transform: rotate(45deg);
}

@keyframes landing-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 0.6;
    transform: translateX(-50%) translateY(6px);
  }
}

/* ── Title ─────────────────────────────────────────────────────────────── */

#title {
  position: fixed;
  top: 24px;
  left: 28px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  user-select: none;
}

/* ── Tooltip ───────────────────────────────────────────────────────────── */

#tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 4px;
}

/* ── Controls bar ──────────────────────────────────────────────────────── */

#controls {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 13px 22px;
  border-radius: 40px;
  font-size: 12px;
  white-space: nowrap;
}

#controls button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0 2px;
  transition: color 0.15s;
}

#btn-pause {
  font-size: 15px !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

#controls button:hover {
  color: #fff;
}

#btn-about {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0 2px;
  text-decoration: none;
  transition: color 0.15s;
}

#btn-about:hover {
  color: #fff;
}
#controls button.active {
  color: rgba(255, 255, 255, 0.7);
}

.sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
}

#speed {
  width: 90px;
  accent-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

#speed-label {
  color: rgba(255, 255, 255, 0.5);
  min-width: 48px;
  font-size: 11px;
}

#date-display {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  letter-spacing: 0.05em;
  font-family: inherit;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  padding: 0;
  cursor: text;
  width: 150px;
}

#date-display:hover {
  color: rgba(255, 255, 255, 0.65);
}

#date-display:focus {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

/* ── Timeline ──────────────────────────────────────────────────────────── */

#timeline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  cursor: ew-resize;
}

#timeline-canvas {
  width: 100%;
  height: 100%;
}

/* ── Info panel ────────────────────────────────────────────────────────── */

#info-panel {
  position: fixed;
  top: 24px;
  right: 28px;
  display: none;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.75;
  width: 272px;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.info-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
  opacity: 0.8;
}

.info-body {
  padding: 13px 16px 14px;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 9px;
}

.info-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.info-type {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 2px;
}

.info-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 8px;
  flex-shrink: 0;
}
.info-close:hover {
  color: rgba(255, 255, 255, 0.7);
}

.info-desc {
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 10px;
}

.info-section {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.28);
  margin: 10px 0 3px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.info-row span:last-child {
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
}

.info-note {
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  font-size: 11px;
  margin-top: 4px;
}

.info-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.info-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    color 0.15s;
}
.info-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Galaxy panel ──────────────────────────────────────────────────────── */

#galaxy-panel {
  position: fixed;
  bottom: 52px;
  left: 20px;
  display: none;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
  user-select: none;
}

#galaxy-panel.visible {
  display: block;
}

#galaxy-canvas {
  display: block;
}

/* ── Layer panel ───────────────────────────────────────────────────────── */

#layer-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 50;
  width: 210px;
  background: linear-gradient(
    150deg,
    rgba(4, 10, 28, 0.88),
    rgba(2, 5, 18, 0.78)
  );
  border: 0.5px solid rgba(100, 160, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: opacity 0.2s;
}

#layer-panel.hidden {
  opacity: 0;
  pointer-events: none;
}

#layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 8px;
  border-bottom: 0.5px solid rgba(100, 160, 255, 0.1);
}

#layer-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180, 210, 255, 0.6);
}

#layer-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

#layer-header-right button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

#layer-header-right button:hover {
  color: rgba(255, 255, 255, 0.8);
}

#layer-body {
  padding: 6px 0 8px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

#layer-body::-webkit-scrollbar {
  width: 1px;
}

#layer-body::-webkit-scrollbar-track {
  background: transparent;
}

#layer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 1px;
}

#layer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

#layer-panel.collapsed #layer-body {
  display: none;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.layer-row:hover {
  background: rgba(100, 160, 255, 0.06);
}

.layer-row:has(input:checked) {
  background: rgba(100, 160, 255, 0.04);
}

.layer-row:has(input:checked) .layer-name {
  color: rgba(255, 255, 255, 0.85);
}

.layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.8;
}

.layer-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  flex: 1;
  letter-spacing: 0.03em;
}

.layer-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
}

.layer-row input[type="checkbox"] {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(100, 160, 255, 0.3);
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.layer-row input[type="checkbox"]:checked {
  background: rgba(100, 160, 255, 0.5);
  border-color: rgba(100, 160, 255, 0.6);
}

.layer-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -1px;
  width: 5px;
  height: 8px;
  border: 1.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.layer-sep {
  height: 1px;
  background: rgba(100, 160, 255, 0.08);
  margin: 5px 12px;
}

.layer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(100, 160, 255, 0.35);
  padding: 8px 12px 3px;
  user-select: none;
  cursor: pointer;
  transition: color 0.15s;
}

.layer-section-header:hover {
  color: rgba(100, 160, 255, 0.65);
}

.layer-section-arrow {
  font-size: 7px;
  letter-spacing: 0;
  opacity: 0.6;
}

/* ── Spirograph config ─────────────────────────────────────────────────── */

#spiro-config {
  padding: 4px 12px 10px;
  border-top: 0.5px solid rgba(100, 160, 255, 0.08);
}

/* Slot rows */

.spiro-slot-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.spiro-slot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.spiro-slot-arrow {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.spiro-slot-row input[type="text"] {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 0.5px solid rgba(100, 160, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.03em;
  padding: 3px 5px;
  outline: none;
}

.spiro-slot-row input[type="text"]:focus {
  border-color: rgba(100, 160, 255, 0.4);
  color: #fff;
}

.spiro-slot-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 1px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.spiro-slot-remove:hover {
  color: rgba(255, 100, 80, 0.8);
}

/* Add pair button */

#spiro-add {
  display: block;
  width: 100%;
  margin-top: 2px;
  background: none;
  border: 0.5px dashed rgba(100, 160, 255, 0.2);
  border-radius: 4px;
  color: rgba(100, 160, 255, 0.4);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 3px 0;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

#spiro-add:hover {
  color: rgba(100, 160, 255, 0.8);
  border-color: rgba(100, 160, 255, 0.4);
}

/* Separator */

.spiro-sep {
  height: 0.5px;
  background: rgba(100, 160, 255, 0.08);
  margin: 8px 0 6px;
}

/* Replay controls */

.spiro-replay-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.spiro-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.spiro-replay-row select {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 0.5px solid rgba(100, 160, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 10px;
  padding: 2px 4px;
  outline: none;
  cursor: pointer;
}

.spiro-replay-row input[type="range"] {
  flex: 1;
  accent-color: rgba(255, 200, 80, 0.7);
  cursor: pointer;
}

#spiro-speed-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  min-width: 14px;
  text-align: right;
}

#spiro-span-label {
  font-size: 9px;
  color: rgba(255, 200, 80, 0.6);
  min-width: 28px;
  text-align: right;
  letter-spacing: 0.04em;
}

#spiro-replay,
#spiro-clear-all {
  background: none;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.35);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

#spiro-replay:hover {
  color: rgba(255, 200, 80, 0.9);
  border-color: rgba(255, 200, 80, 0.4);
}

#spiro-clear-all:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Resonance buttons — mirror spirograph style */

#reson-add {
  display: block;
  width: 100%;
  margin-top: 2px;
  background: none;
  border: 0.5px dashed rgba(100, 160, 255, 0.2);
  border-radius: 4px;
  color: rgba(100, 160, 255, 0.4);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 3px 0;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

#reson-add:hover {
  color: rgba(100, 160, 255, 0.8);
  border-color: rgba(100, 160, 255, 0.4);
}

#reson-clear-all {
  background: none;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.35);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

#reson-clear-all:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Progress bar */

#spiro-progress-wrap {
  display: none;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  margin: 4px 0;
  overflow: hidden;
}

#spiro-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255, 200, 80, 0.7);
  border-radius: 1px;
  transition: width 0.1s linear;
}

/* Status line */

#spiro-status {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 4px;
}

#spiro-status.spiro-recording {
  color: rgba(255, 170, 68, 0.75);
  animation: spiro-pulse 2s ease-in-out infinite;
}

@keyframes spiro-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ── Credits ───────────────────────────────────────────────────────────── */

#credits {
  position: fixed;
  bottom: 46px;
  right: 20px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.25);
  display: flex;
  gap: 5px;
  align-items: center;
  pointer-events: none;
}

#credits a {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  pointer-events: all;
  transition: color 0.15s;
}

#credits a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Labels ────────────────────────────────────────────────────────────── */

#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.body-label {
  position: absolute;
  transform: translate(-50%, -100%);
  padding-bottom: 3px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  pointer-events: all;
  cursor: pointer;
  transition: color 0.15s;
}

.body-label:hover {
  color: rgba(255, 255, 255, 0.95);
}

.body-label.is-moon {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.32);
}

.lagrange-label {
  font-size: 8px;
  color: rgba(136, 255, 204, 0.55);
  letter-spacing: 0.08em;
}

.heliosphere-label {
  font-size: 8px;
  color: rgba(180, 200, 255, 0.45);
  letter-spacing: 0.1em;
  pointer-events: none;
}

.body-label.is-star {
  font-size: 9px;
  color: rgba(255, 230, 180, 0.6);
}

.constellation-label {
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: rgba(140, 190, 255, 0.32);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: all;
}

.messier-label {
  transform: translate(-50%, -50%);
  font-size: 7px;
  opacity: 0.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.constellation-label:hover {
  color: rgba(140, 210, 255, 0.85);
}

.constellation-label.active {
  color: rgba(140, 220, 255, 0.75);
}

/* ── Search bar ────────────────────────────────────────────────────────── */

#search-wrap {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 220px;
}

#search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 14px;
  outline: none;
  transition: border-color 0.15s;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

#search-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

#search-results {
  display: none;
  list-style: none;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

#search-results li {
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition:
    background 0.1s,
    color 0.1s;
}

#search-results li:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── Speed presets ─────────────────────────────────────────────────────── */

.btn-speed-preset {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 0 2px;
  transition: color 0.15s;
}

.btn-speed-preset:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Distance scale bar ────────────────────────────────────────────────── */

#scale-bar {
  position: fixed;
  bottom: 56px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
}

#scale-bar-fill {
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  position: relative;
}

#scale-bar-fill::before,
#scale-bar-fill::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, 0.45);
}

#scale-bar-fill::before {
  left: 0;
}

#scale-bar-fill::after {
  right: 0;
}

#scale-bar-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Sky tonight config ─────────────────────────────────────────────────── */

#sky-config {
  padding: 4px 12px 10px;
  border-top: 0.5px solid rgba(100, 200, 255, 0.08);
}

.sky-inputs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.sky-inputs input {
  width: 70px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  color: #fff;
  font-family: inherit;
  font-size: 10px;
  padding: 3px 5px;
  outline: none;
  text-align: center;
}

.sky-inputs button {
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}

.sky-inputs button:hover {
  background: rgba(255, 255, 255, 0.14);
}

#sky-results {
  max-height: 180px;
  overflow-y: auto;
}

.sky-row {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 10px;
  padding: 2px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

.sky-name {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
}

.sky-alt {
  width: 44px;
  text-align: right;
  font-size: 10px;
}

.sky-az {
  width: 64px;
  text-align: right;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
}

.sky-visible .sky-alt {
  color: #88ffcc;
}

.sky-below .sky-alt {
  color: rgba(255, 255, 255, 0.3);
}

.sky-below .sky-name {
  color: rgba(255, 255, 255, 0.35);
}

.sky-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  padding: 4px 0;
}

/* ── Hidden native date picker ─────────────────────────────────────────── */

#date-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

/* ── Custom calendar picker ────────────────────────────────────────────── */

#cal-panel {
  position: fixed;
  display: none;
  background: rgba(7, 9, 15, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 10px;
  z-index: 200;
  backdrop-filter: blur(20px);
  font-size: 11px;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  width: 196px;
  user-select: none;
}

.cal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-ttl {
  flex: 1;
  text-align: center;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
}

.cal-nav {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 2px 5px;
  font-size: 12px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s;
  font-family: inherit;
}

.cal-nav:hover {
  color: rgba(255, 255, 255, 0.65);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  text-align: center;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.18);
  padding: 2px 0 5px;
  letter-spacing: 0.03em;
}

.cal-day {
  text-align: center;
  padding: 4px 1px;
  border-radius: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  transition:
    background 0.1s,
    color 0.1s;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
}

.cal-day.cal-today {
  color: rgba(160, 200, 255, 0.75);
}

.cal-day.cal-sel {
  background: rgba(130, 170, 255, 0.18);
  color: rgba(180, 215, 255, 1);
}

/* ── Shortcuts overlay ─────────────────────────────────────────────────── */

#shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shortcuts-overlay.hidden {
  display: none;
}

#shortcuts-panel {
  background: rgba(6, 6, 10, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 28px 36px 32px;
  min-width: 300px;
  position: relative;
}

#shortcuts-title {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 18px;
}

#shortcuts-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  padding: 0;
}

#shortcuts-close:hover {
  color: #fff;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 22px;
  font-size: 11px;
}

.shortcuts-grid .key {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 7px;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.04em;
  align-self: center;
}

.shortcuts-grid .desc {
  color: rgba(255, 255, 255, 0.55);
  align-self: center;
}
