:root {
  --bg: #0b1220;
  --panel: #111c31;
  --panel-border: #22334f;
  --text: #e9f1ff;
  --muted: #9fb3d9;
  --accent: #4fc3f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Liberation", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 320px;
  flex: 0 0 auto;
  min-width: 240px;
  max-width: 70vw;
  padding: 1.25rem;
  background: linear-gradient(180deg, var(--panel), #0d1729);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  resize: horizontal;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.locale-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.locale-icon {
  font-size: 1rem;
  line-height: 1;
}

.locale-row select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: black;
  color: var(--text);
}

.controls {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.9rem;
}

.control {
  display: grid;
  gap: 0.35rem;
}

.control label {
  font-size: 0.82rem;
  color: var(--muted);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 8.5rem;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: black;
  text-align: left;
  justify-items: start;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text);
  width: 100%;
}

#discovery-methods {
  align-items: flex-start;
}

#discovery-methods .checklist-item span {
  text-align: left;
}

.control input,
.control select,
.control button {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: black;
  color: var(--text);
}

.axis-toggle {
  display: flex;
  align-items: left;
  gap: 0.6rem;
}

.axis-toggle input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.legend-info {
  padding: 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(10, 19, 37, 0.45);
}

.legend-info h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.legend-info p {
  margin: 0.35rem 0;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-info strong {
  color: var(--text);
}

.legend-swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}

.legend-earth {
  background: #0000ff;
}

.legend-inside {
  background: #8fb8ff;
}

.legend-outside {
  background: #ffffff;
}

.legend-selected {
  background: #ff0000;
}
.planet-info {
  margin-top: auto;
  padding: 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(10, 19, 37, 0.7);
}

.planet-info h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.planet-info p {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.planet-info strong {
  color: var(--text);
}

.planet-list {
  display: grid;
  gap: 0.5rem;
}

.planet-item {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(7, 14, 27, 0.75);
  padding: 0.5rem 0.6rem;
}

.planet-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.83rem;
  color: var(--text);
}

.planet-item p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.planet-item a {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.planet-item a:hover {
  text-decoration: underline;
}

.planet-item-muted {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.canvas-wrap {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: black;
}

#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: none;
    overflow-y: visible;
    resize: none;
  }
}


