/* ============================================================
   NAVIGATION - Top bar, bottom nav, dropdowns
   ============================================================ */

/* --- Command Header (single-row topbar) --- */
.topbar.command-header {
  height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 0;
  background: rgba(6, 6, 15, 0.98);
}

/* Single command row: logo | planet selector | tabs | actions */
.command-row {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 var(--panel-padding);
  gap: 8px;
}

/* Command tabs strip - takes the remaining width, centered. safe center +
   hidden-scrollbar overflow so no tab is ever clipped on narrow strips. */
.command-tabs {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  justify-content: safe center;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.command-tabs::-webkit-scrollbar {
  display: none;
}

/* Individual command tab */
.cmd-tab {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  position: relative;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 44px touch area without growing the visual */
.cmd-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  bottom: -4px;
}


.cmd-tab .tab-icon {
  display: none;
}

.cmd-tab span {
  font-size: inherit;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  font-weight: 600;
  padding-right: 0.05em;
}

.cmd-tab:hover {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.06);
}

.cmd-tab.active {
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.cmd-tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.75);
  animation: cmd-tab-dot-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
.cmd-tab-dot[hidden] { display: none; }
@keyframes cmd-tab-dot-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(250, 204, 21, 0.5); }
  50%      { box-shadow: 0 0 12px rgba(250, 204, 21, 0.95); }
}

/* --- Mobile: compact command header ---
   No logo on mobile: the planet selector takes the left slot and the
   5 tabs scroll horizontally if they don't fit. */
