/* ==========================================================================
   Stellar Atlas — a navigable local universe
   ========================================================================== */

:root {
  --bg: #030609;
  --bg-soft: #070c11;
  --panel: #080d12;
  --text: #e9e7df;
  --text-bright: #f8f5ed;
  --muted: #929ba2;
  --faint: #5c666e;
  --line: rgba(235, 240, 242, 0.12);
  --line-soft: rgba(235, 240, 242, 0.07);
  --accent: #d9c3a0;
  --accent-cool: #a9c1ca;
  --sans: "Avenir Next", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 55%, rgba(24, 40, 50, 0.22), transparent 48%),
    #030609;
}

::selection { color: #16120b; background: var(--accent); }
button { color: inherit; font: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 1px solid rgba(217, 195, 160, 0.9);
  outline-offset: 4px;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* Loading ------------------------------------------------------------------ */

.atlas-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  background: #030609;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.atlas-loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.atlas-loading-mark {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
}

.atlas-loading-mark i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(217, 195, 160, 0.8);
}
.atlas-loading-mark i:nth-child(1) { animation: atlas-orbit 2.4s linear infinite; }
.atlas-loading-mark i:nth-child(2) { animation: atlas-orbit 2.4s linear infinite reverse; animation-delay: -0.8s; opacity: 0.65; }
.atlas-loading-mark i:nth-child(3) { width: 3px; height: 3px; opacity: 0.45; }

@keyframes atlas-orbit {
  0% { transform: rotate(0deg) translateX(22px); }
  100% { transform: rotate(360deg) translateX(22px); }
}

.atlas-loading > span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(187, 188, 175, 0.7);
}
.atlas-loading > b {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  color: rgba(217, 195, 160, 0.6);
}

/* Scene -------------------------------------------------------------------- */

.atlas-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.atlas-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.atlas-scene canvas.is-dragging { cursor: grabbing; }
.atlas-scene canvas.is-over { cursor: pointer; }

/* Labels ------------------------------------------------------------------- */

.atlas-labels {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.atlas-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px 5px 8px;
  border: 1px solid rgba(235, 240, 242, 0.13);
  border-radius: 999px;
  background: rgba(4, 8, 12, 0.74);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(232, 230, 220, 0.9);
  white-space: nowrap;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: border-color 0.22s ease, background 0.22s ease, opacity 0.22s ease;
}

.atlas-label:hover,
.atlas-label.is-hover {
  border-color: rgba(217, 195, 160, 0.45);
  background: rgba(13, 18, 23, 0.9);
}

.atlas-label.is-active {
  border-color: rgba(217, 195, 160, 0.65);
  background: rgba(28, 25, 20, 0.86);
}

.atlas-label.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }

.atlas-label-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 9px var(--dot, var(--accent));
}

.atlas-label-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.atlas-label-name {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(245, 241, 231, 0.94);
}

.atlas-label-meta {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.02em;
  color: rgba(151, 160, 162, 0.82);
}

/* Topbar ------------------------------------------------------------------- */

.atlas-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  pointer-events: none;
}

.atlas-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.atlas-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 195, 160, 0.32);
  border-radius: 50%;
  color: rgba(239, 208, 153, 0.96);
}

.atlas-mark svg { width: 30px; height: 30px; }

.atlas-brand-copy { display: flex; flex-direction: column; gap: 4px; }
.atlas-brand-copy > span {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: rgba(243, 239, 230, 0.94);
}
.atlas-brand-copy small {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.2em;
  color: rgba(141, 151, 156, 0.8);
}

.atlas-status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(160, 165, 160, 0.75);
  white-space: nowrap;
}

.atlas-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9c3a0;
  box-shadow: 0 0 10px rgba(217, 195, 160, 0.7);
}
.atlas-status i { width: 28px; height: 1px; background: rgba(235, 240, 242, 0.14); }
.atlas-status span:last-child { color: rgba(196, 191, 176, 0.78); }

.atlas-back {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.62);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: rgba(210, 207, 198, 0.8);
  pointer-events: auto;
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.atlas-back svg { width: 13px; height: 13px; opacity: 0.75; }
.atlas-back:hover {
  border-color: rgba(217, 195, 160, 0.45);
  background: rgba(16, 21, 26, 0.8);
  color: var(--text-bright);
}

