.constellation-body {
  overflow: hidden;
}

.constellation-header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4vw;
  border-bottom: 1px solid var(--border);
  background: rgba(8,11,13,0.92);
}

.constellation-brand {
  color: inherit;
  text-decoration: none;
}

.constellation-brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
}

.constellation-header-actions {
  display: flex;
  gap: 8px;
}

.constellation-layout {
  height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: 280px 1fr;
}

.constellation-sidebar {
  overflow-y: auto;
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: rgba(8,11,13,0.78);
}

.constellation-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.constellation-check input {
  width: auto;
  margin: 0;
}

.legend p {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.legend-dot,
.legend-ring {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.legend-dot.journal {
  background: var(--accent);
}

.legend-dot.tasting {
  background: #9a86af;
}

.legend-ring {
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.constellation-stage {
  position: relative;
  min-width: 0;
  background:
    radial-gradient(circle at center, rgba(64,100,95,0.07), transparent 50%),
    #06090b;
}

#constellationCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#constellationCanvas:active {
  cursor: grabbing;
}

.constellation-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.constellation-empty h2 {
  margin-bottom: 8px;
}

.node-inspector {
  position: absolute;
  top: 22px;
  right: 22px;
  width: min(360px, calc(100% - 44px));
  padding: 24px;
  border: 1px solid var(--border-bright);
  background: rgba(10,14,16,0.96);
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
}

.inspector-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.node-inspector h2 {
  padding-right: 38px;
  margin-bottom: 8px;
}

.inspector-meta {
  color: var(--text-dark);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.inspector-excerpt {
  margin: 18px 0;
  color: var(--text-muted);
  font-family: var(--serif);
  line-height: 1.65;
}

.inspector-open {
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 760px) {
  .constellation-body {
    overflow: auto;
  }

  .constellation-header {
    height: auto;
    min-height: 92px;
    flex-wrap: wrap;
  }

  .constellation-layout {
    height: calc(100vh - 126px);
    grid-template-columns: 1fr;
  }

  .constellation-sidebar {
    display: none;
  }

  .node-inspector {
    top: auto;
    bottom: 14px;
    right: 14px;
    width: calc(100% - 28px);
    max-height: 44vh;
    overflow-y: auto;
  }
}


/* ------------------------------------------------
   V4.2: CLUSTERS + TEMPORAL LINKS
------------------------------------------------ */

.constellation-select-label {
  display: block;
  margin-top: 12px;
  color: var(--text-dark);
  font-size: 0.65rem;
}

.constellation-select-label select {
  margin-top: 6px;
  padding: 8px 9px;
  font-size: 0.68rem;
}

.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cluster-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: 0.67rem;
}

.cluster-button:hover,
.cluster-button.active {
  border-color: var(--accent-dark);
  color: var(--accent-bright);
  background: rgba(64,100,95,0.12);
}

.cluster-button span:last-child {
  color: var(--text-dark);
}

.legend-line {
  width: 22px;
  height: 1px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.legend-line.explicit {
  background: rgba(134,175,167,0.9);
}

.legend-line.tag {
  background: rgba(110,125,139,0.8);
}

.legend-line.temporal {
  border-top: 1px dashed rgba(181,164,123,0.8);
}

.cluster-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cluster-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 8px;
  border: 1px solid rgba(64,100,95,0.22);
  background: rgba(6,9,11,0.52);
  color: rgba(134,175,167,0.34);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cluster-label.active {
  color: var(--accent-bright);
  border-color: var(--accent-dark);
}

.inspector-time {
  color: var(--accent);
}
