    /* make Characteristics + LOS + Nearest + Stats scroll inside the panel */
    #infoPanel{
      max-height: 50vh;
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 6px;
      box-sizing: border-box;
    }
    #infoPanel::-webkit-scrollbar { width: 8px; }
    #infoPanel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 6px; }
    #infoPanel::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }

    #catalogStatus {
      font-size: 11px;
      line-height: 1.3;
      margin-top: 6px;
      color: #cfcfcf;
      word-break: break-word;
    }
    .catalog-btn {
      margin: 4px 0;
      width: 100%;
      padding: 6px 8px;
      font-size: 12px;
      cursor: pointer;
    }
    #starmapListContainer {
      margin-top: 8px;
      max-height: 180px;
      overflow-y: auto;
      border: 1px solid #444;
      background: rgba(0,0,0,0.35);
      padding: 6px;
      font-size: 12px;
    }
    .starmap-item {
      padding: 6px 8px;
      margin: 2px 0;
      cursor: pointer;
      border-radius: 4px;
      background: rgba(255,255,255,0.05);
      display:flex;
      justify-content:space-between;
      gap:10px;
    }
    .starmap-item:hover { background: rgba(255,255,255,0.12); }
    .starmap-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .starmap-size { color:#9aa; font-size:11px; white-space:nowrap; }

    /* ============================
       LOS (Line-of-sight) panel
       ============================ */
    #losContainer {
      margin-top: 8px;
      padding-top: 6px;
      border-top: 1px solid rgba(255,255,255,0.15);
      font-size: 12px;
    }
    #losHeader {
      font-weight: bold;
      margin-bottom: 4px;
      color: #9fd0ff;
      font-size: 11px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }
    #losList {
      max-height: 140px;
      overflow-y: auto;
      border: 1px solid #333;
      background: rgba(0,0,0,0.35);
      padding: 4px;
      border-radius: 4px;
    }
    .los-item {
      padding: 4px 6px;
      margin: 2px 0;
      cursor: pointer;
      border-radius: 3px;
      background: rgba(255,255,255,0.05);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
    }
    .los-item:hover { background: rgba(120,170,255,0.18); }
    .los-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
    .los-dist { font-size: 11px; color:#aac; white-space:nowrap; }
    .los-empty { color:#888; font-size:11px; padding:4px 6px; }

    /* ============================
       Nearest Stars panel
       ============================ */
    #nearestContainer {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.15);
      font-size: 12px;
    }
    #nearestHeader {
      font-weight: bold;
      margin-bottom: 4px;
      color: #b6ffa8;
      font-size: 11px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }
    #nearestList {
      max-height: 190px;
      overflow-y: auto;
      border: 1px solid #333;
      background: rgba(0,0,0,0.35);
      padding: 4px;
      border-radius: 4px;
    }
    .nearest-item {
      padding: 4px 6px;
      margin: 2px 0;
      cursor: pointer;
      border-radius: 3px;
      background: rgba(255,255,255,0.05);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
    }
    .nearest-item:hover { background: rgba(120,255,170,0.18); }
    .nearest-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
    .nearest-dist { font-size: 11px; color:#9fb8a2; white-space:nowrap; }
    .nearest-empty { color:#888; font-size:11px; padding:4px 6px; }

    /* ============================
       Catalog / View Stats panel
       ============================ */
    #catalogStatsContainer {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.15);
      font-size: 12px;
    }
    #catalogStatsHeader {
      font-weight: bold;
      margin-bottom: 4px;
      color: #ffd28a;
      font-size: 11px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }
    #catalogStats {
      border: 1px solid #333;
      background: rgba(0,0,0,0.35);
      padding: 6px 8px;
      border-radius: 4px;
      line-height: 1.45;
      font-size: 12px;
      color: #ddd;
    }
    .stat-row {
      display:flex;
      justify-content:space-between;
      gap:8px;
      padding:2px 0;
      border-bottom: 1px dashed rgba(255,255,255,0.06);
    }
    .stat-row:last-child { border-bottom:none; }
    .stat-label { color:#bbb; }
    .stat-value { color:#fff; white-space:nowrap; }

    /* ============================
       Minimap popup
       ============================ */
    #minimapPopup{
      position: fixed;
      top: 90px;
      left: 320px;
      width: 300px;
      background: rgba(10,10,14,0.96);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 8px;
      z-index: 9999;
      box-shadow: 0 8px 30px rgba(0,0,0,0.6);
      display:none;
      user-select:none;
    }
    #minimapHeader{
      cursor: move;
      padding: 6px 8px;
      font-size: 12px;
      font-weight: bold;
      color: #cfe3ff;
      background: rgba(40,60,90,0.35);
      border-bottom: 1px solid rgba(255,255,255,0.12);
      display:flex;
      align-items:center;
      justify-content:space-between;
    }
    #minimapClose{
      border:none;
      background: transparent;
      color:#fff;
      font-size:16px;
      line-height:16px;
      cursor:pointer;
      padding:0 4px;
    }

    #minimapCanvas{
      width: 280px;
      height: 280px;
      margin: 8px 10px 6px 10px;
      background: rgba(0,0,0,0.9);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 6px;
      display:block;
    }

    #minimapControls{
      padding: 6px 10px 10px 10px;
      display:flex;
      gap:6px;
      align-items:center;
      flex-wrap:wrap;
    }
    #minimapControls button{
      font-size:12px;
      padding:4px 8px;
      cursor:pointer;
    }
    #minimapAxisLabel{
      font-size:11px;
      color:#9fd0ff;
      margin-left:auto;
    }
    #minimapHint{
      width:100%;
      font-size:10px;
      color:#99a;
      margin-top:2px;
    }

    #minimapHoverBar{
      display:flex;
      justify-content:space-between;
      align-items:center;
      padding:6px 10px 0 10px;
      font-size:11px;
      color:#ddd;
    }
    #minimapHoverName{
      color:#cfe3ff;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      max-width:180px;
    }
    #minimapHoverDist{
      color:#9fb8a2;
      white-space:nowrap;
    }

    /* ============================
       Visited Objects panel
       ============================ */
    #visitedContainer {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.15);
      font-size: 12px;
    }
