/* Collaboration network page. Every selector is scoped to the .net- prefix. */
/* The page head sits in .net-page-head, so the task colour is set on that wrapper (VD-25c). */
.net-page-head {
  --atlas-task: var(--atlas-task-people);
}
.net-page {
  min-width: 0;
}

.net-primary-grid {
  align-items: end;
}

/* Grid children may shrink below their content, so a control cannot spill into the next column. */
.net-primary-grid > *,
.net-more-grid > * {
  min-width: 0;
}

.net-filter-form {
  display: contents;
}

.net-primary-grid > .net-filter-form > .atlas-filters__more {
  grid-column: 1 / -1;
}

.net-more-grid {
  align-items: end;
}

/* Slider and value share one 2.5rem row, the same height as the select and input beside them. */
.net-range-row {
  display: flex;
  min-width: 0;
  min-height: 2.5rem;
  align-items: center;
  gap: var(--atlas-space-3);
}

.net-range {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  margin: 0;
  accent-color: var(--atlas-brand);
}

.net-range-out {
  flex: 0 0 auto;
  min-width: 2ch;
  color: var(--atlas-ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.net-range:focus-visible {
  outline: 3px solid var(--atlas-accent);
  outline-offset: 2px;
}

/* The status line gets the card's horizontal padding so its text does not sit on the box edge. */
.net-page .atlas-result-line > p {
  margin: 0;
  padding: var(--atlas-space-2) var(--atlas-space-4);
}

.net-chart {
  position: relative;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-card);
  background: var(--atlas-surface);
}

.net-chart:fullscreen {
  height: 100vh;
  max-height: none;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.net-toolbar {
  position: absolute;
  z-index: 3;
  top: var(--atlas-space-3);
  left: var(--atlas-space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--atlas-space-2);
  max-width: calc(100% - 1.5rem);
}

.net-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
}

.net-btn .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.net-btn__mark {
  position: absolute;
  right: var(--atlas-space-1);
  bottom: var(--atlas-space-1);
  min-width: 0.75rem;
  border-radius: var(--atlas-radius-pill);
  background: var(--atlas-surface);
  color: var(--atlas-brand-strong);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.net-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.net-btn__tooltip {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--atlas-space-2));
  left: 50%;
  visibility: hidden;
  padding: var(--atlas-space-2) var(--atlas-space-3);
  border-radius: var(--atlas-radius-control);
  background: var(--atlas-ink);
  color: var(--atlas-surface);
  font: 500 var(--atlas-type-caption-size) / 1.2 var(--atlas-font-body);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.net-btn:hover .net-btn__tooltip,
.net-btn:focus-visible .net-btn__tooltip {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.net-toolbar > .net-btn:last-child .net-btn__tooltip {
  right: 0;
  left: auto;
  transform: translate(0, -2px);
}

.net-toolbar > .net-btn:last-child:hover .net-btn__tooltip,
.net-toolbar > .net-btn:last-child:focus-visible .net-btn__tooltip {
  transform: translate(0, 0);
}

/* Loading and fallback text overlays the chart box, so showing or hiding it never moves the chart. */
.net-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: var(--atlas-space-4);
  color: var(--atlas-muted);
  text-align: center;
  pointer-events: none;
}

.net-message[hidden] {
  display: none;
}

.net-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  height: 70vh;
  min-height: 420px;
  max-height: 760px;
}

.net-chart:fullscreen .net-body {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.net-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: var(--atlas-radius-card) 0 0 var(--atlas-radius-card);
  cursor: grab;
}

.net-panel {
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  margin: var(--atlas-space-3);
  padding: var(--atlas-space-4);
  border-left: 0;
  font-size: var(--atlas-type-small-size);
  line-height: 1.45;
}

.net-panel h2 {
  margin: 0 0 var(--atlas-space-2);
  font-size: var(--atlas-type-subsection-size);
}

.net-panel h3 {
  margin: var(--atlas-space-4) 0 var(--atlas-space-2);
  font-size: var(--atlas-type-small-size);
}

.net-panel-note {
  color: var(--atlas-muted);
}

.net-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--atlas-space-1) var(--atlas-space-2);
  margin: 0;
}

.net-facts dt {
  font-weight: 650;
  color: var(--atlas-muted);
}

.net-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.net-coauthors {
  display: grid;
  gap: var(--atlas-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.net-coauthors li {
  min-width: 0;
}

.net-link-button {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--atlas-space-2) var(--atlas-space-3);
  border: 1px solid var(--atlas-boundary);
  border-radius: var(--atlas-radius-control);
  background: var(--atlas-surface);
  color: var(--atlas-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.net-link-button:hover {
  border-color: var(--atlas-brand);
  background: var(--atlas-brand-wash);
}

.net-profile-link {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  margin-top: var(--atlas-space-3);
}

.net-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--atlas-space-2);
  margin: var(--atlas-space-3) 0;
  padding: 0;
  list-style: none;
  font-size: var(--atlas-type-small-size);
}

.net-legend-item {
  min-width: 0;
  min-height: 1.75rem;
  padding: 0 var(--atlas-space-3);
  border-color: var(--atlas-boundary);
  cursor: pointer;
}

/* VD-24: long cluster names wrap inside their pill at 390 px (the shared pill is nowrap, which made the
   legend widen the whole page). */
.net-legend > li {
  max-width: 100%;
}

.net-legend .net-legend-item {
  max-width: 100%;
  padding-block: var(--atlas-space-1);
  text-align: left;
  white-space: normal;
}

.net-legend-item[aria-pressed="false"] {
  opacity: 0.55;
  text-decoration: line-through;
}

.net-swatch {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
  margin-right: var(--atlas-space-2);
  border-radius: 50%;
  vertical-align: middle;
}

.net-table-wrap {
  overflow-x: auto;
}

.net-table .net-table-wrap {
  padding: var(--atlas-space-4);
}

.net-table .atlas-table a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
}

@media (max-width: 720px) {
  .net-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60vh auto;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .net-toolbar {
    right: var(--atlas-space-3);
  }

  .net-stage {
    height: 60vh;
    min-height: 320px;
    border-radius: var(--atlas-radius-card) var(--atlas-radius-card) 0 0;
  }

  .net-panel {
    max-height: 50vh;
    margin-top: 0;
    border-top: 0;
  }
}

/* Cluster names over the canvas (VD-20). Decorative: the legend and table carry the text. The layer
   sits above sigma's canvases, ignores the pointer, and is absolutely positioned so nothing reflows. */
.net-cluster-labels {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.net-cluster-label {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--atlas-type-small-size);
  font-weight: 700;
  line-height: 1.25;
  text-shadow:
    0 0 2px var(--atlas-surface),
    0 0 2px var(--atlas-surface),
    0 0 4px var(--atlas-surface);
}

@media (prefers-reduced-motion: reduce) {
  .net-btn__tooltip {
    transition: none;
  }
}
.net-more-grid .atlas-input { width: 100%; box-sizing: border-box; }