/* Intro -------------------------------------------------------------------- */

.atlas-intro {
  position: fixed;
  left: 44px;
  top: 128px;
  z-index: 8;
  width: 352px;
  pointer-events: none;
}

.atlas-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
  color: rgba(203, 182, 146, 0.72);
}
.atlas-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dfb676;
  box-shadow: 0 0 10px rgba(223, 182, 118, 0.7);
}

.atlas-intro h1 {
  margin: 15px 0 0;
  font-family: var(--serif);
  font-size: clamp(38px, 3.4vw, 50px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.035em;
  color: rgba(245, 241, 231, 0.96);
}
.atlas-intro h1 em { font-style: normal; color: #ddb77d; }

.atlas-intro p {
  margin: 17px 0 0;
  max-width: 300px;
  font-size: 11px;
  line-height: 1.85;
  color: rgba(146, 155, 159, 0.9);
}

.atlas-readout {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 24px;
  padding-top: 13px;
  width: 250px;
  border-top: 1px solid var(--line-soft);
}
.atlas-readout span {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
  color: rgba(110, 121, 126, 0.85);
}
.atlas-readout b {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(209, 198, 178, 0.82);
}

/* Panel -------------------------------------------------------------------- */

.atlas-panel {
  position: fixed;
  top: 98px;
  right: 32px;
  bottom: 108px;
  z-index: 20;
  width: 352px;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(6, 10, 15, 0.8);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(22px) saturate(0.9);
  -webkit-backdrop-filter: blur(22px) saturate(0.9);
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 160, 135, 0.3) transparent;
  pointer-events: auto;
}

.atlas-panel-kicker,
.atlas-object-type {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(168, 158, 139, 0.66);
}

.atlas-panel-empty h2 {
  margin: 15px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: rgba(245, 240, 230, 0.94);
}

.atlas-panel-empty p {
  margin: 13px 0 0;
  font-size: 11px;
  line-height: 1.75;
  color: rgba(143, 153, 157, 0.9);
}

.atlas-index-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.atlas-index-stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 8px;
  border-right: 1px solid var(--line-soft);
}
.atlas-index-stats div:first-child { padding-left: 0; }
.atlas-index-stats div:last-child { border-right: 0; }
.atlas-index-stats strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: rgba(239, 231, 216, 0.92);
}
.atlas-index-stats span {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
  color: rgba(116, 127, 131, 0.85);
}

.atlas-panel-fine {
  margin-top: 18px !important;
  font-size: 9px !important;
  line-height: 1.7 !important;
  color: rgba(105, 116, 121, 0.75) !important;
}

/* Dynamic object panel ----------------------------------------------------- */

.atlas-object-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.atlas-object-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 17px;
  color: rgba(158, 164, 164, 0.65);
}
.atlas-object-close:hover { border-color: var(--line); color: var(--text-bright); }

.atlas-object-title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: rgba(247, 242, 231, 0.96);
}

.atlas-object-en {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
  color: var(--object-accent, rgba(199, 177, 143, 0.8));
}

.atlas-object-desc {
  margin: 17px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(153, 162, 164, 0.92);
}

.atlas-object-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.atlas-object-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(235, 240, 242, 0.035);
}
.atlas-object-stat:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line-soft); }
.atlas-object-stat:nth-last-child(-n+2) { border-bottom: 0; }
.atlas-object-stat span {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  color: rgba(117, 127, 131, 0.86);
}
.atlas-object-stat strong {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  color: rgba(226, 222, 211, 0.92);
}

.atlas-system-preview {
  margin-top: 17px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.atlas-system-preview svg { width: 100%; height: auto; display: block; }
.atlas-system-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  color: rgba(109, 119, 123, 0.8);
}

.atlas-object-section {
  margin-top: 18px;
}
.atlas-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.atlas-section-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  color: rgba(233, 227, 215, 0.94);
}
.atlas-section-title span {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  color: rgba(107, 117, 121, 0.8);
}