#visitedHeaderRow{
  display:flex;
  flex-direction:column;   /* <-- puts filters under title */
  align-items:flex-start;
  gap:2px;
  margin-bottom:4px;
}

#visitedFilters{
  width:100%;
  justify-content:flex-start;
  gap:10px;
  font-size:11px;
  color:#bbb;
  white-space:normal;      /* allow wrap if needed */
  flex-wrap:wrap;
}

    #visitedHeader {
      font-weight: bold;
      color: #ff9fe8;
      font-size: 11px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }

    #visitedFilters label{
      display:flex;
      gap:4px;
      align-items:center;
      cursor:pointer;
    }

    #visitedList {
      max-height: 190px;
      overflow-y: auto;
      border: 1px solid #333;
      background: rgba(0,0,0,0.35);
      padding: 4px;
      border-radius: 4px;
    }
    .visited-item {
      padding: 4px 6px;
      margin: 2px 0;
      cursor: pointer;
      border-radius: 3px;
      background: rgba(255,255,255,0.05);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
      border-left: 3px solid transparent;
    }
    .visited-item:hover { background: rgba(255,160,240,0.18); }
    .visited-item.star-item { border-left-color: rgba(140,180,255,0.95); }
    .visited-item.planet-item { border-left-color: rgba(140,255,190,0.95); }
    .visited-item.virtual-item { border-left-color: rgba(255,255,255,0.8); }
    .visited-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
    .visited-dist { font-size: 11px; color:#d8a9cf; white-space:nowrap; }
    .visited-empty { color:#888; font-size:11px; padding:4px 6px; }

    /* ============================
       Travel tiny play button (global)
       ============================ */
    .travel-play{
      font-size:10px;
      padding:1px 4px;
      border:1px solid rgba(255,255,255,0.25);
      background: rgba(0,0,0,0.65);
      border-radius:3px;
      cursor:pointer;
      color:#cfe3ff;
      line-height:12px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-width:14px;
      height:14px;
      user-select:none;
      transform: translateY(-1px);
      flex:0 0 auto;
    }
    .travel-play:hover{
      background: rgba(120,200,255,0.25);
      border-color: rgba(120,200,255,0.6);
    }

    /* ============================
       Throneworld (Sol) display
       ============================ */
    #throneworldContainer{
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.12);
      font-size:12px;
    }
    #throneworldHeader{
      font-weight:bold;
      margin-bottom:4px;
      color:#ffd28a;
      font-size:11px;
      letter-spacing:0.3px;
      text-transform:uppercase;
    }
    #throneworldList{
      border:1px solid #333;
      background: rgba(0,0,0,0.35);
      padding:4px;
      border-radius:4px;
    }
    .throneworld-item{
      padding:4px 6px;
      margin:2px 0;
      border-radius:3px;
      background: rgba(255,210,138,0.10);
      color:#ffd28a;
      font-weight:bold;
      border-left:3px solid rgba(255,210,138,0.95);
      cursor:pointer;
      white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
      display:flex;
      align-items:center;
      gap:6px;
    }

    /* ============================
       Colonies panel (under throneworld)
       ============================ */
    #colonyContainer{
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.12);
      font-size:12px;
    }
    #colonyHeader{
      font-weight:bold;
      margin-bottom:4px;
      color:#9fd0ff;
      font-size:11px;
      letter-spacing:0.3px;
      text-transform:uppercase;
    }
    #colonyList{
      max-height: 170px;
      overflow-y:auto;
      border:1px solid #333;
      background: rgba(0,0,0,0.35);
      padding:4px;
      border-radius:4px;
    }
    .colony-item{
      padding:4px 6px;
      margin:2px 0;
      cursor:pointer;
      border-radius:3px;
      background: rgba(255,255,255,0.05);
      border-left:3px solid rgba(140,255,190,0.95);
      display:flex;
      align-items:center;
      gap:6px;
    }
    .colony-item:hover{ background: rgba(120,255,170,0.18); }
    .colony-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
    .colony-empty{ color:#888; font-size:11px; padding:4px 6px; }

    /* ============================
       Homeworlds panel (under colonies)
       ============================ */
    #homeworldContainer{
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.12);
      font-size:12px;
    }
    #homeworldHeader{
      font-weight:bold;
      margin-bottom:4px;
      color:#b6ffa8;
      font-size:11px;
      letter-spacing:0.3px;
      text-transform:uppercase;
    }
    #homeworldList{
      max-height: 170px;
      overflow-y:auto;
      border:1px solid #333;
      background: rgba(0,0,0,0.35);
      padding:4px;
      border-radius:4px;
    }
    .homeworld-item{
      padding:4px 6px;
      margin:2px 0;
      cursor:pointer;
      border-radius:3px;
      background: rgba(255,255,255,0.05);
      border-left:3px solid rgba(140,255,140,0.95);
      display:flex;
      align-items:center;
      gap:6px;
    }
    .homeworld-item:hover{ background: rgba(120,255,170,0.18); }
    .homeworld-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
    .homeworld-empty{ color:#888; font-size:11px; padding:4px 6px; }

    /* ============================
       Visit Details draggable popup
       ============================ */
    #visitDetailsPopup{
      position: fixed;
      top: 140px;
      left: 640px;
      width: 360px;
      background: rgba(10,10,14,0.98);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 8px;
      z-index: 10000;
      box-shadow: 0 8px 30px rgba(0,0,0,0.6);
      display:none;
      user-select:none;
    }
    #visitDetailsHeader{
      cursor: move;
      padding: 6px 8px;
      font-size: 12px;
      font-weight: bold;
      color: #ffd6fb;
      background: rgba(90,40,80,0.30);
      border-bottom: 1px solid rgba(255,255,255,0.12);
      display:flex;
      align-items:center;
      justify-content:space-between;
    }

    #visitDetailsClose{
      border:none;
      background: transparent;
      color:#fff;
      font-size:16px;
      line-height:16px;
      cursor:pointer;
      padding:0 4px;
    }

    #visitDetailsBody{
      padding: 8px 10px 10px 10px;
      max-height: 60vh;
      overflow-y: auto;
      font-size: 12px;
      color: #ddd;
    }

    .vd-section{
      display:flex;
      justify-content:space-between;
      gap:8px;
      padding:3px 0;
      border-bottom: 1px dashed rgba(255,255,255,0.06);
    }
    .vd-section:last-child{ border-bottom:none; }
    .vd-label{ color:#bbb; }

    .vd-subheader{
      margin-top:8px;
      font-size:11px;
      font-weight:bold;
      color:#b6ffa8;
      letter-spacing:0.3px;
      text-transform:uppercase;
    }

    .vd-planets{
      margin-top:4px;
      border:1px solid rgba(255,255,255,0.08);
      border-radius:4px;
      background: rgba(0,0,0,0.3);
      padding:4px;
      max-height: 240px;
      overflow-y:auto;
    }

    .vd-planet-row{
      display:flex;
      justify-content:space-between;
      gap:8px;
      padding:3px 4px;
      margin:2px 0;
      border-radius:3px;
      background: rgba(255,255,255,0.05);
      cursor:pointer;
      align-items:center;
    }
    .vd-planet-row:hover{
      background: rgba(140,255,190,0.12);
    }

    .vd-planet-left{
      display:flex;
      align-items:center;
      gap:6px;
      flex:1;
      min-width:0;
    }

    .vd-planet-name{
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      flex:1;
      min-width:0;
    }
    .vd-planet-type{
      font-size:11px;
      color:#9fb8a2;
      white-space:nowrap;
      flex:0 0 auto;
    }

    .vd-planet-stats{
      margin:2px 0 6px 8px;
      font-size:11px;
      color:#cfcfcf;
      line-height:1.35;
    }

    #visitActionRow{
      margin-top:8px;
      display:flex;
      gap:6px;
      flex-wrap:wrap;
    }
    #visitActionRow button{
      font-size:12px;
      padding:4px 8px;
      cursor:pointer;
    }

    #visitRenameRow{
      margin-top:10px;
      display:flex;
      gap:6px;
      align-items:center;
    }
    #visitRenameInput{
      flex:1;
      font-size:12px;
      padding:4px 6px;
      background: rgba(0,0,0,0.6);
      color:#fff;
      border:1px solid rgba(255,255,255,0.18);
      border-radius:4px;
    }
    #visitRenameBtn{
      font-size:12px;
      padding:4px 8px;
      cursor:pointer;
    }
    #visitRenameMsg{
      margin-top:6px;
      font-size:11px;
      color:#ffd28a;
    }
    .vd-parent-star-btn{
  font-size:12px;
  padding:3px 8px;
  cursor:pointer;
  background: rgba(120,200,255,0.12);
  border: 1px solid rgba(120,200,255,0.45);
  color:#cfe3ff;
  border-radius:4px;
}
.vd-parent-star-btn:hover{
  background: rgba(120,200,255,0.25);
}

#nearestFilters {
  margin-bottom: 4px;
  font-size: 11px;
  color: #bbb;
}
#nearestFilters label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}



