.constellation-page .hero-content {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: clamp(1rem, 3vw, 2rem);
}

.constellation-callout {
  align-self: stretch;
  justify-content: space-between;
}

.constellation-status {
  display: grid;
  gap: 0.35rem;
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--color-text);
}

.constellation-status h3 {
  margin: 0;
}

.constellation-view {
  padding-top: clamp(2rem, 6vh, 4rem);
}

.constellation-view__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.8fr);
  align-items: start;
}

.constellation-cell {
  display: grid;
  gap: 0.75rem;
}

.constellation-view__canvas {
  position: relative;
  min-height: 380px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background:
  radial-gradient(circle at 18% 20%, rgba(187, 123, 255, 0.22), transparent 42%),
  radial-gradient(circle at 72% 68%, rgba(122, 228, 201, 0.16), transparent 48%),
  radial-gradient(circle at 64% 16%, rgba(111, 200, 255, 0.16), transparent 40%),
  linear-gradient(175deg, #0a0c14 0%, #11182a 54%, var(--color-bg));
  overflow: hidden;
  display: grid;
  place-items: center;
}

.constellation-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--color-text);
  z-index: 3;
}

.constellation-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid var(--label-color, rgba(255, 255, 255, 0.16));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.2s ease;
  white-space: nowrap;
}