@media (max-width: 768px) {
  .topbar.command-header .command-row {
    gap: 4px;
    padding: 0 8px;
  }

  /* Drop logo + title entirely to free room for the planet selector */
  .topbar.command-header .topbar-title {
    display: none;
  }

  /* Tight labels so the 5 tabs (COLONIAS/PLANETA/EDIFICIOS/COMERCIO/
     MILITAR) fit at 390px width. */
  .topbar.command-header .command-tabs {
    gap: 2px;
  }
  .topbar.command-header .cmd-tab {
    padding: 5px 6px;
    gap: 0;
    font-size: 13px;
    min-height: 34px;
    letter-spacing: 0.03em;
  }
  .topbar.command-header .cmd-tab span {
    letter-spacing: 0.03em;
  }

  .topbar.command-header .topbar-btn {
    width: 32px;
    height: 32px;
  }
  .topbar.command-header .topbar-btn svg {
    width: 18px;
    height: 18px;
  }

  .topbar.command-header .topbar-planet {
    max-width: 130px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-trigger {
    padding: 3px 6px;
    gap: 4px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-name {
    font-size: 0.88rem;
  }
}

/* Narrow phones: tighter row padding + smaller buttons/planet selector */
@media (max-width: 480px) {
  .topbar.command-header .command-row {
    padding: 0 4px;
    gap: 2px;
  }
  .topbar.command-header .command-tabs {
    gap: 1px;
  }
  .topbar.command-header .cmd-tab {
    padding: 4px 6px;
    font-size: 13px;
  }
  .topbar.command-header .topbar-btn {
    width: 30px;
    height: 30px;
  }
  .topbar.command-header .topbar-btn svg {
    width: 16px;
    height: 16px;
  }
  .topbar.command-header .topbar-planet {
    max-width: 100px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-trigger {
    padding: 2px 5px;
    gap: 3px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-img {
    width: 18px;
    height: 18px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-name {
    font-size: 0.8rem;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-chevron {
    width: 12px;
    height: 12px;
  }
}

/* Very narrow (<=360px): hide planet name so the 5 tabs still fit */
@media (max-width: 360px) {
  .topbar.command-header .cmd-tab {
    padding: 3px 4px;
    font-size: 12px;
  }
  .topbar.command-header .topbar-planet {
    max-width: 55px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-name {
    display: none;
  }
  .topbar.command-header .topbar-btn {
    width: 28px;
    height: 28px;
  }
}

/* Legacy .topbar compat (non-command-header contexts) */
.topbar:not(.command-header) {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--panel-padding);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  background: rgba(6, 6, 15, 0.98);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.topbar-logo {
  height: 22px;
  width: auto;
}

.topbar-actions {
  display: flex;
  gap: 4px;
}
/* Legacy compat: old single-row topbar still needs the push-right */
.topbar:not(.command-header) .topbar-actions {
  margin-left: auto;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.topbar-btn:hover,
.topbar-btn.active {
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.12);
}

.topbar-btn svg {
  width: 20px;
  height: 20px;
}

.topbar-btn.refreshing svg {
  animation: topbar-refresh-spin 0.8s linear infinite;
}
@keyframes topbar-refresh-spin {
  to { transform: rotate(360deg); }
}

/* Refresh button: desktop only */
.topbar-refresh-btn {
  display: none;
}
@media (min-width: 768px) {
  .topbar-refresh-btn {
    display: flex;
  }
}
.topbar-refresh-btn.is-refreshing svg {
  animation: topbar-spin 0.8s linear infinite;
}
@keyframes topbar-spin {
  to { transform: rotate(360deg); }
}

/* --- Topbar Dropdowns (fixed, below topbar) --- */
.topbar-dd.panel {
  position: fixed;
  top: calc(var(--banner-offset) + var(--topbar-height) + var(--topbar-dropdown-gap));
  right: var(--panel-padding);
  min-width: 180px;
  max-width: min(260px, calc(100vw - (var(--panel-padding) * 2)));
  max-height: calc(100vh - var(--banner-offset) - var(--topbar-height) - var(--topbar-dropdown-gap) - var(--panel-padding));
  max-height: calc(var(--app-height, 100dvh) - var(--banner-offset) - var(--topbar-height) - var(--topbar-dropdown-gap) - var(--panel-padding));
  z-index: 1000;
  padding: 6px 0;
  overflow: auto;
  transform-origin: top right;
  animation: ddFadeIn 0.15s ease-out;
}

.topbar-dd[hidden] {
  display: none !important;
}
@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dd-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 1px 8px rgba(var(--accent-rgb), 0.05);
}
.dd-username {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
}
.dd-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.dd-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  min-height: 44px;
}
.dd-profile-btn:hover,
.dd-profile-btn:active {
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.dd-section {
  padding: 6px 16px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
}
.dd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
}
.dd-divider {
  height: 1px;
  background: rgba(var(--accent-rgb), 0.1);
  margin: 4px 0;
}
.dd-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.dd-item {
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
}
.dd-item:hover {
  background: rgba(var(--accent-rgb), 0.08);
}
.notif-item:hover {
  background: rgba(var(--accent-rgb), 0.08);
}
.dd-logout {
  color: var(--red);
}
.dd-toggle {
  padding: 3px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  letter-spacing: 0.04em;
}
.dd-toggle:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.06);
}
.dd-toggle.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.1);
}
.dd-volume {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dd-vol-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 4px;
  background: none;
  color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.15s, opacity 0.15s;
}
.dd-vol-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
}
.dd-vol-btn.muted {
  opacity: 0.35;
}
.dd-vol-btn.muted .vol-waves {
  display: none;
}
.dd-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.2);
  outline: none;
  cursor: pointer;
}
.dd-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4);
}
.dd-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4);
}
.dd-track-row {
  justify-content: space-between;
  padding: 0 12px 2px;
  min-height: auto;
  align-items: center;
}
.dd-track-mid {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 20px;
  margin: 0 6px;
}
.dd-progress-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(var(--accent-rgb), 0.15);
  border-radius: 1px;
  overflow: hidden;
}
.dd-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.6), var(--cyan));
  border-radius: 1px;
  transition: width 0.3s linear;
  box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.3);
}
.dd-track-name {
  position: relative;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  letter-spacing: 0.3px;
}
.dd-skip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 4px;
  background: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.dd-skip-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  color: var(--cyan);
}
.dd-version {
  padding: 3px 12px 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.18);
  text-align: center;
  font-family: var(--font-mono);
}
.dd-lang {
  display: flex;
  gap: 8px;
}
.dd-lang .lang-option {
  font-size: 1.3rem;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.dd-lang .lang-option.active,
.dd-lang .lang-option:hover {
  opacity: 1;
}
.dd-theme-row {
  display: flex;
  gap: 6px;
}
.dd-empty {
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* --- Bottom Navigation --- */
/* Visibility controlled via inline style by JS (showGame/showLogin) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: auto;
  display: flex;
  align-items: center;
  padding: 4px 0 var(--bottom-sai);
  justify-content: center;
  gap: 2px;
  background: var(--bg-void);
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
  z-index: 9999;
}

html.pwa-standalone.game-active .bottom-nav {
  position: absolute;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

/* Hide nav when any overlay is open */
body:has(
  .collection-detail-overlay:not([hidden]),
  .balance-ledger-overlay:not([hidden]),
  .card-zoom-backdrop.visible,
  .confirm-overlay:not([hidden]),
  .fleet-dispatch-overlay,
  .prereq-overlay,
  .battle-report-overlay,
  #player-profile-modal
) .bottom-nav {
  display: none;
}

.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.3), transparent);
}


/* Dock buttons share the command-tab grammar (one button language
   across the console): soft hover fill, cyan framed active state. */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 10px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  min-width: 44px;
  min-height: 34px;
  justify-content: center;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.06);
}

