html,
body {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: #000308;
  font-family: arial;
  margin: 0;
  overflow: hidden;
}

#main-container {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background-color: transparent;
  font-family: arial;
  margin: 0;
  overflow: hidden;
}

.sim-info {
  position: absolute;
  top: 0;
  padding: 0.5em;
  background-color: transparent;
  color: grey;
}

.Nav {
  position: absolute;
  bottom: 0;
  padding: 0.5em;
  background-color: transparent;
  color: grey;
}

.credits {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 0.5em;
  background-color: transparent;
  color: grey;
}

button {
  background-color: transparent;
  color: grey;
  background-color: grey; /* Green */
  border: none;
  color: white;
  padding: 5px 5px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 10 px;
}

.debug {
  margin-top: 1rem;
}

.slider-container {
  margin: 0.5rem 0;
}

.menu-container {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  border-radius: 0.5rem;
  display: none;
  position: absolute;
  background-color: rgba(249, 249, 249, 0.8);
  min-width: 250px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  z-index: 1;
  color: #161616;
}

.dropdown-content a {
  color: inherit;
}

.menu-container:hover .dropdown-content {
  display: block;
}

.extra-info {
  margin: 1rem 0;
}

/* Other styles */

#current-date {
  font-size: 36px;             /* Making the font larger */
  color: rgba(255, 255, 255, 0.8);  /* White color with 80% transparency */
  font-family: 'Arial', sans-serif; /* For demonstration purposes, but consider importing a more trendy font */
  text-shadow: 2px 2px 4px #000;   /* Giving a subtle shadow to make it stand out on any background */
}

#current-date {
  font-size: 36px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Roboto', sans-serif;
  text-shadow: 2px 2px 4px #000;
}

.fullscreen-btn {
  padding: 5px 10px;
  font-size: 1rem;
  background-color: #333;
  color: #a89b9b;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.fullscreen-btn:hover {
  background-color: #555;
}

.control-btn {
  background-color: #4CAF50; /* Green background */
  border: none; 
  color: white; /* White text */
  padding: 6px 10px; 
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  margin: 2px 2px;
  cursor: pointer;
  border-radius: 4px;
}

.control-btn:hover {
  background-color: #45a049; /* Darker green on hover */
}

.btn-container {
  display: flex;
  align-items: center; /* This ensures vertical alignment */
  gap: 5px; /* Reducing the space between buttons, can be adjusted */
}

.control-btn, .fullscreen-btn {
  /* Add uniform styling here to ensure buttons are of the same dimensions */
  padding: 10px 15px; /* Example padding */
  border: none;
  background-color: #333; /* Example background color */
  color: #fff; /* Example text color */
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s; /* Smooth transition for hover effect */
}

.control-btn:hover, .fullscreen-btn:hover {
  background-color: #555; /* Example hover background color */
}

/* ── Viewport object counter (stars / planets in view) ────────────────────── */
#viewport-counts {
  display: block;
  width: 100%;
  padding: 2px 8px 4px;
  line-height: 1.5;
  pointer-events: none;
  user-select: none;
}
#viewport-counts span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  font-family: inherit;
}
body.paper #viewport-counts span { color: rgba(0, 0, 0, 0.45); }

.Nav button,
.Nav a {
  padding: 8px 12px;
  margin: 5px;
  border: none;
  background-color: #333;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .3em;
}

.Nav button:hover,
.Nav a:hover {
  background-color: #555;
}

