.partner-hierarchy-page {
  display: flex;
  flex-direction: column;
  gap: 24px;

  &__header p {
    max-width: 70ch;
    color: var(--text-secondary);
  }

  &__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  &__envs {
    display: flex;
    gap: 4px;
  }

  &__env {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: inherit;
    cursor: pointer;

    &--active {
      // Environment is a hard partition (contract §3), so the active one is
      // stated with a filled background rather than a subtle outline - picking
      // the wrong one here is not a cosmetic mistake.
      background: var(--primary-color);
      color: var(--primary-contrast, #fff);
      border-color: var(--primary-color);
    }
  }

  &__summary {
    margin: 0;
    color: var(--text-secondary);
  }

  &__error {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--danger-color, #b3261e);
    border-radius: var(--radius-md);
    color: var(--danger-color, #b3261e);
  }

  &__empty {
    margin: 0;
    color: var(--text-secondary);
  }

  &__tree,
  &__creds {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  &__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
  }

  &__node {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  &__level {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
  }

  &__ref {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

  &__actions {
    display: flex;
    gap: 6px;

    button {
      padding: 4px 12px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm, 6px);
      background: transparent;
      color: inherit;
      cursor: pointer;
    }
  }

  &__danger {
    border-color: var(--danger-color, #b3261e) !important;
    color: var(--danger-color, #b3261e);
  }

  &__credentials {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);

    p {
      max-width: 70ch;
      color: var(--text-secondary);
    }

    li {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      padding: 8px 16px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
    }
  }
}