/* Desktop: horizontal style, grouped in center */
@media (min-width: 1024px) {
  /* Cap topbar row contents to match the main-content width (1400px) so the
     command header aligns with the dashboard body on wide screens. The dark
     .topbar background still fills full width; only the row contents center. */
  .topbar.command-header .command-row {
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .bottom-nav {
    gap: 6px;
    height: auto;
    padding: 10px 0 4px;
  }

  .nav-item {
    width: auto;
    min-width: 64px;
    flex-direction: row;
    gap: 5px;
    padding: 0 14px;
  }

  .nav-item span {
    display: inline;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .topbar.command-header .topbar-planet {
    max-width: 220px;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-name {
    font-size: 0.88rem;
  }
  .topbar.command-header .topbar-planet .planet-dropdown-coords {
    font-size: 0.7rem;
  }

  /* desktop3 center column is narrow (~720px with both side rails):
     compact tabs so all 5 fit between logo and actions */
  .topbar.command-header .command-tabs {
    gap: 4px;
  }
  .topbar.command-header .cmd-tab {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* Mid-width desktops: keep only the logo icon so the 5 tabs and the
   planet selector share the narrow desktop3 strip */
@media (min-width: 1024px) and (max-width: 1599px) {
  .topbar.command-header .topbar-title .topbar-logo {
    display: none;
  }
}

/* --- Nav badge (bottom-nav events/comms badge) --- */
/* Wrap around the label so the badge anchors to the end of the text,
   not the top-right of the whole button (which sat over the icon).
   Specificity matches `.nav-item span` so it wins on desktop too. */
.nav-item .nav-label-wrap {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.nav-item .nav-badge {
  position: absolute;
  top: -11px;
  right: -10px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 1px var(--scrim-50);
  pointer-events: none;
}
.nav-item .nav-badge.hidden { display: none; }

/* Mobile / PWA: the bottom-nav item is flex-column (icon on top of
   label). Anchoring the badge to the end of the label wrap pushes it
   below the icon instead of the usual top-right corner, so lift it
   further here. */
@media (max-width: 1023px) {
  .nav-item .nav-badge {
    top: -22px;
    right: -8px;
  }

  /* Active-only labels: only the current tab shows its text. Inactive
     items collapse to icon-only so the dock no longer overflows. The
     .nav-label-wrap and its badge stay in flow so unread counts keep
     showing on inactive items too. */
  .nav-item > span:not(.nav-label-wrap):not(.kc-pending-orb):not(.kc-pending-orb-badge),
  .nav-item .nav-label-wrap > span[data-i18n] {
    display: none;
  }
  .nav-item.active > span:not(.nav-label-wrap):not(.kc-pending-orb):not(.kc-pending-orb-badge),
  .nav-item.active .nav-label-wrap > span[data-i18n] {
    display: inline;
  }
}

/* --- Topbar Planet Selector (inline in topbar) --- */
.topbar-planet {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 280px;
  margin: 0;
}
.topbar-planet .planet-dropdown-trigger {
  background: transparent;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  gap: 6px;
}
.topbar-planet .planet-dropdown-img {
  width: 24px;
  height: 24px;
}
.topbar-planet .planet-dropdown-name {
  font-size: 0.78rem;
}
.topbar-planet .planet-dropdown-coords {
  font-size: 0.62rem;
}

@media (max-width: 600px) {
  .topbar-planet { max-width: 180px; }
  .topbar-planet .planet-dropdown-coords { display: none; }
  .topbar-planet .planet-dropdown-img { width: 20px; height: 20px; }
  .topbar-planet .planet-dropdown-list {
    min-width: 220px;
    right: auto;
  }
}

/* Topbar button notification badge (mirrors .nav-badge but positioned
   for the compact topbar buttons). Used for Comms unread and Reports
   unseen event counts. */
.topbar-btn { position: relative; }
.topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 1px var(--scrim-50);
  pointer-events: none;
}
.topbar-badge.hidden { display: none; }

/* --- Planet selector --- */
.planet-selector {
  position: relative;
  padding: 6px var(--panel-padding);
  background: rgba(13, 13, 31, 0.7);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
}

.planet-dropdown {
  position: relative;
  width: 100%;
}

.planet-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(14, 14, 30, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 3px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.planet-dropdown-trigger:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  outline: none;
}

.planet-dropdown-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.planet-dropdown-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.planet-dropdown-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planet-dropdown-coords {
  font-size: 0.7rem;
  color: var(--cyan);
}

.planet-dropdown-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.planet-dropdown[data-open] .planet-dropdown-chevron {
  transform: rotate(180deg);
}

.planet-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: rgba(10, 10, 24, 0.96);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 3px;
  box-shadow: 0 8px 24px var(--scrim-50);
  max-height: 240px;
  overflow-y: auto;
}

.planet-dropdown-list[hidden] {
  display: none;
}

.planet-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.planet-dropdown-item:hover,
.planet-dropdown-item.is-active {
  background: rgba(var(--accent-rgb), 0.1);
}

.planet-dropdown-item img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.planet-dropdown-item-info {
  flex: 1;
  min-width: 0;
}

.planet-dropdown-item-name {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
}
.planet-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.planet-dropdown-item-coords {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.moon-badge,
.autofarm-badge {
  flex-shrink: 0;
}
.moon-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.25);
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.autofarm-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.04em;
}