.constellation-label.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.constellation-label.is-secondary {
  opacity: 0.6;
  background: rgba(10, 12, 20, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  filter: saturate(0.8);
}

.constellation-label.is-primary {
  opacity: 1;
  background: rgba(10, 12, 20, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.constellation-label__text {
  white-space: nowrap;
}

.info-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 14, 20, 0.8);
  color: var(--color-text);
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}

.info-toggle:hover,
.info-toggle:focus-visible {
  border-color: rgba(187, 123, 255, 0.6);
  outline: none;
}

.fullscreen-toggle {
  position: absolute;
  top: 12px;
  left: 108px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 14, 20, 0.85);
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.fullscreen-toggle:hover,
.fullscreen-toggle:focus-visible {
  border-color: rgba(187, 123, 255, 0.6);
  outline: none;
}

.fullscreen-toggle.is-active {
  background: rgba(187, 123, 255, 0.16);
  border-color: rgba(187, 123, 255, 0.6);
}

.fullscreen-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.reset-toggle {
  position: absolute;
  top: 12px;
  left: 60px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 14, 20, 0.82);
  color: var(--color-text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.reset-toggle:hover,
.reset-toggle:focus-visible {
  border-color: rgba(187, 123, 255, 0.6);
  outline: none;
}

.constellation-fullscreen-ui {
  position: absolute;
  inset: 0;
  display: none;
  padding: 1rem;
  pointer-events: none;
  z-index: 3;
}

.constellation-fullscreen-ui.is-hidden {
  display: none;
}

.constellation-fullscreen-ui .fullscreen-panel {
  pointer-events: auto;
  backdrop-filter: blur(10px);
  background: rgba(10, 12, 20, 0.4);
  border: 1px solid rgba(187, 123, 255, 0.35);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

.constellation-fullscreen-ui .fullscreen-panel.fixed-height {
  height: auto;
}

.constellation-fullscreen-ui .fullscreen-panel.flex-fill {
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

.constellation-fullscreen-ui .fullscreen-panel.flex-fill .constellation-detail {
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) rgba(255, 255, 255, 0.08);
}

.constellation-fullscreen-ui .fullscreen-panel.flex-fill .constellation-detail::-webkit-scrollbar {
  width: 8px;
}

.constellation-fullscreen-ui .fullscreen-panel.flex-fill .constellation-detail::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 999px;
}

.constellation-fullscreen-ui .fullscreen-panel.flex-fill .constellation-detail::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.constellation-help-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(10, 12, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  z-index: 2;
}

.constellation-help-overlay .detail-summary {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
}

.constellation-help-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: var(--color-text-muted);
  display: grid;
  gap: 0.25rem;
}

.constellation-help-overlay.is-hidden {
  display: none;
}

.panel-card.constellation-search {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.panel-card.constellation-search .search-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.panel-card.constellation-search label {
  margin: 0;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
}

.panel-card.constellation-search input {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: rgba(12, 14, 20, 0.7);
  color: var(--color-text);
}

.constellation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-placeholder {
  text-align: center;
  display: grid;
  gap: 0.75rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 520px;
}

.constellation-placeholder--ready {
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.constellation-placeholder.is-hidden {
  display: none;
}

.constellation-log {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
  max-height: 38%;
  overflow-y: auto;
}

.constellation-view__canvas:fullscreen {
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

.constellation-view__panel {
  display: grid;
  gap: 1rem;
}

.panel-card {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 20px;
  background: rgba(20, 21, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 0.75rem;
}

.constellation-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
  color: var(--color-text-muted);
}

.constellation-help.is-hidden {
  display: none;
}

.constellation-edge-filter {
  margin-top: 1rem;
}

.constellation-edge-filter .panel-card {
  padding: 1rem 1.25rem;
}

.constellation-edge-panel {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 20px;
  background: rgba(20, 21, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.detail-source a {
  color: var(--color-primary);
  font-weight: 600;
}

.constellation-controls {
  display: grid;
  gap: 1.1rem;
}

.constellation-hero-controls {
  align-self: stretch;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.constellation-hero {
  max-width: 68ch;
}

.constellation-hero h2 {
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

.constellation-intro {
  color: var(--color-text-muted);
  margin: 0;
}

.control-block {
  display: grid;
  gap: 0.35rem;
}

.constellation-controls input[type="search"] {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(15, 16, 22, 0.65);
  color: var(--color-text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  cursor: pointer;
}

.chip input {
  accent-color: var(--color-primary);
}

.constellation-detail {
  display: grid;
  gap: 0.5rem;
}

.detail-title {
  margin: 0;
}

.detail-tags,
.detail-source {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.neighbor-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  display: grid;
  gap: 0.3rem;
}

.neighbor-list a {
  color: var(--color-primary);
}

.neighbor-list button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}

.detail-neighbors.is-hidden {
  display: none;
}

.constellation-pipeline .pillar-grid article {
  background: rgba(18, 19, 28, 0.75);
}

@media (max-width: 680px) {
  .constellation-view__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .constellation-view__grid {
    grid-template-columns: 1fr;
  }

  .constellation-left,
  .constellation-cell {
    display: contents;
  }

  .constellation-left > * {
    width: 100%;
  }

  .constellation-view__panel {
    display: contents;
  }

  .constellation-edge-panel {
    order: 3;
  }

  .constellation-view__canvas {
    order: 4;
    min-height: 320px;
  }

  .constellation-detail {
    order: 5;
  }
}

@media (min-width: 1024px) {
  .constellation-view__canvas:fullscreen .constellation-fullscreen-ui {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.85rem;
    width: 33vw;
    min-width: 320px;
    max-width: 540px;
    margin-left: auto;
    padding: 1.25rem;
  }

  .constellation-view__canvas:fullscreen .constellation-fullscreen-ui.is-hidden {
    display: none;
  }

  .constellation-view__canvas:fullscreen .fullscreen-panel {
    margin-left: auto;
    width: 100%;
  }

  .constellation-view__canvas:fullscreen .constellation-canvas {
    width: 100%;
  }
}

.constellation-fullscreen-ui .fullscreen-panel:nth-child(1),
.constellation-fullscreen-ui .fullscreen-panel:nth-child(2) {
  min-height: 0;
}

.constellation-fullscreen-ui .fullscreen-panel:nth-child(3) {
  min-height: 0;
}

.constellation-fullscreen-ui .fullscreen-panel:nth-child(3) .detail-summary,
.constellation-fullscreen-ui .fullscreen-panel:nth-child(3) .detail-tags,
.constellation-fullscreen-ui .fullscreen-panel:nth-child(3) .detail-source {
  margin: 0 0 0.35rem;
}

.constellation-fullscreen-ui .fullscreen-panel:nth-child(3) .detail-neighbors {
  overflow: visible;
  max-height: none;
}

.constellation-view__canvas:fullscreen .constellation-fullscreen-ui > .fullscreen-panel {
  grid-column: 2 / 3;
  width: 100%;
  margin-left: auto;
}

.constellation-view__canvas:fullscreen .constellation-canvas {
  width: 100%;
}