.atlas-planet-list { display: flex; flex-direction: column; }
.atlas-planet-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(235, 240, 242, 0.045);
}
.atlas-planet-row:last-child { border-bottom: 0; }
.atlas-planet-dot {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--planet-color, var(--accent));
  box-shadow: 0 0 7px var(--planet-color, var(--accent));
}
.atlas-planet-name {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(236, 231, 220, 0.94);
}
.atlas-planet-meta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.5;
  color: rgba(125, 135, 139, 0.85);
}
.atlas-planet-status {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  color: rgba(165, 152, 128, 0.72);
  white-space: nowrap;
}
.atlas-planet-status.is-hz { color: rgba(137, 183, 174, 0.92); }
.atlas-planet-status.is-confirmed { color: rgba(169, 190, 180, 0.88); }

.atlas-no-planets {
  margin: 12px 0 0;
  padding: 13px;
  border: 1px dashed rgba(235, 240, 242, 0.11);
  font-size: 10px;
  line-height: 1.65;
  color: rgba(136, 146, 150, 0.82);
}

.atlas-object-note {
  margin: 14px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: rgba(113, 123, 127, 0.8);
}

.atlas-object-actions {
  display: flex;
  gap: 6px;
  margin-top: 15px;
}
.atlas-object-actions a,
.atlas-object-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(218, 212, 201, 0.9);
}
.atlas-object-actions a:hover,
.atlas-object-actions button:hover {
  border-color: rgba(217, 195, 160, 0.4);
  background: rgba(217, 195, 160, 0.06);
}

.atlas-wonder-facts {
  margin-top: 16px;
  padding: 0;
  list-style: none;
}
.atlas-wonder-facts li {
  position: relative;
  padding: 9px 0 9px 14px;
  border-bottom: 1px solid rgba(235, 240, 242, 0.045);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(151, 160, 162, 0.9);
}
.atlas-wonder-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(217, 195, 160, 0.6);
}
.atlas-wonder-facts li:last-child { border-bottom: 0; }

/* Toolbar ------------------------------------------------------------------ */

.atlas-toolbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 40px);
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid rgba(235, 240, 242, 0.14);
  border-radius: 3px;
  background: rgba(5, 9, 13, 0.82);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px) saturate(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(0.9);
}

.atlas-layers {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 9px;
  border-right: 1px solid var(--line-soft);
}
.atlas-layers button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: rgba(145, 154, 157, 0.82);
}
.atlas-layers button:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-bright); }
.atlas-layers button.is-active {
  border-color: rgba(217, 195, 160, 0.3);
  background: rgba(217, 195, 160, 0.12);
  color: rgba(244, 226, 198, 0.95);
}

.atlas-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-right: 1px solid var(--line-soft);
}
.atlas-nav > span {
  font-family: var(--mono);
  font-size: 7px;
  color: rgba(137, 147, 151, 0.82);
  white-space: nowrap;
}
.atlas-nav select {
  width: 132px;
  height: 36px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(237, 232, 221, 0.9);
  cursor: pointer;
}
.atlas-nav option { background: #0b1015; color: #e8e4da; }

.atlas-tools { padding-left: 8px; }
.atlas-tools button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(207, 203, 192, 0.9);
}
.atlas-tools button:hover {
  border-color: rgba(217, 195, 160, 0.4);
  background: rgba(217, 195, 160, 0.06);
  color: var(--text-bright);
}

.atlas-hint {
  position: fixed;
  left: 44px;
  bottom: 24px;
  z-index: 10;
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  color: rgba(116, 126, 130, 0.6);
  pointer-events: none;
}
.atlas-hint span + span::before {
  content: "·";
  margin-right: 14px;
  color: rgba(87, 97, 101, 0.55);
}

.atlas-footer-note {
  position: fixed;
  right: 32px;
  bottom: 24px;
  z-index: 10;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.12em;
  color: rgba(95, 105, 109, 0.5);
  pointer-events: none;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
  .atlas-intro { left: 30px; width: 300px; }
  .atlas-intro h1 { font-size: 42px; }
  .atlas-panel { width: 326px; right: 22px; }
  .atlas-topbar { padding: 0 24px; }
  .atlas-hint { left: 30px; }
  .atlas-footer-note { right: 22px; }
  .atlas-nav select { width: 116px; }
}

