@import url("atlas-semantic-zoom.css");

.atlas-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.65rem;
  background: #f8faf8;
}

.atlas-mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(7.5rem, 1fr));
  gap: 0.25rem;
  min-width: min(100%, 25rem);
  padding: 0;
  border: 0;
}

.atlas-mode-switcher button {
  display: grid;
  gap: 0.08rem;
  min-height: 2.8rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0;
  text-align: left;
}

.atlas-mode-switcher button:first-of-type {
  border-radius: 4px 0 0 4px;
}

.atlas-mode-switcher button:last-of-type {
  border-radius: 0 4px 4px 0;
}

.atlas-mode-switcher button[aria-pressed="true"] {
  border-color: #244f42;
  background: #163b31;
  color: #f4faf7;
}

.atlas-mode-switcher strong {
  font-size: 0.76rem;
}

.atlas-mode-switcher small {
  color: #728178;
  font-size: 0.58rem;
  font-weight: 550;
}

.atlas-mode-switcher button[aria-pressed="true"] small {
  color: #b8d5c9;
}

.atlas-state-filter {
  flex: 0 0 auto;
}

.atlas-cluster-select select {
  width: min(18rem, 35vw);
}

.atlas-cluster-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atlas-cluster-overlay[hidden] {
  display: none;
}

.atlas-cluster-hull {
  --cluster-hue: 170;
  position: absolute;
  min-width: 4rem;
  min-height: 3.5rem;
  border: 1px solid hsl(var(--cluster-hue) 72% 68% / 0.48);
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse at center,
      hsl(var(--cluster-hue) 66% 48% / 0.035) 0%,
      hsl(var(--cluster-hue) 66% 48% / 0.075) 58%,
      hsl(var(--cluster-hue) 66% 48% / 0.02) 100%
    );
  box-shadow:
    inset 0 0 2.2rem hsl(var(--cluster-hue) 68% 58% / 0.055),
    0 0 1.1rem hsl(var(--cluster-hue) 70% 62% / 0.08);
  opacity: 0.82;
  transform-origin: center;
  transition: opacity 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  pointer-events: none;
}

.atlas-cluster-hull.is-active {
  border-width: 2px;
  border-color: hsl(var(--cluster-hue) 88% 76% / 0.86);
  box-shadow:
    inset 0 0 2.8rem hsl(var(--cluster-hue) 76% 60% / 0.1),
    0 0 1.8rem hsl(var(--cluster-hue) 78% 70% / 0.18);
  opacity: 1;
}

.atlas-cluster-label {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  max-width: min(17rem, 80vw);
  min-height: 1.55rem;
  padding: 0.24rem 0.52rem;
  border: 1px solid hsl(var(--cluster-hue) 66% 69% / 0.54);
  border-radius: 999px;
  background: rgba(5, 15, 12, 0.88);
  color: hsl(var(--cluster-hue) 64% 82%);
  font: 680 0.62rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}

.atlas-cluster-label:hover,
.atlas-cluster-label:focus-visible {
  border-color: hsl(var(--cluster-hue) 82% 80% / 0.9);
  background: rgba(9, 27, 22, 0.96);
  outline: 2px solid hsl(var(--cluster-hue) 72% 72% / 0.25);
  outline-offset: 2px;
}

.atlas-cluster-label.is-secondary {
  opacity: 0.35;
}

.atlas-cluster-hull:hover .atlas-cluster-label.is-secondary,
.atlas-cluster-label.is-secondary:focus-visible {
  opacity: 1;
}

.atlas-legend {
  max-width: calc(100% - 2rem);
}

.legend-cluster {
  width: 0.78rem;
  height: 0.56rem;
  border: 1px solid rgba(122, 216, 190, 0.72);
  border-radius: 50%;
  background: rgba(64, 159, 132, 0.12);
}

.legend-line.relation-bridge {
  width: 1.2rem;
  height: 3px;
  background: #e7cf91;
}

.legend-line.relation-derived {
  width: 1.2rem;
  height: 0;
  border-top: 1px dashed #8bb0df;
  background: transparent;
}

.legend-line.relation-advisory {
  width: 1.2rem;
  height: 0;
  border-top: 2px dashed #cda4ff;
  background: transparent;
}

.legend-line.relation-derived::after,
.legend-line.relation-advisory::after,
.legend-line.relation-bridge::after {
  display: none;
}

.structure-key {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-inline: 1px solid #cbd3cd;
  border-bottom: 1px solid #cbd3cd;
  background: #cbd3cd;
  list-style: none;
}

.structure-key li {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: start;
  column-gap: 0.45rem;
  min-height: 3.2rem;
  padding: 0.5rem 0.7rem;
  background: #fff;
  color: #69756d;
  font-size: 0.65rem;
}

.structure-key b {
  color: #1c2e27;
  font-size: 0.72rem;
}

.structure-key li > :last-child {
  grid-column: 2;
}

.role-glyph {
  grid-row: 1 / span 2;
  display: inline-block;
  width: 0.74rem;
  height: 0.74rem;
  border: 1.5px solid #3b7662;
  border-radius: 50%;
  background: #d9ebe4;
}

.role-hub {
  width: 0.94rem;
  height: 0.94rem;
  border-width: 2px;
}

.role-bridge {
  border: 3px double #8b6a2d;
  background: #f4ead5;
}

.role-interface {
  border-radius: 2px 50% 50% 2px;
  background: #e3edf2;
}

.role-frontier {
  border-color: #be7b1e;
  box-shadow: 0 0 0 3px rgba(224, 157, 55, 0.16);
  background: #fff1d8;
}

@media (max-width: 82rem) {
  .atlas-mode-switcher {
    flex-basis: 100%;
  }

  .atlas-cluster-select select {
    width: min(16rem, 45vw);
  }
}

@media (max-width: 58rem) {
  .atlas-mode-switcher {
    grid-template-columns: 1fr;
  }

  .atlas-mode-switcher button,
  .atlas-mode-switcher button:first-of-type,
  .atlas-mode-switcher button:last-of-type {
    border-radius: 4px;
  }

  .atlas-cluster-select {
    order: 2;
    flex: 1 1 14rem;
  }

  .atlas-cluster-select select {
    width: 100%;
  }

  .structure-key {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .atlas-state-filter {
    width: 100%;
  }

  .structure-key {
    grid-template-columns: 1fr;
  }

  .atlas-cluster-label.is-secondary {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-cluster-hull,
  .atlas-cluster-label {
    transition: none;
  }
}