/* Tour navigation: ◀ [label] ▶ inline widget */
.nav-history {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 5px;
}
.nav-history #btn-tour-label {
  display: inline-block;
  min-width: 90px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  padding: 0 6px;
  background: none !important;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.nav-history #btn-tour-label:hover {
  background: rgba(255,255,255,0.12) !important;
}
.nav-history button {
  padding: 8px 10px;
  margin: 0;
  font-size: 13px;
  background-color: #333;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.nav-history button:hover { background-color: #555; }
body.paper .nav-history button     { background-color: #e0e0e0 !important; color: #111 !important; }
body.paper .nav-history button:hover { background-color: #ccc !important; }
body.paper .nav-history #btn-tour-label { color: #222; }

.info-box {
  position: absolute; 
  bottom: 70px; /* Assuming 50px is the height of the nav buttons. Adjust as needed */
  left: 20px;
  background-color: rgba(128, 128, 128, 0.7); 
  color: lightgrey;
  padding: 8px 12px;
  border-radius: 5px;
  margin: 5px;       /* Space around each button */
  display: none; 
  z-index: 1000;

font-size: 16px;
  width: 300px; /* Set a fixed width for the box */
  max-height: calc(100% - 300px); /* Assuming the space you want to leave at the top is 100px. Adjust as needed. */
  overflow-y: auto; /* Make it scrollable when content overflows */
}


/* For Webkit browsers (Chrome, Safari etc.) */
.info-box::-webkit-scrollbar {
  width: 10px;
}

.info-box::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.info-box::-webkit-scrollbar-thumb {
  background: #888;
}

.info-box::-webkit-scrollbar-thumb:hover {
  background: #555;
}


.close-btn {
  position: absolute;
  top: 1px;
  right: 5px;
  cursor: pointer;
}

/* Mobile View */
@media screen and (max-width: 768px) {
  .info-box {
    bottom: 100px;
    left: 7px;
    width: 80%;
  }
  .close-btn {
    font-size: 2.5em;
  }
  .Nav {
    bottom: 0;
  }

  /* Nav: hide text labels — keep only icons/symbols */
  .btn-label       { display: none !important; }
  .btn-desktop-only { display: none !important; }

  /* Hide the datasets status overlay and dynamic quote on mobile */
  #datasets-overlay  { display: none !important; }
  #dynamic-text      { display: none; }
  #viewport-counts   { display: none; }

  /* Compact nav buttons on mobile */
  .Nav button, .Nav a {
    padding: 6px 8px !important;
    font-size: 14px !important;
  }
}

/* Desktop View */
@media screen and (min-width: 769px) {
  .info-box {
    bottom: 70px;
    left: 20px;
  }
  .close-btn {
    font-size: 1em;
  }
}

.parameters-menu {
  display: none;
  position: fixed;
  bottom: 0;
  right: 0;
  /* Other styling as you desire */
}

/* ── Settings panel ────────────────────────────────────────────────────────── */
#settings-panel {
  position: fixed;
  bottom: 56px;
  right: 8px;
  z-index: 400;
  flex-direction: column;
  min-width: 280px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: rgba(12, 14, 24, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 0 8px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  animation: sp-slide-up 0.18s ease both;
}

@keyframes sp-slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

#settings-panel .sp-close-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: #778;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
#settings-panel .sp-close-btn:hover { color: #dde; }

.se-panel-section {
  padding: 8px 14px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.se-section-header {
  font-variant: small-caps;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #668;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* Override JS-injected positioning when datasets-overlay lives inside settings-panel */
#settings-panel #datasets-overlay {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  z-index: auto !important;
}

#man-icon {
  color: red;
  transform: scale(1.7);

}
#man-icon.active {
  color: white; /* or any other color to indicate active state */
}

.custom-button {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px 0;
  background-color: #2a2a2a; /* Dark gray based on the space theme */
  color: #ff6363; /* Slightly reddish tint for text */
  border: 2px solid #ff6363;
  border-radius: 4px;
  transition: all 0.3s ease;
  text-decoration: none; /* Removes the underline from the anchor tags */
  font-weight: bold; /* Making the text bold for visibility */
}

.custom-button:hover {
  background-color: #ff6363;
  color: #2a2a2a;
  border: 2px solid #2a2a2a;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

#popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  z-index: 3;
}

/* Add to your existing CSS */
#overlay a {
  display: inline-block;
  margin-top: 10px;
  background-color: #333; /* Match your button background */
  color: white; /* Match your button text color */
  text-align: center;
  padding: 10px 20px;
  text-decoration: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

#overlay a:hover {
  background-color: #555; /* Hover state color change */
}
.dropdown-content {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.75); /* Dark background with 75% opacity */
  color: #fff; /* White text color */
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  border-radius: 5px; /* Optional: adds rounded corners */
  padding: 10px;
  z-index: 1;
}