@media (max-width: 900px) {
  .atlas-topbar {
    height: 70px;
    padding: 0 16px;
  }
  .atlas-mark { width: 36px; height: 36px; }
  .atlas-mark svg { width: 25px; height: 25px; }
  .atlas-brand-copy > span { font-size: 13px; }
  .atlas-brand-copy small { font-size: 5px; }
  .atlas-status { display: none; }
  .atlas-back { height: 32px; padding: 0 10px; font-size: 7px; }
  .atlas-back svg { width: 11px; height: 11px; }

  .atlas-intro {
    top: 92px;
    left: 18px;
    width: min(285px, 70vw);
  }
  .atlas-intro h1 { margin-top: 12px; font-size: 35px; }
  .atlas-intro p { margin-top: 12px; font-size: 10px; line-height: 1.75; }
  .atlas-readout { margin-top: 17px; width: 220px; }
  .atlas-kicker { font-size: 6px; }

  .atlas-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 110px;
    width: auto;
    max-height: min(48vh, 360px);
    padding: 16px;
    display: none;
  }
  .atlas-panel.is-open { display: block; }
  .atlas-panel-empty h2 { font-size: 23px; }

  .atlas-toolbar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    max-width: none;
    flex-wrap: wrap;
    padding: 8px;
    row-gap: 6px;
  }
  .atlas-layers {
    flex: 1 1 auto;
    border-right: 0;
    padding-right: 0;
  }
  .atlas-layers button { height: 34px; padding: 0 10px; font-size: 8.5px; }
  .atlas-tools {
    flex: 0 0 auto;
    padding-left: 0;
  }
  .atlas-tools button { height: 34px; font-size: 8.5px; }
  .atlas-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: space-between;
    padding: 6px 0 0;
    border-top: 1px solid var(--line-soft);
    border-right: 0;
  }
  .atlas-nav > span { font-size: 8px; }
  .atlas-nav select {
    flex: 1 1 auto;
    width: auto;
    max-width: 190px;
    height: 34px;
    font-size: 10px;
  }

  .atlas-hint { display: none; }
  .atlas-footer-note { bottom: 8px; right: 12px; font-size: 5px; }
  .atlas-label { min-height: 26px; padding: 4px 8px 4px 7px; gap: 6px; }
  .atlas-label-name { font-size: 9.5px; }
  .atlas-label-meta { font-size: 6.5px; }
}

