:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; }
body { background: #01030a; color: #f8fafc; }

.system-app {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background: #01030a;
}

#solar-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
}

#solar-scene:active { cursor: grabbing; }

.topbar,
.object-panel,
.planet-rail,
.zoom-stack button {
  border: 1px solid rgba(226, 232, 240, 0.16);
  background: rgba(1, 6, 18, 0.58);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.topbar {
  position: fixed;
  z-index: 4;
  left: 14px;
  right: 14px;
  top: 12px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #dbeafe;
}

.topbar strong {
  color: #fff;
  font-size: 0.98rem;
  white-space: nowrap;
}

.app-link,
.topbar button,
.planet-rail button,
.zoom-stack button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.64);
  color: #e0f2fe;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
  padding: 0 11px;
  cursor: pointer;
  white-space: nowrap;
}

.app-link:hover,
.topbar button:hover,
.planet-rail button:hover,
.planet-rail button.active,
.zoom-stack button:hover {
  border-color: rgba(251, 191, 36, 0.72);
  color: #fef3c7;
  background: rgba(251, 191, 36, 0.16);
}

.time-label {
  margin-left: auto;
  color: #b7c8dc;
  font-size: 0.9rem;
  white-space: nowrap;
}

.time-label b { color: #ffffff; }
.hint { color: #91a4bb; font-size: 0.88rem; white-space: nowrap; }

.object-panel {
  position: fixed;
  z-index: 3;
  left: 18px;
  bottom: 88px;
  width: min(380px, calc(100vw - 36px));
  padding: 16px;
  border-radius: 8px;
}

#selected-label {
  display: block;
  margin-bottom: 8px;
  color: #7dd3fc;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#selected-name {
  display: block;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

#selected-info {
  margin: 10px 0 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.zoom-stack {
  position: fixed;
  z-index: 4;
  right: 18px;
  top: 76px;
  display: grid;
  gap: 8px;
}

.zoom-stack button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.35rem;
}

.planet-rail {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 28px));
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
}

.planet-rail button {
  min-width: 78px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .time-label { margin-left: 0; }
  .hint { width: 100%; }
}

@media (max-width: 640px) {
  html, body { overflow: auto; }
  .system-app { min-height: 100svh; }
  .topbar { position: relative; left: auto; right: auto; top: auto; margin: 10px; }
  .object-panel { position: relative; left: auto; bottom: auto; width: calc(100% - 20px); margin: 12px 10px 150px; }
  .planet-rail { max-height: 126px; overflow: auto; align-content: flex-start; }
  .planet-rail button { min-width: auto; flex: 1 1 86px; }
  .zoom-stack { top: auto; bottom: 154px; right: 10px; }
}

.credit {
  position: fixed;
  z-index: 4;
  right: 18px;
  bottom: 88px;
  max-width: 280px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.76rem;
  text-decoration: none;
}

.credit:hover { color: #fef3c7; }

@media (max-width: 640px) {
  .credit {
    right: 12px;
    bottom: 286px;
    max-width: 180px;
    text-align: right;
  }
}