.dropdown-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-content ul li {
  padding: 8px 12px;
  cursor: pointer;
}

.dropdown-content ul li:hover {
  background-color: rgba(255, 255, 255, 0.1); /* Light highlight for hover */
}

.dropdown-content input[type='number'],
.dropdown-content label {
  color: #fff; /* Ensures text is visible against dark background */
}

.dropdown-content input[type='number'] {
  background: rgba(255, 255, 255, 0.1); /* Light input field background */
  border: none;
  border-bottom: 1px solid #fff; /* Underline style */
  margin-top: 5px;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it is above all other content */
}

.lightbox-content {
  background: #fff;
  padding: 20px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  text-align: center;
}

.lightbox-button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #b01a1a; /* Dark red */
  color: white;
}

.lightbox-button.close {
  background-color: #666;
}


.dynamic-text {
  position: relative;
  background: url('/Images/ingenuity.jpg') no-repeat center center;
  background-size: cover;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-bottom: 0rem;
  height: 25vh; /* Fixed height to 25% of the window height */
  display: flex;
  align-items: center; /* Center the text vertically */
  justify-content: center; /* Center the text horizontally */
}

.dynamic-text p {
  font-size: calc(25vh * 0.2); /* Adjust font size based on height */
  animation: fadeInOut 10s infinite;
  margin: 0; /* Remove default margin */
  padding: 0; /* Remove default padding */
  position: absolute;
  top: 10px; /* Adjust as needed */
  right: 10px; /* Adjust as needed */
  z-index: 1000; /* 
}

.dynamic-text .overlay-text {
  position: center;
  top: 10px;
  left: 0px;
  font-size: 1rem;
  font-weight: bold;
}
/* ── White / paper background mode ──────────────────────────────────────────
   Toggle by adding class .paper to <body>.
   Makes the scene look clean on white-background embeds / screenshots.      */
body.paper #current-date        { color: rgba(0,0,0,0.75); text-shadow: none; }
body.paper .Nav                 { color: #222; }
body.paper .Nav button,
body.paper .Nav a               { background-color: #e0e0e0 !important; color: #111 !important; border-color: #aaa !important; }
body.paper .Nav button:hover,
body.paper .Nav a:hover         { background-color: #ccc !important; }
body.paper .sim-info            { color: #333; }
body.paper #speed-display,
body.paper #sunDistanceDisplay  { color: #333; }
body.paper .info-box            { background-color: rgba(240,240,240,0.92); color: #111; }
body.paper .control-btn,
body.paper .fullscreen-btn      { background-color: #ddd !important; color: #222 !important; }
body.paper #btn-about           { color: #333 !important; border-color: #aaa !important; }

/* ── Sources Panel ──────────────────────────────────────────────────────────── */
.sources-panel {
  position: fixed;
  top: 3.5rem;
  right: .75rem;
  width: 340px;
  max-height: calc(100vh - 5rem);
  background: rgba(10, 10, 18, 0.94);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  overflow-y: auto;
  flex-direction: column;
  z-index: 200;
  font-size: .78rem;
  color: rgba(200,205,215,.7);
  display: none;
  box-shadow: 0 4px 24px rgba(0,0,0,.6);
}

.sp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem .85rem .45rem;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.1);
  position: sticky;
  top: 0;
  background: rgba(10,10,18,.97);
  z-index: 1;
}

.sp-close {
  cursor: pointer;
  opacity: .6;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 .2rem;
}
.sp-close:hover { opacity: 1; }

.sp-cat { border: none; }
.sp-cat + .sp-cat { border-top: 1px solid rgba(255,255,255,.06); }

.sp-cat-title {
  list-style: none;
  cursor: pointer;
  padding: .5rem .85rem;
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  user-select: none;
}
.sp-cat-title::-webkit-details-marker { display: none; }
.sp-cat[open] .sp-cat-title { color: rgba(200,205,215,.65); }

.sp-cat-body { padding: 0 .5rem .4rem; }

.sp-row {
  padding: .42rem .35rem;
  border-radius: 5px;
  margin-bottom: .15rem;
}
.sp-row:hover { background: rgba(255,255,255,.04); }

.sp-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
  margin-bottom: .15rem;
}

.sp-name { font-weight: 600; font-size: .8rem; color: rgba(200,205,215,.85); }

.sp-badges { display: flex; gap: .25rem; flex-shrink: 0; }

.sp-badge {
  font-size: .62rem;
  padding: .1em .45em;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #fff;
  white-space: nowrap;
}
.sp-badge--static  { background: #444; }
.sp-badge--auto    { background: #1565c0; }
.sp-badge--ok      { background: #2e7d32; }
.sp-badge--loading { background: #e65100; }
.sp-badge--err     { background: #b71c1c; }
.sp-badge--off     { background: #333; color: rgba(255,255,255,.45); }

.sp-row-detail {
  font-size: .71rem;
  color: rgba(255,255,255,.48);
  margin-bottom: .2rem;
  line-height: 1.35;
}

.sp-row-meta {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  color: rgba(255,255,255,.4);
  flex-wrap: wrap;
}

.sp-link {
  color: rgba(120,180,255,.75);
  text-decoration: none;
}
.sp-link:hover { color: rgba(120,180,255,1); text-decoration: underline; }

.sp-coverage { color: rgba(255,255,255,.35); }

/* Toggle switch */
.sp-toggle {
  position: relative; display: inline-block;
  width: 30px; height: 17px;
  flex-shrink: 0; margin-left: .4rem;
  vertical-align: middle;
}
.sp-toggle input { opacity: 0; width: 0; height: 0; }
.sp-toggle-track {
  position: absolute; inset: 0;
  border-radius: 9px; background: #444;
  transition: background .2s; cursor: pointer;
}
.sp-toggle input:checked + .sp-toggle-track { background: #e05a2b; }
.sp-toggle-track::after {
  content: ''; position: absolute;
  width: 11px; height: 11px; top: 3px; left: 3px;
  border-radius: 50%; background: #fff; transition: left .2s;
}
.sp-toggle input:checked + .sp-toggle-track::after { left: 16px; }
.sp-toggle-always-on {
  color: #4caf50; font-size: .85rem;
  margin-left: .4rem; flex-shrink: 0;
}

/* Paper mode overrides */
body.paper .sources-panel {
  background: rgba(245,245,245,.97);
  border-color: rgba(0,0,0,.15);
  color: #222;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
body.paper .sp-header { background: rgba(240,240,240,.98); }
body.paper .sp-cat-title { color: rgba(0,0,0,.45); }
body.paper .sp-cat[open] .sp-cat-title { color: rgba(0,0,0,.75); }
body.paper .sp-row:hover { background: rgba(0,0,0,.04); }
body.paper .sp-row-detail { color: rgba(0,0,0,.5); }
body.paper .sp-row-meta { color: rgba(0,0,0,.45); }
body.paper .sp-link { color: #1565c0; }
body.paper .sp-coverage { color: rgba(0,0,0,.35); }
body.paper .sp-toggle-track { background: #ccc; }
body.paper .sp-toggle input:checked + .sp-toggle-track { background: #e05a2b; }
body.paper .sp-toggle-always-on { color: #2e7d32; }

/* ── Datasets Overlay ────────────────────────────────────────────────────── */
#datasets-overlay {
  /* position/placement enforced by JS in datasetsOverlay.js */
  position: fixed;
  top: 3.8rem;
  right: .75rem;
  left: auto;
  width: 168px;
  background: rgba(6, 6, 14, 0.88);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  padding: .3rem .45rem .35rem;
  z-index: 300;
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  color: rgba(255,255,255,.88);
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,.55);
}

.dol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .28rem;
  padding-bottom: .2rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.dol-title {
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.dol-toggle {
  cursor: pointer;
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  line-height: 1;
  padding: 0 .1rem;
}
.dol-toggle:hover { color: rgba(255,255,255,.9); }

.dol-row {
  display: flex;
  align-items: center;
  gap: .28rem;
  padding: .16rem .12rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s;
}
.dol-row:hover { background: rgba(255,255,255,.1); }

.dol-icon  { font-size: .72rem; line-height: 1; }
.dol-label { flex: 1; font-size: .68rem; color: rgba(255,255,255,.85); }

.dol-dot {
  font-size: .8rem;   /* bigger for legibility */
  line-height: 1;
  flex-shrink: 0;
  min-width: 1em;
  text-align: center;
}
/* ◉ visible on screen = bright green */
.dol-dot--on      { color: #44ee66; text-shadow: 0 0 4px #44ee66; }
/* ◎ loaded but hidden = steel blue */
.dol-dot--loaded  { color: #55aaff; }
/* ↻ loading = amber, spinning */
.dol-dot--loading { color: #ffaa22; display: inline-block; animation: dol-spin .8s linear infinite; }
/* ○ not loaded = dim */
.dol-dot--off     { color: rgba(255,255,255,.22); }

@keyframes dol-spin { to { transform: rotate(360deg); } }

/* Paper mode */
body.paper #datasets-overlay {
  background: rgba(30, 30, 40, 0.92);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
}
body.paper .dol-label  { color: rgba(255,255,255,.88); }
body.paper .dol-title  { color: rgba(255,255,255,.5); }
body.paper .dol-toggle { color: rgba(255,255,255,.55); }
body.paper .dol-row:hover { background: rgba(255,255,255,.1); }
body.paper .dol-dot--off  { color: rgba(255,255,255,.25); }

/* ── Search pill — upper right ───────────────────────────────────────────────── */
/* Mirrors the compass button approach: position:fixed + right — confirmed working. */
#search-pill {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 260px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
}

/* Actual inner pill row */
#search-pill-inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(248,248,250,.97);
  border-radius: 999px;
  padding: .45rem 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
#search-pill-inner:focus-within {
  box-shadow: 0 4px 20px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.1);
}

.search-pill-icon {
  color: rgba(80,80,90,.65);
  font-size: .85rem;
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: rgba(30,30,35,.9);
  font-size: .9rem;
  min-width: 0;
  line-height: 1.5;
}
#search-input::placeholder { color: rgba(110,110,120,.6); }

#search-clear {
  background: none;
  border: none;
  color: rgba(80,80,90,.5);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 0;
  line-height: 1;
  display: none;
  flex-shrink: 0;
}
#search-clear:hover { color: rgba(30,30,35,.8); }

#search-results {
  display: none;
  margin-top: .35rem;
  background: rgba(248,248,250,.98);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.07);
  max-height: 280px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(0,0,0,.05); }

.search-result-name {
  font-size: .84rem;
  color: rgba(30,30,35,.88);
  font-weight: 500;
}
.search-result-name mark {
  background: rgba(255,210,60,.35);
  color: rgba(20,20,25,.9);
  border-radius: 2px;
  padding: 0 1px;
}

.search-result-group {
  font-size: .7rem;
  color: rgba(100,100,110,.65);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobile: hide search pill */
@media screen and (max-width: 768px) {
  #search-pill { display: none !important; }
}

/* ── Selection system: tooltip + infoboxes + rings ────────────────────────── */

/* Hover tooltip */
.se-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 1001;
  background: rgba(8, 14, 30, 0.94);
  color: #c8d8e8;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  display: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

/* Per-selection infobox */
.se-infobox {
  position: fixed;
  z-index: 1000;
  width: 280px;
  background: rgba(8, 14, 30, 0.94);
  color: #c0cdd8;
  padding: 10px 14px 12px;
  border-radius: 7px;
  font-size: 14px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.06);
  cursor: default;
  user-select: none;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 3px solid rgba(100,160,240,0.65);
}
.se-infobox-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: grab;
  margin-bottom: 5px;
  gap: 6px;
}
.se-infobox-header:active { cursor: grabbing; }
.se-infobox-name {
  font-weight: bold;
  font-size: 15px;
  color: #eef4ff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.se-infobox-close {
  cursor: pointer;
  opacity: 0.45;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 2px;
  transition: opacity .15s;
  color: #aac;
}
.se-infobox-close:hover { opacity: 1; }
.se-infobox-dist {
  font-size: 11px;
  color: rgba(180, 210, 255, 0.55);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.se-infobox-text {
  font-size: 12.5px;
  color: #9aaabb;
  line-height: 1.5;
  margin-bottom: 7px;
  max-height: 120px;
  overflow-y: auto;
}
.se-infobox-ref a {
  color: rgba(120, 180, 255, 0.85);
  font-size: 12px;
  text-decoration: none;
}
.se-infobox-ref a:hover { text-decoration: underline; }

/* Per-selection ring */
.se-ring {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(160, 160, 175, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
  box-sizing: border-box;
}

/* Mobile */
@media screen and (max-width: 768px) {
  .se-infobox { width: calc(100vw - 28px); right: 14px !important; }
  .se-tooltip { display: none !important; }
}

/* Mobile CTA */
.se-mobile-cta {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: none;
}

/* Paper mode */
body.paper .se-infobox      { background: rgba(240,242,248,0.97); color: #111; border-left-color: rgba(60,100,200,0.6); }
body.paper .se-infobox-name { color: #111; }
body.paper .se-infobox-dist { color: rgba(0,0,0,0.45); }
body.paper .se-infobox-text { color: #333; }
body.paper .se-tooltip      { background: rgba(230,234,244,0.95); color: #222; border-color: rgba(0,0,0,0.1); }

/* Infobox "More on this object" button */
.se-infobox-moreinfo {
  background: none;
  border: none;
  color: #7ab;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.se-infobox-moreinfo:hover { text-decoration: underline; }

/* Infobox "Fly to" button */
.se-infobox-flyto-btn {
  background: rgba(255, 200, 50, 0.12);
  border: 1px solid rgba(255, 200, 50, 0.3);
  color: #fc3;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 4px;
  margin: 4px 0;
}
.se-infobox-flyto-btn:hover {
  background: rgba(255, 200, 50, 0.22);
  border-color: rgba(255, 200, 50, 0.5);
}

/* ── Visit Planet button (planets only) ─────────────────────────────────── */
.se-infobox-visit-planet { margin: 6px 0 2px; }
.se-infobox-visit-btn {
  width: 100%;
  background: rgba(60, 130, 255, 0.18);
  border: 1px solid rgba(60, 130, 255, 0.45);
  color: #88bbff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 5px;
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s;
}
.se-infobox-visit-btn:hover {
  background: rgba(60, 130, 255, 0.30);
  border-color: rgba(60, 130, 255, 0.70);
}
.se-visit-disclaimer {
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  font-style: italic;
  line-height: 1.4;
  margin-top: 4px;
}

/* ── Planet infobox content elements ────────────────────────────────────── */
.se-infobox-text { max-height: 220px; }  /* override the 120px cap for rich planet boxes */

.se-pblock { margin-bottom: 5px; line-height: 1.55; }

.se-hz-status { margin-bottom: 4px; }
.se-hz-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  font-weight: bold;
}
.se-hz-badge.hz-conservative { background: rgba(34,200,90,0.18); color: #44ee88; border: 1px solid rgba(34,200,90,0.3); }
.se-hz-badge.hz-optimistic   { background: rgba(80,180,80,0.12);  color: #88cc88; border: 1px solid rgba(80,180,80,0.25); }
.se-hz-badge.hz-hot          { background: rgba(220,80,40,0.15);  color: #ff8866; border: 1px solid rgba(220,80,40,0.3); }
.se-hz-badge.hz-cold         { background: rgba(80,140,200,0.15); color: #88aaff; border: 1px solid rgba(80,140,200,0.3); }
.se-hz-timeline { font-size: 10px; color: rgba(255,255,255,0.48); }

.se-evo-line { font-size: 10px; color: rgba(255,220,100,0.65); margin: 3px 0; }
.se-visited-badge { font-size: 10px; color: rgba(255,255,255,0.35); margin-left: 2px; }

hr.se-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 7px 0 5px;
}
.se-art-block { font-size: 10px; line-height: 1.5; }
.se-art-label { font-weight: bold; color: rgba(200,170,255,0.75); }
.se-art-disclaimer { color: rgba(255,255,255,0.32); font-style: italic; }

/* ── System infobox planet links ────────────────────────────────────────── */
.se-sys-head  { font-size: 11px; color: #ccc; }
.se-hz-line   { font-size: 10px; color: rgba(80,200,130,0.75); }
.se-dist-line { font-size: 10px; color: rgba(255,255,255,0.38); }
.se-plinks-label { font-size: 10px; color: rgba(255,255,255,0.40); }
.se-planet-links { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.se-planet-link {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aac8ff;
  font-size: 10px;
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.se-planet-link:hover           { background: rgba(60,130,255,0.22); border-color: rgba(60,130,255,0.5); color: #ddeeff; }
.se-planet-link.se-plink-hz     { color: #55ee88; border-color: rgba(34,200,90,0.3); }
.se-planet-link.se-plink-hz:hover { background: rgba(34,200,90,0.15); }
.se-planet-link.se-plink-opt    { color: #88cc88; }

/* ── Spacekit planet/object labels ──────────────────────────────────────────
   Spacekit uses Three.js CSS2DRenderer. The renderer creates a single <div>
   as a direct child of #main-container; individual label <div>s live inside
   that wrapper (one level deeper → grandchildren of #main-container).        */
#main-container > div > div {
  font-family: 'Roboto', sans-serif !important;
  font-size: 22px !important;
  color: rgba(255, 255, 255, 0.80) !important;
  background: rgba(0, 0, 0, 0.45) !important;
  padding: 3px 10px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
  white-space: nowrap;
}
#main-container > div > div:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}

/* ── Proper-motion panel active button state (legacy Trail/Vec) ── */
#pm-trail-btn.pm-active, #pm-vector-btn.pm-active {
  background: rgba(80, 120, 200, .55) !important;
  border-color: #6090dd !important;
  color: #eef !important;
}

/* ── PM showMode buttons ── */
#pm-mode-never, #pm-mode-hover, #pm-mode-all {
  transition: background .15s, border-color .15s, color .15s;
}
#pm-mode-never:hover, #pm-mode-hover:hover, #pm-mode-all:hover {
  border-color: #7090bb !important;
  color: #ddf !important;
}

/* ── Reference frame hover-expand dropdown ── */
.pm-frame-dropdown {
  display: none;
  position: absolute;
  left: 0; top: 100%;
  z-index: 200;
  min-width: 160px;
  background: rgba(16, 20, 36, 0.97);
  border: 1px solid #4a5a7a;
  border-radius: 4px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
}
#pm-frame-wrap:hover .pm-frame-dropdown,
.pm-frame-dropdown:hover {
  display: block !important;
}
.pm-frame-opt {
  display: block;
  width: 100%;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #ccd;
  cursor: pointer;
  font-size: 10px;
  text-align: left;
  transition: background .1s, color .1s, border-color .1s;
}
.pm-frame-opt:hover {
  background: rgba(80, 120, 200, .2);
  color: #eef;
}
.pm-frame-opt--active,
.pm-frame-opt.pm-frame-opt--active {
  background: rgba(80, 130, 220, .35) !important;
  border-color: rgba(100, 160, 255, .55) !important;
  color: #ddeeff !important;
}

/* #pm-extras: visibility toggled by JS in pmSetMode */

/* ── Narrative Tour overlay ──────────────────────────────────────────────── */
#narrative-overlay {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(640px, calc(100vw - 32px));
  pointer-events: auto;
}

.nt-panel {
  background: rgba(8, 12, 24, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 20px 24px 16px;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65);
}

.nt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.nt-act {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e05a2b;
  font-weight: 600;
}

.nt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nt-counter {
  font-size: 10px;
  color: #556;
  letter-spacing: 0.05em;
}

.nt-close {
  background: none;
  border: none;
  color: #667;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.nt-close:hover { color: #fff; }

.nt-scale-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}

.nt-scale-num {
  font-size: 10px;
  color: #e05a2b;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
}

.nt-scale-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.nt-range-row {
  font-size: 11px;
  color: #667;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.nt-anchor {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aab;
  margin-bottom: 12px;
  border-left: 2px solid #e05a2b;
  padding-left: 8px;
}

.nt-text {
  font-size: 13px;
  line-height: 1.7;
  color: #bbc;
  margin-bottom: 16px;
}

.nt-text p { margin: 0 0 8px 0; }
.nt-text p:last-child { margin-bottom: 0; }

.nt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nt-btn {
  background: rgba(224, 90, 43, 0.12);
  border: 1px solid rgba(224, 90, 43, 0.35);
  color: #e05a2b;
  padding: 6px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}
.nt-btn:hover { background: rgba(224, 90, 43, 0.28); }
.nt-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* Trigger button active state */
#btn-narrative-tour.nt-active {
  background-color: #e05a2b;
  color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
  #narrative-overlay { bottom: 58px; }
  .nt-panel { padding: 14px 16px 12px; }
  .nt-scale-name { font-size: 16px; }
  .nt-text { font-size: 12px; max-height: 130px; overflow-y: auto; }
}

/* ── Planet World Viewer ────────────────────────────────────────────────────── */
.pw-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  animation: pw-fade-in 0.25s ease;
}
@keyframes pw-fade-in { from { opacity: 0; } to { opacity: 1; } }

.pw-shell {
  display: grid;
  grid-template-columns: 1fr 280px;
  width: min(1100px, 96vw);
  height: min(700px, 90vh);
  background: #0a0a0f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.pw-canvas-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
}

.pw-close {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ccc; font-size: 12px;
  padding: 5px 12px; border-radius: 4px;
  cursor: pointer; letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
}
.pw-close:hover { background: rgba(255,60,60,0.4); color: #fff; }

.pw-info {
  background: #0d0d14;
  border-left: 1px solid rgba(255,255,255,0.07);
  overflow-y: auto;
  padding: 20px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.pw-info-inner { color: #ccc; }

.pw-planet-name {
  font-size: 18px; font-weight: bold;
  color: #e8e8f0; margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.pw-stats { margin-top: 4px; }
.pw-stats > div {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
}
.pw-stat-l { color: #666; }
.pw-stat-r { color: #aaa; text-align: right; }

@media (max-width: 640px) {
  .pw-shell { grid-template-columns: 1fr; grid-template-rows: 1fr 220px; }
  .pw-info { border-left: none; border-top: 1px solid rgba(255,255,255,0.07); }
}


/* ─── Narrative Tour Overlay ─────────────────────────────────────────────── */
#narrative-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 24px 0;
}

.nt-panel {
  pointer-events: all;
  background: rgba(6, 10, 24, 0.92);
  border: 1px solid rgba(80, 120, 200, 0.35);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  width: min(520px, 94vw);
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(120,160,255,0.08);
}

.nt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 8px;
  border-bottom: 1px solid rgba(80,120,200,0.2);
  flex-shrink: 0;
}

.nt-act {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6090dd;
}

.nt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nt-counter {
  font-size: 10px;
  color: #556;
  letter-spacing: 0.06em;
}

.nt-close {
  background: transparent;
  border: none;
  color: #778;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.nt-close:hover { color: #aab; }

.nt-body {
  padding: 12px 16px 10px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.nt-scale-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
}

.nt-scale-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a6a9a;
}

.nt-scale-name {
  font-size: 15px;
  font-weight: 700;
  color: #d8e4f8;
  letter-spacing: 0.01em;
}

.nt-range-row {
  font-size: 10px;
  color: #5a7a9a;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.nt-anchor {
  font-size: 10px;
  color: #7090a8;
  font-style: italic;
  margin-bottom: 9px;
}

.nt-text {
  font-size: 12px;
  color: #b0bfd0;
  line-height: 1.65;
}
.nt-text p {
  margin: 0 0 8px;
}
.nt-text p:last-child {
  margin-bottom: 0;
}

.nt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid rgba(80,120,200,0.15);
  flex-shrink: 0;
}

.nt-btn {
  background: rgba(30, 50, 100, 0.5);
  border: 1px solid rgba(60, 90, 160, 0.5);
  border-radius: 5px;
  color: #8ab0d8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
}
.nt-btn:hover:not(:disabled) {
  background: rgba(50, 80, 160, 0.6);
  color: #cde;
}
.nt-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Active-state highlight for Story button */
#btn-narrative-tour.nt-active {
  background: rgba(60, 90, 180, 0.55) !important;
  border-color: #6090dd !important;
  color: #ccddff !important;
}