@media (max-width: 560px) {
  .atlas-brand-copy > span { font-size: 12px; }
  .atlas-back { font-size: 6.5px; }
  .atlas-intro { top: 82px; width: min(245px, 72vw); }
  .atlas-intro h1 { font-size: 32px; }
  .atlas-intro p { display: none; }
  .atlas-readout { margin-top: 14px; width: 195px; padding-top: 10px; }
  .atlas-readout span { font-size: 6px; }
  .atlas-readout b { font-size: 7.5px; }

  .atlas-panel {
    left: 6px;
    right: 6px;
    bottom: 118px;
    max-height: min(48vh, 355px);
    padding: 15px;
  }
  .atlas-object-title { font-size: 28px; }
  .atlas-object-desc { font-size: 10.5px; }
  .atlas-planet-name { font-size: 10px; }
  .atlas-planet-meta { font-size: 7px; }
  .atlas-object-stats strong { font-size: 9px; }

  .atlas-toolbar {
    left: 6px;
    right: 6px;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    padding: 7px;
    row-gap: 5px;
  }
  .atlas-layers button { height: 33px; font-size: 8px; padding: 0 8px; }
  .atlas-tools button { height: 33px; font-size: 8px; padding: 0 10px; }
  .atlas-nav { padding-top: 5px; }
  .atlas-nav select { max-width: 175px; height: 33px; font-size: 9.5px; }
  .atlas-label { min-height: 24px; padding: 4px 7px; gap: 5px; }
  .atlas-label-name { font-size: 9px; }
  .atlas-label-meta { font-size: 6px; }
  .atlas-footer-note { display: none; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .atlas-topbar { height: 56px; padding: 0 12px; }
  .atlas-brand-copy small { display: none; }
  .atlas-mark { width: 32px; height: 32px; }
  .atlas-back { height: 29px; }
  .atlas-intro { top: 67px; left: 16px; width: 220px; }
  .atlas-intro h1 { font-size: 26px; }
  .atlas-intro p { display: none; }
  .atlas-readout { display: none; }
  .atlas-panel {
    top: 56px;
    right: 10px;
    bottom: auto;
    left: auto;
    width: 280px;
    max-height: 64vh;
    display: none;
  }
  .atlas-panel.is-open { display: block; }
  .atlas-toolbar {
    left: 10px;
    right: 10px;
    bottom: 7px;
    padding: 5px;
    flex-wrap: nowrap;
  }
  .atlas-layers { flex: 0 0 auto; }
  .atlas-layers button { height: 30px; font-size: 8px; }
  .atlas-nav { order: 0; flex: 1 1 auto; border-top: 0; padding: 0 6px; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
  .atlas-nav select { max-width: 130px; height: 30px; font-size: 8px; }
  .atlas-tools button { height: 30px; font-size: 8px; }
  .atlas-hint, .atlas-footer-note { display: none; }
}

/* --------------------------------------------------------------------------
   System view: full 3D planetary systems
   -------------------------------------------------------------------------- */

.atlas-system-labels {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.atlas-planet-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 4px 8px 4px 7px;
  border: 1px solid rgba(196, 216, 220, 0.14);
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.78);
  color: rgba(226, 232, 231, 0.9);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.atlas-planet-label:hover,
.atlas-planet-label.is-active {
  border-color: rgba(217, 195, 160, 0.5);
  background: rgba(22, 23, 21, 0.9);
  color: var(--text-bright);
}
.atlas-planet-label.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }

.atlas-planet-label-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--planet-color, var(--accent));
  box-shadow: 0 0 7px var(--planet-color, var(--accent));
}

.atlas-system-labels.is-hidden { display: none; }

@media (max-width: 900px) {
  .atlas-planet-label { min-height: 24px; padding: 4px 7px; font-size: 8px; }
}

.atlas-planet-row { cursor: pointer; transition: background 0.2s ease; }
.atlas-planet-row:hover { background: rgba(217, 195, 160, 0.04); }

.atlas-intro h1 .atlas-title-sub {
  font-size: 0.66em;
  letter-spacing: 0.055em;
  line-height: 1.15;
}
.atlas-intro h1 { overflow-wrap: anywhere; }

.atlas-object-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.atlas-object-back {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 7.5px;
  color: rgba(206, 201, 190, 0.8);
}
.atlas-object-back:hover {
  border-color: rgba(217, 195, 160, 0.4);
  background: rgba(217, 195, 160, 0.06);
  color: var(--text-bright);
}

.atlas-index-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.atlas-index-stats div { padding: 12px 6px; }
.atlas-index-stats strong { font-size: 20px; }
.atlas-index-stats span { font-size: 6px; }
#atlas-tour[hidden] { display: none; }
#atlas-tour.is-active {
  border-color: rgba(217, 195, 160, 0.5);
  background: rgba(217, 195, 160, 0.12);
  color: rgba(246, 228, 199, 0.96);
}
@media (max-width: 900px) {
  .atlas-index-stats strong { font-size: 18px; }
  .atlas-layers button { padding: 0 8px; }
}
@media (max-width: 560px) {
  .atlas-index-stats span { font-size: 5.5px; }
  .atlas-layers button { padding: 0 7px; font-size: 7.5px; }
  .atlas-tools button { padding: 0 9px; }
}

/* Link to Cosmic Lifetime */
.atlas-story-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 10px;
  border: 1px solid rgba(217, 195, 160, 0.22);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  color: rgba(217, 196, 161, 0.82);
  pointer-events: auto;
  background: rgba(8, 12, 15, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.atlas-story-link span { opacity: 0.6; }
.atlas-story-link:hover {
  border-color: rgba(217, 195, 160, 0.5);
  background: rgba(217, 195, 160, 0.07);
  color: var(--text-bright);
}
